diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml index be7dc863d8fe..4e2e6c1ef402 100644 --- a/eng/.docsettings.yml +++ b/eng/.docsettings.yml @@ -84,7 +84,8 @@ known_content_issues: - ['sdk/monitor/azure-monitor-opentelemetry-exporter/README.md', '#4554'] - ['sdk/digitaltwins/azure-digitaltwins-core/swagger/README.md', '#4554'] - ['sdk/textanalytics/azure-ai-textanalytics/swagger/README.md', '#4554'] - + - ['sdk/purview/azure-purview-catalog/swagger/README.md',  '#4554'] + - ['sdk/purview/azure-purview-scanning/swagger/README.md',  '#4554'] - ['sdk/containerregistry/azure-containerregistry/swagger/README.md', '#4554'] - ['sdk/appconfiguration/azure-appconfiguration/swagger/README.md', '#4554'] diff --git a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py index d80cd8566054..cf91929e3870 100644 --- a/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py +++ b/sdk/appconfiguration/azure-appconfiguration/azure/appconfiguration/_models.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. # ------------------------------------ import json +from typing import Dict, Union, List, Any, Optional from msrest.serialization import Model from ._generated.models import KeyValue @@ -60,18 +61,21 @@ def _from_generated(cls, key_value): if key_value is None: return None if key_value.content_type is not None: - if key_value.content_type.startswith( - FeatureFlagConfigurationSetting._feature_flag_content_type # pylint:disable=protected-access - ) and key_value.key.startswith(FeatureFlagConfigurationSetting.key_prefix): - return FeatureFlagConfigurationSetting._from_generated( # pylint: disable=protected-access - key_value - ) - if key_value.content_type.startswith( - SecretReferenceConfigurationSetting._secret_reference_content_type # pylint:disable=protected-access - ): - return SecretReferenceConfigurationSetting._from_generated( # pylint: disable=protected-access - key_value - ) + try: + if key_value.content_type.startswith( + FeatureFlagConfigurationSetting._feature_flag_content_type # pylint:disable=protected-access + ) and key_value.key.startswith(FeatureFlagConfigurationSetting.key_prefix): + return FeatureFlagConfigurationSetting._from_generated( # pylint: disable=protected-access + key_value + ) + if key_value.content_type.startswith( + SecretReferenceConfigurationSetting._secret_reference_content_type # pylint:disable=protected-access + ): + return SecretReferenceConfigurationSetting._from_generated( # pylint: disable=protected-access + key_value + ) + except (KeyError, AttributeError, TypeError): + pass return cls( key=key_value.key, @@ -143,7 +147,7 @@ class FeatureFlagConfigurationSetting( kind = "FeatureFlag" def __init__(self, feature_id, enabled, filters=[], **kwargs): # pylint: disable=dangerous-default-value - # type: (str, bool, Optional[List[Dict[str, Any]]]) -> None + # type: (str, bool, Optional[List[Dict[str, Any]]], **Any) -> None super(FeatureFlagConfigurationSetting, self).__init__(**kwargs) if not feature_id.startswith(self.key_prefix): feature_id = self.key_prefix + feature_id @@ -236,19 +240,12 @@ def _from_generated(cls, key_value): return ConfigurationSetting._from_generated(key_value) def _to_generated(self): - # type: (...) -> KeyValue - # value = { - # u"id": self.key, - # u"description": self.description, - # u"enabled": self._enabled, - # u"conditions": {u"client_filters": self._filters}, - # } - # value = json.dumps(value) + # type: () -> KeyValue return KeyValue( key=self.key, label=self.label, - value=self.value, + value=json.dumps(self.value), # NOTE: This has to be added for valid json content_type=self.content_type, last_modified=self.last_modified, tags=self.tags, @@ -297,7 +294,7 @@ class SecretReferenceConfigurationSetting(ConfigurationSetting): kind = "SecretReference" def __init__(self, key, secret_uri, label=None, **kwargs): - # type: (str, str, str) -> None + # type: (str, str, str, **Any) -> None self._secret_uri = secret_uri super(SecretReferenceConfigurationSetting, self).__init__(**kwargs) self.key = key @@ -334,26 +331,24 @@ def _validate(self): @classmethod def _from_generated(cls, key_value): # type: (KeyValue) -> SecretReferenceConfigurationSetting - try: - if key_value is None: - return None - if key_value.value: - try: - key_value.value = json.loads(key_value.value) - except json.decoder.JSONDecodeError: - pass - return cls( - key=key_value.key, - secret_uri=key_value.value[u"secret_uri"], - label=key_value.label, - secret_id=key_value.value, - last_modified=key_value.last_modified, - tags=key_value.tags, - read_only=key_value.locked, - etag=key_value.etag, - ) - except (KeyError, AttributeError): - return ConfigurationSetting._from_generated(key_value) + if key_value is None: + return None + if key_value.value: + try: + key_value.value = json.loads(key_value.value) + except json.decoder.JSONDecodeError: + pass + + return cls( + key=key_value.key, + secret_uri=key_value.value[u"secret_uri"], + label=key_value.label, + secret_id=key_value.value, + last_modified=key_value.last_modified, + tags=key_value.tags, + read_only=key_value.locked, + etag=key_value.etag, + ) def _to_generated(self): # type: (...) -> KeyValue diff --git a/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_invalid_json.yaml b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_invalid_json.yaml new file mode 100644 index 000000000000..8fa39947c2bd --- /dev/null +++ b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_invalid_json.yaml @@ -0,0 +1,588 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:33.978375 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[{"etag":"djrAHMY0jkywZ9VvfEOSmFfm56f","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:57:23+00:00"}]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:33 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjM1;sn=8415635 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjM1 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:34.844795 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"djrAHMY0jkywZ9VvfEOSmFfm56f","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:57:23+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:33 GMT + etag: + - '"djrAHMY0jkywZ9VvfEOSmFfm56f"' + last-modified: + - Mon, 03 May 2021 21:57:23 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjM2;sn=8415636 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "label": + "test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309", "content_type": "test content + type", "value": "test value", "tags": {"tag1": "tag1", "tag2": "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '231' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjM2 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 5b/E4qQlXHTRod+n+f+xjK6c/tRVR8uxoC62FjvGJPw= + x-ms-date: + - May, 03 2021 21:58:35.000917 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"c0swcVHiuT91I0neQZPWWL5i3js","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:35+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:34 GMT + etag: + - '"c0swcVHiuT91I0neQZPWWL5i3js"' + last-modified: + - Mon, 03 May 2021 21:58:35 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjM3;sn=8415637 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjM3 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:35.244646 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[{"etag":"4CSXEnijrJWxA5Sk3BeqdSQLM6C","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:57:25+00:00"},{"etag":"c0swcVHiuT91I0neQZPWWL5i3js","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:35+00:00"}]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:34 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjM3;sn=8415637 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjM3 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:35.383183 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"4CSXEnijrJWxA5Sk3BeqdSQLM6C","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:57:25+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:34 GMT + etag: + - '"4CSXEnijrJWxA5Sk3BeqdSQLM6C"' + last-modified: + - Mon, 03 May 2021 21:57:25 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjM4;sn=8415638 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "content_type": + "test content type", "value": "test value", "tags": {"tag1": "tag1", "tag2": + "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '170' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjM4 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 4rt07HteiPg5NxofrgzMmlQPTVbo1no7aKxDSI5uUU4= + x-ms-date: + - May, 03 2021 21:58:35.656579 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"lA0AyVRLLrjpZM8TXJNdbmoXFS4","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:36+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:34 GMT + etag: + - '"lA0AyVRLLrjpZM8TXJNdbmoXFS4"' + last-modified: + - Mon, 03 May 2021 21:58:36 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjM5;sn=8415639 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": ".appconfig.featureflag/keyd3491363", "content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8", + "value": "{\"enabled\": true, \"conditions\": {\"client_filters\": []}}", "tags": + {}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '208' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjM5 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - LjWKVVL5Zt6i8jFOOgvyNjp0GllB0ztsBUNpfaiHBkg= + x-ms-date: + - May, 03 2021 21:58:35.889375 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/.appconfig.featureflag%2Fkeyd3491363?api-version=1.0 + response: + body: + string: '{"etag":"q1W8v0WHZ6WiZqqtAEBfe4qp7j6","key":".appconfig.featureflag/keyd3491363","label":null,"content_type":"application/vnd.microsoft.appconfig.ff+json;charset=utf-8","value":"{\"enabled\": + true, \"conditions\": {\"client_filters\": []}}","tags":{},"locked":false,"last_modified":"2021-05-03T21:58:36+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:34 GMT + etag: + - '"q1W8v0WHZ6WiZqqtAEBfe4qp7j6"' + last-modified: + - Mon, 03 May 2021 21:58:36 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQw;sn=8415640 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": ".appconfig.featureflag/keyd3491363", "content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8", + "value": "[]", "last_modified": "2021-05-03T21:58:36.000Z", "tags": {}, "locked": + false, "etag": "q1W8v0WHZ6WiZqqtAEBfe4qp7j6"}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '250' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQw + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - J3LhXuTOLjL63EMZ3OtBTymfrgWxHuCr8hOCSD6BF/I= + x-ms-date: + - May, 03 2021 21:58:36.061590 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/.appconfig.featureflag%2Fkeyd3491363?api-version=1.0 + response: + body: + string: '{"etag":"uMoZ5zZSbrbfYubraCoWmLaF8rH","key":".appconfig.featureflag/keyd3491363","label":null,"content_type":"application/vnd.microsoft.appconfig.ff+json;charset=utf-8","value":"[]","tags":{},"locked":false,"last_modified":"2021-05-03T21:58:36+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:35 GMT + etag: + - '"uMoZ5zZSbrbfYubraCoWmLaF8rH"' + last-modified: + - Mon, 03 May 2021 21:58:36 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQx;sn=8415641 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQx + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:36.265755 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"c0swcVHiuT91I0neQZPWWL5i3js","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:35+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:35 GMT + etag: + - '"c0swcVHiuT91I0neQZPWWL5i3js"' + last-modified: + - Mon, 03 May 2021 21:58:35 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQy;sn=8415642 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQy + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:36.475674 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"lA0AyVRLLrjpZM8TXJNdbmoXFS4","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:36+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:35 GMT + etag: + - '"lA0AyVRLLrjpZM8TXJNdbmoXFS4"' + last-modified: + - Mon, 03 May 2021 21:58:36 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQz;sn=8415643 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_invalid_json_access_properties.yaml b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_invalid_json_access_properties.yaml new file mode 100644 index 000000000000..3cd6ab249df1 --- /dev/null +++ b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_invalid_json_access_properties.yaml @@ -0,0 +1,458 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:36.807615 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:37 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQz;sn=8415643 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "label": + "test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309", "content_type": "test content + type", "value": "test value", "tags": {"tag1": "tag1", "tag2": "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '231' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQz + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 5b/E4qQlXHTRod+n+f+xjK6c/tRVR8uxoC62FjvGJPw= + x-ms-date: + - May, 03 2021 21:58:37.576172 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"4rWZIgq67tV0uynuzu7hOJDQMq1","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:38+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:37 GMT + etag: + - '"4rWZIgq67tV0uynuzu7hOJDQMq1"' + last-modified: + - Mon, 03 May 2021 21:58:38 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQ0;sn=8415644 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQ0 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:37.725822 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[{"etag":"4rWZIgq67tV0uynuzu7hOJDQMq1","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:38+00:00"}]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:37 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQ0;sn=8415644 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQ0 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:37.867969 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:38 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + status: + code: 204 + message: No Content +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "content_type": + "test content type", "value": "test value", "tags": {"tag1": "tag1", "tag2": + "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '170' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQ0 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 4rt07HteiPg5NxofrgzMmlQPTVbo1no7aKxDSI5uUU4= + x-ms-date: + - May, 03 2021 21:58:38.043663 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"eHfRiAZzp8jEAC0g2JSo9ul8XQ5","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:38+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:38 GMT + etag: + - '"eHfRiAZzp8jEAC0g2JSo9ul8XQ5"' + last-modified: + - Mon, 03 May 2021 21:58:38 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQ1;sn=8415645 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": ".appconfig.featureflag/key76191ae0", "content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8", + "value": "{\"enabled\": true, \"conditions\": {\"client_filters\": []}}", "tags": + {}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '208' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQ1 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - urM6Dh9pMGq2hExCeZuik6DvGMZc7PUzo01IOjdHNnM= + x-ms-date: + - May, 03 2021 21:58:38.179041 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/.appconfig.featureflag%2Fkey76191ae0?api-version=1.0 + response: + body: + string: '{"etag":"cgOX3mhkm2afHFHHRw5aSiD7xr9","key":".appconfig.featureflag/key76191ae0","label":null,"content_type":"application/vnd.microsoft.appconfig.ff+json;charset=utf-8","value":"{\"enabled\": + true, \"conditions\": {\"client_filters\": []}}","tags":{},"locked":false,"last_modified":"2021-05-03T21:58:38+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:38 GMT + etag: + - '"cgOX3mhkm2afHFHHRw5aSiD7xr9"' + last-modified: + - Mon, 03 May 2021 21:58:38 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQ2;sn=8415646 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQ2 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:38.344887 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"4rWZIgq67tV0uynuzu7hOJDQMq1","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:38+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:38 GMT + etag: + - '"4rWZIgq67tV0uynuzu7hOJDQMq1"' + last-modified: + - Mon, 03 May 2021 21:58:38 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQ3;sn=8415647 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQ3 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:38.493263 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"eHfRiAZzp8jEAC0g2JSo9ul8XQ5","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:38+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:38 GMT + etag: + - '"eHfRiAZzp8jEAC0g2JSo9ul8XQ5"' + last-modified: + - Mon, 03 May 2021 21:58:38 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQ4;sn=8415648 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_invalid_json_string.yaml b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_invalid_json_string.yaml new file mode 100644 index 000000000000..8132be72d094 --- /dev/null +++ b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_invalid_json_string.yaml @@ -0,0 +1,520 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:38.771997 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:38 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjQ4;sn=8415648 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "label": + "test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309", "content_type": "test content + type", "value": "test value", "tags": {"tag1": "tag1", "tag2": "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '231' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjQ4 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 5b/E4qQlXHTRod+n+f+xjK6c/tRVR8uxoC62FjvGJPw= + x-ms-date: + - May, 03 2021 21:58:39.654752 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"nRcGGTOaPm6hO8ZB7aJJkxjSHsK","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:40+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:38 GMT + etag: + - '"nRcGGTOaPm6hO8ZB7aJJkxjSHsK"' + last-modified: + - Mon, 03 May 2021 21:58:40 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjUw;sn=8415650 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjUw + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:39.822965 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[{"etag":"nRcGGTOaPm6hO8ZB7aJJkxjSHsK","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:40+00:00"}]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:38 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjUw;sn=8415650 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjUw + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:40.054826 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:39 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + status: + code: 204 + message: No Content +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "content_type": + "test content type", "value": "test value", "tags": {"tag1": "tag1", "tag2": + "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '170' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjUw + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 4rt07HteiPg5NxofrgzMmlQPTVbo1no7aKxDSI5uUU4= + x-ms-date: + - May, 03 2021 21:58:40.206121 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"u2nNEyErIQ5Ca07jZjjJBp5RyMC","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:40+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:39 GMT + etag: + - '"u2nNEyErIQ5Ca07jZjjJBp5RyMC"' + last-modified: + - Mon, 03 May 2021 21:58:40 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjUx;sn=8415651 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": ".appconfig.featureflag/key66e21659", "content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8", + "value": "{\"enabled\": true, \"conditions\": {\"client_filters\": []}}", "tags": + {}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '208' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjUx + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 17x5rUxEzdPUbvwjq7cijwAAa4G4V9c7vRDgKqImUpY= + x-ms-date: + - May, 03 2021 21:58:40.578707 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/.appconfig.featureflag%2Fkey66e21659?api-version=1.0 + response: + body: + string: '{"etag":"Wy87loi6IXyPT6Jv7HSvPJZWVzj","key":".appconfig.featureflag/key66e21659","label":null,"content_type":"application/vnd.microsoft.appconfig.ff+json;charset=utf-8","value":"{\"enabled\": + true, \"conditions\": {\"client_filters\": []}}","tags":{},"locked":false,"last_modified":"2021-05-03T21:58:41+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:39 GMT + etag: + - '"Wy87loi6IXyPT6Jv7HSvPJZWVzj"' + last-modified: + - Mon, 03 May 2021 21:58:41 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjUy;sn=8415652 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": ".appconfig.featureflag/key66e21659", "content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8", + "value": "\"hello world\"", "last_modified": "2021-05-03T21:58:41.000Z", "tags": + {}, "locked": false, "etag": "Wy87loi6IXyPT6Jv7HSvPJZWVzj"}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '263' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjUy + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - uXx6uKzaLrglAy7yTbgFAbC3VjLH+HR95/KFeR+azP8= + x-ms-date: + - May, 03 2021 21:58:40.741715 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/.appconfig.featureflag%2Fkey66e21659?api-version=1.0 + response: + body: + string: '{"etag":"fQUWCFLDKasFXUVjl95HMJh8508","key":".appconfig.featureflag/key66e21659","label":null,"content_type":"application/vnd.microsoft.appconfig.ff+json;charset=utf-8","value":"\"hello + world\"","tags":{},"locked":false,"last_modified":"2021-05-03T21:58:41+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:39 GMT + etag: + - '"fQUWCFLDKasFXUVjl95HMJh8508"' + last-modified: + - Mon, 03 May 2021 21:58:41 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjUz;sn=8415653 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjUz + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:40.893641 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"nRcGGTOaPm6hO8ZB7aJJkxjSHsK","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:40+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:39 GMT + etag: + - '"nRcGGTOaPm6hO8ZB7aJJkxjSHsK"' + last-modified: + - Mon, 03 May 2021 21:58:40 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjU0;sn=8415654 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjU0 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:41.082473 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"u2nNEyErIQ5Ca07jZjjJBp5RyMC","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:40+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:40 GMT + etag: + - '"u2nNEyErIQ5Ca07jZjjJBp5RyMC"' + last-modified: + - Mon, 03 May 2021 21:58:40 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjU1;sn=8415655 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_prefix.yaml b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_prefix.yaml new file mode 100644 index 000000000000..a01eaa7d6044 --- /dev/null +++ b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_prefix.yaml @@ -0,0 +1,396 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:41.419627 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:41 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjU1;sn=8415655 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "label": + "test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309", "content_type": "test content + type", "value": "test value", "tags": {"tag1": "tag1", "tag2": "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '231' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjU1 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 5b/E4qQlXHTRod+n+f+xjK6c/tRVR8uxoC62FjvGJPw= + x-ms-date: + - May, 03 2021 21:58:42.150828 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"jjvTDcmmYIieU3z9pCu33MVGIz1","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:42+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:41 GMT + etag: + - '"jjvTDcmmYIieU3z9pCu33MVGIz1"' + last-modified: + - Mon, 03 May 2021 21:58:42 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjU2;sn=8415656 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjU2 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:42.304929 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[{"etag":"jjvTDcmmYIieU3z9pCu33MVGIz1","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:42+00:00"}]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:41 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjU2;sn=8415656 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjU2 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:42.463311 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:41 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + status: + code: 204 + message: No Content +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "content_type": + "test content type", "value": "test value", "tags": {"tag1": "tag1", "tag2": + "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '170' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjU2 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 4rt07HteiPg5NxofrgzMmlQPTVbo1no7aKxDSI5uUU4= + x-ms-date: + - May, 03 2021 21:58:42.645253 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"pp8dFo0mwv5Nu3fVtKwC7WbtCzs","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:43+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:41 GMT + etag: + - '"pp8dFo0mwv5Nu3fVtKwC7WbtCzs"' + last-modified: + - Mon, 03 May 2021 21:58:43 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjU3;sn=8415657 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjU3 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:42.867127 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"jjvTDcmmYIieU3z9pCu33MVGIz1","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:42+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:42 GMT + etag: + - '"jjvTDcmmYIieU3z9pCu33MVGIz1"' + last-modified: + - Mon, 03 May 2021 21:58:42 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjU4;sn=8415658 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjU4 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:43.084705 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"pp8dFo0mwv5Nu3fVtKwC7WbtCzs","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:43+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:42 GMT + etag: + - '"pp8dFo0mwv5Nu3fVtKwC7WbtCzs"' + last-modified: + - Mon, 03 May 2021 21:58:43 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjU5;sn=8415659 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_set_enabled.yaml b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_set_enabled.yaml new file mode 100644 index 000000000000..dc4aebc41ae6 --- /dev/null +++ b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_set_enabled.yaml @@ -0,0 +1,396 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:43.371541 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:42 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjU5;sn=8415659 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "label": + "test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309", "content_type": "test content + type", "value": "test value", "tags": {"tag1": "tag1", "tag2": "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '231' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjU5 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 5b/E4qQlXHTRod+n+f+xjK6c/tRVR8uxoC62FjvGJPw= + x-ms-date: + - May, 03 2021 21:58:44.086130 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"uel69xsZ1iFb0k2pEBgIQwg0uOy","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:45+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:44 GMT + etag: + - '"uel69xsZ1iFb0k2pEBgIQwg0uOy"' + last-modified: + - Mon, 03 May 2021 21:58:45 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjYw;sn=8415660 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjYw + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:45.118629 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[{"etag":"uel69xsZ1iFb0k2pEBgIQwg0uOy","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:45+00:00"}]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:44 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjYw;sn=8415660 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjYw + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:45.483702 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:44 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + status: + code: 204 + message: No Content +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "content_type": + "test content type", "value": "test value", "tags": {"tag1": "tag1", "tag2": + "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '170' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjYw + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 4rt07HteiPg5NxofrgzMmlQPTVbo1no7aKxDSI5uUU4= + x-ms-date: + - May, 03 2021 21:58:45.893859 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"nnEwyEdmrqwIodMgJSRdPyxtNJy","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:46+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:45 GMT + etag: + - '"nnEwyEdmrqwIodMgJSRdPyxtNJy"' + last-modified: + - Mon, 03 May 2021 21:58:46 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjYx;sn=8415661 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjYx + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:46.204676 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"uel69xsZ1iFb0k2pEBgIQwg0uOy","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:45+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:45 GMT + etag: + - '"uel69xsZ1iFb0k2pEBgIQwg0uOy"' + last-modified: + - Mon, 03 May 2021 21:58:45 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjYy;sn=8415662 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjYy + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:46.517640 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"nnEwyEdmrqwIodMgJSRdPyxtNJy","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:46+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:45 GMT + etag: + - '"nnEwyEdmrqwIodMgJSRdPyxtNJy"' + last-modified: + - Mon, 03 May 2021 21:58:46 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjYz;sn=8415663 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_set_value.yaml b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_set_value.yaml new file mode 100644 index 000000000000..4a89bb818d92 --- /dev/null +++ b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_feature_flag_set_value.yaml @@ -0,0 +1,396 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:46.950351 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:47 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjY3;sn=8415667 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "label": + "test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309", "content_type": "test content + type", "value": "test value", "tags": {"tag1": "tag1", "tag2": "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '231' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjY3 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 5b/E4qQlXHTRod+n+f+xjK6c/tRVR8uxoC62FjvGJPw= + x-ms-date: + - May, 03 2021 21:58:48.249994 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"ZII8KKWnbHYtmuTbfVVcR3Pspvc","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:48+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:47 GMT + etag: + - '"ZII8KKWnbHYtmuTbfVVcR3Pspvc"' + last-modified: + - Mon, 03 May 2021 21:58:48 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjY4;sn=8415668 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjY4 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:48.462503 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[{"etag":"ZII8KKWnbHYtmuTbfVVcR3Pspvc","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:48+00:00"}]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:47 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjY4;sn=8415668 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjY4 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:48.662289 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:47 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + status: + code: 204 + message: No Content +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "content_type": + "test content type", "value": "test value", "tags": {"tag1": "tag1", "tag2": + "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '170' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjY4 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 4rt07HteiPg5NxofrgzMmlQPTVbo1no7aKxDSI5uUU4= + x-ms-date: + - May, 03 2021 21:58:49.075766 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"GXWutIwo9tW45hFThFzgcz5O6FG","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:49+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:48 GMT + etag: + - '"GXWutIwo9tW45hFThFzgcz5O6FG"' + last-modified: + - Mon, 03 May 2021 21:58:49 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1NjY5;sn=8415669 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1NjY5 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:49.234555 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"ZII8KKWnbHYtmuTbfVVcR3Pspvc","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:48+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:48 GMT + etag: + - '"ZII8KKWnbHYtmuTbfVVcR3Pspvc"' + last-modified: + - Mon, 03 May 2021 21:58:48 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1Njcw;sn=8415670 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1Njcw + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:49.402138 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"GXWutIwo9tW45hFThFzgcz5O6FG","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:49+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:48 GMT + etag: + - '"GXWutIwo9tW45hFThFzgcz5O6FG"' + last-modified: + - Mon, 03 May 2021 21:58:49 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1Njcx;sn=8415671 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_update_json_by_value.yaml b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_update_json_by_value.yaml new file mode 100644 index 000000000000..e5c5cfcac781 --- /dev/null +++ b/sdk/appconfiguration/azure-appconfiguration/tests/recordings/test_consistency.test_update_json_by_value.yaml @@ -0,0 +1,528 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:49.674799 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:50 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1Njcx;sn=8415671 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "label": + "test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309", "content_type": "test content + type", "value": "test value", "tags": {"tag1": "tag1", "tag2": "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '231' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1Njcx + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 5b/E4qQlXHTRod+n+f+xjK6c/tRVR8uxoC62FjvGJPw= + x-ms-date: + - May, 03 2021 21:58:50.394436 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"CbfAmDsEn3iiEqWrrpVTGRkezL6","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:51+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:50 GMT + etag: + - '"CbfAmDsEn3iiEqWrrpVTGRkezL6"' + last-modified: + - Mon, 03 May 2021 21:58:51 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1Njcy;sn=8415672 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kvset+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1Njcy + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:50.605499 GMT + method: GET + uri: https://fake_app_config.azconfig-test.io/kv?key=PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309&api-version=1.0 + response: + body: + string: '{"items":[{"etag":"CbfAmDsEn3iiEqWrrpVTGRkezL6","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:51+00:00"}]}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kvset+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:50 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1Njcy;sn=8415672 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1Njcy + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:50.748838 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:50 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + status: + code: 204 + message: No Content +- request: + body: '{"key": "PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309", "content_type": + "test content type", "value": "test value", "tags": {"tag1": "tag1", "tag2": + "tag2"}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '170' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + If-None-Match: + - '*' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1Njcy + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 4rt07HteiPg5NxofrgzMmlQPTVbo1no7aKxDSI5uUU4= + x-ms-date: + - May, 03 2021 21:58:50.891876 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"ja17BYywpiROARjiFTimC87XL9E","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:51+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:51 GMT + etag: + - '"ja17BYywpiROARjiFTimC87XL9E"' + last-modified: + - Mon, 03 May 2021 21:58:51 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1Njcz;sn=8415673 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": ".appconfig.featureflag/key78451171", "content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8", + "value": "{\"enabled\": true, \"conditions\": {\"client_filters\": [{\"name\": + \"Microsoft.Percentage\", \"parameters\": {\"Value\": 10, \"User\": \"user1\"}}]}}", + "tags": {}}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '298' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1Njcz + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - Dcc2FB7FNKenwl3VKqgzMVzVtp139dqiz1gMFqIDwvk= + x-ms-date: + - May, 03 2021 21:58:51.119807 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/.appconfig.featureflag%2Fkey78451171?api-version=1.0 + response: + body: + string: '{"etag":"yg0fBwGOfRBfu3kePuIFSZ9RnbK","key":".appconfig.featureflag/key78451171","label":null,"content_type":"application/vnd.microsoft.appconfig.ff+json;charset=utf-8","value":"{\"enabled\": + true, \"conditions\": {\"client_filters\": [{\"name\": \"Microsoft.Percentage\", + \"parameters\": {\"Value\": 10, \"User\": \"user1\"}}]}}","tags":{},"locked":false,"last_modified":"2021-05-03T21:58:51+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:51 GMT + etag: + - '"yg0fBwGOfRBfu3kePuIFSZ9RnbK"' + last-modified: + - Mon, 03 May 2021 21:58:51 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1Njc0;sn=8415674 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"key": ".appconfig.featureflag/key78451171", "content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8", + "value": "{\"conditions\": {\"client_filters\": [{\"name\": \"Microsoft.Targeting\", + \"parameters\": {\"name\": \"Microsoft.Targeting\", \"parameters\": {\"Audience\": + {\"DefaultRolloutPercentage\": 50, \"Groups\": [], \"Users\": []}}}}]}, \"description\": + \"\", \"enabled\": false, \"id\": \"key78451171\"}", "last_modified": "2021-05-03T21:58:51.000Z", + "tags": {}, "locked": false, "etag": "yg0fBwGOfRBfu3kePuIFSZ9RnbK"}' + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '545' + Content-Type: + - application/vnd.microsoft.appconfig.kv+json + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1Njc0 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - kYjNyPpKZVMyCrUTzs8nG5trlkvqUmZRVX5drrdrQPQ= + x-ms-date: + - May, 03 2021 21:58:51.290499 GMT + method: PUT + uri: https://fake_app_config.azconfig-test.io/kv/.appconfig.featureflag%2Fkey78451171?api-version=1.0 + response: + body: + string: '{"etag":"foD7fe9Swjg3l2Plbpv5LEbqNu1","key":".appconfig.featureflag/key78451171","label":null,"content_type":"application/vnd.microsoft.appconfig.ff+json;charset=utf-8","value":"{\"conditions\": + {\"client_filters\": [{\"name\": \"Microsoft.Targeting\", \"parameters\": + {\"name\": \"Microsoft.Targeting\", \"parameters\": {\"Audience\": {\"DefaultRolloutPercentage\": + 50, \"Groups\": [], \"Users\": []}}}}]}, \"description\": \"\", \"enabled\": + false, \"id\": \"key78451171\"}","tags":{},"locked":false,"last_modified":"2021-05-03T21:58:51+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:51 GMT + etag: + - '"foD7fe9Swjg3l2Plbpv5LEbqNu1"' + last-modified: + - Mon, 03 May 2021 21:58:51 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1Njc1;sn=8415675 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1Njc1 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:51.524211 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?label=test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309&api-version=1.0 + response: + body: + string: '{"etag":"CbfAmDsEn3iiEqWrrpVTGRkezL6","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":"test_label1_1d7b2b28-549e-11e9-b51c-2816a84d0309","content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:51+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:51 GMT + etag: + - '"CbfAmDsEn3iiEqWrrpVTGRkezL6"' + last-modified: + - Mon, 03 May 2021 21:58:51 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1Njc2;sn=8415676 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/vnd.microsoft.appconfig.kv+json, application/json, application/problem+json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Sync-Token: + - zAJw6V16=MDoxNyM4NDE1Njc2 + User-Agent: + - azsdk-python-appconfiguration/1.2.0b1 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-content-sha256: + - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= + x-ms-date: + - May, 03 2021 21:58:51.729525 GMT + method: DELETE + uri: https://fake_app_config.azconfig-test.io/kv/PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309?api-version=1.0 + response: + body: + string: '{"etag":"ja17BYywpiROARjiFTimC87XL9E","key":"PYTHON_UNIT_test_key_a6af8952-54a6-11e9-b600-2816a84d0309","label":null,"content_type":"test + content type","value":"test value","tags":{"tag1":"tag1","tag2":"tag2"},"locked":false,"last_modified":"2021-05-03T21:58:51+00:00"}' + headers: + access-control-allow-credentials: + - 'true' + access-control-allow-origin: + - '*' + access-control-expose-headers: + - DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, + Cache-Control, Content-Type, Authorization, x-ms-client-request-id, x-ms-useragent, + x-ms-content-sha256, x-ms-date, host, Accept, Accept-Datetime, Date, If-Match, + If-None-Match, Sync-Token, x-ms-return-client-request-id, ETag, Last-Modified, + Link, Memento-Datetime, retry-after-ms, x-ms-request-id, x-ms-client-session-id, + x-ms-effective-locale, WWW-Authenticate + connection: + - keep-alive + content-type: + - application/vnd.microsoft.appconfig.kv+json; charset=utf-8 + date: + - Mon, 03 May 2021 21:58:51 GMT + etag: + - '"ja17BYywpiROARjiFTimC87XL9E"' + last-modified: + - Mon, 03 May 2021 21:58:51 GMT + server: + - openresty/1.17.8.2 + strict-transport-security: + - max-age=15724800; includeSubDomains + sync-token: + - zAJw6V16=MDoxNyM4NDE1Njc3;sn=8415677 + transfer-encoding: + - chunked + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/appconfiguration/azure-appconfiguration/tests/test_consistency.py b/sdk/appconfiguration/azure-appconfiguration/tests/test_consistency.py new file mode 100644 index 000000000000..772facbaa876 --- /dev/null +++ b/sdk/appconfiguration/azure-appconfiguration/tests/test_consistency.py @@ -0,0 +1,189 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from azure.core import MatchConditions +from azure.core.exceptions import HttpResponseError +from devtools_testutils import AzureTestCase, PowerShellPreparer +from azure.core.exceptions import ( + ResourceModifiedError, + ResourceNotFoundError, + ResourceExistsError, + AzureError, +) +from azure.appconfiguration import ( + ResourceReadOnlyError, + AzureAppConfigurationClient, + ConfigurationSetting, + FeatureFlagConfigurationSetting, + SecretReferenceConfigurationSetting, + PERCENTAGE, + TARGETING, + TIME_WINDOW, +) +from azure.identity import DefaultAzureCredential + +from consts import ( + KEY, + LABEL, + TEST_VALUE, + TEST_CONTENT_TYPE, + LABEL_RESERVED_CHARS, + PAGE_SIZE, + KEY_UUID, +) +from wrapper import app_config_decorator + +from uuid import uuid4 +import pytest + + +class AppConfigurationClientTest(AzureTestCase): + + + def _assert_same_keys(self, key1, key2): + assert type(key1) == type(key2) + assert key1.key == key2.key + assert key1.label == key2.label + assert key1.content_type == key2.content_type + assert key1.tags == key2.tags + assert key1.etag != key2.etag + if isinstance(key1, FeatureFlagConfigurationSetting): + assert key1.enabled == key2.enabled + assert len(key1.filters) == len(key2.filters) + elif isinstance(key1, SecretReferenceConfigurationSetting): + assert key1.secret_uri == key2.secret_uri + else: + assert key1.value == key2.value + + @app_config_decorator + def test_update_json_by_value(self, client): + key = self.get_resource_name("key") + feature_flag = FeatureFlagConfigurationSetting( + key, + True, + filters=[ + { + "name": PERCENTAGE, + "parameters": { + "Value": 10, + "User": "user1" + } + } + ] + ) + set_flag = client.set_configuration_setting(feature_flag) + + set_flag.value = { + 'conditions': { + 'client_filters': [ + { + 'name': 'Microsoft.Targeting', + 'parameters': { + 'name': 'Microsoft.Targeting', + 'parameters': { + 'Audience': { + 'DefaultRolloutPercentage': 50, + 'Groups': [], + 'Users': [] + } + } + } + } + ] + }, + 'description': '', + 'enabled': False, + 'id': key, + } + + set_flag = client.set_configuration_setting(set_flag) + assert isinstance(set_flag, FeatureFlagConfigurationSetting) + assert set_flag.enabled == False + assert set_flag.key.endswith(key) + + @app_config_decorator + def test_feature_flag_invalid_json(self, client): + key = self.get_resource_name("key") + feature_flag = FeatureFlagConfigurationSetting(key, True) + set_flag = client.set_configuration_setting(feature_flag) + + set_flag.value = [] + received = client.set_configuration_setting(set_flag) + + assert not isinstance(received, FeatureFlagConfigurationSetting) + + @app_config_decorator + def test_feature_flag_invalid_json_string(self, client): + key = self.get_resource_name("key") + feature_flag = FeatureFlagConfigurationSetting(key, True) + set_flag = client.set_configuration_setting(feature_flag) + + set_flag.value = "hello world" + received = client.set_configuration_setting(set_flag) + + assert not isinstance(received, FeatureFlagConfigurationSetting) + + @app_config_decorator + def test_feature_flag_invalid_json_access_properties(self, client): + key = self.get_resource_name("key") + feature_flag = FeatureFlagConfigurationSetting(key, True) + set_flag = client.set_configuration_setting(feature_flag) + + set_flag.value = "hello world" + with pytest.raises(ValueError): + a = set_flag.enabled + with pytest.raises(ValueError): + b = set_flag.filters + + @app_config_decorator + def test_feature_flag_set_value(self, client): + key = self.get_resource_name("key") + feature_flag = FeatureFlagConfigurationSetting( + key, + True, + filters=[ + { + "name": PERCENTAGE, + "parameters": { + "Value": 10, + "User": "user1" + } + } + ] + ) + feature_flag.value = { + "conditions": { + "client_filters": [] + }, + "enabled": False + } + + assert feature_flag.value["enabled"] == False + + @app_config_decorator + def test_feature_flag_set_enabled(self, client): + key = self.get_resource_name("key") + feature_flag = FeatureFlagConfigurationSetting( + key, + True, + filters=[ + { + "name": PERCENTAGE, + "parameters": { + "Value": 10, + "User": "user1" + } + } + ] + ) + feature_flag.enabled = False + + assert feature_flag.value["enabled"] == False + + @app_config_decorator + def test_feature_flag_prefix(self, client): + key = self.get_resource_name("key") + feature_flag = FeatureFlagConfigurationSetting(key, True) + assert feature_flag.key.startswith(".appconfig.featureflag/") diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/__init__.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/__init__.py index 92083da1a2de..f58b0efbc9ca 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/__init__.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/__init__.py @@ -11,8 +11,8 @@ from ._models import ( DeleteRepositoryResult, ContentProperties, - RegistryArtifactOrderBy, - RegistryArtifactProperties, + ManifestOrderBy, + ArtifactManifestProperties, RepositoryProperties, TagOrderBy, ArtifactTagProperties, @@ -26,8 +26,8 @@ "ContainerRepositoryClient", "DeleteRepositoryResult", "ContentProperties", - "RegistryArtifactOrderBy", - "RegistryArtifactProperties", + "ManifestOrderBy", + "ArtifactManifestProperties", "RepositoryProperties", "TagOrderBy", "ArtifactTagProperties", diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_registry_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_registry_client.py index 2cf8519d0847..8da2f684fb93 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_registry_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_registry_client.py @@ -36,6 +36,15 @@ def __init__(self, endpoint, credential, **kwargs): :type credential: :class:`~azure.core.credentials.TokenCredential` :returns: None :raises: None + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_create_client.py + :start-after: [START create_registry_client] + :end-before: [END create_registry_client] + :language: python + :dedent: 8 + :caption: Instantiate an instance of `ContainerRegistryClient` """ if not endpoint.startswith("https://") and not endpoint.startswith("http://"): endpoint = "https://" + endpoint @@ -52,6 +61,15 @@ def delete_repository(self, repository, **kwargs): :returns: Object containing information about the deleted repository :rtype: :class:`~azure.containerregistry.DeleteRepositoryResult` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_create_client.py + :start-after: [START delete_repository] + :end-before: [END delete_repository] + :language: python + :dedent: 8 + :caption: Delete a repository from the `ContainerRegistryClient` """ return DeleteRepositoryResult._from_generated( # pylint: disable=protected-access self._client.container_registry.delete_repository(repository, **kwargs) @@ -72,6 +90,15 @@ def list_repositories(self, **kwargs): :return: ItemPaged[str] :rtype: :class:`~azure.core.paging.ItemPaged` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_delete_old_tags.py + :start-after: [START list_repositories] + :end-before: [END list_repositories] + :language: python + :dedent: 8 + :caption: List repositories in a container registry account """ n = kwargs.pop("results_per_page", None) last = kwargs.pop("last", None) @@ -172,6 +199,17 @@ def get_repository_client(self, repository, **kwargs): :param str repository: The repository to create a client for :returns: :class:`~azure.containerregistry.ContainerRepositoryClient` :raises: None + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRegistryClient(account_url, DefaultAzureCredential()) + repository_client = client.get_repository_client("my_repository") """ _pipeline = Pipeline( transport=TransportWrapper(self._client._client._pipeline._transport), # pylint: disable=protected-access diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py index 3cbcade4979f..f2aa8acffe4c 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_container_repository_client.py @@ -20,7 +20,7 @@ from ._helpers import _is_tag, _parse_next_link from ._models import ( DeleteRepositoryResult, - RegistryArtifactProperties, + ArtifactManifestProperties, RepositoryProperties, ArtifactTagProperties, ) @@ -43,6 +43,15 @@ def __init__(self, endpoint, repository, credential, **kwargs): :type credential: :class:`~azure.core.credentials.TokenCredential` :returns: None :raises: None + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_create_client.py + :start-after: [START create_repository_client] + :end-before: [END create_repository_client] + :language: python + :dedent: 8 + :caption: Instantiate an instance of `ContainerRepositoryClient` """ if not endpoint.startswith("https://") and not endpoint.startswith("http://"): endpoint = "https://" + endpoint @@ -63,6 +72,17 @@ def delete(self, **kwargs): :returns: Object containing information about the deleted repository :rtype: :class:`~azure.containerregistry.DeleteRepositoryResult` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + client.delete() """ return DeleteRepositoryResult._from_generated( # pylint: disable=protected-access self._client.container_registry.delete_repository(self.repository, **kwargs) @@ -77,6 +97,18 @@ def delete_registry_artifact(self, digest, **kwargs): :type digest: str :returns: None :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + for artifact in client.list_registry_artifacts(): + client.delete_registry_artifact(artifact.digest) """ self._client.container_registry.delete_manifest(self.repository, digest, **kwargs) @@ -88,6 +120,18 @@ def delete_tag(self, tag, **kwargs): :param str tag: The tag to be deleted :returns: None :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + for artifact in client.list_tags(): + client.delete_tag(tag.name) """ self._client.container_registry.delete_tag(self.repository, tag, **kwargs) @@ -98,6 +142,24 @@ def get_properties(self, **kwargs): :returns: :class:`~azure.containerregistry.RepositoryProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + repository_properties = client.get_properties() + print(repository_properties.name) + print(repository_properties.content_permissions) + print(repository_properties.created_on) + print(repository_properties.last_updated_on) + print(repository_properties.manifest_count) + print(repository_properties.registry) + print(repository_properties.tag_count) """ return RepositoryProperties._from_generated( # pylint: disable=protected-access self._client.container_registry.get_properties(self.repository, **kwargs) @@ -105,19 +167,32 @@ def get_properties(self, **kwargs): @distributed_trace def get_registry_artifact_properties(self, tag_or_digest, **kwargs): - # type: (str, Dict[str, Any]) -> RegistryArtifactProperties + # type: (str, Dict[str, Any]) -> ArtifactManifestProperties """Get the properties of a registry artifact :param tag_or_digest: The tag/digest of a registry artifact :type tag_or_digest: str - :returns: :class:`~azure.containerregistry.RegistryArtifactProperties` + :returns: :class:`~azure.containerregistry.ArtifactManifestProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + for artifact in client.list_registry_artifacts(): + properties = client.get_registry_artifact_properties(artifact.digest) """ if _is_tag(tag_or_digest): tag_or_digest = self._get_digest_from_tag(tag_or_digest) - return RegistryArtifactProperties._from_generated( # pylint: disable=protected-access - self._client.container_registry.get_manifest_properties(self.repository, tag_or_digest, **kwargs) + return ArtifactManifestProperties._from_generated( # pylint: disable=protected-access + self._client.container_registry.get_manifest_properties(self.repository, tag_or_digest, **kwargs), + repository=self.repository ) @distributed_trace @@ -129,6 +204,18 @@ def get_tag_properties(self, tag, **kwargs): :type tag: str :returns: :class:`~azure.containerregistry.ArtifactTagProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + for tag in client.list_tags(): + tag_properties = client.get_tag_properties(tag.name) """ return ArtifactTagProperties._from_generated( # pylint: disable=protected-access self._client.container_registry.get_tag_properties(self.repository, tag, **kwargs), @@ -137,19 +224,31 @@ def get_tag_properties(self, tag, **kwargs): @distributed_trace def list_registry_artifacts(self, **kwargs): - # type: (Dict[str, Any]) -> ItemPaged[RegistryArtifactProperties] + # type: (Dict[str, Any]) -> ItemPaged[ArtifactManifestProperties] """List the artifacts for a repository :keyword last: Query parameter for the last item in the previous call. Ensuing call will return values after last lexically :paramtype last: str :keyword order_by: Query parameter for ordering by time ascending or descending - :paramtype order_by: :class:`~azure.containerregistry.RegistryArtifactOrderBy` + :paramtype order_by: :class:`~azure.containerregistry.ManifestOrderBy` :keyword results_per_page: Number of repositories to return per page :paramtype results_per_page: int - :return: ItemPaged[:class:`RegistryArtifactProperties`] + :return: ItemPaged[:class:`ArtifactManifestProperties`] :rtype: :class:`~azure.core.paging.ItemPaged` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + for artifact in client.list_registry_artifacts(): + print(artifact.digest) """ name = self.repository last = kwargs.pop("last", None) @@ -158,7 +257,7 @@ def list_registry_artifacts(self, **kwargs): cls = kwargs.pop( "cls", lambda objs: [ - RegistryArtifactProperties._from_generated(x) for x in objs # pylint: disable=protected-access + ArtifactManifestProperties._from_generated(x, repository=self.repository) for x in objs # pylint: disable=protected-access ], ) @@ -268,6 +367,18 @@ def list_tags(self, **kwargs): :return: ItemPaged[:class:`~azure.containerregistry.ArtifactTagProperties`] :rtype: :class:`~azure.core.paging.ItemPaged` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + for tag in client.list_tags(): + tag_properties = client.get_tag_properties(tag.name) """ name = self.repository last = kwargs.pop("last", None) @@ -377,20 +488,41 @@ def get_next(next_link=None): @distributed_trace def set_manifest_properties(self, digest, permissions, **kwargs): - # type: (str, ContentProperties, Dict[str, Any]) -> RegistryArtifactProperties + # type: (str, ContentProperties, Dict[str, Any]) -> ArtifactManifestProperties """Set the properties for a manifest :param digest: Digest of a manifest :type digest: str :param permissions: The property's values to be set :type permissions: ContentProperties - :returns: :class:`~azure.containerregistry.RegistryArtifactProperties` + :returns: :class:`~azure.containerregistry.ArtifactManifestProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + for artifact in client.list_registry_artifacts(): + received_permissions = client.set_manifest_properties( + artifact.digest, + ContentPermissions( + can_delete=False, + can_list=False, + can_read=False, + can_write=False, + ), + ) """ - return RegistryArtifactProperties._from_generated( # pylint: disable=protected-access + return ArtifactManifestProperties._from_generated( # pylint: disable=protected-access self._client.container_registry.update_manifest_properties( self.repository, digest, value=permissions._to_generated(), **kwargs # pylint: disable=protected-access - ) + ), + repository=self.repository ) @distributed_trace @@ -404,6 +536,26 @@ def set_tag_properties(self, tag, permissions, **kwargs): :type permissions: ContentProperties :returns: :class:`~azure.containerregistry.ArtifactTagProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry import ContainerRepositoryClient + from azure.identity import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + tag_identifier = "latest" + received = client.set_tag_properties( + tag_identifier, + ContentPermissions( + can_delete=False, + can_list=False, + can_read=False, + can_write=False, + ), + ) """ return ArtifactTagProperties._from_generated( # pylint: disable=protected-access self._client.container_registry.update_tag_attributes( diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_models.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_models.py index 1685b653e0b6..259c60db2002 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_models.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/_models.py @@ -75,7 +75,7 @@ def _from_generated(cls, gen): ) -class RegistryArtifactProperties(object): +class ArtifactManifestProperties(object): """Represents properties of a registry artifact :ivar str cpu_architecture: CPU Architecture of an artifact @@ -85,7 +85,7 @@ class RegistryArtifactProperties(object): :ivar last_updated_on: Time and date an artifact was last updated :vartype last_updated_on: :class:`~datetime.datetime` :ivar str operating_system: Operating system for the artifact - :ivar List[str] references: References for the artifact + :ivar str repository_name: Repository name the artifact belongs to :ivar str size: Size of the artifact :ivar List[str] tags: Tags associated with a registry artifact :ivar writeable_properties: Permissions for an artifact @@ -98,7 +98,7 @@ def __init__(self, **kwargs): self.digest = kwargs.get("digest", None) self.last_updated_on = kwargs.get("last_updated_on", None) self.operating_system = kwargs.get("operating_system", None) - self.references = kwargs.get("references", None) + self.repository_name = kwargs.get("repository_name", None) self.size = kwargs.get("size", None) self.tags = kwargs.get("tags", None) self.writeable_properties = kwargs.get("content_permissions", None) @@ -106,8 +106,8 @@ def __init__(self, **kwargs): self.writeable_properties = ContentProperties._from_generated(self.writeable_properties) @classmethod - def _from_generated(cls, generated): - # type: (ManifestAttributesBase) -> RegistryArtifactProperties + def _from_generated(cls, generated, **kwargs): + # type: (ManifestAttributesBase, Any) -> ArtifactManifestProperties return cls( cpu_architecture=generated.architecture, created_on=generated.created_on, @@ -117,6 +117,7 @@ def _from_generated(cls, generated): size=generated.size, tags=generated.tags, content_permissions=generated.writeable_properties, + repository_name=kwargs.get("repository_name", None), ) @@ -160,7 +161,7 @@ def _from_generated(cls, generated): ) -class RegistryArtifactOrderBy(str, Enum): +class ManifestOrderBy(str, Enum): """Enum for ordering registry artifacts""" LAST_UPDATE_TIME_DESCENDING = "timedesc" diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_registry_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_registry_client.py index a9669b17e274..f9d5f7284462 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_registry_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_registry_client.py @@ -37,6 +37,15 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: :type credential: :class:`~azure.core.credentials_async.AsyncTokenCredential` :returns: None :raises: None + + .. admonition:: Example: + + .. literalinclude:: ../samples/async_samples/sample_create_client_async.py + :start-after: [START create_registry_client] + :end-before: [END create_registry_client] + :language: python + :dedent: 8 + :caption: Instantiate an instance of `ContainerRegistryClient` """ if not endpoint.startswith("https://") and not endpoint.startswith("http://"): endpoint = "https://" + endpoint @@ -53,6 +62,15 @@ async def delete_repository(self, repository: str, **kwargs: Dict[str, Any]) -> :returns: Object containing information about the deleted repository :rtype: :class:`~azure.containerregistry.DeleteRepositoryResult` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + .. admonition:: Example: + + .. literalinclude:: ../samples/async_samples/sample_create_client_async.py + :start-after: [START delete_repository] + :end-before: [END delete_repository] + :language: python + :dedent: 8 + :caption: Delete a repository from the `ContainerRegistryClient` """ result = await self._client.container_registry.delete_repository(repository, **kwargs) return DeleteRepositoryResult._from_generated(result) # pylint: disable=protected-access @@ -71,6 +89,15 @@ def list_repositories(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[str]: :return: ItemPaged[str] :rtype: :class:`~azure.core.async_paging.AsyncItemPaged` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + .. admonition:: Example: + + .. literalinclude:: ../samples/async_samples/sample_delete_old_tags_async.py + :start-after: [START list_repositories] + :end-before: [END list_repositories] + :language: python + :dedent: 8 + :caption: List repositories in a container registry account """ n = kwargs.pop("results_per_page", None) last = kwargs.pop("last", None) @@ -168,6 +195,17 @@ def get_repository_client(self, repository: str, **kwargs: Dict[str, Any]) -> Co :param repository: The repository to create a client for :type repository: str :returns: :class:`~azure.containerregistry.aio.ContainerRepositoryClient` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRegistryClient(account_url, DefaultAzureCredential()) + repository_client = client.get_repository_client("my_repository") """ _pipeline = AsyncPipeline( transport=AsyncTransportWrapper( diff --git a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository_client.py b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository_client.py index 77546ccc4ee4..47b50ba0b992 100644 --- a/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository_client.py +++ b/sdk/containerregistry/azure-containerregistry/azure/containerregistry/aio/_async_container_repository_client.py @@ -22,7 +22,7 @@ from .._models import ( DeleteRepositoryResult, ContentProperties, - RegistryArtifactProperties, + ArtifactManifestProperties, RepositoryProperties, ArtifactTagProperties, ) @@ -45,6 +45,15 @@ def __init__( :type credential: :class:`~azure.core.credentials_async.AsyncTokenCredential` :returns: None :raises: None + + .. admonition:: Example: + + .. literalinclude:: ../samples/sample_create_client.py + :start-after: [START create_registry_client] + :end-before: [END create_registry_client] + :language: python + :dedent: 8 + :caption: Instantiate an instance of `ContainerRepositoryClient` """ if not endpoint.startswith("https://") and not endpoint.startswith("http://"): endpoint = "https://" + endpoint @@ -64,6 +73,17 @@ async def delete(self, **kwargs: Dict[str, Any]) -> DeleteRepositoryResult: :returns: Object containing information about the deleted repository :rtype: :class:`~azure.containerregistry.DeleteRepositoryResult` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + await client.delete() """ return DeleteRepositoryResult._from_generated( # pylint: disable=protected-access await self._client.container_registry.delete_repository(self.repository, **kwargs) @@ -77,6 +97,18 @@ async def delete_registry_artifact(self, digest: str, **kwargs: Dict[str, Any]) :type digest: str :returns: None :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + async for artifact in client.list_registry_artifacts(): + await client.delete_registry_artifact(artifact.digest) """ await self._client.container_registry.delete_manifest(self.repository, digest, **kwargs) @@ -87,6 +119,18 @@ async def delete_tag(self, tag: str, **kwargs: Dict[str, Any]) -> None: :param str tag: The tag to be deleted :returns: None :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + async for artifact in client.list_tags(): + await client.delete_tag(tag.name) """ await self._client.container_registry.delete_tag(self.repository, tag, **kwargs) @@ -96,6 +140,24 @@ async def get_properties(self, **kwargs: Dict[str, Any]) -> RepositoryProperties :returns: :class:`~azure.containerregistry.RepositoryProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + repository_properties = await client.get_properties() + print(repository_properties.name) + print(repository_properties.content_permissions) + print(repository_properties.created_on) + print(repository_properties.last_updated_on) + print(repository_properties.manifest_count) + print(repository_properties.registry) + print(repository_properties.tag_count) """ return RepositoryProperties._from_generated( # pylint: disable=protected-access await self._client.container_registry.get_properties(self.repository, **kwargs) @@ -104,19 +166,32 @@ async def get_properties(self, **kwargs: Dict[str, Any]) -> RepositoryProperties @distributed_trace_async async def get_registry_artifact_properties( self, tag_or_digest: str, **kwargs: Dict[str, Any] - ) -> RegistryArtifactProperties: + ) -> ArtifactManifestProperties: """Get the properties of a registry artifact :param tag_or_digest: The tag/digest of a registry artifact :type tag_or_digest: str - :returns: :class:`~azure.containerregistry.RegistryArtifactProperties` + :returns: :class:`~azure.containerregistry.ArtifactManifestProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + async for artifact in client.list_registry_artifacts(): + properties = await client.get_registry_artifact_properties(artifact.digest) """ if _is_tag(tag_or_digest): tag_or_digest = self._get_digest_from_tag(tag_or_digest) - return RegistryArtifactProperties._from_generated( # pylint: disable=protected-access - await self._client.container_registry.get_manifest_properties(self.repository, tag_or_digest, **kwargs) + return ArtifactManifestProperties._from_generated( # pylint: disable=protected-access + await self._client.container_registry.get_manifest_properties(self.repository, tag_or_digest, **kwargs), + repository=self.repository ) @distributed_trace_async @@ -127,6 +202,18 @@ async def get_tag_properties(self, tag: str, **kwargs: Dict[str, Any]) -> Artifa :type tag: str :returns: :class:`~azure.containerregistry.ArtifactTagProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + async for tag in client.list_tags(): + tag_properties = await client.get_tag_properties(tag.name) """ return ArtifactTagProperties._from_generated( # pylint: disable=protected-access await self._client.container_registry.get_tag_properties(self.repository, tag, **kwargs), @@ -134,19 +221,31 @@ async def get_tag_properties(self, tag: str, **kwargs: Dict[str, Any]) -> Artifa ) @distributed_trace - def list_registry_artifacts(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[RegistryArtifactProperties]: + def list_registry_artifacts(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[ArtifactManifestProperties]: """List the artifacts for a repository :keyword last: Query parameter for the last item in the previous call. Ensuing call will return values after last lexically :paramtype last: str :keyword order_by: Query parameter for ordering by time ascending or descending - :paramtype order_by: :class:`~azure.containerregistry.RegistryArtifactOrderBy` + :paramtype order_by: :class:`~azure.containerregistry.ManifestOrderBy` :keyword results_per_page: Number of repositories to return per page :paramtype results_per_page: int - :return: ItemPaged[:class:`~azure.containerregistry.RegistryArtifactProperties`] + :return: ItemPaged[:class:`~azure.containerregistry.ArtifactManifestProperties`] :rtype: :class:`~azure.core.async_paging.AsyncItemPaged` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + async for artifact in client.list_registry_artifacts(): + print(artifact.digest) """ name = self.repository last = kwargs.pop("last", None) @@ -155,7 +254,7 @@ def list_registry_artifacts(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[Re cls = kwargs.pop( "cls", lambda objs: [ - RegistryArtifactProperties._from_generated(x) for x in objs # pylint: disable=protected-access + ArtifactManifestProperties._from_generated(x, repository=self.repository) for x in objs # pylint: disable=protected-access ], ) @@ -264,6 +363,18 @@ def list_tags(self, **kwargs: Dict[str, Any]) -> AsyncItemPaged[ArtifactTagPrope :return: ItemPaged[:class:`~azure.containerregistry.ArtifactTagProperties`] :rtype: :class:`~azure.core.async_paging.AsyncItemPaged` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + async for tag in client.list_tags(): + tag_properties = await client.get_tag_properties(tag.name) """ name = self.repository last = kwargs.pop("last", None) @@ -381,13 +492,34 @@ async def set_manifest_properties( :type digest: str :param permissions: The property's values to be set :type permissions: ContentProperties - :returns: :class:`~azure.containerregistry.RegistryArtifactProperties` + :returns: :class:`~azure.containerregistry.ArtifactManifestProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + async for artifact in client.list_registry_artifacts(): + received_permissions = await client.set_manifest_properties( + artifact.digest, + ContentPermissions( + can_delete=False, + can_list=False, + can_read=False, + can_write=False, + ), + ) """ - return RegistryArtifactProperties._from_generated( # pylint: disable=protected-access + return ArtifactManifestProperties._from_generated( # pylint: disable=protected-access await self._client.container_registry.update_manifest_properties( self.repository, digest, value=permissions._to_generated(), **kwargs # pylint: disable=protected-access - ) + ), + repository=self.repository ) @distributed_trace_async @@ -402,6 +534,26 @@ async def set_tag_properties( :type permissions: ContentProperties :returns: :class:`~azure.containerregistry.ArtifactTagProperties` :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` + + Example + + .. code-block:: python + + from azure.containerregistry.aio import ContainerRepositoryClient + from azure.identity.aio import DefaultAzureCredential + + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + client = ContainerRepositoryClient(account_url, "my_repository", DefaultAzureCredential()) + tag_identifier = "latest" + received = await client.set_tag_properties( + tag_identifier, + ContentPermissions( + can_delete=False, + can_list=False, + can_read=False, + can_write=False, + ), + ) """ return ArtifactTagProperties._from_generated( # pylint: disable=protected-access await self._client.container_registry.update_tag_attributes( diff --git a/sdk/containerregistry/azure-containerregistry/samples/README.md b/sdk/containerregistry/azure-containerregistry/samples/README.md index 289a04251778..e29d222f4c5c 100644 --- a/sdk/containerregistry/azure-containerregistry/samples/README.md +++ b/sdk/containerregistry/azure-containerregistry/samples/README.md @@ -16,7 +16,8 @@ The async versions of the samples require Python 3.6 or later. |**File Name**|**Description**| |-------------|---------------| -|[sample_create_client.py][create_client] and [sample_create_client_async.py][create_client_async]|Instantiate a client|Authorizing a `ContainerRegistryClient` object and `ContainerRepositoryClient` object| +|[sample_create_client.py][create_client] ([async version][create_client_async]) |Instantiate a client | Authorizing a `ContainerRegistryClient` object and `ContainerRepositoryClient` object | +|[sample_delete_old_tags.py][delete_old_tags] and [sample_delete_old_tags_async.py][delete_old_tags_async] | Delete tags from a repository | ### Prerequisites * Python 2.7, or 3.6 or later is required to use this package. @@ -49,4 +50,6 @@ Check out the [API reference documentation][rest_docs] to learn more about what [container_registry_docs]: https://docs.microsoft.com/azure/container-registry/container-registry-intro [create_client]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/containerregistry/azure-containerregistry/samples/sample_create_client.py -[create_client_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_create_client_async.py \ No newline at end of file +[create_client_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_create_client_async.py +[delete_old_tags]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/containerregistry/azure-containerregistry/samples/sample_delete_old_tags.py +[delete_old_tags_async]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_delete_old_tags_async.py diff --git a/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_create_client_async.py b/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_create_client_async.py index 1e50f9f3dda8..21b26d35094b 100644 --- a/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_create_client_async.py +++ b/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_create_client_async.py @@ -66,6 +66,9 @@ async def basic_sample(self): async for tag in repository_client.list_tags(): print(tag.digest) + # [START delete_repository] + await client.delete_repository("hello-world") + # [END delete_repository] async def main(): sample = CreateClients() @@ -76,4 +79,4 @@ async def main(): if __name__ == "__main__": loop = asyncio.get_event_loop() - loop.run_until_complete(main()) \ No newline at end of file + loop.run_until_complete(main()) diff --git a/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_delete_old_tags_async.py b/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_delete_old_tags_async.py new file mode 100644 index 000000000000..4c6b789f4eec --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_delete_old_tags_async.py @@ -0,0 +1,67 @@ +# 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_delete_old_tags_async.py + +DESCRIPTION: + These samples demonstrates deleting the three oldest tags for each repository asynchronously. + +USAGE: + python sample_delete_old_tags_async.py + + Set the environment variables with your own values before running the sample: + 1) CONTAINERREGISTRY_ENDPOINT - The URL of you Container Registry account +""" + +import asyncio +from dotenv import find_dotenv, load_dotenv +import os + + +class DeleteOperations(object): + def __init__(self): + load_dotenv(find_dotenv()) + self.account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + + async def delete_old_tags(self): + from azure.containerregistry import TagOrderBy + from azure.containerregistry.aio import ( + ContainerRegistryClient, + ContainerRepositoryClient, + ) + from azure.identity.aio import DefaultAzureCredential + + # [START list_repositories] + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + credential = DefaultAzureCredential() + client = ContainerRegistryClient(account_url, credential) + + async for repository in client.list_repositories(): + repository_client = ContainerRepositoryClient(account_url, repository, credential) + # [END list_repositories] + + # [START list_tags] + tag_count = 0 + async for tag in repository_client.list_tags(order_by=TagOrderBy.LAST_UPDATE_TIME_DESCENDING): + tag_count += 1 + if tag_count > 3: + await repository_client.delete_tag(tag.name) + # [END list_tags] + + await client.close() + + +async def main(): + sample = DeleteOperations() + sample.delete_old_tags() + + +if __name__ == '__main__': + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) diff --git a/sdk/containerregistry/azure-containerregistry/samples/sample_create_client.py b/sdk/containerregistry/azure-containerregistry/samples/sample_create_client.py index df9fa8066d4e..1ce7cf38438d 100644 --- a/sdk/containerregistry/azure-containerregistry/samples/sample_create_client.py +++ b/sdk/containerregistry/azure-containerregistry/samples/sample_create_client.py @@ -65,6 +65,10 @@ def basic_sample(self): for tag in repository_client.list_tags(): print(tag.digest) + # [START delete_repository] + client.delete_repository("hello-world") + # [END delete_repository] + if __name__ == "__main__": sample = CreateClients() diff --git a/sdk/containerregistry/azure-containerregistry/samples/sample_delete_old_tags.py b/sdk/containerregistry/azure-containerregistry/samples/sample_delete_old_tags.py new file mode 100644 index 000000000000..521c25fcb4bd --- /dev/null +++ b/sdk/containerregistry/azure-containerregistry/samples/sample_delete_old_tags.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. +# -------------------------------------------------------------------------- + +""" +FILE: sample_delete_old_tags.py + +DESCRIPTION: + These samples demonstrates deleting the three oldest tags for each repository + +USAGE: + python sample_delete_old_tags.py + + Set the environment variables with your own values before running the sample: + 1) CONTAINERREGISTRY_ENDPOINT - The URL of you Container Registry account +""" + +from dotenv import find_dotenv, load_dotenv +import os + + +class DeleteOperations(object): + def __init__(self): + load_dotenv(find_dotenv()) + self.account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + + def delete_old_tags(self): + from azure.containerregistry import ( + ContainerRegistryClient, + ContainerRepositoryClient, + TagOrderBy + ) + from azure.identity import DefaultAzureCredential + + # [START list_repositories] + account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"] + credential = DefaultAzureCredential() + client = ContainerRegistryClient(account_url, credential) + + for repository in client.list_repositories(): + repository_client = ContainerRepositoryClient(account_url, repository, credential) + # [END list_repositories] + + # [START list_tags] + tag_count = 0 + for tag in repository_client.list_tags(order_by=TagOrderBy.LAST_UPDATE_TIME_DESCENDING): + tag_count += 1 + if tag_count > 3: + repository_client.delete_tag(tag.name) + # [END list_tags] + + client.close() diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py index f927c58857f3..82b61bc7c029 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py +++ b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client.py @@ -9,8 +9,8 @@ from azure.containerregistry import ( DeleteRepositoryResult, ContentProperties, - RegistryArtifactOrderBy, - RegistryArtifactProperties, + ManifestOrderBy, + ArtifactManifestProperties, ArtifactTagProperties, TagOrderBy, ) @@ -70,7 +70,7 @@ def test_list_registry_artifacts(self, containerregistry_endpoint): count = 0 for artifact in client.list_registry_artifacts(): assert artifact is not None - assert isinstance(artifact, RegistryArtifactProperties) + assert isinstance(artifact, ArtifactManifestProperties) assert artifact.created_on is not None assert isinstance(artifact.created_on, datetime) assert artifact.last_updated_on is not None @@ -101,7 +101,7 @@ def test_list_registry_artifacts_descending(self, containerregistry_endpoint): prev_last_updated_on = None count = 0 - for artifact in client.list_registry_artifacts(order_by=RegistryArtifactOrderBy.LAST_UPDATE_TIME_DESCENDING): + for artifact in client.list_registry_artifacts(order_by=ManifestOrderBy.LAST_UPDATE_TIME_DESCENDING): if prev_last_updated_on: assert artifact.last_updated_on < prev_last_updated_on prev_last_updated_on = artifact.last_updated_on @@ -115,7 +115,7 @@ def test_list_registry_artifacts_ascending(self, containerregistry_endpoint): prev_last_updated_on = None count = 0 - for artifact in client.list_registry_artifacts(order_by=RegistryArtifactOrderBy.LAST_UPDATE_TIME_ASCENDING): + for artifact in client.list_registry_artifacts(order_by=ManifestOrderBy.LAST_UPDATE_TIME_ASCENDING): if prev_last_updated_on: assert artifact.last_updated_on > prev_last_updated_on prev_last_updated_on = artifact.last_updated_on @@ -129,7 +129,7 @@ def test_get_registry_artifact_properties(self, containerregistry_endpoint): properties = client.get_registry_artifact_properties("latest") - assert isinstance(properties, RegistryArtifactProperties) + assert isinstance(properties, ArtifactManifestProperties) assert isinstance(properties.created_on, datetime) assert isinstance(properties.last_updated_on, datetime) diff --git a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client_async.py b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client_async.py index fc5080260799..02ea7dfef5a3 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client_async.py +++ b/sdk/containerregistry/azure-containerregistry/tests/test_container_repository_client_async.py @@ -10,8 +10,8 @@ DeleteRepositoryResult, ArtifactTagProperties, ContentProperties, - RegistryArtifactOrderBy, - RegistryArtifactProperties, + ManifestOrderBy, + ArtifactManifestProperties, TagOrderBy, ) from azure.core.exceptions import ResourceNotFoundError @@ -29,7 +29,7 @@ async def test_list_registry_artifacts(self, containerregistry_endpoint): async for artifact in client.list_registry_artifacts(): assert artifact is not None - assert isinstance(artifact, RegistryArtifactProperties) + assert isinstance(artifact, ArtifactManifestProperties) assert artifact.created_on is not None assert isinstance(artifact.created_on, datetime) assert artifact.last_updated_on is not None @@ -277,7 +277,7 @@ async def test_list_registry_artifacts(self, containerregistry_endpoint): count = 0 async for artifact in client.list_registry_artifacts(): assert artifact is not None - assert isinstance(artifact, RegistryArtifactProperties) + assert isinstance(artifact, ArtifactManifestProperties) assert artifact.created_on is not None assert isinstance(artifact.created_on, datetime) assert artifact.last_updated_on is not None @@ -293,7 +293,7 @@ async def test_list_registry_artifacts_descending(self, containerregistry_endpoi prev_last_updated_on = None count = 0 async for artifact in client.list_registry_artifacts( - order_by=RegistryArtifactOrderBy.LAST_UPDATE_TIME_DESCENDING + order_by=ManifestOrderBy.LAST_UPDATE_TIME_DESCENDING ): if prev_last_updated_on: assert artifact.last_updated_on < prev_last_updated_on @@ -309,7 +309,7 @@ async def test_list_registry_artifacts_ascending(self, containerregistry_endpoin prev_last_updated_on = None count = 0 async for artifact in client.list_registry_artifacts( - order_by=RegistryArtifactOrderBy.LAST_UPDATE_TIME_ASCENDING + order_by=ManifestOrderBy.LAST_UPDATE_TIME_ASCENDING ): if prev_last_updated_on: assert artifact.last_updated_on > prev_last_updated_on diff --git a/sdk/containerregistry/azure-containerregistry/tests/testcase.py b/sdk/containerregistry/azure-containerregistry/tests/testcase.py index a845f294ca3c..c5afbd4b7aa6 100644 --- a/sdk/containerregistry/azure-containerregistry/tests/testcase.py +++ b/sdk/containerregistry/azure-containerregistry/tests/testcase.py @@ -17,7 +17,7 @@ ContainerRegistryClient, ArtifactTagProperties, ContentProperties, - RegistryArtifactProperties, + ArtifactManifestProperties, ) from azure.core.credentials import AccessToken @@ -276,7 +276,7 @@ def assert_tag( assert tag.repository == repository def assert_registry_artifact(self, tag_or_digest, expected_tag_or_digest): - assert isinstance(tag_or_digest, RegistryArtifactProperties) + assert isinstance(tag_or_digest, ArtifactManifestProperties) assert tag_or_digest == expected_tag_or_digest diff --git a/sdk/eventgrid/azure-eventgrid/CHANGELOG.md b/sdk/eventgrid/azure-eventgrid/CHANGELOG.md index 0c94f2c285fa..520adbd6be3f 100644 --- a/sdk/eventgrid/azure-eventgrid/CHANGELOG.md +++ b/sdk/eventgrid/azure-eventgrid/CHANGELOG.md @@ -2,6 +2,8 @@ ## 4.1.2 (Unreleased) + **New Features** + - Added new event names to the `SystemEventNames` enum. ## 4.1.1 (2021-04-07) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py index 08466276aa66..8669a259692f 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py @@ -4,6 +4,7 @@ # -------------------------------------------------------------------------------------------- from enum import Enum +# pylint: disable=line-too-long class SystemEventNames(str, Enum): """ @@ -11,168 +12,279 @@ class SystemEventNames(str, Enum): Azure Event Grid. To check the list of recognizable system topics, visit https://docs.microsoft.com/azure/event-grid/system-topics. """ + AcsChatMessageDeletedEventName = 'Microsoft.Communication.ChatMessageDeleted' - AcsChatMemberAddedToThreadWithUserEventName = ( - "Microsoft.Communication.ChatMemberAddedToThreadWithUser" - ) - AcsChatMemberRemovedFromThreadWithUserEventName = ( - "Microsoft.Communication.ChatMemberRemovedFromThreadWithUser" - ) - AcsChatMessageDeletedEventName = "Microsoft.Communication.ChatMessageDeleted" - AcsChatMessageEditedEventName = "Microsoft.Communication.ChatMessageEdited" - AcsChatMessageReceivedEventName = "Microsoft.Communication.ChatMessageReceived" - AcsRecordingFileStatusUpdatedEventName = "Microsoft.Communication.RecordingFileStatusUpdated" - AcsChatThreadCreatedWithUserEventName = ( - "Microsoft.Communication.ChatThreadCreatedWithUser" - ) - AcsChatThreadParticipantAddedEventName = "Microsoft.Communication.ChatThreadParticipantAdded" - AcsChatThreadParticipantRemovedEventName = "Microsoft.Communication.ChatThreadParticipantRemoved" - AcsChatThreadPropertiesUpdatedPerUserEventName = ( - "Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser" - ) - AcsChatThreadWithUserDeletedEventName = ( - "Microsoft.Communication.ChatThreadWithUserDeleted" - ) - AcsSmsDeliveryReportReceivedEventName = ( - "Microsoft.Communication.SMSDeliveryReportReceived" - ) - AcsSmsReceivedEventName = "Microsoft.Communication.SMSReceived" - AppConfigurationKeyValueDeletedEventName = ( - "Microsoft.AppConfiguration.KeyValueDeleted" - ) - AppConfigurationKeyValueModifiedEventName = ( - "Microsoft.AppConfiguration.KeyValueModified" - ) - ContainerRegistryChartDeletedEventName = "Microsoft.ContainerRegistry.ChartDeleted" - ContainerRegistryChartPushedEventName = "Microsoft.ContainerRegistry.ChartPushed" - ContainerRegistryImageDeletedEventName = "Microsoft.ContainerRegistry.ImageDeleted" - ContainerRegistryImagePushedEventName = "Microsoft.ContainerRegistry.ImagePushed" - EventGridSubscriptionDeletedEventName = ( - "Microsoft.EventGrid.SubscriptionDeletedEvent" - ) - EventGridSubscriptionValidationEventName = ( - "Microsoft.EventGrid.SubscriptionValidationEvent" - ) - EventHubCaptureFileCreatedEventName = "Microsoft.EventHub.CaptureFileCreated" - IoTHubDeviceConnectedEventName = "Microsoft.Devices.DeviceConnected" - IoTHubDeviceCreatedEventName = "Microsoft.Devices.DeviceCreated" - IoTHubDeviceDeletedEventName = "Microsoft.Devices.DeviceDeleted" - IoTHubDeviceDisconnectedEventName = "Microsoft.Devices.DeviceDisconnected" - IotHubDeviceTelemetryEventName = "Microsoft.Devices.DeviceTelemetry" - KeyVaultAccessPolicyChangedEventName = "Microsoft.KeyVault.VaultAccessPolicyChanged" - KeyVaultCertificateExpiredEventName = "Microsoft.KeyVault.CertificateExpired" - KeyVaultCertificateNearExpiryEventName = "Microsoft.KeyVault.CertificateNearExpiry" - KeyVaultCertificateNewVersionCreatedEventName = ( - "Microsoft.KeyVault.CertificateNewVersionCreated" - ) - KeyVaultKeyExpiredEventName = "Microsoft.KeyVault.KeyExpired" - KeyVaultKeyNearExpiryEventName = "Microsoft.KeyVault.KeyNearExpiry" - KeyVaultKeyNewVersionCreatedEventName = "Microsoft.KeyVault.KeyNewVersionCreated" - KeyVaultSecretExpiredEventName = "Microsoft.KeyVault.SecretExpired" - KeyVaultSecretNearExpiryEventName = "Microsoft.KeyVault.SecretNearExpiry" - KeyVaultSecretNewVersionCreatedEventName = ( - "Microsoft.KeyVault.SecretNewVersionCreated" - ) - MachineLearningServicesDatasetDriftDetectedEventName = ( - "Microsoft.MachineLearningServices.DatasetDriftDetected" - ) - MachineLearningServicesModelDeployedEventName = ( - "Microsoft.MachineLearningServices.ModelDeployed" - ) - MachineLearningServicesModelRegisteredEventName = ( - "Microsoft.MachineLearningServices.ModelRegistered" - ) - MachineLearningServicesRunCompletedEventName = ( - "Microsoft.MachineLearningServices.RunCompleted" - ) - MachineLearningServicesRunStatusChangedEventName = ( - "Microsoft.MachineLearningServices.RunStatusChanged" - ) - MapsGeofenceEnteredEventName = "Microsoft.Maps.GeofenceEntered" - MapsGeofenceExitedEventName = "Microsoft.Maps.GeofenceExited" - MapsGeofenceResultEventName = "Microsoft.Maps.GeofenceResult" - MediaJobCanceledEventName = "Microsoft.Media.JobCanceled" - MediaJobCancelingEventName = "Microsoft.Media.JobCanceling" - MediaJobErroredEventName = "Microsoft.Media.JobErrored" - MediaJobFinishedEventName = "Microsoft.Media.JobFinished" - MediaJobOutputCanceledEventName = "Microsoft.Media.JobOutputCanceled" - MediaJobOutputCancelingEventName = "Microsoft.Media.JobOutputCanceling" - MediaJobOutputErroredEventName = "Microsoft.Media.JobOutputErrored" - MediaJobOutputFinishedEventName = "Microsoft.Media.JobOutputFinished" - MediaJobOutputProcessingEventName = "Microsoft.Media.JobOutputProcessing" - MediaJobOutputProgressEventName = "Microsoft.Media.JobOutputProgress" - MediaJobOutputScheduledEventName = "Microsoft.Media.JobOutputScheduled" - MediaJobOutputStateChangeEventName = "Microsoft.Media.JobOutputStateChange" - MediaJobProcessingEventName = "Microsoft.Media.JobProcessing" - MediaJobScheduledEventName = "Microsoft.Media.JobScheduled" - MediaJobStateChangeEventName = "Microsoft.Media.JobStateChange" - MediaLiveEventConnectionRejectedEventName = ( - "Microsoft.Media.LiveEventConnectionRejected" - ) - MediaLiveEventEncoderConnectedEventName = ( - "Microsoft.Media.LiveEventEncoderConnected" - ) - MediaLiveEventEncoderDisconnectedEventName = ( - "Microsoft.Media.LiveEventEncoderDisconnected" - ) - MediaLiveEventIncomingDataChunkDroppedEventName = ( - "Microsoft.Media.LiveEventIncomingDataChunkDropped" - ) - MediaLiveEventIncomingStreamReceivedEventName = ( - "Microsoft.Media.LiveEventIncomingStreamReceived" - ) - MediaLiveEventIncomingStreamsOutOfSyncEventName = ( - "Microsoft.Media.LiveEventIncomingStreamsOutOfSync" - ) - MediaLiveEventIncomingVideoStreamsOutOfSyncEventName = ( - "Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync" - ) - MediaLiveEventIngestHeartbeatEventName = "Microsoft.Media.LiveEventIngestHeartbeat" - MediaLiveEventTrackDiscontinuityDetectedEventName = ( - "Microsoft.Media.LiveEventTrackDiscontinuityDetected" - ) - ResourceActionCancelEventName = "Microsoft.Resources.ResourceActionCancel" - ResourceActionFailureEventName = "Microsoft.Resources.ResourceActionFailure" - ResourceActionSuccessEventName = "Microsoft.Resources.ResourceActionSuccess" - ResourceDeleteCancelEventName = "Microsoft.Resources.ResourceDeleteCancel" - ResourceDeleteFailureEventName = "Microsoft.Resources.ResourceDeleteFailure" - ResourceDeleteSuccessEventName = "Microsoft.Resources.ResourceDeleteSuccess" - ResourceWriteCancelEventName = "Microsoft.Resources.ResourceWriteCancel" - ResourceWriteFailureEventName = "Microsoft.Resources.ResourceWriteFailure" - ResourceWriteSuccessEventName = "Microsoft.Resources.ResourceWriteSuccess" - ServiceBusActiveMessagesAvailableWithNoListenersEventName = ( - "Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners" - ) - ServiceBusDeadletterMessagesAvailableWithNoListenerEventName = ( - "Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener" - ) - ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventName = ( - "Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications" - ) - ServiceBusActiveMessagesAvailablePeriodicNotificationsEventName = ( - "Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications" - ) - StorageBlobCreatedEventName = "Microsoft.Storage.BlobCreated" - StorageBlobDeletedEventName = "Microsoft.Storage.BlobDeleted" - StorageBlobRenamedEventName = "Microsoft.Storage.BlobRenamed" - StorageDirectoryCreatedEventName = "Microsoft.Storage.DirectoryCreated" - StorageDirectoryDeletedEventName = "Microsoft.Storage.DirectoryDeleted" - StorageDirectoryRenamedEventName = "Microsoft.Storage.DirectoryRenamed" - StorageLifecyclePolicyCompletedEventName = ( - "Microsoft.Storage.LifecyclePolicyCompleted" - ) - WebAppServicePlanUpdatedEventName = "Microsoft.Web.AppServicePlanUpdated" - WebAppUpdatedEventName = "Microsoft.Web.AppUpdated" - WebBackupOperationCompletedEventName = "Microsoft.Web.BackupOperationCompleted" - WebBackupOperationFailedEventName = "Microsoft.Web.BackupOperationFailed" - WebBackupOperationStartedEventName = "Microsoft.Web.BackupOperationStarted" - WebRestoreOperationCompletedEventName = "Microsoft.Web.RestoreOperationCompleted" - WebRestoreOperationFailedEventName = "Microsoft.Web.RestoreOperationFailed" - WebRestoreOperationStartedEventName = "Microsoft.Web.RestoreOperationStarted" - WebSlotSwapCompletedEventName = "Microsoft.Web.SlotSwapCompleted" - WebSlotSwapFailedEventName = "Microsoft.Web.SlotSwapFailed" - WebSlotSwapStartedEventName = "Microsoft.Web.SlotSwapStarted" - WebSlotSwapWithPreviewCancelledEventName = ( - "Microsoft.Web.SlotSwapWithPreviewCancelled" - ) - WebSlotSwapWithPreviewStartedEventName = "Microsoft.Web.SlotSwapWithPreviewStarted" + AcsChatMessageDeletedInThreadEventName = 'Microsoft.Communication.ChatMessageDeletedInThread' + + AcsChatMessageEditedEventName = 'Microsoft.Communication.ChatMessageEdited' + + AcsChatMessageEditedInThreadEventName = 'Microsoft.Communication.ChatMessageEditedInThread' + + AcsChatMessageReceivedEventName = 'Microsoft.Communication.ChatMessageReceived' + + AcsChatMessageReceivedInThreadEventName = 'Microsoft.Communication.ChatMessageReceivedInThread' + + AcsChatParticipantAddedToThreadEventName = 'Microsoft.Communication.ChatThreadParticipantAdded' + + AcsChatParticipantAddedToThreadWithUserEventName = 'Microsoft.Communication.ChatParticipantAddedToThreadWithUser' + + AcsChatParticipantRemovedFromThreadEventName = 'Microsoft.Communication.ChatThreadParticipantRemoved' + + AcsChatParticipantRemovedFromThreadWithUserEventName = 'Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser' + + AcsChatThreadCreatedEventName = 'Microsoft.Communication.ChatThreadCreated' + + AcsChatThreadCreatedWithUserEventName = 'Microsoft.Communication.ChatThreadCreatedWithUser' + + AcsChatThreadDeletedEventName = 'Microsoft.Communication.ChatThreadDeleted' + + AcsChatThreadPropertiesUpdatedEventName = 'Microsoft.Communication.ChatThreadPropertiesUpdated' + + AcsChatThreadPropertiesUpdatedPerUserEventName = 'Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser' + + AcsChatThreadWithUserDeletedEventName = 'Microsoft.Communication.ChatThreadWithUserDeleted' + + AcsRecordingFileStatusUpdatedEventName = 'Microsoft.Communication.RecordingFileStatusUpdated' + + AcsSmsDeliveryReportReceivedEventName = 'Microsoft.Communication.SMSDeliveryReportReceived' + + AcsSmsReceivedEventName = 'Microsoft.Communication.SMSReceived' + + AppConfigurationKeyValueDeletedEventName = 'Microsoft.AppConfiguration.KeyValueDeleted' + + AppConfigurationKeyValueModifiedEventName = 'Microsoft.AppConfiguration.KeyValueModified' + + ContainerRegistryArtifactEventName = 'Microsoft.AppConfiguration.KeyValueModified' + + ContainerRegistryChartDeletedEventName = 'Microsoft.ContainerRegistry.ChartDeleted' + + ContainerRegistryChartPushedEventName = 'Microsoft.ContainerRegistry.ChartPushed' + + ContainerRegistryEventName = 'Microsoft.ContainerRegistry.ChartPushed' + + ContainerRegistryImageDeletedEventName = 'Microsoft.ContainerRegistry.ImageDeleted' + + ContainerRegistryImagePushedEventName = 'Microsoft.ContainerRegistry.ImagePushed' + + EventHubCaptureFileCreatedEventName = 'Microsoft.EventHub.CaptureFileCreated' + + IotHubDeviceConnectedEventName = 'Microsoft.Devices.DeviceConnected' + + IotHubDeviceCreatedEventName = 'Microsoft.Devices.DeviceCreated' + + IotHubDeviceDeletedEventName = 'Microsoft.Devices.DeviceDeleted' + + IotHubDeviceDisconnectedEventName = 'Microsoft.Devices.DeviceDisconnected' + + IotHubDeviceTelemetryEventName = 'Microsoft.Devices.DeviceTelemetry' + + KeyVaultAccessPolicyChangedEventName = 'Microsoft.KeyVault.VaultAccessPolicyChanged' + + KeyVaultCertificateExpiredEventName = 'Microsoft.KeyVault.CertificateExpired' + + KeyVaultCertificateNearExpiryEventName = 'Microsoft.KeyVault.CertificateNearExpiry' + + KeyVaultCertificateNewVersionCreatedEventName = 'Microsoft.KeyVault.CertificateNewVersionCreated' + + KeyVaultKeyExpiredEventName = 'Microsoft.KeyVault.KeyExpired' + + KeyVaultKeyNearExpiryEventName = 'Microsoft.KeyVault.KeyNearExpiry' + + KeyVaultKeyNewVersionCreatedEventName = 'Microsoft.KeyVault.KeyNewVersionCreated' + + KeyVaultSecretExpiredEventName = 'Microsoft.KeyVault.SecretExpired' + + KeyVaultSecretNearExpiryEventName = 'Microsoft.KeyVault.SecretNearExpiry' + + KeyVaultSecretNewVersionCreatedEventName = 'Microsoft.KeyVault.SecretNewVersionCreated' + + MachineLearningServicesNamesetDriftDetectedEventName = 'Microsoft.MachineLearningServices.DatasetDriftDetected' + + MachineLearningServicesModelDeployedEventName = 'Microsoft.MachineLearningServices.ModelDeployed' + + MachineLearningServicesModelRegisteredEventName = 'Microsoft.MachineLearningServices.ModelRegistered' + + MachineLearningServicesRunCompletedEventName = 'Microsoft.MachineLearningServices.RunCompleted' + + MachineLearningServicesRunStatusChangedEventName = 'Microsoft.MachineLearningServices.RunStatusChanged' + + MapsGeofenceEnteredEventName = 'Microsoft.Maps.GeofenceEntered' + + MapsGeofenceExitedEventName = 'Microsoft.Maps.GeofenceExited' + + MapsGeofenceResultEventName = 'Microsoft.Maps.GeofenceResult' + + MediaJobCanceledEventName = 'Microsoft.Media.JobCanceled' + + MediaJobCancelingEventName = 'Microsoft.Media.JobCanceling' + + MediaJobErroredEventName = 'Microsoft.Media.JobErrored' + + MediaJobFinishedEventName = 'Microsoft.Media.JobFinished' + + MediaJobOutputCanceledEventName = 'Microsoft.Media.JobOutputCanceled' + + MediaJobOutputCancelingEventName = 'Microsoft.Media.JobOutputCanceling' + + MediaJobOutputErroredEventName = 'Microsoft.Media.JobOutputErrored' + + MediaJobOutputFinishedEventName = 'Microsoft.Media.JobOutputFinished' + + MediaJobOutputProcessingEventName = 'Microsoft.Media.JobOutputProcessing' + + MediaJobOutputProgressEventName = 'Microsoft.Media.JobOutputProgress' + + MediaJobOutputScheduledEventName = 'Microsoft.Media.JobOutputScheduled' + + MediaJobOutputStateChangeEventName = 'Microsoft.Media.JobOutputStateChange' + + MediaJobProcessingEventName = 'Microsoft.Media.JobProcessing' + + MediaJobScheduledEventName = 'Microsoft.Media.JobScheduled' + + MediaJobStateChangeEventName = 'Microsoft.Media.JobStateChange' + + MediaLiveEventConnectionRejectedEventName = 'Microsoft.Media.LiveEventConnectionRejected' + + MediaLiveEventEncoderConnectedEventName = 'Microsoft.Media.LiveEventEncoderConnected' + + MediaLiveEventEncoderDisconnectedEventName = 'Microsoft.Media.LiveEventEncoderDisconnected' + + MediaLiveEventIncomingNameChunkDroppedEventName = 'Microsoft.Media.LiveEventIncomingDataChunkDropped' + + MediaLiveEventIncomingStreamReceivedEventName = 'Microsoft.Media.LiveEventIncomingStreamReceived' + + MediaLiveEventIncomingStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingStreamsOutOfSync' + + MediaLiveEventIncomingVideoStreamsOutOfSyncEventName = 'Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync' + + MediaLiveEventIngestHeartbeatEventName = 'Microsoft.Media.LiveEventIngestHeartbeat' + + MediaLiveEventTrackDiscontinuityDetectedEventName = 'Microsoft.Media.LiveEventTrackDiscontinuityDetected' + + RedisExportRDBCompletedEventName = 'Microsoft.Cache.ExportRDBCompleted' + + RedisImportRDBCompletedEventName = 'Microsoft.Cache.ImportRDBCompleted' + + RedisPatchingCompletedEventName = 'Microsoft.Cache.PatchingCompleted' + + RedisScalingCompletedEventName = 'Microsoft.Cache.ScalingCompleted' + + ResourceActionCancelName = 'Microsoft.Resources.ResourceActionCancel' + + ResourceActionFailureName = 'Microsoft.Resources.ResourceActionFailure' + + ResourceActionSuccessName = 'Microsoft.Resources.ResourceActionSuccess' + + ResourceDeleteCancelName = 'Microsoft.Resources.ResourceDeleteCancel' + + ResourceDeleteFailureName = 'Microsoft.Resources.ResourceDeleteFailure' + + ResourceDeleteSuccessName = 'Microsoft.Resources.ResourceDeleteSuccess' + + ResourceWriteCancelName = 'Microsoft.Resources.ResourceWriteCancel' + + ResourceWriteFailureName = 'Microsoft.Resources.ResourceWriteFailure' + + ResourceWriteSuccessName = 'Microsoft.Resources.ResourceWriteSuccess' + + ServiceBusActiveMessagesAvailablePeriodicNotificationsEventName = 'Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications' + + ServiceBusActiveMessagesAvailableWithNoListenersEventName = 'Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners' + + ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications' + + ServiceBusDeadletterMessagesAvailableWithNoListenersEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListenersEvent' + + SignalRServiceClientConnectionConnectedEventName = 'Microsoft.SignalRService.ClientConnectionConnected' + + SignalRServiceClientConnectionDisconnectedEventName = 'Microsoft.SignalRService.ClientConnectionDisconnected' + + StorageAsyncOperationInitiatedEventName = 'Microsoft.Storage.AsyncOperationInitiated' + + StorageBlobCreatedEventName = 'Microsoft.Storage.BlobCreated' + + StorageBlobDeletedEventName = 'Microsoft.Storage.BlobDeleted' + + StorageBlobRenamedEventName = 'Microsoft.Storage.BlobRenamed' + + StorageBlobTierChangedEventName = 'Microsoft.Storage.BlobTierChanged' + + StorageDirectoryCreatedEventName = 'Microsoft.Storage.DirectoryCreated' + + StorageDirectoryDeletedEventName = 'Microsoft.Storage.DirectoryDeleted' + + StorageDirectoryRenamedEventName = 'Microsoft.Storage.DirectoryRenamed' + + StorageLifecyclePolicyCompletedEventName = 'Microsoft.Storage.LifecyclePolicyCompleted' + + SubscriptionDeletedEventName = 'Microsoft.EventGrid.SubscriptionDeletedEvent' + + SubscriptionValidationEventName = 'Microsoft.EventGrid.SubscriptionValidationEvent' + + WebAppServicePlanUpdatedEventName = 'Microsoft.Web.AppServicePlanUpdated' + + WebAppUpdatedEventName = 'Microsoft.Web.AppUpdated' + + WebBackupOperationCompletedEventName = 'Microsoft.Web.BackupOperationCompleted' + + WebBackupOperationFailedEventName = 'Microsoft.Web.BackupOperationFailed' + + WebBackupOperationStartedEventName = 'Microsoft.Web.BackupOperationStarted' + + WebRestoreOperationCompletedEventName = 'Microsoft.Web.RestoreOperationCompleted' + + WebRestoreOperationFailedEventName = 'Microsoft.Web.RestoreOperationFailed' + + WebRestoreOperationStartedEventName = 'Microsoft.Web.RestoreOperationStarted' + + WebSlotSwapCompletedEventName = 'Microsoft.Web.SlotSwapCompleted' + + WebSlotSwapFailedEventName = 'Microsoft.Web.SlotSwapFailed' + + WebSlotSwapStartedEventName = 'Microsoft.Web.SlotSwapStarted' + + WebSlotSwapWithPreviewCancelledEventName = 'Microsoft.Web.SlotSwapWithPreviewCancelled' + + WebSlotSwapWithPreviewStartedEventName = 'Microsoft.Web.SlotSwapWithPreviewStarted' + + # these names below are for backward compat only - refrain from using them. + AcsChatMemberAddedToThreadWithUserEventName = 'Microsoft.Communication.ChatMemberAddedToThreadWithUser' + + ResourceWriteFailureEventName = 'Microsoft.Resources.ResourceWriteFailure' + + IoTHubDeviceDeletedEventName = 'Microsoft.Devices.DeviceDeleted' + + IoTHubDeviceDisconnectedEventName = 'Microsoft.Devices.DeviceDisconnected' + + ResourceDeleteFailureEventName = 'Microsoft.Resources.ResourceDeleteFailure' + + ResourceDeleteCancelEventName = 'Microsoft.Resources.ResourceDeleteCancel' + + AcsChatThreadParticipantAddedEventName = 'Microsoft.Communication.ChatThreadParticipantAdded' + + ResourceDeleteSuccessEventName = 'Microsoft.Resources.ResourceDeleteSuccess' + + EventGridSubscriptionValidationEventName = 'Microsoft.EventGrid.SubscriptionValidationEvent' + + ResourceWriteSuccessEventName = 'Microsoft.Resources.ResourceWriteSuccess' + + ResourceActionSuccessEventName = 'Microsoft.Resources.ResourceActionSuccess' + + ResourceWriteCancelEventName = 'Microsoft.Resources.ResourceWriteCancel' + + ServiceBusDeadletterMessagesAvailableWithNoListenerEventName = 'Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener' + + ResourceActionFailureEventName = 'Microsoft.Resources.ResourceActionFailure' + + AcsChatMemberRemovedFromThreadWithUserEventName = 'Microsoft.Communication.ChatMemberRemovedFromThreadWithUser' + + IoTHubDeviceConnectedEventName = 'Microsoft.Devices.DeviceConnected' + + EventGridSubscriptionDeletedEventName = 'Microsoft.EventGrid.SubscriptionDeletedEvent' + + AcsChatThreadParticipantRemovedEventName = 'Microsoft.Communication.ChatThreadParticipantRemoved' + + ResourceActionCancelEventName = 'Microsoft.Resources.ResourceActionCancel' + + IoTHubDeviceCreatedEventName = 'Microsoft.Devices.DeviceCreated' diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py index 1c7169dcfe59..81d2c9bbaeeb 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py @@ -32,7 +32,7 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - base_url = '{topicHostname}' + base_url = 'https://{topicHostname}' self._config = EventGridPublisherClientConfiguration(**kwargs) self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client.py index f14d01caf5a7..48616ed868e2 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client.py @@ -26,7 +26,7 @@ def __init__( self, **kwargs: Any ) -> None: - base_url = '{topicHostname}' + base_url = 'https://{topicHostname}' self._config = EventGridPublisherClientConfiguration(**kwargs) self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/_event_grid_publisher_client_operations.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/_event_grid_publisher_client_operations.py index 0369afe99666..a2a3ee562e89 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/_event_grid_publisher_client_operations.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/_event_grid_publisher_client_operations.py @@ -185,4 +185,4 @@ async def publish_custom_event_events( if cls: return cls(pipeline_response, None, {}) - publish_custom_event_events.metadata = {'url': ''} # type: ignore + publish_custom_event_events.metadata = {'url': '/api/events'} # type: ignore diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py index 624c31af936d..792fd132d949 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py @@ -30,6 +30,9 @@ from ._models_py3 import AcsChatThreadPropertiesUpdatedEventData from ._models_py3 import AcsChatThreadPropertiesUpdatedPerUserEventData from ._models_py3 import AcsChatThreadWithUserDeletedEventData + from ._models_py3 import AcsRecordingChunkInfoProperties + from ._models_py3 import AcsRecordingFileStatusUpdatedEventData + from ._models_py3 import AcsRecordingStorageInfoProperties from ._models_py3 import AcsSmsDeliveryAttemptProperties from ._models_py3 import AcsSmsDeliveryReportReceivedEventData from ._models_py3 import AcsSmsEventBaseProperties @@ -137,9 +140,11 @@ from ._models_py3 import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData from ._models_py3 import SignalRServiceClientConnectionConnectedEventData from ._models_py3 import SignalRServiceClientConnectionDisconnectedEventData + from ._models_py3 import StorageAsyncOperationInitiatedEventData from ._models_py3 import StorageBlobCreatedEventData from ._models_py3 import StorageBlobDeletedEventData from ._models_py3 import StorageBlobRenamedEventData + from ._models_py3 import StorageBlobTierChangedEventData from ._models_py3 import StorageDirectoryCreatedEventData from ._models_py3 import StorageDirectoryDeletedEventData from ._models_py3 import StorageDirectoryRenamedEventData @@ -186,6 +191,9 @@ from ._models import AcsChatThreadPropertiesUpdatedEventData # type: ignore from ._models import AcsChatThreadPropertiesUpdatedPerUserEventData # type: ignore from ._models import AcsChatThreadWithUserDeletedEventData # type: ignore + from ._models import AcsRecordingChunkInfoProperties # type: ignore + from ._models import AcsRecordingFileStatusUpdatedEventData # type: ignore + from ._models import AcsRecordingStorageInfoProperties # type: ignore from ._models import AcsSmsDeliveryAttemptProperties # type: ignore from ._models import AcsSmsDeliveryReportReceivedEventData # type: ignore from ._models import AcsSmsEventBaseProperties # type: ignore @@ -293,9 +301,11 @@ from ._models import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData # type: ignore from ._models import SignalRServiceClientConnectionConnectedEventData # type: ignore from ._models import SignalRServiceClientConnectionDisconnectedEventData # type: ignore + from ._models import StorageAsyncOperationInitiatedEventData # type: ignore from ._models import StorageBlobCreatedEventData # type: ignore from ._models import StorageBlobDeletedEventData # type: ignore from ._models import StorageBlobRenamedEventData # type: ignore + from ._models import StorageBlobTierChangedEventData # type: ignore from ._models import StorageDirectoryCreatedEventData # type: ignore from ._models import StorageDirectoryDeletedEventData # type: ignore from ._models import StorageDirectoryRenamedEventData # type: ignore @@ -355,6 +365,9 @@ 'AcsChatThreadPropertiesUpdatedEventData', 'AcsChatThreadPropertiesUpdatedPerUserEventData', 'AcsChatThreadWithUserDeletedEventData', + 'AcsRecordingChunkInfoProperties', + 'AcsRecordingFileStatusUpdatedEventData', + 'AcsRecordingStorageInfoProperties', 'AcsSmsDeliveryAttemptProperties', 'AcsSmsDeliveryReportReceivedEventData', 'AcsSmsEventBaseProperties', @@ -462,9 +475,11 @@ 'ServiceBusDeadletterMessagesAvailableWithNoListenersEventData', 'SignalRServiceClientConnectionConnectedEventData', 'SignalRServiceClientConnectionDisconnectedEventData', + 'StorageAsyncOperationInitiatedEventData', 'StorageBlobCreatedEventData', 'StorageBlobDeletedEventData', 'StorageBlobRenamedEventData', + 'StorageBlobTierChangedEventData', 'StorageDirectoryCreatedEventData', 'StorageDirectoryDeletedEventData', 'StorageDirectoryRenamedEventData', diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py index e1e8beff6a23..f71b9174bdba 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py @@ -40,11 +40,14 @@ def __init__( class AcsChatEventInThreadBaseProperties(msrest.serialization.Model): """Schema of common properties of all thread-level chat events. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, } @@ -53,6 +56,7 @@ def __init__( **kwargs ): super(AcsChatEventInThreadBaseProperties, self).__init__(**kwargs) + self.transaction_id = kwargs.get('transaction_id', None) self.thread_id = kwargs.get('thread_id', None) @@ -107,7 +111,7 @@ def __init__( class AcsChatMessageDeletedEventData(AcsChatMessageEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeleted event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -157,6 +161,8 @@ def __init__( class AcsChatMessageEventInThreadBaseProperties(AcsChatEventInThreadBaseProperties): """Schema of common properties of all thread-level chat message events. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. @@ -175,6 +181,7 @@ class AcsChatMessageEventInThreadBaseProperties(AcsChatEventInThreadBaseProperti """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -198,8 +205,10 @@ def __init__( class AcsChatMessageDeletedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeletedInThread event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeletedInThread event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. @@ -220,6 +229,7 @@ class AcsChatMessageDeletedInThreadEventData(AcsChatMessageEventInThreadBaseProp """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -239,7 +249,7 @@ def __init__( class AcsChatMessageEditedEventData(AcsChatMessageEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEdited event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEdited event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -291,8 +301,10 @@ def __init__( class AcsChatMessageEditedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEditedInThread event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEditedInThread event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. @@ -315,6 +327,7 @@ class AcsChatMessageEditedInThreadEventData(AcsChatMessageEventInThreadBasePrope """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -336,7 +349,7 @@ def __init__( class AcsChatMessageReceivedEventData(AcsChatMessageEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceived event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -384,8 +397,10 @@ def __init__( class AcsChatMessageReceivedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceivedInThread event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceivedInThread event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. @@ -406,6 +421,7 @@ class AcsChatMessageReceivedInThreadEventData(AcsChatMessageEventInThreadBasePro """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -425,8 +441,10 @@ def __init__( class AcsChatParticipantAddedToThreadEventData(AcsChatEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantAddedToThread event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantAdded event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param time: The time at which the user was added to the thread. @@ -442,6 +460,7 @@ class AcsChatParticipantAddedToThreadEventData(AcsChatEventInThreadBasePropertie """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'time': {'key': 'time', 'type': 'iso-8601'}, 'added_by_communication_identifier': {'key': 'addedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -494,7 +513,7 @@ def __init__( class AcsChatParticipantAddedToThreadWithUserEventData(AcsChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantAddedToThreadWithUser event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantAddedToThreadWithUser event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -539,8 +558,10 @@ def __init__( class AcsChatParticipantRemovedFromThreadEventData(AcsChatEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantRemovedFromThread event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantRemoved event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param time: The time at which the user was removed to the thread. @@ -557,6 +578,7 @@ class AcsChatParticipantRemovedFromThreadEventData(AcsChatEventInThreadBasePrope """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'time': {'key': 'time', 'type': 'iso-8601'}, 'removed_by_communication_identifier': {'key': 'removedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -576,7 +598,7 @@ def __init__( class AcsChatParticipantRemovedFromThreadWithUserEventData(AcsChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -624,6 +646,8 @@ def __init__( class AcsChatThreadEventInThreadBaseProperties(AcsChatEventInThreadBaseProperties): """Schema of common properties of all chat thread events. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param create_time: The original creation time of the thread. @@ -633,6 +657,7 @@ class AcsChatThreadEventInThreadBaseProperties(AcsChatEventInThreadBasePropertie """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'long'}, @@ -648,8 +673,10 @@ def __init__( class AcsChatThreadCreatedEventData(AcsChatThreadEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreated event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param create_time: The original creation time of the thread. @@ -668,6 +695,7 @@ class AcsChatThreadCreatedEventData(AcsChatThreadEventInThreadBaseProperties): """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'long'}, @@ -687,7 +715,7 @@ def __init__( class AcsChatThreadCreatedWithUserEventData(AcsChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreatedWithUser event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -733,8 +761,10 @@ def __init__( class AcsChatThreadDeletedEventData(AcsChatThreadEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadDeleted event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param create_time: The original creation time of the thread. @@ -750,6 +780,7 @@ class AcsChatThreadDeletedEventData(AcsChatThreadEventInThreadBaseProperties): """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'long'}, @@ -791,8 +822,10 @@ def __init__( class AcsChatThreadPropertiesUpdatedEventData(AcsChatThreadEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdated event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param create_time: The original creation time of the thread. @@ -810,6 +843,7 @@ class AcsChatThreadPropertiesUpdatedEventData(AcsChatThreadEventInThreadBaseProp """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'long'}, @@ -829,7 +863,7 @@ def __init__( class AcsChatThreadPropertiesUpdatedPerUserEventData(AcsChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -874,7 +908,7 @@ def __init__( class AcsChatThreadWithUserDeletedEventData(AcsChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadWithUserDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadWithUserDeleted event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -914,6 +948,85 @@ def __init__( self.delete_time = kwargs.get('delete_time', None) +class AcsRecordingChunkInfoProperties(msrest.serialization.Model): + """Schema for all properties of Recording Chunk Information. + + :param document_id: The documentId of the recording chunk. + :type document_id: str + :param index: The index of the recording chunk. + :type index: long + :param end_reason: The reason for ending the recording chunk. + :type end_reason: str + """ + + _attribute_map = { + 'document_id': {'key': 'documentId', 'type': 'str'}, + 'index': {'key': 'index', 'type': 'long'}, + 'end_reason': {'key': 'endReason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsRecordingChunkInfoProperties, self).__init__(**kwargs) + self.document_id = kwargs.get('document_id', None) + self.index = kwargs.get('index', None) + self.end_reason = kwargs.get('end_reason', None) + + +class AcsRecordingFileStatusUpdatedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RecordingFileStatusUpdated event. + + :param recording_storage_info: The details of recording storage information. + :type recording_storage_info: + ~event_grid_publisher_client.models.AcsRecordingStorageInfoProperties + :param recording_start_time: The time at which the recording started. + :type recording_start_time: ~datetime.datetime + :param recording_duration_ms: The recording duration in milliseconds. + :type recording_duration_ms: long + :param session_end_reason: The reason for ending recording session. + :type session_end_reason: str + """ + + _attribute_map = { + 'recording_storage_info': {'key': 'recordingStorageInfo', 'type': 'AcsRecordingStorageInfoProperties'}, + 'recording_start_time': {'key': 'recordingStartTime', 'type': 'iso-8601'}, + 'recording_duration_ms': {'key': 'recordingDurationMs', 'type': 'long'}, + 'session_end_reason': {'key': 'sessionEndReason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsRecordingFileStatusUpdatedEventData, self).__init__(**kwargs) + self.recording_storage_info = kwargs.get('recording_storage_info', None) + self.recording_start_time = kwargs.get('recording_start_time', None) + self.recording_duration_ms = kwargs.get('recording_duration_ms', None) + self.session_end_reason = kwargs.get('session_end_reason', None) + + +class AcsRecordingStorageInfoProperties(msrest.serialization.Model): + """Schema for all properties of Recording Storage Information. + + :param recording_chunks: List of details of recording chunks information. + :type recording_chunks: + list[~event_grid_publisher_client.models.AcsRecordingChunkInfoProperties] + """ + + _attribute_map = { + 'recording_chunks': {'key': 'recordingChunks', 'type': '[AcsRecordingChunkInfoProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsRecordingStorageInfoProperties, self).__init__(**kwargs) + self.recording_chunks = kwargs.get('recording_chunks', None) + + class AcsSmsDeliveryAttemptProperties(msrest.serialization.Model): """Schema for details of a delivery attempt. @@ -969,7 +1082,7 @@ def __init__( class AcsSmsDeliveryReportReceivedEventData(AcsSmsEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSDeliveryReportReceived event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSDeliveryReportReceived event. :param message_id: The identity of the SMS message. :type message_id: str @@ -986,6 +1099,8 @@ class AcsSmsDeliveryReportReceivedEventData(AcsSmsEventBaseProperties): list[~event_grid_publisher_client.models.AcsSmsDeliveryAttemptProperties] :param received_timestamp: The time at which the SMS delivery report was received. :type received_timestamp: ~datetime.datetime + :param tag: Customer Content. + :type tag: str """ _attribute_map = { @@ -996,6 +1111,7 @@ class AcsSmsDeliveryReportReceivedEventData(AcsSmsEventBaseProperties): 'delivery_status_details': {'key': 'deliveryStatusDetails', 'type': 'str'}, 'delivery_attempts': {'key': 'deliveryAttempts', 'type': '[AcsSmsDeliveryAttemptProperties]'}, 'received_timestamp': {'key': 'receivedTimestamp', 'type': 'iso-8601'}, + 'tag': {'key': 'tag', 'type': 'str'}, } def __init__( @@ -1007,10 +1123,11 @@ def __init__( self.delivery_status_details = kwargs.get('delivery_status_details', None) self.delivery_attempts = kwargs.get('delivery_attempts', None) self.received_timestamp = kwargs.get('received_timestamp', None) + self.tag = kwargs.get('tag', None) class AcsSmsReceivedEventData(AcsSmsEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSReceived event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSReceived event. :param message_id: The identity of the SMS message. :type message_id: str @@ -1042,7 +1159,7 @@ def __init__( class AppConfigurationKeyValueDeletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.AppConfiguration.KeyValueDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event. :param key: The key used to identify the key-value that was deleted. :type key: str @@ -1073,7 +1190,7 @@ def __init__( class AppConfigurationKeyValueModifiedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.AppConfiguration.KeyValueModified event. + """Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event. :param key: The key used to identify the key-value that was modified. :type key: str @@ -1986,7 +2103,7 @@ def __init__( class EventHubCaptureFileCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.EventHub.CaptureFileCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.EventHub.CaptureFileCreated event. :param fileurl: The path to the capture file. :type fileurl: str @@ -2180,7 +2297,7 @@ def __init__( class KeyVaultAccessPolicyChangedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an VaultAccessPolicyChanged event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event. :param id: The id of the object that triggered this event. :type id: str @@ -2223,7 +2340,7 @@ def __init__( class KeyVaultCertificateExpiredEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an CertificateExpired event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event. :param id: The id of the object that triggered this event. :type id: str @@ -2266,7 +2383,7 @@ def __init__( class KeyVaultCertificateNearExpiryEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an CertificateNearExpiry event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event. :param id: The id of the object that triggered this event. :type id: str @@ -2309,7 +2426,7 @@ def __init__( class KeyVaultCertificateNewVersionCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an CertificateNewVersionCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event. :param id: The id of the object that triggered this event. :type id: str @@ -2352,7 +2469,7 @@ def __init__( class KeyVaultKeyExpiredEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an KeyExpired event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event. :param id: The id of the object that triggered this event. :type id: str @@ -2395,7 +2512,7 @@ def __init__( class KeyVaultKeyNearExpiryEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an KeyNearExpiry event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event. :param id: The id of the object that triggered this event. :type id: str @@ -2438,7 +2555,7 @@ def __init__( class KeyVaultKeyNewVersionCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an KeyNewVersionCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event. :param id: The id of the object that triggered this event. :type id: str @@ -2481,7 +2598,7 @@ def __init__( class KeyVaultSecretExpiredEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an SecretExpired event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event. :param id: The id of the object that triggered this event. :type id: str @@ -2524,7 +2641,7 @@ def __init__( class KeyVaultSecretNearExpiryEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an SecretNearExpiry event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event. :param id: The id of the object that triggered this event. :type id: str @@ -2567,7 +2684,7 @@ def __init__( class KeyVaultSecretNewVersionCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an SecretNewVersionCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event. :param id: The id of the object that triggered this event. :type id: str @@ -2610,7 +2727,7 @@ def __init__( class MachineLearningServicesDatasetDriftDetectedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.MachineLearningServices.DatasetDriftDetected event. + """Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.DatasetDriftDetected event. :param data_drift_id: The ID of the data drift monitor that triggered the event. :type data_drift_id: str @@ -2659,7 +2776,7 @@ def __init__( class MachineLearningServicesModelDeployedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.MachineLearningServices.ModelDeployed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelDeployed event. :param service_name: The name of the deployed service. :type service_name: str @@ -2695,7 +2812,7 @@ def __init__( class MachineLearningServicesModelRegisteredEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.MachineLearningServices.ModelRegistered event. + """Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelRegistered event. :param model_name: The name of the model that was registered. :type model_name: str @@ -2726,7 +2843,7 @@ def __init__( class MachineLearningServicesRunCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.MachineLearningServices.RunCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunCompleted event. :param experiment_id: The ID of the experiment that the run belongs to. :type experiment_id: str @@ -2765,7 +2882,7 @@ def __init__( class MachineLearningServicesRunStatusChangedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.MachineLearningServices.RunStatusChanged event. + """Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunStatusChanged event. :param experiment_id: The ID of the experiment that the Machine Learning Run belongs to. :type experiment_id: str @@ -3019,7 +3136,7 @@ def __init__( class MediaJobCanceledEventData(MediaJobStateChangeEventData): - """Job canceled event data. + """Job canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceled event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3056,7 +3173,7 @@ def __init__( class MediaJobCancelingEventData(MediaJobStateChangeEventData): - """Job canceling event data. + """Job canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceling event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3170,7 +3287,7 @@ def __init__( class MediaJobErroredEventData(MediaJobStateChangeEventData): - """Job error state event data. + """Job error state event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobErrored event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3207,7 +3324,7 @@ def __init__( class MediaJobFinishedEventData(MediaJobStateChangeEventData): - """Job finished event data. + """Job finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobFinished event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3371,7 +3488,7 @@ def __init__( class MediaJobOutputCanceledEventData(MediaJobOutputStateChangeEventData): - """Job output canceled event data. + """Job output canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceled event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3402,7 +3519,7 @@ def __init__( class MediaJobOutputCancelingEventData(MediaJobOutputStateChangeEventData): - """Job output canceling event data. + """Job output canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceling event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3433,7 +3550,7 @@ def __init__( class MediaJobOutputErroredEventData(MediaJobOutputStateChangeEventData): - """Job output error event data. + """Job output error event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputErrored event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3464,7 +3581,7 @@ def __init__( class MediaJobOutputFinishedEventData(MediaJobOutputStateChangeEventData): - """Job output finished event data. + """Job output finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputFinished event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3495,7 +3612,7 @@ def __init__( class MediaJobOutputProcessingEventData(MediaJobOutputStateChangeEventData): - """Job output processing event data. + """Job output processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputProcessing event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3526,7 +3643,7 @@ def __init__( class MediaJobOutputProgressEventData(msrest.serialization.Model): - """Job Output Progress Event Data. + """Job Output Progress Event Data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputProgress event. :param label: Gets the Job output label. :type label: str @@ -3553,7 +3670,7 @@ def __init__( class MediaJobOutputScheduledEventData(MediaJobOutputStateChangeEventData): - """Job output scheduled event data. + """Job output scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputScheduled event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3584,7 +3701,7 @@ def __init__( class MediaJobProcessingEventData(MediaJobStateChangeEventData): - """Job processing event data. + """Job processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobProcessing event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3617,7 +3734,7 @@ def __init__( class MediaJobScheduledEventData(MediaJobStateChangeEventData): - """Job scheduled event data. + """Job scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobScheduled event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3650,7 +3767,7 @@ def __init__( class MediaLiveEventConnectionRejectedEventData(msrest.serialization.Model): - """Encoder connection rejected event data. + """Encoder connection rejected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventConnectionRejected event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3695,7 +3812,7 @@ def __init__( class MediaLiveEventEncoderConnectedEventData(msrest.serialization.Model): - """Encoder connect event data. + """Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderConnected event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3735,7 +3852,7 @@ def __init__( class MediaLiveEventEncoderDisconnectedEventData(msrest.serialization.Model): - """Encoder disconnected event data. + """Encoder disconnected event data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderDisconnected event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3780,7 +3897,7 @@ def __init__( class MediaLiveEventIncomingDataChunkDroppedEventData(msrest.serialization.Model): - """Ingest fragment dropped event data. + """Ingest fragment dropped event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingDataChunkDropped event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3830,7 +3947,7 @@ def __init__( class MediaLiveEventIncomingStreamReceivedEventData(msrest.serialization.Model): - """Encoder connect event data. + """Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamReceived event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3895,7 +4012,7 @@ def __init__( class MediaLiveEventIncomingStreamsOutOfSyncEventData(msrest.serialization.Model): - """Incoming streams out of sync event data. + """Incoming streams out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamsOutOfSync event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3949,7 +4066,7 @@ def __init__( class MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(msrest.serialization.Model): - """Incoming video stream out of synch event data. + """Incoming video stream out of synch event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3994,7 +4111,7 @@ def __init__( class MediaLiveEventIngestHeartbeatEventData(msrest.serialization.Model): - """Ingest fragment dropped event data. + """Ingest fragment dropped event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIngestHeartbeat event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4074,7 +4191,7 @@ def __init__( class MediaLiveEventTrackDiscontinuityDetectedEventData(msrest.serialization.Model): - """Ingest track discontinuity detected event data. + """Ingest track discontinuity detected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventTrackDiscontinuityDetected event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4191,7 +4308,7 @@ def __init__( class RedisExportRDBCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Cache.ExportRDBCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event. :param timestamp: The time at which the event occurred. :type timestamp: ~datetime.datetime @@ -4218,7 +4335,7 @@ def __init__( class RedisImportRDBCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Cache.ImportRDBCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event. :param timestamp: The time at which the event occurred. :type timestamp: ~datetime.datetime @@ -4245,7 +4362,7 @@ def __init__( class RedisPatchingCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Cache.PatchingCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Cache.PatchingCompleted event. :param timestamp: The time at which the event occurred. :type timestamp: ~datetime.datetime @@ -4272,7 +4389,7 @@ def __init__( class RedisScalingCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Cache.ScalingCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ScalingCompleted event. :param timestamp: The time at which the event occurred. :type timestamp: ~datetime.datetime @@ -4299,7 +4416,7 @@ def __init__( class ResourceActionCancelData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled. + """Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled. :param tenant_id: The tenant ID of the resource. :type tenant_id: str @@ -4476,7 +4593,7 @@ def __init__( class ResourceDeleteCancelData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled. + """Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled. :param tenant_id: The tenant ID of the resource. :type tenant_id: str @@ -5067,8 +5184,70 @@ def __init__( self.error_message = kwargs.get('error_message', None) +class StorageAsyncOperationInitiatedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the Storage service for the storage API + operation that triggered this event. + :type request_id: str + :param content_type: The content type of the blob. This is the same as what would be returned + in the Content-Type header from the blob. + :type content_type: str + :param content_length: The size of the blob in bytes. This is the same as what would be + returned in the Content-Length header from the blob. + :type content_length: long + :param blob_type: The type of blob. + :type blob_type: str + :param url: The path to the blob. + :type url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular blob name. Users can use standard string comparison to understand the relative + sequence of two events on the same blob name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_length': {'key': 'contentLength', 'type': 'long'}, + 'blob_type': {'key': 'blobType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageAsyncOperationInitiatedEventData, self).__init__(**kwargs) + self.api = kwargs.get('api', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.request_id = kwargs.get('request_id', None) + self.content_type = kwargs.get('content_type', None) + self.content_length = kwargs.get('content_length', None) + self.blob_type = kwargs.get('blob_type', None) + self.url = kwargs.get('url', None) + self.sequencer = kwargs.get('sequencer', None) + self.identity = kwargs.get('identity', None) + self.storage_diagnostics = kwargs.get('storage_diagnostics', None) + + class StorageBlobCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -5138,7 +5317,7 @@ def __init__( class StorageBlobDeletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -5195,7 +5374,7 @@ def __init__( class StorageBlobRenamedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobRenamed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -5246,8 +5425,70 @@ def __init__( self.storage_diagnostics = kwargs.get('storage_diagnostics', None) +class StorageBlobTierChangedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the Storage service for the storage API + operation that triggered this event. + :type request_id: str + :param content_type: The content type of the blob. This is the same as what would be returned + in the Content-Type header from the blob. + :type content_type: str + :param content_length: The size of the blob in bytes. This is the same as what would be + returned in the Content-Length header from the blob. + :type content_length: long + :param blob_type: The type of blob. + :type blob_type: str + :param url: The path to the blob. + :type url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular blob name. Users can use standard string comparison to understand the relative + sequence of two events on the same blob name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_length': {'key': 'contentLength', 'type': 'long'}, + 'blob_type': {'key': 'blobType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(StorageBlobTierChangedEventData, self).__init__(**kwargs) + self.api = kwargs.get('api', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.request_id = kwargs.get('request_id', None) + self.content_type = kwargs.get('content_type', None) + self.content_length = kwargs.get('content_length', None) + self.blob_type = kwargs.get('blob_type', None) + self.url = kwargs.get('url', None) + self.sequencer = kwargs.get('sequencer', None) + self.identity = kwargs.get('identity', None) + self.storage_diagnostics = kwargs.get('storage_diagnostics', None) + + class StorageDirectoryCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -5299,7 +5540,7 @@ def __init__( class StorageDirectoryDeletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -5351,7 +5592,7 @@ def __init__( class StorageDirectoryRenamedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryRenamed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -5430,7 +5671,7 @@ def __init__( class StorageLifecyclePolicyCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.LifecyclePolicyCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event. :param schedule_time: The time the policy task was scheduled. :type schedule_time: str @@ -5467,7 +5708,7 @@ def __init__( class SubscriptionDeletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent. + """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent event. Variables are only populated by the server, and will be ignored when sending a request. @@ -5492,7 +5733,7 @@ def __init__( class SubscriptionValidationEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent. + """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event. Variables are only populated by the server, and will be ignored when sending a request. @@ -5548,7 +5789,7 @@ def __init__( class WebAppServicePlanUpdatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.AppServicePlanUpdated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event. :param app_service_plan_event_type_detail: Detail of action on the app service plan. :type app_service_plan_event_type_detail: @@ -5634,7 +5875,7 @@ def __init__( class WebAppUpdatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.AppUpdated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -5680,7 +5921,7 @@ def __init__( class WebBackupOperationCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.BackupOperationCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -5726,7 +5967,7 @@ def __init__( class WebBackupOperationFailedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.BackupOperationFailed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -5772,7 +6013,7 @@ def __init__( class WebBackupOperationStartedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.BackupOperationStarted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -5818,7 +6059,7 @@ def __init__( class WebRestoreOperationCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.RestoreOperationCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -5864,7 +6105,7 @@ def __init__( class WebRestoreOperationFailedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.RestoreOperationFailed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -5910,7 +6151,7 @@ def __init__( class WebRestoreOperationStartedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.RestoreOperationStarted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -5956,7 +6197,7 @@ def __init__( class WebSlotSwapCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.SlotSwapCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6002,7 +6243,7 @@ def __init__( class WebSlotSwapFailedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.SlotSwapFailed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6048,7 +6289,7 @@ def __init__( class WebSlotSwapStartedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.SlotSwapStarted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6094,7 +6335,7 @@ def __init__( class WebSlotSwapWithPreviewCancelledEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.SlotSwapWithPreviewCancelled event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6140,7 +6381,7 @@ def __init__( class WebSlotSwapWithPreviewStartedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.SlotSwapWithPreviewStarted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py index 43219b81e591..c635d4bb9c95 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py @@ -49,21 +49,26 @@ def __init__( class AcsChatEventInThreadBaseProperties(msrest.serialization.Model): """Schema of common properties of all thread-level chat events. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, } def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, **kwargs ): super(AcsChatEventInThreadBaseProperties, self).__init__(**kwargs) + self.transaction_id = transaction_id self.thread_id = thread_id @@ -128,7 +133,7 @@ def __init__( class AcsChatMessageDeletedEventData(AcsChatMessageEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeleted event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -189,6 +194,8 @@ def __init__( class AcsChatMessageEventInThreadBaseProperties(AcsChatEventInThreadBaseProperties): """Schema of common properties of all thread-level chat message events. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. @@ -207,6 +214,7 @@ class AcsChatMessageEventInThreadBaseProperties(AcsChatEventInThreadBaseProperti """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -219,6 +227,7 @@ class AcsChatMessageEventInThreadBaseProperties(AcsChatEventInThreadBaseProperti def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, message_id: Optional[str] = None, sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, @@ -228,7 +237,7 @@ def __init__( version: Optional[int] = None, **kwargs ): - super(AcsChatMessageEventInThreadBaseProperties, self).__init__(thread_id=thread_id, **kwargs) + super(AcsChatMessageEventInThreadBaseProperties, self).__init__(transaction_id=transaction_id, thread_id=thread_id, **kwargs) self.message_id = message_id self.sender_communication_identifier = sender_communication_identifier self.sender_display_name = sender_display_name @@ -238,8 +247,10 @@ def __init__( class AcsChatMessageDeletedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeletedInThread event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageDeletedInThread event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. @@ -260,6 +271,7 @@ class AcsChatMessageDeletedInThreadEventData(AcsChatMessageEventInThreadBaseProp """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -273,6 +285,7 @@ class AcsChatMessageDeletedInThreadEventData(AcsChatMessageEventInThreadBaseProp def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, message_id: Optional[str] = None, sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, @@ -283,12 +296,12 @@ def __init__( delete_time: Optional[datetime.datetime] = None, **kwargs ): - super(AcsChatMessageDeletedInThreadEventData, self).__init__(thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) + super(AcsChatMessageDeletedInThreadEventData, self).__init__(transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) self.delete_time = delete_time class AcsChatMessageEditedEventData(AcsChatMessageEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEdited event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEdited event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -352,8 +365,10 @@ def __init__( class AcsChatMessageEditedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEditedInThread event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageEditedInThread event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. @@ -376,6 +391,7 @@ class AcsChatMessageEditedInThreadEventData(AcsChatMessageEventInThreadBasePrope """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -390,6 +406,7 @@ class AcsChatMessageEditedInThreadEventData(AcsChatMessageEventInThreadBasePrope def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, message_id: Optional[str] = None, sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, @@ -401,13 +418,13 @@ def __init__( edit_time: Optional[datetime.datetime] = None, **kwargs ): - super(AcsChatMessageEditedInThreadEventData, self).__init__(thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) + super(AcsChatMessageEditedInThreadEventData, self).__init__(transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) self.message_body = message_body self.edit_time = edit_time class AcsChatMessageReceivedEventData(AcsChatMessageEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceived event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceived event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -466,8 +483,10 @@ def __init__( class AcsChatMessageReceivedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceivedInThread event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatMessageReceivedInThread event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. @@ -488,6 +507,7 @@ class AcsChatMessageReceivedInThreadEventData(AcsChatMessageEventInThreadBasePro """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -501,6 +521,7 @@ class AcsChatMessageReceivedInThreadEventData(AcsChatMessageEventInThreadBasePro def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, message_id: Optional[str] = None, sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, @@ -511,13 +532,15 @@ def __init__( message_body: Optional[str] = None, **kwargs ): - super(AcsChatMessageReceivedInThreadEventData, self).__init__(thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) + super(AcsChatMessageReceivedInThreadEventData, self).__init__(transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) self.message_body = message_body class AcsChatParticipantAddedToThreadEventData(AcsChatEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantAddedToThread event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantAdded event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param time: The time at which the user was added to the thread. @@ -533,6 +556,7 @@ class AcsChatParticipantAddedToThreadEventData(AcsChatEventInThreadBasePropertie """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'time': {'key': 'time', 'type': 'iso-8601'}, 'added_by_communication_identifier': {'key': 'addedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -543,6 +567,7 @@ class AcsChatParticipantAddedToThreadEventData(AcsChatEventInThreadBasePropertie def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, time: Optional[datetime.datetime] = None, added_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, @@ -550,7 +575,7 @@ def __init__( version: Optional[int] = None, **kwargs ): - super(AcsChatParticipantAddedToThreadEventData, self).__init__(thread_id=thread_id, **kwargs) + super(AcsChatParticipantAddedToThreadEventData, self).__init__(transaction_id=transaction_id, thread_id=thread_id, **kwargs) self.time = time self.added_by_communication_identifier = added_by_communication_identifier self.participant_added = participant_added @@ -597,7 +622,7 @@ def __init__( class AcsChatParticipantAddedToThreadWithUserEventData(AcsChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantAddedToThreadWithUser event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantAddedToThreadWithUser event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -651,8 +676,10 @@ def __init__( class AcsChatParticipantRemovedFromThreadEventData(AcsChatEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantRemovedFromThread event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadParticipantRemoved event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param time: The time at which the user was removed to the thread. @@ -669,6 +696,7 @@ class AcsChatParticipantRemovedFromThreadEventData(AcsChatEventInThreadBasePrope """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'time': {'key': 'time', 'type': 'iso-8601'}, 'removed_by_communication_identifier': {'key': 'removedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, @@ -679,6 +707,7 @@ class AcsChatParticipantRemovedFromThreadEventData(AcsChatEventInThreadBasePrope def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, time: Optional[datetime.datetime] = None, removed_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, @@ -686,7 +715,7 @@ def __init__( version: Optional[int] = None, **kwargs ): - super(AcsChatParticipantRemovedFromThreadEventData, self).__init__(thread_id=thread_id, **kwargs) + super(AcsChatParticipantRemovedFromThreadEventData, self).__init__(transaction_id=transaction_id, thread_id=thread_id, **kwargs) self.time = time self.removed_by_communication_identifier = removed_by_communication_identifier self.participant_removed = participant_removed @@ -694,7 +723,7 @@ def __init__( class AcsChatParticipantRemovedFromThreadWithUserEventData(AcsChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -751,6 +780,8 @@ def __init__( class AcsChatThreadEventInThreadBaseProperties(AcsChatEventInThreadBaseProperties): """Schema of common properties of all chat thread events. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param create_time: The original creation time of the thread. @@ -760,6 +791,7 @@ class AcsChatThreadEventInThreadBaseProperties(AcsChatEventInThreadBasePropertie """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'long'}, @@ -768,19 +800,22 @@ class AcsChatThreadEventInThreadBaseProperties(AcsChatEventInThreadBasePropertie def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, create_time: Optional[datetime.datetime] = None, version: Optional[int] = None, **kwargs ): - super(AcsChatThreadEventInThreadBaseProperties, self).__init__(thread_id=thread_id, **kwargs) + super(AcsChatThreadEventInThreadBaseProperties, self).__init__(transaction_id=transaction_id, thread_id=thread_id, **kwargs) self.create_time = create_time self.version = version class AcsChatThreadCreatedEventData(AcsChatThreadEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreated event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param create_time: The original creation time of the thread. @@ -799,6 +834,7 @@ class AcsChatThreadCreatedEventData(AcsChatThreadEventInThreadBaseProperties): """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'long'}, @@ -810,6 +846,7 @@ class AcsChatThreadCreatedEventData(AcsChatThreadEventInThreadBaseProperties): def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, create_time: Optional[datetime.datetime] = None, version: Optional[int] = None, @@ -818,14 +855,14 @@ def __init__( participants: Optional[List["AcsChatThreadParticipantProperties"]] = None, **kwargs ): - super(AcsChatThreadCreatedEventData, self).__init__(thread_id=thread_id, create_time=create_time, version=version, **kwargs) + super(AcsChatThreadCreatedEventData, self).__init__(transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) self.created_by_communication_identifier = created_by_communication_identifier self.properties = properties self.participants = participants class AcsChatThreadCreatedWithUserEventData(AcsChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadCreatedWithUser event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -880,8 +917,10 @@ def __init__( class AcsChatThreadDeletedEventData(AcsChatThreadEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadDeleted event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param create_time: The original creation time of the thread. @@ -897,6 +936,7 @@ class AcsChatThreadDeletedEventData(AcsChatThreadEventInThreadBaseProperties): """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'long'}, @@ -907,6 +947,7 @@ class AcsChatThreadDeletedEventData(AcsChatThreadEventInThreadBaseProperties): def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, create_time: Optional[datetime.datetime] = None, version: Optional[int] = None, @@ -914,7 +955,7 @@ def __init__( delete_time: Optional[datetime.datetime] = None, **kwargs ): - super(AcsChatThreadDeletedEventData, self).__init__(thread_id=thread_id, create_time=create_time, version=version, **kwargs) + super(AcsChatThreadDeletedEventData, self).__init__(transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) self.deleted_by_communication_identifier = deleted_by_communication_identifier self.delete_time = delete_time @@ -947,8 +988,10 @@ def __init__( class AcsChatThreadPropertiesUpdatedEventData(AcsChatThreadEventInThreadBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdated event. + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param create_time: The original creation time of the thread. @@ -966,6 +1009,7 @@ class AcsChatThreadPropertiesUpdatedEventData(AcsChatThreadEventInThreadBaseProp """ _attribute_map = { + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'long'}, @@ -977,6 +1021,7 @@ class AcsChatThreadPropertiesUpdatedEventData(AcsChatThreadEventInThreadBaseProp def __init__( self, *, + transaction_id: Optional[str] = None, thread_id: Optional[str] = None, create_time: Optional[datetime.datetime] = None, version: Optional[int] = None, @@ -985,14 +1030,14 @@ def __init__( properties: Optional[Dict[str, object]] = None, **kwargs ): - super(AcsChatThreadPropertiesUpdatedEventData, self).__init__(thread_id=thread_id, create_time=create_time, version=version, **kwargs) + super(AcsChatThreadPropertiesUpdatedEventData, self).__init__(transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) self.edited_by_communication_identifier = edited_by_communication_identifier self.edit_time = edit_time self.properties = properties class AcsChatThreadPropertiesUpdatedPerUserEventData(AcsChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -1046,7 +1091,7 @@ def __init__( class AcsChatThreadWithUserDeletedEventData(AcsChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadWithUserDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.ChatThreadWithUserDeleted event. :param recipient_communication_identifier: The communication identifier of the target user. :type recipient_communication_identifier: @@ -1094,6 +1139,96 @@ def __init__( self.delete_time = delete_time +class AcsRecordingChunkInfoProperties(msrest.serialization.Model): + """Schema for all properties of Recording Chunk Information. + + :param document_id: The documentId of the recording chunk. + :type document_id: str + :param index: The index of the recording chunk. + :type index: long + :param end_reason: The reason for ending the recording chunk. + :type end_reason: str + """ + + _attribute_map = { + 'document_id': {'key': 'documentId', 'type': 'str'}, + 'index': {'key': 'index', 'type': 'long'}, + 'end_reason': {'key': 'endReason', 'type': 'str'}, + } + + def __init__( + self, + *, + document_id: Optional[str] = None, + index: Optional[int] = None, + end_reason: Optional[str] = None, + **kwargs + ): + super(AcsRecordingChunkInfoProperties, self).__init__(**kwargs) + self.document_id = document_id + self.index = index + self.end_reason = end_reason + + +class AcsRecordingFileStatusUpdatedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.RecordingFileStatusUpdated event. + + :param recording_storage_info: The details of recording storage information. + :type recording_storage_info: + ~event_grid_publisher_client.models.AcsRecordingStorageInfoProperties + :param recording_start_time: The time at which the recording started. + :type recording_start_time: ~datetime.datetime + :param recording_duration_ms: The recording duration in milliseconds. + :type recording_duration_ms: long + :param session_end_reason: The reason for ending recording session. + :type session_end_reason: str + """ + + _attribute_map = { + 'recording_storage_info': {'key': 'recordingStorageInfo', 'type': 'AcsRecordingStorageInfoProperties'}, + 'recording_start_time': {'key': 'recordingStartTime', 'type': 'iso-8601'}, + 'recording_duration_ms': {'key': 'recordingDurationMs', 'type': 'long'}, + 'session_end_reason': {'key': 'sessionEndReason', 'type': 'str'}, + } + + def __init__( + self, + *, + recording_storage_info: Optional["AcsRecordingStorageInfoProperties"] = None, + recording_start_time: Optional[datetime.datetime] = None, + recording_duration_ms: Optional[int] = None, + session_end_reason: Optional[str] = None, + **kwargs + ): + super(AcsRecordingFileStatusUpdatedEventData, self).__init__(**kwargs) + self.recording_storage_info = recording_storage_info + self.recording_start_time = recording_start_time + self.recording_duration_ms = recording_duration_ms + self.session_end_reason = session_end_reason + + +class AcsRecordingStorageInfoProperties(msrest.serialization.Model): + """Schema for all properties of Recording Storage Information. + + :param recording_chunks: List of details of recording chunks information. + :type recording_chunks: + list[~event_grid_publisher_client.models.AcsRecordingChunkInfoProperties] + """ + + _attribute_map = { + 'recording_chunks': {'key': 'recordingChunks', 'type': '[AcsRecordingChunkInfoProperties]'}, + } + + def __init__( + self, + *, + recording_chunks: Optional[List["AcsRecordingChunkInfoProperties"]] = None, + **kwargs + ): + super(AcsRecordingStorageInfoProperties, self).__init__(**kwargs) + self.recording_chunks = recording_chunks + + class AcsSmsDeliveryAttemptProperties(msrest.serialization.Model): """Schema for details of a delivery attempt. @@ -1157,7 +1292,7 @@ def __init__( class AcsSmsDeliveryReportReceivedEventData(AcsSmsEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSDeliveryReportReceived event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSDeliveryReportReceived event. :param message_id: The identity of the SMS message. :type message_id: str @@ -1174,6 +1309,8 @@ class AcsSmsDeliveryReportReceivedEventData(AcsSmsEventBaseProperties): list[~event_grid_publisher_client.models.AcsSmsDeliveryAttemptProperties] :param received_timestamp: The time at which the SMS delivery report was received. :type received_timestamp: ~datetime.datetime + :param tag: Customer Content. + :type tag: str """ _attribute_map = { @@ -1184,6 +1321,7 @@ class AcsSmsDeliveryReportReceivedEventData(AcsSmsEventBaseProperties): 'delivery_status_details': {'key': 'deliveryStatusDetails', 'type': 'str'}, 'delivery_attempts': {'key': 'deliveryAttempts', 'type': '[AcsSmsDeliveryAttemptProperties]'}, 'received_timestamp': {'key': 'receivedTimestamp', 'type': 'iso-8601'}, + 'tag': {'key': 'tag', 'type': 'str'}, } def __init__( @@ -1196,6 +1334,7 @@ def __init__( delivery_status_details: Optional[str] = None, delivery_attempts: Optional[List["AcsSmsDeliveryAttemptProperties"]] = None, received_timestamp: Optional[datetime.datetime] = None, + tag: Optional[str] = None, **kwargs ): super(AcsSmsDeliveryReportReceivedEventData, self).__init__(message_id=message_id, from_property=from_property, to=to, **kwargs) @@ -1203,10 +1342,11 @@ def __init__( self.delivery_status_details = delivery_status_details self.delivery_attempts = delivery_attempts self.received_timestamp = received_timestamp + self.tag = tag class AcsSmsReceivedEventData(AcsSmsEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSReceived event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Communication.SMSReceived event. :param message_id: The identity of the SMS message. :type message_id: str @@ -1244,7 +1384,7 @@ def __init__( class AppConfigurationKeyValueDeletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.AppConfiguration.KeyValueDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueDeleted event. :param key: The key used to identify the key-value that was deleted. :type key: str @@ -1280,7 +1420,7 @@ def __init__( class AppConfigurationKeyValueModifiedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.AppConfiguration.KeyValueModified event. + """Schema of the Data property of an EventGridEvent for a Microsoft.AppConfiguration.KeyValueModified event. :param key: The key used to identify the key-value that was modified. :type key: str @@ -2335,7 +2475,7 @@ def __init__( class EventHubCaptureFileCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.EventHub.CaptureFileCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.EventHub.CaptureFileCreated event. :param fileurl: The path to the capture file. :type fileurl: str @@ -2561,7 +2701,7 @@ def __init__( class KeyVaultAccessPolicyChangedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an VaultAccessPolicyChanged event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.VaultAccessPolicyChanged event. :param id: The id of the object that triggered this event. :type id: str @@ -2612,7 +2752,7 @@ def __init__( class KeyVaultCertificateExpiredEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an CertificateExpired event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateExpired event. :param id: The id of the object that triggered this event. :type id: str @@ -2663,7 +2803,7 @@ def __init__( class KeyVaultCertificateNearExpiryEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an CertificateNearExpiry event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNearExpiry event. :param id: The id of the object that triggered this event. :type id: str @@ -2714,7 +2854,7 @@ def __init__( class KeyVaultCertificateNewVersionCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an CertificateNewVersionCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.CertificateNewVersionCreated event. :param id: The id of the object that triggered this event. :type id: str @@ -2765,7 +2905,7 @@ def __init__( class KeyVaultKeyExpiredEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an KeyExpired event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyExpired event. :param id: The id of the object that triggered this event. :type id: str @@ -2816,7 +2956,7 @@ def __init__( class KeyVaultKeyNearExpiryEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an KeyNearExpiry event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNearExpiry event. :param id: The id of the object that triggered this event. :type id: str @@ -2867,7 +3007,7 @@ def __init__( class KeyVaultKeyNewVersionCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an KeyNewVersionCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.KeyNewVersionCreated event. :param id: The id of the object that triggered this event. :type id: str @@ -2918,7 +3058,7 @@ def __init__( class KeyVaultSecretExpiredEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an SecretExpired event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretExpired event. :param id: The id of the object that triggered this event. :type id: str @@ -2969,7 +3109,7 @@ def __init__( class KeyVaultSecretNearExpiryEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an SecretNearExpiry event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNearExpiry event. :param id: The id of the object that triggered this event. :type id: str @@ -3020,7 +3160,7 @@ def __init__( class KeyVaultSecretNewVersionCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an SecretNewVersionCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.KeyVault.SecretNewVersionCreated event. :param id: The id of the object that triggered this event. :type id: str @@ -3071,7 +3211,7 @@ def __init__( class MachineLearningServicesDatasetDriftDetectedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.MachineLearningServices.DatasetDriftDetected event. + """Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.DatasetDriftDetected event. :param data_drift_id: The ID of the data drift monitor that triggered the event. :type data_drift_id: str @@ -3129,7 +3269,7 @@ def __init__( class MachineLearningServicesModelDeployedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.MachineLearningServices.ModelDeployed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelDeployed event. :param service_name: The name of the deployed service. :type service_name: str @@ -3171,7 +3311,7 @@ def __init__( class MachineLearningServicesModelRegisteredEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.MachineLearningServices.ModelRegistered event. + """Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.ModelRegistered event. :param model_name: The name of the model that was registered. :type model_name: str @@ -3207,7 +3347,7 @@ def __init__( class MachineLearningServicesRunCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.MachineLearningServices.RunCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunCompleted event. :param experiment_id: The ID of the experiment that the run belongs to. :type experiment_id: str @@ -3253,7 +3393,7 @@ def __init__( class MachineLearningServicesRunStatusChangedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.MachineLearningServices.RunStatusChanged event. + """Schema of the Data property of an EventGridEvent for a Microsoft.MachineLearningServices.RunStatusChanged event. :param experiment_id: The ID of the experiment that the Machine Learning Run belongs to. :type experiment_id: str @@ -3544,7 +3684,7 @@ def __init__( class MediaJobCanceledEventData(MediaJobStateChangeEventData): - """Job canceled event data. + """Job canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceled event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3584,7 +3724,7 @@ def __init__( class MediaJobCancelingEventData(MediaJobStateChangeEventData): - """Job canceling event data. + """Job canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobCanceling event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3700,7 +3840,7 @@ def __init__( class MediaJobErroredEventData(MediaJobStateChangeEventData): - """Job error state event data. + """Job error state event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobErrored event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3740,7 +3880,7 @@ def __init__( class MediaJobFinishedEventData(MediaJobStateChangeEventData): - """Job finished event data. + """Job finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobFinished event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3921,7 +4061,7 @@ def __init__( class MediaJobOutputCanceledEventData(MediaJobOutputStateChangeEventData): - """Job output canceled event data. + """Job output canceled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceled event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3955,7 +4095,7 @@ def __init__( class MediaJobOutputCancelingEventData(MediaJobOutputStateChangeEventData): - """Job output canceling event data. + """Job output canceling event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputCanceling event. Variables are only populated by the server, and will be ignored when sending a request. @@ -3989,7 +4129,7 @@ def __init__( class MediaJobOutputErroredEventData(MediaJobOutputStateChangeEventData): - """Job output error event data. + """Job output error event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputErrored event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4023,7 +4163,7 @@ def __init__( class MediaJobOutputFinishedEventData(MediaJobOutputStateChangeEventData): - """Job output finished event data. + """Job output finished event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputFinished event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4057,7 +4197,7 @@ def __init__( class MediaJobOutputProcessingEventData(MediaJobOutputStateChangeEventData): - """Job output processing event data. + """Job output processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputProcessing event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4091,7 +4231,7 @@ def __init__( class MediaJobOutputProgressEventData(msrest.serialization.Model): - """Job Output Progress Event Data. + """Job Output Progress Event Data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.JobOutputProgress event. :param label: Gets the Job output label. :type label: str @@ -4122,7 +4262,7 @@ def __init__( class MediaJobOutputScheduledEventData(MediaJobOutputStateChangeEventData): - """Job output scheduled event data. + """Job output scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobOutputScheduled event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4156,7 +4296,7 @@ def __init__( class MediaJobProcessingEventData(MediaJobStateChangeEventData): - """Job processing event data. + """Job processing event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobProcessing event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4191,7 +4331,7 @@ def __init__( class MediaJobScheduledEventData(MediaJobStateChangeEventData): - """Job scheduled event data. + """Job scheduled event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.JobScheduled event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4226,7 +4366,7 @@ def __init__( class MediaLiveEventConnectionRejectedEventData(msrest.serialization.Model): - """Encoder connection rejected event data. + """Encoder connection rejected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventConnectionRejected event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4271,7 +4411,7 @@ def __init__( class MediaLiveEventEncoderConnectedEventData(msrest.serialization.Model): - """Encoder connect event data. + """Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderConnected event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4311,7 +4451,7 @@ def __init__( class MediaLiveEventEncoderDisconnectedEventData(msrest.serialization.Model): - """Encoder disconnected event data. + """Encoder disconnected event data. Schema of the Data property of an EventGridEvent for a Microsoft.Media.LiveEventEncoderDisconnected event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4356,7 +4496,7 @@ def __init__( class MediaLiveEventIncomingDataChunkDroppedEventData(msrest.serialization.Model): - """Ingest fragment dropped event data. + """Ingest fragment dropped event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingDataChunkDropped event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4406,7 +4546,7 @@ def __init__( class MediaLiveEventIncomingStreamReceivedEventData(msrest.serialization.Model): - """Encoder connect event data. + """Encoder connect event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamReceived event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4471,7 +4611,7 @@ def __init__( class MediaLiveEventIncomingStreamsOutOfSyncEventData(msrest.serialization.Model): - """Incoming streams out of sync event data. + """Incoming streams out of sync event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingStreamsOutOfSync event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4525,7 +4665,7 @@ def __init__( class MediaLiveEventIncomingVideoStreamsOutOfSyncEventData(msrest.serialization.Model): - """Incoming video stream out of synch event data. + """Incoming video stream out of synch event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIncomingVideoStreamsOutOfSync event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4570,7 +4710,7 @@ def __init__( class MediaLiveEventIngestHeartbeatEventData(msrest.serialization.Model): - """Ingest fragment dropped event data. + """Ingest fragment dropped event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventIngestHeartbeat event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4650,7 +4790,7 @@ def __init__( class MediaLiveEventTrackDiscontinuityDetectedEventData(msrest.serialization.Model): - """Ingest track discontinuity detected event data. + """Ingest track discontinuity detected event data. Schema of the data property of an EventGridEvent for a Microsoft.Media.LiveEventTrackDiscontinuityDetected event. Variables are only populated by the server, and will be ignored when sending a request. @@ -4773,7 +4913,7 @@ def __init__( class RedisExportRDBCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Cache.ExportRDBCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ExportRDBCompleted event. :param timestamp: The time at which the event occurred. :type timestamp: ~datetime.datetime @@ -4804,7 +4944,7 @@ def __init__( class RedisImportRDBCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Cache.ImportRDBCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ImportRDBCompleted event. :param timestamp: The time at which the event occurred. :type timestamp: ~datetime.datetime @@ -4835,7 +4975,7 @@ def __init__( class RedisPatchingCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Cache.PatchingCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Cache.PatchingCompleted event. :param timestamp: The time at which the event occurred. :type timestamp: ~datetime.datetime @@ -4866,7 +5006,7 @@ def __init__( class RedisScalingCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Cache.ScalingCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Cache.ScalingCompleted event. :param timestamp: The time at which the event occurred. :type timestamp: ~datetime.datetime @@ -4897,7 +5037,7 @@ def __init__( class ResourceActionCancelData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled. + """Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceActionCancel event. This is raised when a resource action operation is canceled. :param tenant_id: The tenant ID of the resource. :type tenant_id: str @@ -5110,7 +5250,7 @@ def __init__( class ResourceDeleteCancelData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled. + """Schema of the Data property of an EventGridEvent for a Microsoft.Resources.ResourceDeleteCancel event. This is raised when a resource delete operation is canceled. :param tenant_id: The tenant ID of the resource. :type tenant_id: str @@ -5812,8 +5952,81 @@ def __init__( self.error_message = error_message +class StorageAsyncOperationInitiatedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.AsyncOperationInitiated event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the Storage service for the storage API + operation that triggered this event. + :type request_id: str + :param content_type: The content type of the blob. This is the same as what would be returned + in the Content-Type header from the blob. + :type content_type: str + :param content_length: The size of the blob in bytes. This is the same as what would be + returned in the Content-Length header from the blob. + :type content_length: long + :param blob_type: The type of blob. + :type blob_type: str + :param url: The path to the blob. + :type url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular blob name. Users can use standard string comparison to understand the relative + sequence of two events on the same blob name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_length': {'key': 'contentLength', 'type': 'long'}, + 'blob_type': {'key': 'blobType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + *, + api: Optional[str] = None, + client_request_id: Optional[str] = None, + request_id: Optional[str] = None, + content_type: Optional[str] = None, + content_length: Optional[int] = None, + blob_type: Optional[str] = None, + url: Optional[str] = None, + sequencer: Optional[str] = None, + identity: Optional[str] = None, + storage_diagnostics: Optional[object] = None, + **kwargs + ): + super(StorageAsyncOperationInitiatedEventData, self).__init__(**kwargs) + self.api = api + self.client_request_id = client_request_id + self.request_id = request_id + self.content_type = content_type + self.content_length = content_length + self.blob_type = blob_type + self.url = url + self.sequencer = sequencer + self.identity = identity + self.storage_diagnostics = storage_diagnostics + + class StorageBlobCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobCreated event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -5896,7 +6109,7 @@ def __init__( class StorageBlobDeletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobDeleted event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -5963,7 +6176,7 @@ def __init__( class StorageBlobRenamedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobRenamed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobRenamed event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -6023,8 +6236,81 @@ def __init__( self.storage_diagnostics = storage_diagnostics +class StorageBlobTierChangedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.BlobTierChanged event. + + :param api: The name of the API/operation that triggered this event. + :type api: str + :param client_request_id: A request id provided by the client of the storage API operation that + triggered this event. + :type client_request_id: str + :param request_id: The request id generated by the Storage service for the storage API + operation that triggered this event. + :type request_id: str + :param content_type: The content type of the blob. This is the same as what would be returned + in the Content-Type header from the blob. + :type content_type: str + :param content_length: The size of the blob in bytes. This is the same as what would be + returned in the Content-Length header from the blob. + :type content_length: long + :param blob_type: The type of blob. + :type blob_type: str + :param url: The path to the blob. + :type url: str + :param sequencer: An opaque string value representing the logical sequence of events for any + particular blob name. Users can use standard string comparison to understand the relative + sequence of two events on the same blob name. + :type sequencer: str + :param identity: The identity of the requester that triggered this event. + :type identity: str + :param storage_diagnostics: For service use only. Diagnostic data occasionally included by the + Azure Storage service. This property should be ignored by event consumers. + :type storage_diagnostics: object + """ + + _attribute_map = { + 'api': {'key': 'api', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'request_id': {'key': 'requestId', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_length': {'key': 'contentLength', 'type': 'long'}, + 'blob_type': {'key': 'blobType', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'sequencer': {'key': 'sequencer', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'str'}, + 'storage_diagnostics': {'key': 'storageDiagnostics', 'type': 'object'}, + } + + def __init__( + self, + *, + api: Optional[str] = None, + client_request_id: Optional[str] = None, + request_id: Optional[str] = None, + content_type: Optional[str] = None, + content_length: Optional[int] = None, + blob_type: Optional[str] = None, + url: Optional[str] = None, + sequencer: Optional[str] = None, + identity: Optional[str] = None, + storage_diagnostics: Optional[object] = None, + **kwargs + ): + super(StorageBlobTierChangedEventData, self).__init__(**kwargs) + self.api = api + self.client_request_id = client_request_id + self.request_id = request_id + self.content_type = content_type + self.content_length = content_length + self.blob_type = blob_type + self.url = url + self.sequencer = sequencer + self.identity = identity + self.storage_diagnostics = storage_diagnostics + + class StorageDirectoryCreatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryCreated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryCreated event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -6085,7 +6371,7 @@ def __init__( class StorageDirectoryDeletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryDeleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryDeleted event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -6146,7 +6432,7 @@ def __init__( class StorageDirectoryRenamedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.DirectoryRenamed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.DirectoryRenamed event. :param api: The name of the API/operation that triggered this event. :type api: str @@ -6238,7 +6524,7 @@ def __init__( class StorageLifecyclePolicyCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.LifecyclePolicyCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Storage.LifecyclePolicyCompleted event. :param schedule_time: The time the policy task was scheduled. :type schedule_time: str @@ -6280,7 +6566,7 @@ def __init__( class SubscriptionDeletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent. + """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionDeletedEvent event. Variables are only populated by the server, and will be ignored when sending a request. @@ -6305,7 +6591,7 @@ def __init__( class SubscriptionValidationEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent. + """Schema of the Data property of an EventGridEvent for a Microsoft.EventGrid.SubscriptionValidationEvent event. Variables are only populated by the server, and will be ignored when sending a request. @@ -6363,7 +6649,7 @@ def __init__( class WebAppServicePlanUpdatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.AppServicePlanUpdated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppServicePlanUpdated event. :param app_service_plan_event_type_detail: Detail of action on the app service plan. :type app_service_plan_event_type_detail: @@ -6464,7 +6750,7 @@ def __init__( class WebAppUpdatedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.AppUpdated event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.AppUpdated event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6518,7 +6804,7 @@ def __init__( class WebBackupOperationCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.BackupOperationCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationCompleted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6572,7 +6858,7 @@ def __init__( class WebBackupOperationFailedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.BackupOperationFailed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationFailed event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6626,7 +6912,7 @@ def __init__( class WebBackupOperationStartedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.BackupOperationStarted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.BackupOperationStarted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6680,7 +6966,7 @@ def __init__( class WebRestoreOperationCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.RestoreOperationCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationCompleted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6734,7 +7020,7 @@ def __init__( class WebRestoreOperationFailedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.RestoreOperationFailed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationFailed event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6788,7 +7074,7 @@ def __init__( class WebRestoreOperationStartedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.RestoreOperationStarted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.RestoreOperationStarted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6842,7 +7128,7 @@ def __init__( class WebSlotSwapCompletedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.SlotSwapCompleted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapCompleted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6896,7 +7182,7 @@ def __init__( class WebSlotSwapFailedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.SlotSwapFailed event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapFailed event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -6950,7 +7236,7 @@ def __init__( class WebSlotSwapStartedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.SlotSwapStarted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapStarted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -7004,7 +7290,7 @@ def __init__( class WebSlotSwapWithPreviewCancelledEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.SlotSwapWithPreviewCancelled event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewCancelled event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail @@ -7058,7 +7344,7 @@ def __init__( class WebSlotSwapWithPreviewStartedEventData(msrest.serialization.Model): - """Schema of the Data property of an EventGridEvent for an Microsoft.Web.SlotSwapWithPreviewStarted event. + """Schema of the Data property of an EventGridEvent for a Microsoft.Web.SlotSwapWithPreviewStarted event. :param app_event_type_detail: Detail of action on the app. :type app_event_type_detail: ~event_grid_publisher_client.models.AppEventTypeDetail diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py index fd34788dd48c..24de6628e62f 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py @@ -192,4 +192,4 @@ def publish_custom_event_events( if cls: return cls(pipeline_response, None, {}) - publish_custom_event_events.metadata = {'url': ''} # type: ignore + publish_custom_event_events.metadata = {'url': '/api/events'} # type: ignore diff --git a/sdk/eventgrid/azure-eventgrid/swagger/postprocess_eventnames.py b/sdk/eventgrid/azure-eventgrid/swagger/postprocess_eventnames.py new file mode 100644 index 000000000000..ad20925542ce --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/swagger/postprocess_eventnames.py @@ -0,0 +1,54 @@ +import inspect +import re +import warnings +import sys +from azure.eventgrid._generated import models + +backward_compat = { + 'AcsChatMemberAddedToThreadWithUserEventName': "Microsoft.Communication.ChatMemberAddedToThreadWithUser", + 'ResourceWriteFailureEventName': "Microsoft.Resources.ResourceWriteFailure", + 'IoTHubDeviceDeletedEventName': "Microsoft.Devices.DeviceDeleted", + 'IoTHubDeviceDisconnectedEventName': "Microsoft.Devices.DeviceDisconnected", + 'ResourceDeleteFailureEventName': "Microsoft.Resources.ResourceDeleteFailure", + 'ResourceDeleteCancelEventName': "Microsoft.Resources.ResourceDeleteCancel", + 'AcsChatThreadParticipantAddedEventName': "Microsoft.Communication.ChatThreadParticipantAdded", + 'ResourceDeleteSuccessEventName': "Microsoft.Resources.ResourceDeleteSuccess", + 'EventGridSubscriptionValidationEventName': "Microsoft.EventGrid.SubscriptionValidationEvent", + 'ResourceWriteSuccessEventName': "Microsoft.Resources.ResourceWriteSuccess", + 'ResourceActionSuccessEventName': "Microsoft.Resources.ResourceActionSuccess", + 'ResourceWriteCancelEventName': "Microsoft.Resources.ResourceWriteCancel", + 'ServiceBusDeadletterMessagesAvailableWithNoListenerEventName': "Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener", + 'ResourceActionFailureEventName': "Microsoft.Resources.ResourceActionFailure", + 'AcsChatMemberRemovedFromThreadWithUserEventName': "Microsoft.Communication.ChatMemberRemovedFromThreadWithUser", + 'IoTHubDeviceConnectedEventName': "Microsoft.Devices.DeviceConnected", + 'EventGridSubscriptionDeletedEventName': "Microsoft.EventGrid.SubscriptionDeletedEvent", + 'AcsChatThreadParticipantRemovedEventName': "Microsoft.Communication.ChatThreadParticipantRemoved", + 'ResourceActionCancelEventName': "Microsoft.Resources.ResourceActionCancel", + 'IoTHubDeviceCreatedEventName': "Microsoft.Devices.DeviceCreated" +} + +def event_tuples(system_events): + tup_list = [] + for event in system_events: + class_name = event[0].replace("Data", "Name") + try: + event_name = re.findall("Microsoft.[a-zA-Z]+.[a-zA-Z]+", event[1].__doc__)[0] + except: + # these two are just superclasses and are known exceptions. + if event[0] not in ('ContainerRegistryArtifactEventData', 'ContainerRegistryEventData'): + warnings.warn("Unable to generate the event mapping for {}".format(event[0])) + sys.exit(1) + tup_list.append((class_name, event_name)) + return tup_list + +def generate_enum_content(tuples): + for tup in tup_list: + print(tup[0] + " = '" + tup[1] + "'\n") + print("# these names below are for backward compat only - refrain from using them.") + for k, v in backward_compat.items(): + print(k + " = '" + v + "'\n") + +system_events = [m for m in inspect.getmembers(models) if m[0].endswith('Data')] +tup_list = event_tuples(system_events) + +generate_enum_content(tup_list) diff --git a/sdk/eventhub/azure-eventhub/samples/README.md b/sdk/eventhub/azure-eventhub/samples/README.md index 62197853abc1..73ab85d7e7f9 100644 --- a/sdk/eventhub/azure-eventhub/samples/README.md +++ b/sdk/eventhub/azure-eventhub/samples/README.md @@ -70,6 +70,9 @@ Both [sync version](https://github.com/Azure/azure-sdk-for-python/tree/master/sd - [authenticate_with_azure_sas_credential.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/eventhub/azure-eventhub/samples/sync_samples/authenticate_with_azure_sas_credential.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/eventhub/azure-eventhub/samples/async_samples/authenticate_with_azure_sas_credential_async.py)) - Examples: - Utilize `azure.core.credentials.AzureSasCredential` to authenticate when creating an Event Hub client. +- [authenticate_with_azure_named_key_credential.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/eventhub/azure-eventhub/samples/sync_samples/authenticate_with_azure_named_key_credential.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/eventhub/azure-eventhub/samples/async_samples/authenticate_with_azure_named_key_credential_async.py)) - Examples: + - Utilize `azure.core.credentials.AzureNamedKeyCredential` to authenticate when creating an Event Hub client. + - [connection_to_custom_endpoint_address.py](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventhub/azure-eventhub/samples/sync_samples/connection_to_custom_endpoint_address.py) ([async version](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/eventhub/azure-eventhub/samples/async_samples/connection_to_custom_endpoint_address_async.py)) - Examples: to create EventHubProducerClient and EventHubConsumerClient that connect to a custom endpoint with a custom certificate. diff --git a/sdk/eventhub/azure-eventhub/samples/async_samples/authenticate_with_named_key_credential_async.py b/sdk/eventhub/azure-eventhub/samples/async_samples/authenticate_with_azure_named_key_credential_async.py similarity index 100% rename from sdk/eventhub/azure-eventhub/samples/async_samples/authenticate_with_named_key_credential_async.py rename to sdk/eventhub/azure-eventhub/samples/async_samples/authenticate_with_azure_named_key_credential_async.py diff --git a/sdk/eventhub/azure-eventhub/samples/sync_samples/authenticate_with_named_key_credential.py b/sdk/eventhub/azure-eventhub/samples/sync_samples/authenticate_with_azure_named_key_credential.py similarity index 100% rename from sdk/eventhub/azure-eventhub/samples/sync_samples/authenticate_with_named_key_credential.py rename to sdk/eventhub/azure-eventhub/samples/sync_samples/authenticate_with_azure_named_key_credential.py diff --git a/sdk/nspkg/azure-purview-nspkg/CHANGELOG.md b/sdk/nspkg/azure-purview-nspkg/CHANGELOG.md new file mode 100644 index 000000000000..45cf868070d1 --- /dev/null +++ b/sdk/nspkg/azure-purview-nspkg/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 2.0.0 (2021-03-08) + +* Initial Release diff --git a/sdk/nspkg/azure-purview-nspkg/MANIFEST.in b/sdk/nspkg/azure-purview-nspkg/MANIFEST.in new file mode 100644 index 000000000000..f7c294f423e6 --- /dev/null +++ b/sdk/nspkg/azure-purview-nspkg/MANIFEST.in @@ -0,0 +1,3 @@ +include *.md +include azure/__init__.py +include azure/purview/__init__.py diff --git a/sdk/nspkg/azure-purview-nspkg/README.md b/sdk/nspkg/azure-purview-nspkg/README.md new file mode 100644 index 000000000000..51011b1b8bf4 --- /dev/null +++ b/sdk/nspkg/azure-purview-nspkg/README.md @@ -0,0 +1,11 @@ +# Microsoft Azure Purview SDK for Python + +This is the Microsoft Azure Purview 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.purview namespace. + +The complete list of available packages can be found at: +https://aka.ms/azsdk/python/all diff --git a/sdk/nspkg/azure-purview-nspkg/azure/__init__.py b/sdk/nspkg/azure-purview-nspkg/azure/__init__.py new file mode 100644 index 000000000000..69e3be50dac4 --- /dev/null +++ b/sdk/nspkg/azure-purview-nspkg/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/sdk/nspkg/azure-purview-nspkg/azure/purview/__init__.py b/sdk/nspkg/azure-purview-nspkg/azure/purview/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/nspkg/azure-purview-nspkg/setup.cfg b/sdk/nspkg/azure-purview-nspkg/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/nspkg/azure-purview-nspkg/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/nspkg/azure-purview-nspkg/setup.py b/sdk/nspkg/azure-purview-nspkg/setup.py new file mode 100644 index 000000000000..7dd417bf4ad4 --- /dev/null +++ b/sdk/nspkg/azure-purview-nspkg/setup.py @@ -0,0 +1,39 @@ +#!/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. +# -------------------------------------------------------------------------- + +from setuptools import setup + +setup( + name='azure-purview-nspkg', + version='2.0.0', + description='Microsoft Azure Purview Namespace Package [Internal]', + long_description=open('README.md', 'r').read(), + license='MIT License', + author='Microsoft Corporation', + author_email='azurepysdk@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python/', + 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.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=[ + 'azure.purview', + ], + install_requires=[ + 'azure-nspkg>=2.0.0', + ] +) diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_base_handler.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_base_handler.py index 5b41690b0dc7..0f866a2ea241 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_base_handler.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_base_handler.py @@ -196,6 +196,7 @@ def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument raise ValueError("No token scope provided.") return _generate_sas_token(scopes[0], self.policy, self.key) + class ServiceBusAzureNamedKeyTokenCredential(object): """The named key credential used for authentication. :param credential: The AzureNamedKeyCredential that should be used. @@ -214,7 +215,8 @@ def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument name, key = self._credential.named_key return _generate_sas_token(scopes[0], name, key) -class ServiceBusAzureSasCredential(object): + +class ServiceBusAzureSasTokenCredential(object): """The shared access token credential used for authentication when AzureSasCredential is provided. :param azure_sas_credential: The credential to be used for authentication. @@ -249,7 +251,7 @@ def __init__(self, fully_qualified_namespace, entity_name, credential, **kwargs) ) self._mgmt_target = "{}{}".format(self._entity_path, MANAGEMENT_PATH_SUFFIX) if isinstance(credential, AzureSasCredential): - self._credential = ServiceBusAzureSasCredential(credential) + self._credential = ServiceBusAzureSasTokenCredential(credential) elif isinstance(credential, AzureNamedKeyCredential): self._credential = ServiceBusAzureNamedKeyTokenCredential(credential) # type: ignore else: diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py index a1e124f2c2ff..b6614fa74632 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/_base_handler_async.py @@ -80,6 +80,7 @@ async def get_token( raise ValueError("No token scope provided.") return _generate_sas_token(scopes[0], self.policy, self.key) + class ServiceBusAzureNamedKeyTokenCredentialAsync(object): """The named key credential used for authentication. :param credential: The AzureNamedKeyCredential that should be used. @@ -98,7 +99,7 @@ async def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument return _generate_sas_token(scopes[0], name, key) -class ServiceBusAzureSasCredentialAsync(object): +class ServiceBusAzureSasTokenCredentialAsync(object): """The shared access token credential used for authentication when AzureSasCredential is provided. :param azure_sas_credential: The credential to be used for authentication. @@ -136,7 +137,7 @@ def __init__( ) self._mgmt_target = "{}{}".format(self._entity_path, MANAGEMENT_PATH_SUFFIX) if isinstance(credential, AzureSasCredential): - self._credential = ServiceBusAzureSasCredentialAsync(credential) + self._credential = ServiceBusAzureSasTokenCredentialAsync(credential) elif isinstance(credential, AzureNamedKeyCredential): self._credential = ServiceBusAzureNamedKeyTokenCredentialAsync(credential) # type: ignore else: diff --git a/sdk/servicebus/azure-servicebus/samples/README.md b/sdk/servicebus/azure-servicebus/samples/README.md index d6bade57191c..36b9aa4c2a0a 100644 --- a/sdk/servicebus/azure-servicebus/samples/README.md +++ b/sdk/servicebus/azure-servicebus/samples/README.md @@ -51,6 +51,10 @@ Both [sync version](https://github.com/Azure/azure-sdk-for-python/tree/master/sd - Authenticate and create the client utilizing the `azure.identity` library - [authenticate_client_connstr.py](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/samples/sync_samples/authenticate_client_connstr.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/samples/async_samples/authenticate_client_connstr_async.py)) - Examples to authenticate the client by Connection String: - Authenticate and create the client utilizing the connection string available in the Azure portal or via Azure CLI. +- [authenticate_using_azure_sas_credential.py](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/samples/sync_samples/authenticate_using_azure_sas_credential.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/samples/async_samples/authenticate_using_azure_sas_credential_async.py)) - Examples to authenticate the client by `azure.core.credentials.AzureSasCredential`: + - Authenticate and create the client utilizing the `azure.core.credentials.AzureSasCredential`. +- [authenticate_using_azure_named_key_credential.py](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/samples/sync_samples/authenticate_using_azure_named_key_credential.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/samples/async_samples/authenticate_using_azure_named_key_credential_async.py)) - Examples to authenticate the client by `azure.core.credentials.AzureNamedKeyCredential`: + - Authenticate and create the client utilizing the `azure.core.credentials.AzureNamedKeyCredential`. - [proxy.py](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/samples/sync_samples/proxy.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/servicebus/azure-servicebus/samples/async_samples/proxy_async.py)) - Examples to send message behind a proxy: - Send message behind a proxy - [auto_lock_renew.py](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/sync_samples/auto_lock_renew.py) ([async_version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/servicebus/azure-servicebus/samples/async_samples/auto_lock_renew_async.py)) - Examples to show usage of AutoLockRenewer: diff --git a/sdk/servicebus/azure-servicebus/samples/async_samples/authenticate_using_named_key_credential_async.py b/sdk/servicebus/azure-servicebus/samples/async_samples/authenticate_using_azure_named_key_credential_async.py similarity index 100% rename from sdk/servicebus/azure-servicebus/samples/async_samples/authenticate_using_named_key_credential_async.py rename to sdk/servicebus/azure-servicebus/samples/async_samples/authenticate_using_azure_named_key_credential_async.py diff --git a/sdk/servicebus/azure-servicebus/samples/sync_samples/authenticate_using_named_key_credential.py b/sdk/servicebus/azure-servicebus/samples/sync_samples/authenticate_using_azure_named_key_credential.py similarity index 100% rename from sdk/servicebus/azure-servicebus/samples/sync_samples/authenticate_using_named_key_credential.py rename to sdk/servicebus/azure-servicebus/samples/sync_samples/authenticate_using_azure_named_key_credential.py diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index 5a71a3aa42e9..15cd3f2ac2b6 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -28,6 +28,7 @@ * Added support for Azurite storage emulator * Throws a `RequestTooLargeError` on transaction requests that return a 413 error code * Added support for Int64 and Binary types in query filters +* On `update_entity` and `delete_entity` if no `etag` is supplied via kwargs, the `etag` in the entity will be used if it is in the entity. ## 12.0.0b6 (2021-04-06) * Updated deserialization of datetime fields in entities to support preservation of the service format with additional decimal place. diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py index 6a73c6bd502a..14914e984bd4 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py @@ -238,11 +238,19 @@ def update( self._verify_partition_key(entity) temp = entity.copy() + match_condition = kwargs.pop("match_condition", None) + etag = kwargs.pop("etag", None) + if match_condition and not etag: + try: + etag = entity.metadata.get("etag", None) + except (AttributeError, TypeError): + pass + if_match, _ = _get_match_headers( kwargs=dict( kwargs, - etag=kwargs.pop("etag", None), - match_condition=kwargs.pop("match_condition", None), + etag=etag, + match_condition=match_condition, ), etag_param="etag", match_param="match_condition", @@ -516,16 +524,25 @@ def delete( partition_key = temp["PartitionKey"] row_key = temp["RowKey"] + match_condition = kwargs.pop("match_condition", None) + etag = kwargs.pop("etag", None) + if match_condition and not etag: + try: + etag = entity.metadata.get("etag", None) + except (AttributeError, TypeError): + pass + if_match, _ = _get_match_headers( kwargs=dict( kwargs, - etag=kwargs.pop("etag", None), - match_condition=kwargs.pop("match_condition", None), + etag=etag, + match_condition=match_condition, ), etag_param="etag", match_param="match_condition", ) + self._batch_delete_entity( table=self.table_name, partition_key=partition_key, 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 index 2814d34cfc03..96847adfd2fd 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -323,12 +323,19 @@ def delete_entity(self, *args, **kwargs): if not row_key: row_key = args[1] + match_condition = kwargs.pop("match_condition", None) + etag = kwargs.pop("etag", None) + if match_condition and entity and not etag: + try: + etag = entity.metadata.get("etag", None) + except (AttributeError, TypeError): + pass if_match, _ = _get_match_headers( kwargs=dict( kwargs, - etag=kwargs.pop("etag", None), - match_condition=kwargs.pop("match_condition", None), + etag=etag, + match_condition=match_condition, ), etag_param="etag", match_param="match_condition", @@ -414,12 +421,19 @@ def update_entity( :dedent: 8 :caption: Updating an already exiting entity in a Table """ + match_condition = kwargs.pop("match_condition", None) + etag = kwargs.pop("etag", None) + if match_condition and not etag: + try: + etag = entity.metadata.get("etag", None) + except (AttributeError, TypeError): + pass if_match, _ = _get_match_headers( kwargs=dict( kwargs, - etag=kwargs.pop("etag", None), - match_condition=kwargs.pop("match_condition", None), + etag=etag, + match_condition=match_condition, ), etag_param="etag", match_param="match_condition", diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py index 73e20f5459e7..d8250543613c 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py @@ -214,11 +214,19 @@ def update( self._verify_partition_key(entity) temp = entity.copy() + match_condition = kwargs.pop("match_condition", None) + etag = kwargs.pop("etag", None) + if match_condition and not etag: + try: + etag = entity.metadata.get("etag", None) + except (AttributeError, TypeError): + pass + if_match, _ = _get_match_headers( kwargs=dict( kwargs, - etag=kwargs.pop("etag", None), - match_condition=kwargs.pop("match_condition", None), + etag=etag, + match_condition=match_condition, ), etag_param="etag", match_param="match_condition", @@ -484,11 +492,20 @@ def delete( temp = entity.copy() partition_key = temp["PartitionKey"] row_key = temp["RowKey"] + + match_condition = kwargs.pop("match_condition", None) + etag = kwargs.pop("etag", None) + if match_condition and not etag: + try: + etag = entity.metadata.get("etag", None) + except (AttributeError, TypeError): + pass + if_match, _ = _get_match_headers( kwargs=dict( kwargs, - etag=kwargs.pop("etag", None), - match_condition=kwargs.pop("match_condition", None), + etag=etag, + match_condition=match_condition, ), etag_param="etag", match_param="match_condition", 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 index 2fc44964aed4..539e80384066 100644 --- 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 @@ -314,15 +314,24 @@ async def delete_entity(self, *args: Union[TableEntity, str], **kwargs: Any) -> if not row_key: row_key = args[1] + match_condition = kwargs.pop("match_condition", None) + etag = kwargs.pop("etag", None) + if match_condition and entity and not etag: + try: + etag = entity.metadata.get("etag", None) + except (AttributeError, TypeError): + pass + if_match, _ = _get_match_headers( kwargs=dict( kwargs, - etag=kwargs.pop("etag", None), - match_condition=kwargs.pop("match_condition", None), + etag=etag, + match_condition=match_condition, ), etag_param="etag", match_param="match_condition", ) + try: await self._client.table.delete_entity( table=self.table_name, @@ -402,11 +411,19 @@ async def update_entity( :dedent: 8 :caption: Querying entities from a TableClient """ + match_condition = kwargs.pop("match_condition", None) + etag = kwargs.pop("etag", None) + if match_condition and entity and not etag: + try: + etag = entity.metadata.get("etag", None) + except (AttributeError, TypeError): + pass + if_match, _ = _get_match_headers( kwargs=dict( kwargs, - etag=kwargs.pop("etag", None), - match_condition=kwargs.pop("match_condition", None), + etag=etag, + match_condition=match_condition, ), etag_param="etag", match_param="match_condition", diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_batch.test_delete_batch_with_bad_kwarg.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_batch.test_delete_batch_with_bad_kwarg.yaml new file mode 100644 index 000000000000..0319c5ec14a7 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_batch.test_delete_batch_with_bad_kwarg.yaml @@ -0,0 +1,319 @@ +interactions: +- request: + body: '{"TableName": "uttableee7113c6"}' + 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: + - Wed, 05 May 2021 16:33:06 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:06 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttableee7113c6"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Wed, 05 May 2021 16:33:06 GMT + location: + - https://fake_table_account.table.core.windows.net/Tables('uttableee7113c6') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: '{"PartitionKey": "001", "PartitionKey@odata.type": "Edm.String", "RowKey": + "batch_negative_1", "RowKey@odata.type": "Edm.String", "age": 39, "sex": "male", + "sex@odata.type": "Edm.String", "married": true, "deceased": false, "ratio": + 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: + - '590' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:06 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:06 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttableee7113c6 + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttableee7113c6/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A33%3A07.0314532Z''\"","PartitionKey":"001","RowKey":"batch_negative_1","Timestamp":"2021-05-05T16:33:07.0314532Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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: + - Wed, 05 May 2021 16:33:06 GMT + etag: + - W/"datetime'2021-05-05T16%3A33%3A07.0314532Z'" + location: + - https://fake_table_account.table.core.windows.net/uttableee7113c6(PartitionKey='001',RowKey='batch_negative_1') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + 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: + - Wed, 05 May 2021 16:33:06 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:06 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttableee7113c6(PartitionKey='001',RowKey='batch_negative_1') + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttableee7113c6/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A33%3A07.0314532Z''\"","PartitionKey":"001","RowKey":"batch_negative_1","Timestamp":"2021-05-05T16:33:07.0314532Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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: + - Wed, 05 May 2021 16:33:06 GMT + etag: + - W/"datetime'2021-05-05T16%3A33%3A07.0314532Z'" + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +- request: + body: "--batch_7ede9170-babf-4049-9bc8-8d66e6a0da1b\r\nContent-Type: multipart/mixed;\ + \ boundary=changeset_15be1f87-b28c-4685-ae2a-d458c0ef4f89\r\n\r\n--changeset_15be1f87-b28c-4685-ae2a-d458c0ef4f89\r\ + \nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\nContent-ID:\ + \ 0\r\n\r\nDELETE https://seankaneprim.table.core.windows.net/uttableee7113c6(PartitionKey='001',RowKey='batch_negative_1')\ + \ HTTP/1.1\r\nx-ms-version: 2019-02-02\r\nDataServiceVersion: 3.0\r\nIf-Match:\ + \ W/\"datetime'2012-06-15T22%3A51%3A44.9662825Z'\"\r\nAccept: application/json;odata=minimalmetadata\r\ + \nx-ms-date: Wed, 05 May 2021 16:33:07 GMT\r\nDate: Wed, 05 May 2021 16:33:07\ + \ GMT\r\n\r\n\r\n--changeset_15be1f87-b28c-4685-ae2a-d458c0ef4f89--\r\n\r\n\ + --batch_7ede9170-babf-4049-9bc8-8d66e6a0da1b--\r\n" + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '735' + Content-Type: + - multipart/mixed; boundary=batch_7ede9170-babf-4049-9bc8-8d66e6a0da1b + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:07 GMT + MaxDataServiceVersion: + - 3.0;NetFx + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:07 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/$batch + response: + body: + string: "--batchresponse_833c4844-93a1-4ac7-8bf6-2a30561f1bf7\r\nContent-Type:\ + \ multipart/mixed; boundary=changesetresponse_e981e2d4-1855-44ac-bfb3-95365e89d759\r\ + \n\r\n--changesetresponse_e981e2d4-1855-44ac-bfb3-95365e89d759\r\nContent-Type:\ + \ application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 412\ + \ Precondition Failed\r\nX-Content-Type-Options: nosniff\r\nCache-Control:\ + \ no-cache\r\nDataServiceVersion: 3.0;\r\nContent-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8\r\ + \n\r\n{\"odata.error\":{\"code\":\"UpdateConditionNotSatisfied\",\"message\"\ + :{\"lang\":\"en-US\",\"value\":\"The update condition specified in the request\ + \ was not satisfied.\\nRequestId:505f0dd0-3002-0075-32cc-41b108000000\\nTime:2021-05-05T16:33:07.4047215Z\"\ + }}}\r\n--changesetresponse_e981e2d4-1855-44ac-bfb3-95365e89d759--\r\n--batchresponse_833c4844-93a1-4ac7-8bf6-2a30561f1bf7--\r\ + \n" + headers: + cache-control: + - no-cache + content-type: + - multipart/mixed; boundary=batchresponse_833c4844-93a1-4ac7-8bf6-2a30561f1bf7 + date: + - Wed, 05 May 2021 16:33:07 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 202 + message: Accepted +- request: + body: "--batch_3d82498b-6415-4d5e-b00a-51a2c097475e\r\nContent-Type: multipart/mixed;\ + \ boundary=changeset_226b7ff2-5096-4fd8-afec-456ddec65eb7\r\n\r\n--changeset_226b7ff2-5096-4fd8-afec-456ddec65eb7\r\ + \nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\nContent-ID:\ + \ 0\r\n\r\nDELETE https://seankaneprim.table.core.windows.net/uttableee7113c6(PartitionKey='001',RowKey='batch_negative_1')\ + \ HTTP/1.1\r\nx-ms-version: 2019-02-02\r\nDataServiceVersion: 3.0\r\nIf-Match:\ + \ W/\"datetime'2021-05-05T16%3A33%3A07.0314532Z'\"\r\nAccept: application/json;odata=minimalmetadata\r\ + \nx-ms-date: Wed, 05 May 2021 16:33:07 GMT\r\nDate: Wed, 05 May 2021 16:33:07\ + \ GMT\r\n\r\n\r\n--changeset_226b7ff2-5096-4fd8-afec-456ddec65eb7--\r\n\r\n\ + --batch_3d82498b-6415-4d5e-b00a-51a2c097475e--\r\n" + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '735' + Content-Type: + - multipart/mixed; boundary=batch_3d82498b-6415-4d5e-b00a-51a2c097475e + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:07 GMT + MaxDataServiceVersion: + - 3.0;NetFx + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:07 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/$batch + response: + body: + string: "--batchresponse_936c04d7-3bd1-4d94-8837-cbf222baa948\r\nContent-Type:\ + \ multipart/mixed; boundary=changesetresponse_df66c0dc-4456-484b-9258-9d9b9f6bae6e\r\ + \n\r\n--changesetresponse_df66c0dc-4456-484b-9258-9d9b9f6bae6e\r\nContent-Type:\ + \ application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204\ + \ No Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\ + \nDataServiceVersion: 1.0;\r\n\r\n\r\n--changesetresponse_df66c0dc-4456-484b-9258-9d9b9f6bae6e--\r\ + \n--batchresponse_936c04d7-3bd1-4d94-8837-cbf222baa948--\r\n" + headers: + cache-control: + - no-cache + content-type: + - multipart/mixed; boundary=batchresponse_936c04d7-3bd1-4d94-8837-cbf222baa948 + date: + - Wed, 05 May 2021 16:33:07 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Wed, 05 May 2021 16:33:07 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:07 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttableee7113c6') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 05 May 2021 16:33:07 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_batch_async.test_delete_batch_with_bad_kwarg.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_batch_async.test_delete_batch_with_bad_kwarg.yaml new file mode 100644 index 000000000000..e340641186fc --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_batch_async.test_delete_batch_with_bad_kwarg.yaml @@ -0,0 +1,254 @@ +interactions: +- request: + body: '{"TableName": "uttable70681643"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:07 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:07 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable70681643"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Wed, 05 May 2021 16:33:08 GMT + location: https://fake_table_account.table.core.windows.net/Tables('uttable70681643') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://seankaneprim.table.core.windows.net/Tables +- request: + body: '{"PartitionKey": "001", "PartitionKey@odata.type": "Edm.String", "RowKey": + "batch_negative_1", "RowKey@odata.type": "Edm.String", "age": 39, "sex": "male", + "sex@odata.type": "Edm.String", "married": true, "deceased": false, "ratio": + 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: + - '590' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:08 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:08 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttable70681643 + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable70681643/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A33%3A08.5667399Z''\"","PartitionKey":"001","RowKey":"batch_negative_1","Timestamp":"2021-05-05T16:33:08.5667399Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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: Wed, 05 May 2021 16:33:08 GMT + etag: W/"datetime'2021-05-05T16%3A33%3A08.5667399Z'" + location: https://fake_table_account.table.core.windows.net/uttable70681643(PartitionKey='001',RowKey='batch_negative_1') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://seankaneprim.table.core.windows.net/uttable70681643 +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:08 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:08 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttable70681643(PartitionKey='001',RowKey='batch_negative_1') + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable70681643/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A33%3A08.5667399Z''\"","PartitionKey":"001","RowKey":"batch_negative_1","Timestamp":"2021-05-05T16:33:08.5667399Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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: Wed, 05 May 2021 16:33:08 GMT + etag: W/"datetime'2021-05-05T16%3A33%3A08.5667399Z'" + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: https://seankaneprim.table.core.windows.net/uttable70681643(PartitionKey='001',RowKey='batch_negative_1') +- request: + body: "--batch_fd11d4cd-f988-47d1-b178-e474d62a684b\r\nContent-Type: multipart/mixed;\ + \ boundary=changeset_bb730c62-2bc8-46c3-9b94-1b501fdf3fd6\r\n\r\n--changeset_bb730c62-2bc8-46c3-9b94-1b501fdf3fd6\r\ + \nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\nContent-ID:\ + \ 0\r\n\r\nDELETE https://seankaneprim.table.core.windows.net/uttable70681643(PartitionKey='001',RowKey='batch_negative_1')\ + \ HTTP/1.1\r\nx-ms-version: 2019-02-02\r\nDataServiceVersion: 3.0\r\nIf-Match:\ + \ W/\"datetime'2012-06-15T22%3A51%3A44.9662825Z'\"\r\nAccept: application/json;odata=minimalmetadata\r\ + \nx-ms-date: Wed, 05 May 2021 16:33:08 GMT\r\nDate: Wed, 05 May 2021 16:33:08\ + \ GMT\r\n\r\n\r\n--changeset_bb730c62-2bc8-46c3-9b94-1b501fdf3fd6--\r\n\r\n\ + --batch_fd11d4cd-f988-47d1-b178-e474d62a684b--\r\n" + headers: + Accept: + - application/json + Content-Length: + - '735' + Content-Type: + - multipart/mixed; boundary=batch_fd11d4cd-f988-47d1-b178-e474d62a684b + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:08 GMT + MaxDataServiceVersion: + - 3.0;NetFx + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:08 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/$batch + response: + body: + string: "--batchresponse_3498d08d-5d66-43c2-ae81-1147c7e8af26\r\nContent-Type:\ + \ multipart/mixed; boundary=changesetresponse_0b4a212f-034c-473a-949d-2f586227bbb7\r\ + \n\r\n--changesetresponse_0b4a212f-034c-473a-949d-2f586227bbb7\r\nContent-Type:\ + \ application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 412\ + \ Precondition Failed\r\nX-Content-Type-Options: nosniff\r\nCache-Control:\ + \ no-cache\r\nDataServiceVersion: 3.0;\r\nContent-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8\r\ + \n\r\n{\"odata.error\":{\"code\":\"UpdateConditionNotSatisfied\",\"message\"\ + :{\"lang\":\"en-US\",\"value\":\"The update condition specified in the request\ + \ was not satisfied.\\nRequestId:bfa3c798-c002-0061-76cc-41f967000000\\nTime:2021-05-05T16:33:08.9199901Z\"\ + }}}\r\n--changesetresponse_0b4a212f-034c-473a-949d-2f586227bbb7--\r\n--batchresponse_3498d08d-5d66-43c2-ae81-1147c7e8af26--\r\ + \n" + headers: + cache-control: no-cache + content-type: multipart/mixed; boundary=batchresponse_3498d08d-5d66-43c2-ae81-1147c7e8af26 + date: Wed, 05 May 2021 16: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-02-02' + status: + code: 202 + message: Accepted + url: https://seankaneprim.table.core.windows.net/$batch +- request: + body: "--batch_c8284c9b-1d01-41c1-9f87-e544e3ac49e9\r\nContent-Type: multipart/mixed;\ + \ boundary=changeset_7761c230-6f15-4144-ba65-fb4f202a9c6b\r\n\r\n--changeset_7761c230-6f15-4144-ba65-fb4f202a9c6b\r\ + \nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\nContent-ID:\ + \ 0\r\n\r\nDELETE https://seankaneprim.table.core.windows.net/uttable70681643(PartitionKey='001',RowKey='batch_negative_1')\ + \ HTTP/1.1\r\nx-ms-version: 2019-02-02\r\nDataServiceVersion: 3.0\r\nIf-Match:\ + \ W/\"datetime'2021-05-05T16%3A33%3A08.5667399Z'\"\r\nAccept: application/json;odata=minimalmetadata\r\ + \nx-ms-date: Wed, 05 May 2021 16:33:08 GMT\r\nDate: Wed, 05 May 2021 16:33:08\ + \ GMT\r\n\r\n\r\n--changeset_7761c230-6f15-4144-ba65-fb4f202a9c6b--\r\n\r\n\ + --batch_c8284c9b-1d01-41c1-9f87-e544e3ac49e9--\r\n" + headers: + Accept: + - application/json + Content-Length: + - '735' + Content-Type: + - multipart/mixed; boundary=batch_c8284c9b-1d01-41c1-9f87-e544e3ac49e9 + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:08 GMT + MaxDataServiceVersion: + - 3.0;NetFx + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:08 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/$batch + response: + body: + string: "--batchresponse_414e88dc-731a-4c02-a41c-e028e00077f1\r\nContent-Type:\ + \ multipart/mixed; boundary=changesetresponse_9027b7b1-e146-475a-bc66-50c99598ca11\r\ + \n\r\n--changesetresponse_9027b7b1-e146-475a-bc66-50c99598ca11\r\nContent-Type:\ + \ application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204\ + \ No Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\ + \nDataServiceVersion: 1.0;\r\n\r\n\r\n--changesetresponse_9027b7b1-e146-475a-bc66-50c99598ca11--\r\ + \n--batchresponse_414e88dc-731a-4c02-a41c-e028e00077f1--\r\n" + headers: + cache-control: no-cache + content-type: multipart/mixed; boundary=batchresponse_414e88dc-731a-4c02-a41c-e028e00077f1 + date: Wed, 05 May 2021 16: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-02-02' + status: + code: 202 + message: Accepted + url: https://seankaneprim.table.core.windows.net/$batch +- request: + body: null + headers: + Accept: + - application/json + Date: + - Wed, 05 May 2021 16:33:09 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:09 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttable70681643') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Wed, 05 May 2021 16:33:09 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/Tables('uttable70681643') +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_batch_cosmos.test_delete_batch_with_bad_kwarg.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_batch_cosmos.test_delete_batch_with_bad_kwarg.yaml new file mode 100644 index 000000000000..519d1068c79c --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_batch_cosmos.test_delete_batch_with_bad_kwarg.yaml @@ -0,0 +1,282 @@ +interactions: +- request: + body: '{"TableName": "uttable890c16b9"}' + 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: + - Wed, 05 May 2021 16:33:09 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:09 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttable890c16b9","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 16:33:10 GMT + etag: + - W/"datetime'2021-05-05T16%3A33%3A10.5386504Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable890c16b9') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Ok +- request: + body: '{"PartitionKey": "001", "PartitionKey@odata.type": "Edm.String", "RowKey": + "batch_negative_1", "RowKey@odata.type": "Edm.String", "age": 39, "sex": "male", + "sex@odata.type": "Edm.String", "married": true, "deceased": false, "ratio": + 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: + - '590' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:11 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:11 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable890c16b9 + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable890c16b9/$metadata#uttable890c16b9/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A33%3A11.3570312Z''\"","PartitionKey":"001","RowKey":"batch_negative_1","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T16:33:11.3570312Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 16:33:11 GMT + etag: + - W/"datetime'2021-05-05T16%3A33%3A11.3570312Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/uttable890c16b9(PartitionKey='001',RowKey='batch_negative_1') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + 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: + - Wed, 05 May 2021 16:33:11 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:11 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable890c16b9(PartitionKey='001',RowKey='batch_negative_1') + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable890c16b9/$metadata#uttable890c16b9/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A33%3A11.3570312Z''\"","PartitionKey":"001","RowKey":"batch_negative_1","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T16:33:11.3570312Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 16:33:11 GMT + etag: + - W/"datetime'2021-05-05T16%3A33%3A11.3570312Z'" + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 200 + message: Ok +- request: + body: "--batch_7182a7ef-96ca-4766-b9f1-8ccd2d8e1624\r\nContent-Type: multipart/mixed;\ + \ boundary=changeset_4197d55b-35df-4742-8601-2be80049c34b\r\n\r\n--changeset_4197d55b-35df-4742-8601-2be80049c34b\r\ + \nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\nContent-ID:\ + \ 0\r\n\r\nDELETE https://seankaneprim.table.cosmos.azure.com/uttable890c16b9(PartitionKey='001',RowKey='batch_negative_1')\ + \ HTTP/1.1\r\nx-ms-version: 2019-02-02\r\nDataServiceVersion: 3.0\r\nIf-Match:\ + \ W/\"datetime'2012-06-15T22%3A51%3A44.9662825Z'\"\r\nAccept: application/json;odata=minimalmetadata\r\ + \nx-ms-date: Wed, 05 May 2021 16:33:11 GMT\r\nDate: Wed, 05 May 2021 16:33:11\ + \ GMT\r\n\r\n\r\n--changeset_4197d55b-35df-4742-8601-2be80049c34b--\r\n\r\n\ + --batch_7182a7ef-96ca-4766-b9f1-8ccd2d8e1624--\r\n" + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '735' + Content-Type: + - multipart/mixed; boundary=batch_7182a7ef-96ca-4766-b9f1-8ccd2d8e1624 + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:11 GMT + MaxDataServiceVersion: + - 3.0;NetFx + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:11 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/$batch + response: + body: + string: "--batchresponse_f407c5f4-fa59-4a63-a5d5-7a1e97085ab0\nContent-Type:\ + \ multipart/mixed; boundary=changesetresponse_42281cc4-a8b1-4e85-91c7-5916edd63fcd\r\ + \n\r\n--changesetresponse_42281cc4-a8b1-4e85-91c7-5916edd63fcd\nContent-Type:\ + \ application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 412 Precondition\ + \ Failed\r\nContent-Type: application/json;odata=fullmetadata\r\n\r\n{\"odata.error\"\ + :{\"code\":\"UpdateConditionNotSatisfied\",\"message\":{\"lang\":\"en-us\"\ + ,\"value\":\"0:The update condition specified in the request was not satisfied.\\\ + n\\nRequestID:94f6a376-adbf-11eb-a5f5-002b67128e4c\\n\"}}}\r\n--changesetresponse_42281cc4-a8b1-4e85-91c7-5916edd63fcd--\n\ + --batchresponse_f407c5f4-fa59-4a63-a5d5-7a1e97085ab0--\r\n" + headers: + content-type: + - multipart/mixed; boundary=batchresponse_f407c5f4-fa59-4a63-a5d5-7a1e97085ab0 + date: + - Wed, 05 May 2021 16:33:11 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 202 + message: Accepted +- request: + body: "--batch_4bf14bf7-6893-4601-889f-ed0d7bdfe9e9\r\nContent-Type: multipart/mixed;\ + \ boundary=changeset_650732b4-7032-48e1-ba2e-c33c610b1e96\r\n\r\n--changeset_650732b4-7032-48e1-ba2e-c33c610b1e96\r\ + \nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\nContent-ID:\ + \ 0\r\n\r\nDELETE https://seankaneprim.table.cosmos.azure.com/uttable890c16b9(PartitionKey='001',RowKey='batch_negative_1')\ + \ HTTP/1.1\r\nx-ms-version: 2019-02-02\r\nDataServiceVersion: 3.0\r\nIf-Match:\ + \ W/\"datetime'2021-05-05T16%3A33%3A11.3570312Z'\"\r\nAccept: application/json;odata=minimalmetadata\r\ + \nx-ms-date: Wed, 05 May 2021 16:33:11 GMT\r\nDate: Wed, 05 May 2021 16:33:11\ + \ GMT\r\n\r\n\r\n--changeset_650732b4-7032-48e1-ba2e-c33c610b1e96--\r\n\r\n\ + --batch_4bf14bf7-6893-4601-889f-ed0d7bdfe9e9--\r\n" + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '735' + Content-Type: + - multipart/mixed; boundary=batch_4bf14bf7-6893-4601-889f-ed0d7bdfe9e9 + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:11 GMT + MaxDataServiceVersion: + - 3.0;NetFx + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:11 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/$batch + response: + body: + string: "--batchresponse_6dc33b3a-9309-4e77-ae5c-7c83a0e02ef6\nContent-Type:\ + \ multipart/mixed; boundary=changesetresponse_190f4b34-3c9b-4892-b55f-4d1a1d498f30\r\ + \n\r\n--changesetresponse_190f4b34-3c9b-4892-b55f-4d1a1d498f30\nContent-Type:\ + \ application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\ + \nContent-ID: 1\r\n\r\n\r\n--changesetresponse_190f4b34-3c9b-4892-b55f-4d1a1d498f30--\n\ + --batchresponse_6dc33b3a-9309-4e77-ae5c-7c83a0e02ef6--\r\n" + headers: + content-type: + - multipart/mixed; boundary=batchresponse_6dc33b3a-9309-4e77-ae5c-7c83a0e02ef6 + date: + - Wed, 05 May 2021 16:33:11 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Wed, 05 May 2021 16:33:11 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:11 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable890c16b9') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 05 May 2021 16:33:12 GMT + server: + - Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_batch_cosmos_async.test_delete_batch_with_bad_kwarg.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_batch_cosmos_async.test_delete_batch_with_bad_kwarg.yaml new file mode 100644 index 000000000000..c06b7281cd04 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_batch_cosmos_async.test_delete_batch_with_bad_kwarg.yaml @@ -0,0 +1,263 @@ +interactions: +- request: + body: '{"TableName": "uttable1cb51936"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:42 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:42 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttable1cb51936","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Wed, 05 May 2021 16:33:43 GMT + etag: W/"datetime'2021-05-05T16%3A33%3A43.2065032Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable1cb51936') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Ok + url: https://seankaneprim.table.cosmos.azure.com/Tables +- request: + body: '{"PartitionKey": "001", "PartitionKey@odata.type": "Edm.String", "RowKey": + "batch_negative_1", "RowKey@odata.type": "Edm.String", "age": 39, "sex": "male", + "sex@odata.type": "Edm.String", "married": true, "deceased": false, "ratio": + 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: + - '590' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:43 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:43 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable1cb51936 + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable1cb51936/$metadata#uttable1cb51936/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A33%3A43.9891464Z''\"","PartitionKey":"001","RowKey":"batch_negative_1","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T16:33:43.9891464Z"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Wed, 05 May 2021 16:33:43 GMT + etag: W/"datetime'2021-05-05T16%3A33%3A43.9891464Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/uttable1cb51936(PartitionKey='001',RowKey='batch_negative_1') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Created + url: https://seankaneprim.table.cosmos.azure.com/uttable1cb51936 +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:43 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:43 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable1cb51936(PartitionKey='001',RowKey='batch_negative_1') + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable1cb51936/$metadata#uttable1cb51936/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A33%3A43.9891464Z''\"","PartitionKey":"001","RowKey":"batch_negative_1","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T16:33:43.9891464Z"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Wed, 05 May 2021 16:33:43 GMT + etag: W/"datetime'2021-05-05T16%3A33%3A43.9891464Z'" + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 200 + message: Ok + url: https://seankaneprim.table.cosmos.azure.com/uttable1cb51936(PartitionKey='001',RowKey='batch_negative_1') +- request: + body: "--batch_ab56bfd0-a18f-413e-ac41-edd6889dd46b\r\nContent-Type: multipart/mixed;\ + \ boundary=changeset_5d0123a4-4dad-43ed-92f7-cf8b43b79cb4\r\n\r\n--changeset_5d0123a4-4dad-43ed-92f7-cf8b43b79cb4\r\ + \nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\nContent-ID:\ + \ 0\r\n\r\nDELETE https://seankaneprim.table.cosmos.azure.com/uttable1cb51936(PartitionKey='001',RowKey='batch_negative_1')\ + \ HTTP/1.1\r\nx-ms-version: 2019-02-02\r\nDataServiceVersion: 3.0\r\nIf-Match:\ + \ W/\"datetime'2012-06-15T22%3A51%3A44.9662825Z'\"\r\nAccept: application/json;odata=minimalmetadata\r\ + \nx-ms-date: Wed, 05 May 2021 16:33:44 GMT\r\nDate: Wed, 05 May 2021 16:33:44\ + \ GMT\r\n\r\n\r\n--changeset_5d0123a4-4dad-43ed-92f7-cf8b43b79cb4--\r\n\r\n\ + --batch_ab56bfd0-a18f-413e-ac41-edd6889dd46b--\r\n" + headers: + Accept: + - application/json + Content-Length: + - '735' + Content-Type: + - multipart/mixed; boundary=batch_ab56bfd0-a18f-413e-ac41-edd6889dd46b + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:44 GMT + MaxDataServiceVersion: + - 3.0;NetFx + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:44 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/$batch + response: + body: + string: "--batchresponse_84df3b89-cdce-422b-9d06-f504b4d83eed\nContent-Type:\ + \ multipart/mixed; boundary=changesetresponse_bbd169bb-dcc6-4bfd-b05a-d0278736af54\r\ + \n\r\n--changesetresponse_bbd169bb-dcc6-4bfd-b05a-d0278736af54\nContent-Type:\ + \ application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 412 Precondition\ + \ Failed\r\nContent-Type: application/json;odata=fullmetadata\r\n\r\n{\"odata.error\"\ + :{\"code\":\"UpdateConditionNotSatisfied\",\"message\":{\"lang\":\"en-us\"\ + ,\"value\":\"0:The update condition specified in the request was not satisfied.\\\ + n\\nRequestID:a87033cc-adbf-11eb-8de5-002b67128e4c\\n\"}}}\r\n--changesetresponse_bbd169bb-dcc6-4bfd-b05a-d0278736af54--\n\ + --batchresponse_84df3b89-cdce-422b-9d06-f504b4d83eed--\r\n" + headers: + content-type: multipart/mixed; boundary=batchresponse_84df3b89-cdce-422b-9d06-f504b4d83eed + date: Wed, 05 May 2021 16:33:43 GMT + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 202 + message: Accepted + url: https://seankaneprim.table.cosmos.azure.com/$batch +- request: + body: "--batch_1bc940df-4449-4c48-aee9-a786c420fdc3\r\nContent-Type: multipart/mixed;\ + \ boundary=changeset_4d03eb3e-cf08-4261-bab4-b5c486ca764a\r\n\r\n--changeset_4d03eb3e-cf08-4261-bab4-b5c486ca764a\r\ + \nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\nContent-ID:\ + \ 0\r\n\r\nDELETE https://seankaneprim.table.cosmos.azure.com/uttable1cb51936(PartitionKey='001',RowKey='batch_negative_1')\ + \ HTTP/1.1\r\nx-ms-version: 2019-02-02\r\nDataServiceVersion: 3.0\r\nIf-Match:\ + \ W/\"datetime'2021-05-05T16%3A33%3A43.9891464Z'\"\r\nAccept: application/json;odata=minimalmetadata\r\ + \nx-ms-date: Wed, 05 May 2021 16:33:44 GMT\r\nDate: Wed, 05 May 2021 16:33:44\ + \ GMT\r\n\r\n\r\n--changeset_4d03eb3e-cf08-4261-bab4-b5c486ca764a--\r\n\r\n\ + --batch_1bc940df-4449-4c48-aee9-a786c420fdc3--\r\n" + headers: + Accept: + - application/json + Content-Length: + - '735' + Content-Type: + - multipart/mixed; boundary=batch_1bc940df-4449-4c48-aee9-a786c420fdc3 + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:33:44 GMT + MaxDataServiceVersion: + - 3.0;NetFx + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:44 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/$batch + response: + body: + string: "--batchresponse_0cfc6008-1660-46e6-b502-1a55088ad873\nContent-Type:\ + \ multipart/mixed; boundary=changesetresponse_692f2150-a0ba-438d-b7ed-2d5dcc95648b\r\ + \n\r\n--changesetresponse_692f2150-a0ba-438d-b7ed-2d5dcc95648b\nContent-Type:\ + \ application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\ + \nContent-ID: 1\r\n\r\n\r\n--changesetresponse_692f2150-a0ba-438d-b7ed-2d5dcc95648b--\n\ + --batchresponse_0cfc6008-1660-46e6-b502-1a55088ad873--\r\n" + headers: + content-type: multipart/mixed; boundary=batchresponse_0cfc6008-1660-46e6-b502-1a55088ad873 + date: Wed, 05 May 2021 16:33:43 GMT + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 202 + message: Accepted + url: https://seankaneprim.table.cosmos.azure.com/$batch +- request: + body: null + headers: + Accept: + - application/json + Date: + - Wed, 05 May 2021 16:33:44 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:44 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable1cb51936') + response: + body: + string: '' + headers: + content-length: '0' + date: Wed, 05 May 2021 16:33:44 GMT + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/Tables('uttable1cb51936') +- request: + body: null + headers: + Accept: + - application/json + Date: + - Wed, 05 May 2021 16:33:45 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:33:45 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable1cb51936') + response: + body: + string: "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\"\ + :\"en-us\",\"value\":\"The specified resource does not exist.\\nRequestID:a8fc35f6-adbf-11eb-b450-002b67128e4c\\\ + n\"}}}\r\n" + headers: + content-type: application/json;odata=fullmetadata + date: Wed, 05 May 2021 16:33:44 GMT + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 404 + message: Not Found + url: https://seankaneprim.table.cosmos.azure.com/Tables('uttable1cb51936') +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_if_match_table_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_if_match_table_entity.yaml new file mode 100644 index 000000000000..f384755f05fe --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_if_match_table_entity.yaml @@ -0,0 +1,278 @@ +interactions: +- request: + body: '{"TableName": "uttablebef617dd"}' + 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: + - Wed, 05 May 2021 17:32:01 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:01 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablebef617dd"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Wed, 05 May 2021 17:32:02 GMT + location: + - https://fake_table_account.table.core.windows.net/Tables('uttablebef617dd') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: '{"PartitionKey": "pkbef617dd", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rkbef617dd", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 17:32:02 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:02 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttablebef617dd + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablebef617dd/@Element","odata.etag":"W/\"datetime''2021-05-05T17%3A32%3A02.5872139Z''\"","PartitionKey":"pkbef617dd","RowKey":"rkbef617dd","Timestamp":"2021-05-05T17:32:02.5872139Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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: + - Wed, 05 May 2021 17:32:02 GMT + etag: + - W/"datetime'2021-05-05T17%3A32%3A02.5872139Z'" + location: + - https://fake_table_account.table.core.windows.net/uttablebef617dd(PartitionKey='pkbef617dd',RowKey='rkbef617dd') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + 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: + - Wed, 05 May 2021 17:32:02 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:02 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttablebef617dd(PartitionKey='pkbef617dd',RowKey='rkbef617dd') + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablebef617dd/@Element","odata.etag":"W/\"datetime''2021-05-05T17%3A32%3A02.5872139Z''\"","PartitionKey":"pkbef617dd","RowKey":"rkbef617dd","Timestamp":"2021-05-05T17:32:02.5872139Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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: + - Wed, 05 May 2021 17:32:02 GMT + etag: + - W/"datetime'2021-05-05T17%3A32%3A02.5872139Z'" + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 17:32:02 GMT + If-Match: + - W/"datetime'2021-05-05T17%3A32%3A02.5872139Z'" + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:02 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttablebef617dd(PartitionKey='pkbef617dd',RowKey='rkbef617dd') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 05 May 2021 17:32:02 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + 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: + - Wed, 05 May 2021 17:32:02 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:02 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttablebef617dd(PartitionKey='pkbef617dd',RowKey='rkbef617dd') + response: + body: + string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The + specified resource does not exist.\nRequestId:80084341-5002-003e-0ed4-414d5b000000\nTime:2021-05-05T17:32:02.9834948Z"}}}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Wed, 05 May 2021 17:32:02 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Wed, 05 May 2021 17:32:02 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:02 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttablebef617dd') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 05 May 2021 17:32:02 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + 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 index d08310b3f150..3d72007589b2 100644 --- 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 @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:08:59 GMT + - Wed, 05 May 2021 16:24:20 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:08:59 GMT + - Wed, 05 May 2021 16:24:20 GMT x-ms-version: - '2019-02-02' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:21 GMT location: - https://fake_table_account.table.core.windows.net/Tables('uttable74691147') server: @@ -51,10 +51,11 @@ interactions: body: '{"PartitionKey": "pk74691147", "PartitionKey@odata.type": "Edm.String", "RowKey": "rk74691147", "RowKey@odata.type": "Edm.String", "age": 39, "sex": "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, - "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "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"}' + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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 @@ -63,33 +64,33 @@ interactions: Connection: - keep-alive Content-Length: - - '577' + - '591' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:21 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:21 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_table_account.table.core.windows.net/uttable74691147 response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable74691147/@Element","odata.etag":"W/\"datetime''2020-12-18T17%3A09%3A00.8060527Z''\"","PartitionKey":"pk74691147","RowKey":"rk74691147","Timestamp":"2020-12-18T17:09:00.8060527Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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://fake_table_account.table.core.windows.net/$metadata#uttable74691147/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A24%3A21.9083855Z''\"","PartitionKey":"pk74691147","RowKey":"rk74691147","Timestamp":"2021-05-05T16:24:21.9083855Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:21 GMT etag: - - W/"datetime'2020-12-18T17%3A09%3A00.8060527Z'" + - W/"datetime'2021-05-05T16%3A24%3A21.9083855Z'" location: - https://fake_table_account.table.core.windows.net/uttable74691147(PartitionKey='pk74691147',RowKey='rk74691147') server: @@ -115,27 +116,27 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:21 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:21 GMT x-ms-version: - '2019-02-02' method: GET uri: https://fake_table_account.table.core.windows.net/uttable74691147(PartitionKey='pk74691147',RowKey='rk74691147') response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable74691147/@Element","odata.etag":"W/\"datetime''2020-12-18T17%3A09%3A00.8060527Z''\"","PartitionKey":"pk74691147","RowKey":"rk74691147","Timestamp":"2020-12-18T17:09:00.8060527Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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://fake_table_account.table.core.windows.net/$metadata#uttable74691147/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A24%3A21.9083855Z''\"","PartitionKey":"pk74691147","RowKey":"rk74691147","Timestamp":"2021-05-05T16:24:21.9083855Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:21 GMT etag: - - W/"datetime'2020-12-18T17%3A09%3A00.8060527Z'" + - W/"datetime'2021-05-05T16%3A24%3A21.9083855Z'" server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -161,13 +162,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:21 GMT If-Match: - - W/"datetime'2020-12-18T17%3A09%3A00.8060527Z'" + - W/"datetime'2021-05-05T16%3A24%3A21.9083855Z'" User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:21 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -181,7 +182,7 @@ interactions: content-length: - '0' date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:21 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: @@ -203,11 +204,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:22 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:22 GMT x-ms-version: - '2019-02-02' method: GET @@ -215,14 +216,14 @@ interactions: response: body: string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The - specified resource does not exist.\nRequestId:c5dae71c-e002-002b-6960-d523d5000000\nTime:2020-12-18T17:09:01.2073392Z"}}}' + specified resource does not exist.\nRequestId:6139d8f0-a002-0067-4ecb-41cad8000000\nTime:2021-05-05T16:24:22.3567036Z"}}}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:22 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -246,11 +247,11 @@ interactions: Content-Length: - '0' Date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:22 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:22 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -264,7 +265,7 @@ interactions: content-length: - '0' date: - - Fri, 18 Dec 2020 17:09:00 GMT + - Wed, 05 May 2021 16:24:22 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_entity_bad_etag.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_entity_bad_etag.yaml new file mode 100644 index 000000000000..4f986c714f51 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_get_entity_if_match_entity_bad_etag.yaml @@ -0,0 +1,337 @@ +interactions: +- request: + body: '{"TableName": "uttablec0a717c9"}' + 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: + - Wed, 05 May 2021 16:24:22 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:22 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablec0a717c9"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Wed, 05 May 2021 16:24:22 GMT + location: + - https://fake_table_account.table.core.windows.net/Tables('uttablec0a717c9') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: '{"PartitionKey": "pkc0a717c9", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rkc0a717c9", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:23 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:23 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttablec0a717c9 + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablec0a717c9/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A24%3A23.3510055Z''\"","PartitionKey":"pkc0a717c9","RowKey":"rkc0a717c9","Timestamp":"2021-05-05T16:24:23.3510055Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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: + - Wed, 05 May 2021 16:24:22 GMT + etag: + - W/"datetime'2021-05-05T16%3A24%3A23.3510055Z'" + location: + - https://fake_table_account.table.core.windows.net/uttablec0a717c9(PartitionKey='pkc0a717c9',RowKey='rkc0a717c9') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: '{"PartitionKey": "pkc0a717c9", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rkc0a717c9", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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", "value": 10}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '604' + Content-Type: + - application/json + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:23 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:23 GMT + x-ms-version: + - '2019-02-02' + method: PATCH + uri: https://fake_table_account.table.core.windows.net/uttablec0a717c9(PartitionKey='pkc0a717c9',RowKey='rkc0a717c9') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 05 May 2021 16:24:22 GMT + etag: + - W/"datetime'2021-05-05T16%3A24%3A23.5411106Z'" + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + 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: + - Wed, 05 May 2021 16:24:23 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:23 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttablec0a717c9(PartitionKey='pkc0a717c9',RowKey='rkc0a717c9') + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablec0a717c9/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A24%3A23.5411106Z''\"","PartitionKey":"pkc0a717c9","RowKey":"rkc0a717c9","Timestamp":"2021-05-05T16:24:23.5411106Z","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","age":39,"binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","deceased":false,"evenratio":3.0,"large":933311100,"married":true,"other":20,"ratio":3.1,"sex":"male","value":10}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Wed, 05 May 2021 16:24:22 GMT + etag: + - W/"datetime'2021-05-05T16%3A24%3A23.5411106Z'" + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:23 GMT + If-Match: + - W/"datetime'2021-05-05T16%3A24%3A23.3510055Z'" + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:23 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttablec0a717c9(PartitionKey='pkc0a717c9',RowKey='rkc0a717c9') + response: + body: + string: '{"odata.error":{"code":"UpdateConditionNotSatisfied","message":{"lang":"en-US","value":"The + update condition specified in the request was not satisfied.\nRequestId:68a8783d-b002-008f-13cb-41534e000000\nTime:2021-05-05T16:24:23.9484302Z"}}}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Wed, 05 May 2021 16:24:23 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 412 + message: Precondition Failed +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:23 GMT + If-Match: + - W/"datetime'2021-05-05T16%3A24%3A23.5411106Z'" + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:23 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttablec0a717c9(PartitionKey='pkc0a717c9',RowKey='rkc0a717c9') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 05 May 2021 16:24:23 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Wed, 05 May 2021 16:24:24 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:24 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttablec0a717c9') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 05 May 2021 16:24:23 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 204 + message: No Content +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 index 4140a3764e0b..a5fb139866b1 100644 --- 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 @@ -11,11 +11,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:10:09 GMT + - Wed, 05 May 2021 16:24:24 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:10:09 GMT + - Wed, 05 May 2021 16:24:24 GMT x-ms-version: - '2019-02-02' method: POST @@ -26,7 +26,7 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Fri, 18 Dec 2020 17:10:09 GMT + date: Wed, 05 May 2021 16:24:24 GMT location: https://fake_table_account.table.core.windows.net/Tables('uttablee60b13c4') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -40,37 +40,38 @@ interactions: body: '{"PartitionKey": "pke60b13c4", "PartitionKey@odata.type": "Edm.String", "RowKey": "rke60b13c4", "RowKey@odata.type": "Edm.String", "age": 39, "sex": "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, - "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "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"}' + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: - - '577' + - '591' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:10:10 GMT + - Wed, 05 May 2021 16:24:24 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:10:10 GMT + - Wed, 05 May 2021 16:24:24 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_table_account.table.core.windows.net/uttablee60b13c4 response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablee60b13c4/@Element","odata.etag":"W/\"datetime''2020-12-18T17%3A10%3A10.6145308Z''\"","PartitionKey":"pke60b13c4","RowKey":"rke60b13c4","Timestamp":"2020-12-18T17:10:10.6145308Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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://fake_table_account.table.core.windows.net/$metadata#uttablee60b13c4/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A24%3A25.1416237Z''\"","PartitionKey":"pke60b13c4","RowKey":"rke60b13c4","Timestamp":"2021-05-05T16:24:25.1416237Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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, 18 Dec 2020 17:10:10 GMT - etag: W/"datetime'2020-12-18T17%3A10%3A10.6145308Z'" + date: Wed, 05 May 2021 16:24:24 GMT + etag: W/"datetime'2021-05-05T16%3A24%3A25.1416237Z'" location: https://fake_table_account.table.core.windows.net/uttablee60b13c4(PartitionKey='pke60b13c4',RowKey='rke60b13c4') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -88,23 +89,23 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:10:10 GMT + - Wed, 05 May 2021 16:24:25 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:10:10 GMT + - Wed, 05 May 2021 16:24:25 GMT x-ms-version: - '2019-02-02' method: GET uri: https://fake_table_account.table.core.windows.net/uttablee60b13c4(PartitionKey='pke60b13c4',RowKey='rke60b13c4') response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablee60b13c4/@Element","odata.etag":"W/\"datetime''2020-12-18T17%3A10%3A10.6145308Z''\"","PartitionKey":"pke60b13c4","RowKey":"rke60b13c4","Timestamp":"2020-12-18T17:10:10.6145308Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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://fake_table_account.table.core.windows.net/$metadata#uttablee60b13c4/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A24%3A25.1416237Z''\"","PartitionKey":"pke60b13c4","RowKey":"rke60b13c4","Timestamp":"2021-05-05T16:24:25.1416237Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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, 18 Dec 2020 17:10:10 GMT - etag: W/"datetime'2020-12-18T17%3A10%3A10.6145308Z'" + date: Wed, 05 May 2021 16:24:24 GMT + etag: W/"datetime'2021-05-05T16%3A24%3A25.1416237Z'" server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff @@ -121,13 +122,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 17:10:10 GMT + - Wed, 05 May 2021 16:24:25 GMT If-Match: - - W/"datetime'2020-12-18T17%3A10%3A10.6145308Z'" + - W/"datetime'2021-05-05T16%3A24%3A25.1416237Z'" User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:10:10 GMT + - Wed, 05 May 2021 16:24:25 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -138,7 +139,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Fri, 18 Dec 2020 17:10:10 GMT + date: Wed, 05 May 2021 16:24:24 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: nosniff x-ms-version: '2019-02-02' @@ -146,17 +147,50 @@ interactions: code: 204 message: No Content url: https://seankaneprim.table.core.windows.net/uttablee60b13c4(PartitionKey='pke60b13c4',RowKey='rke60b13c4') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:25 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:25 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttablee60b13c4(PartitionKey='pke60b13c4',RowKey='rke60b13c4') + response: + body: + string: '{"odata.error":{"code":"ResourceNotFound","message":{"lang":"en-US","value":"The + specified resource does not exist.\nRequestId:ad88b967-e002-0082-32cb-419b9a000000\nTime:2021-05-05T16:24:25.4988783Z"}}}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Wed, 05 May 2021 16:24:25 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 404 + message: Not Found + url: https://seankaneprim.table.core.windows.net/uttablee60b13c4(PartitionKey='pke60b13c4',RowKey='rke60b13c4') - request: body: null headers: Accept: - application/json Date: - - Fri, 18 Dec 2020 17:10:10 GMT + - Wed, 05 May 2021 16:24:25 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 17:10:10 GMT + - Wed, 05 May 2021 16:24:25 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -167,7 +201,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Fri, 18 Dec 2020 17:10:10 GMT + date: Wed, 05 May 2021 16:24:25 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: nosniff x-ms-version: '2019-02-02' diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_if_match_entity_bad_etag.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_if_match_entity_bad_etag.yaml new file mode 100644 index 000000000000..33a9dd808733 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_get_entity_if_match_entity_bad_etag.yaml @@ -0,0 +1,259 @@ +interactions: +- request: + body: '{"TableName": "uttable5a281a46"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:25 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:25 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable5a281a46"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Wed, 05 May 2021 16:24:25 GMT + location: https://fake_table_account.table.core.windows.net/Tables('uttable5a281a46') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://seankaneprim.table.core.windows.net/Tables +- request: + body: '{"PartitionKey": "pk5a281a46", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk5a281a46", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:26 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:26 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttable5a281a46 + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable5a281a46/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A24%3A26.2907826Z''\"","PartitionKey":"pk5a281a46","RowKey":"rk5a281a46","Timestamp":"2021-05-05T16:24:26.2907826Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"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: Wed, 05 May 2021 16:24:25 GMT + etag: W/"datetime'2021-05-05T16%3A24%3A26.2907826Z'" + location: https://fake_table_account.table.core.windows.net/uttable5a281a46(PartitionKey='pk5a281a46',RowKey='rk5a281a46') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://seankaneprim.table.core.windows.net/uttable5a281a46 +- request: + body: '{"PartitionKey": "pk5a281a46", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk5a281a46", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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", "value": 10}' + headers: + Accept: + - application/json + Content-Length: + - '604' + Content-Type: + - application/json + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:26 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:26 GMT + x-ms-version: + - '2019-02-02' + method: PATCH + uri: https://fake_table_account.table.core.windows.net/uttable5a281a46(PartitionKey='pk5a281a46',RowKey='rk5a281a46') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Wed, 05 May 2021 16:24:25 GMT + etag: W/"datetime'2021-05-05T16%3A24%3A26.4201528Z'" + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/uttable5a281a46(PartitionKey='pk5a281a46',RowKey='rk5a281a46') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:26 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:26 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttable5a281a46(PartitionKey='pk5a281a46',RowKey='rk5a281a46') + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable5a281a46/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A24%3A26.4201528Z''\"","PartitionKey":"pk5a281a46","RowKey":"rk5a281a46","Timestamp":"2021-05-05T16:24:26.4201528Z","Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","age":39,"binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","deceased":false,"evenratio":3.0,"large":933311100,"married":true,"other":20,"ratio":3.1,"sex":"male","value":10}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Wed, 05 May 2021 16:24:25 GMT + etag: W/"datetime'2021-05-05T16%3A24%3A26.4201528Z'" + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: https://seankaneprim.table.core.windows.net/uttable5a281a46(PartitionKey='pk5a281a46',RowKey='rk5a281a46') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:26 GMT + If-Match: + - W/"datetime'2021-05-05T16%3A24%3A26.2907826Z'" + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:26 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttable5a281a46(PartitionKey='pk5a281a46',RowKey='rk5a281a46') + response: + body: + string: '{"odata.error":{"code":"UpdateConditionNotSatisfied","message":{"lang":"en-US","value":"The + update condition specified in the request was not satisfied.\nRequestId:d810e24d-1002-0096-5acb-41d3f5000000\nTime:2021-05-05T16:24:26.6660521Z"}}}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Wed, 05 May 2021 16:24:25 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 412 + message: Precondition Failed + url: https://seankaneprim.table.core.windows.net/uttable5a281a46(PartitionKey='pk5a281a46',RowKey='rk5a281a46') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:24:26 GMT + If-Match: + - W/"datetime'2021-05-05T16%3A24%3A26.4201528Z'" + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:26 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttable5a281a46(PartitionKey='pk5a281a46',RowKey='rk5a281a46') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Wed, 05 May 2021 16:24:25 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/uttable5a281a46(PartitionKey='pk5a281a46',RowKey='rk5a281a46') +- request: + body: null + headers: + Accept: + - application/json + Date: + - Wed, 05 May 2021 16:24:26 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:26 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttable5a281a46') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Wed, 05 May 2021 16:24:25 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/Tables('uttable5a281a46') +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_if_match_table_entity.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_if_match_table_entity.yaml new file mode 100644 index 000000000000..e3a4dc019cbc --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_if_match_table_entity.yaml @@ -0,0 +1,281 @@ +interactions: +- request: + body: '{"TableName": "uttable75661ad0"}' + 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: + - Wed, 05 May 2021 17:32:03 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:03 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttable75661ad0","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 17:32:03 GMT + etag: + - W/"datetime'2021-05-05T17%3A32%3A04.0869896Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable75661ad0') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Ok +- request: + body: '{"PartitionKey": "pk75661ad0", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk75661ad0", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 17:32:04 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:04 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable75661ad0 + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable75661ad0/$metadata#uttable75661ad0/@Element","odata.etag":"W/\"datetime''2021-05-05T17%3A32%3A04.6855176Z''\"","PartitionKey":"pk75661ad0","RowKey":"rk75661ad0","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T17:32:04.6855176Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 17:32:03 GMT + etag: + - W/"datetime'2021-05-05T17%3A32%3A04.6855176Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/uttable75661ad0(PartitionKey='pk75661ad0',RowKey='rk75661ad0') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + 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: + - Wed, 05 May 2021 17:32:04 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:04 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable75661ad0(PartitionKey='pk75661ad0',RowKey='rk75661ad0') + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable75661ad0/$metadata#uttable75661ad0/@Element","odata.etag":"W/\"datetime''2021-05-05T17%3A32%3A04.6855176Z''\"","PartitionKey":"pk75661ad0","RowKey":"rk75661ad0","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T17:32:04.6855176Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 17:32:03 GMT + etag: + - W/"datetime'2021-05-05T17%3A32%3A04.6855176Z'" + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 17:32:04 GMT + If-Match: + - W/"datetime'2021-05-05T17%3A32%3A04.6855176Z'" + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:04 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable75661ad0(PartitionKey='pk75661ad0',RowKey='rk75661ad0') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 05 May 2021 17:32:05 GMT + server: + - Microsoft-HTTPAPI/2.0 + 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: + - Wed, 05 May 2021 17:32:04 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:04 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable75661ad0(PartitionKey='pk75661ad0',RowKey='rk75661ad0') + response: + body: + string: "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\"\ + :\"en-us\",\"value\":\"The specified resource does not exist.\\nRequestID:cf160c34-adc7-11eb-bc48-002b67128e4c\\\ + n\"}}}\r\n" + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 17:32:05 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Wed, 05 May 2021 17:32:05 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:05 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable75661ad0') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 05 May 2021 17:32:05 GMT + server: + - Microsoft-HTTPAPI/2.0 + 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: + - Wed, 05 May 2021 17:32:05 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 17:32:05 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"value":[],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 17:32:05 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 200 + message: Ok +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_get_entity_if_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_get_entity_if_match.yaml index 2c9f9239df60..8de633ecfed3 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_get_entity_if_match.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_get_entity_if_match.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 16:16:34 GMT + - Wed, 05 May 2021 16:24:26 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:16:34 GMT + - Wed, 05 May 2021 16:24:26 GMT x-ms-version: - '2019-02-02' method: POST @@ -31,9 +31,9 @@ interactions: content-type: - application/json;odata=minimalmetadata date: - - Fri, 18 Dec 2020 16:16:35 GMT + - Wed, 05 May 2021 16:24:27 GMT etag: - - W/"datetime'2020-12-18T16%3A16%3A35.8857736Z'" + - W/"datetime'2021-05-05T16%3A24%3A28.2543112Z'" location: - https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttablefb9a143a') server: @@ -47,10 +47,11 @@ interactions: body: '{"PartitionKey": "pkfb9a143a", "PartitionKey@odata.type": "Edm.String", "RowKey": "rkfb9a143a", "RowKey@odata.type": "Edm.String", "age": 39, "sex": "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, - "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "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"}' + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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 @@ -59,31 +60,31 @@ interactions: Connection: - keep-alive Content-Length: - - '577' + - '591' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:28 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:28 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablefb9a143a response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablefb9a143a/$metadata#uttablefb9a143a/@Element","odata.etag":"W/\"datetime''2020-12-18T16%3A16%3A36.6765064Z''\"","PartitionKey":"pkfb9a143a","RowKey":"rkfb9a143a","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2020-12-18T16:16:36.6765064Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablefb9a143a/$metadata#uttablefb9a143a/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A24%3A28.8490504Z''\"","PartitionKey":"pkfb9a143a","RowKey":"rkfb9a143a","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T16:24:28.8490504Z"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Fri, 18 Dec 2020 16:16:35 GMT + - Wed, 05 May 2021 16:24:28 GMT etag: - - W/"datetime'2020-12-18T16%3A16%3A36.6765064Z'" + - W/"datetime'2021-05-05T16%3A24%3A28.8490504Z'" location: - https://fake_cosmos_account.table.cosmos.azure.com/uttablefb9a143a(PartitionKey='pkfb9a143a',RowKey='rkfb9a143a') server: @@ -105,25 +106,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:28 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:28 GMT x-ms-version: - '2019-02-02' method: GET uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablefb9a143a(PartitionKey='pkfb9a143a',RowKey='rkfb9a143a') response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablefb9a143a/$metadata#uttablefb9a143a/@Element","odata.etag":"W/\"datetime''2020-12-18T16%3A16%3A36.6765064Z''\"","PartitionKey":"pkfb9a143a","RowKey":"rkfb9a143a","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2020-12-18T16:16:36.6765064Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablefb9a143a/$metadata#uttablefb9a143a/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A24%3A28.8490504Z''\"","PartitionKey":"pkfb9a143a","RowKey":"rkfb9a143a","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T16:24:28.8490504Z"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:28 GMT etag: - - W/"datetime'2020-12-18T16%3A16%3A36.6765064Z'" + - W/"datetime'2021-05-05T16%3A24%3A28.8490504Z'" server: - Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -145,13 +146,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:28 GMT If-Match: - - W/"datetime'2020-12-18T16%3A16%3A36.6765064Z'" + - W/"datetime'2021-05-05T16%3A24%3A28.8490504Z'" User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:28 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -163,12 +164,50 @@ interactions: content-length: - '0' date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:28 GMT server: - Microsoft-HTTPAPI/2.0 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: + - Wed, 05 May 2021 16:24:29 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:24:29 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablefb9a143a(PartitionKey='pkfb9a143a',RowKey='rkfb9a143a') + response: + body: + string: "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\"\ + :\"en-us\",\"value\":\"The specified resource does not exist.\\nRequestID:5da68309-adbe-11eb-b79c-002b67128e4c\\\ + n\"}}}\r\n" + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 16:24:28 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 404 + message: Not Found - request: body: null headers: @@ -181,11 +220,11 @@ interactions: Content-Length: - '0' Date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:29 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:29 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -197,7 +236,7 @@ interactions: content-length: - '0' date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:29 GMT server: - Microsoft-HTTPAPI/2.0 status: @@ -215,11 +254,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:29 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:29 GMT x-ms-version: - '2019-02-02' method: GET @@ -231,7 +270,7 @@ interactions: content-type: - application/json;odata=minimalmetadata date: - - Fri, 18 Dec 2020 16:16:36 GMT + - Wed, 05 May 2021 16:24:29 GMT server: - Microsoft-HTTPAPI/2.0 transfer-encoding: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_get_entity_if_match_entity_bad_etag.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_get_entity_if_match_entity_bad_etag.yaml new file mode 100644 index 000000000000..dcbc7c402f0e --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_get_entity_if_match_entity_bad_etag.yaml @@ -0,0 +1,337 @@ +interactions: +- request: + body: '{"TableName": "uttable77171abc"}' + 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: + - Wed, 05 May 2021 16:25:00 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:00 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttable77171abc","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 16:25:01 GMT + etag: + - W/"datetime'2021-05-05T16%3A25%3A01.5590920Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable77171abc') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Ok +- request: + body: '{"PartitionKey": "pk77171abc", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk77171abc", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:01 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:01 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable77171abc + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable77171abc/$metadata#uttable77171abc/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A25%3A02.3135752Z''\"","PartitionKey":"pk77171abc","RowKey":"rk77171abc","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T16:25:02.3135752Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 16:25:01 GMT + etag: + - W/"datetime'2021-05-05T16%3A25%3A02.3135752Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/uttable77171abc(PartitionKey='pk77171abc',RowKey='rk77171abc') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Created +- request: + body: '{"PartitionKey": "pk77171abc", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk77171abc", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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", "value": 10}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '604' + Content-Type: + - application/json + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:02 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + X-HTTP-Method: + - MERGE + x-ms-date: + - Wed, 05 May 2021 16:25:02 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable77171abc(PartitionKey='pk77171abc',RowKey='rk77171abc') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 05 May 2021 16:25:01 GMT + etag: + - W/"datetime'2021-05-05T16%3A25%3A02.4931848Z'" + server: + - Microsoft-HTTPAPI/2.0 + 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: + - Wed, 05 May 2021 16:25:02 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:02 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable77171abc(PartitionKey='pk77171abc',RowKey='rk77171abc') + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable77171abc/$metadata#uttable77171abc/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A25%3A02.4931848Z''\"","PartitionKey":"pk77171abc","RowKey":"rk77171abc","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","value":10,"Timestamp":"2021-05-05T16:25:02.4931848Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 16:25:02 GMT + etag: + - W/"datetime'2021-05-05T16%3A25%3A02.4931848Z'" + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:02 GMT + If-Match: + - W/"datetime'2021-05-05T16%3A25%3A02.3135752Z'" + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:02 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable77171abc(PartitionKey='pk77171abc',RowKey='rk77171abc') + response: + body: + string: "{\"odata.error\":{\"code\":\"UpdateConditionNotSatisfied\",\"message\"\ + :{\"lang\":\"en-us\",\"value\":\"The update condition specified in the request\ + \ was not satisfied.\\nRequestID:7193cf50-adbe-11eb-b547-002b67128e4c\\n\"\ + }}}\r\n" + headers: + content-type: + - application/json;odata=fullmetadata + date: + - Wed, 05 May 2021 16:25:02 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 412 + message: Precondition Failed +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:02 GMT + If-Match: + - W/"datetime'2021-05-05T16%3A25%3A02.4931848Z'" + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:02 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable77171abc(PartitionKey='pk77171abc',RowKey='rk77171abc') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 05 May 2021 16:25:02 GMT + server: + - Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Wed, 05 May 2021 16:25:02 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:02 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable77171abc') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 05 May 2021 16:25:02 GMT + server: + - Microsoft-HTTPAPI/2.0 + 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: + - Wed, 05 May 2021 16:25:03 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:03 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"value":[],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Wed, 05 May 2021 16:25:02 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 200 + message: Ok +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_get_entity_if_match.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_get_entity_if_match.yaml index 4058e4fd0659..1c952f78e7e6 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_get_entity_if_match.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_get_entity_if_match.yaml @@ -11,11 +11,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 16:38:03 GMT + - Wed, 05 May 2021 16:25:03 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:38:03 GMT + - Wed, 05 May 2021 16:25:03 GMT x-ms-version: - '2019-02-02' method: POST @@ -25,8 +25,8 @@ interactions: string: '{"TableName":"uttable7efd16b7","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' headers: content-type: application/json;odata=minimalmetadata - date: Fri, 18 Dec 2020 16:38:05 GMT - etag: W/"datetime'2020-12-18T16%3A38%3A04.5862920Z'" + date: Wed, 05 May 2021 16:25:04 GMT + etag: W/"datetime'2021-05-05T16%3A25%3A04.8830984Z'" location: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable7efd16b7') server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -38,36 +38,37 @@ interactions: body: '{"PartitionKey": "pk7efd16b7", "PartitionKey@odata.type": "Edm.String", "RowKey": "rk7efd16b7", "RowKey@odata.type": "Edm.String", "age": 39, "sex": "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, - "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "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"}' + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: - - '577' + - '591' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 16:38:04 GMT + - Wed, 05 May 2021 16:25:05 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:38:04 GMT + - Wed, 05 May 2021 16:25:05 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable7efd16b7 response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable7efd16b7/$metadata#uttable7efd16b7/@Element","odata.etag":"W/\"datetime''2020-12-18T16%3A38%3A05.3393416Z''\"","PartitionKey":"pk7efd16b7","RowKey":"rk7efd16b7","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2020-12-18T16:38:05.3393416Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable7efd16b7/$metadata#uttable7efd16b7/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A25%3A05.6163848Z''\"","PartitionKey":"pk7efd16b7","RowKey":"rk7efd16b7","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T16:25:05.6163848Z"}' headers: content-type: application/json;odata=minimalmetadata - date: Fri, 18 Dec 2020 16:38:05 GMT - etag: W/"datetime'2020-12-18T16%3A38%3A05.3393416Z'" + date: Wed, 05 May 2021 16:25:04 GMT + etag: W/"datetime'2021-05-05T16%3A25%3A05.6163848Z'" location: https://fake_cosmos_account.table.cosmos.azure.com/uttable7efd16b7(PartitionKey='pk7efd16b7',RowKey='rk7efd16b7') server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -83,22 +84,22 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 16:38:05 GMT + - Wed, 05 May 2021 16:25:05 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:38:05 GMT + - Wed, 05 May 2021 16:25:05 GMT x-ms-version: - '2019-02-02' method: GET uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable7efd16b7(PartitionKey='pk7efd16b7',RowKey='rk7efd16b7') response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable7efd16b7/$metadata#uttable7efd16b7/@Element","odata.etag":"W/\"datetime''2020-12-18T16%3A38%3A05.3393416Z''\"","PartitionKey":"pk7efd16b7","RowKey":"rk7efd16b7","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2020-12-18T16:38:05.3393416Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable7efd16b7/$metadata#uttable7efd16b7/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A25%3A05.6163848Z''\"","PartitionKey":"pk7efd16b7","RowKey":"rk7efd16b7","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T16:25:05.6163848Z"}' headers: content-type: application/json;odata=minimalmetadata - date: Fri, 18 Dec 2020 16:38:05 GMT - etag: W/"datetime'2020-12-18T16%3A38%3A05.3393416Z'" + date: Wed, 05 May 2021 16:25:04 GMT + etag: W/"datetime'2021-05-05T16%3A25%3A05.6163848Z'" server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked status: @@ -113,13 +114,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Fri, 18 Dec 2020 16:38:05 GMT + - Wed, 05 May 2021 16:25:05 GMT If-Match: - - W/"datetime'2020-12-18T16%3A38%3A05.3393416Z'" + - W/"datetime'2021-05-05T16%3A25%3A05.6163848Z'" User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:38:05 GMT + - Wed, 05 May 2021 16:25:05 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -129,23 +130,54 @@ interactions: string: '' headers: content-length: '0' - date: Fri, 18 Dec 2020 16:38:05 GMT + date: Wed, 05 May 2021 16:25:04 GMT server: Microsoft-HTTPAPI/2.0 status: code: 204 message: No Content url: https://seankaneprim.table.cosmos.azure.com/uttable7efd16b7(PartitionKey='pk7efd16b7',RowKey='rk7efd16b7') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:05 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:05 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable7efd16b7(PartitionKey='pk7efd16b7',RowKey='rk7efd16b7') + response: + body: + string: "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\"\ + :\"en-us\",\"value\":\"The specified resource does not exist.\\nRequestID:7377f4f6-adbe-11eb-a3be-002b67128e4c\\\ + n\"}}}\r\n" + headers: + content-type: application/json;odata=minimalmetadata + date: Wed, 05 May 2021 16:25:05 GMT + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 404 + message: Not Found + url: https://seankaneprim.table.cosmos.azure.com/uttable7efd16b7(PartitionKey='pk7efd16b7',RowKey='rk7efd16b7') - request: body: null headers: Accept: - application/json Date: - - Fri, 18 Dec 2020 16:38:05 GMT + - Wed, 05 May 2021 16:25:05 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Fri, 18 Dec 2020 16:38:05 GMT + - Wed, 05 May 2021 16:25:05 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -155,7 +187,7 @@ interactions: string: '' headers: content-length: '0' - date: Fri, 18 Dec 2020 16:38:05 GMT + date: Wed, 05 May 2021 16:25:05 GMT server: Microsoft-HTTPAPI/2.0 status: code: 204 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_get_entity_if_match_entity_bad_etag.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_get_entity_if_match_entity_bad_etag.yaml new file mode 100644 index 000000000000..02a0c53b0e8f --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_get_entity_if_match_entity_bad_etag.yaml @@ -0,0 +1,243 @@ +interactions: +- request: + body: '{"TableName": "uttable224a1d39"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:36 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:36 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttable224a1d39","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Wed, 05 May 2021 16:25:37 GMT + etag: W/"datetime'2021-05-05T16%3A25%3A37.6236552Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable224a1d39') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Ok + url: https://seankaneprim.table.cosmos.azure.com/Tables +- request: + body: '{"PartitionKey": "pk224a1d39", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk224a1d39", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:37 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:37 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable224a1d39 + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable224a1d39/$metadata#uttable224a1d39/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A25%3A38.2396936Z''\"","PartitionKey":"pk224a1d39","RowKey":"rk224a1d39","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-05T16:25:38.2396936Z"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Wed, 05 May 2021 16:25:37 GMT + etag: W/"datetime'2021-05-05T16%3A25%3A38.2396936Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/uttable224a1d39(PartitionKey='pk224a1d39',RowKey='rk224a1d39') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Created + url: https://seankaneprim.table.cosmos.azure.com/uttable224a1d39 +- request: + body: '{"PartitionKey": "pk224a1d39", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk224a1d39", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "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", "value": 10}' + headers: + Accept: + - application/json + Content-Length: + - '604' + Content-Type: + - application/json + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:38 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + X-HTTP-Method: + - MERGE + x-ms-date: + - Wed, 05 May 2021 16:25:38 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable224a1d39(PartitionKey='pk224a1d39',RowKey='rk224a1d39') + response: + body: + string: '' + headers: + content-length: '0' + date: Wed, 05 May 2021 16:25:37 GMT + etag: W/"datetime'2021-05-05T16%3A25%3A38.3818248Z'" + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/uttable224a1d39(PartitionKey='pk224a1d39',RowKey='rk224a1d39') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:38 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:38 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable224a1d39(PartitionKey='pk224a1d39',RowKey='rk224a1d39') + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable224a1d39/$metadata#uttable224a1d39/@Element","odata.etag":"W/\"datetime''2021-05-05T16%3A25%3A38.3818248Z''\"","PartitionKey":"pk224a1d39","RowKey":"rk224a1d39","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","value":10,"Timestamp":"2021-05-05T16:25:38.3818248Z"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Wed, 05 May 2021 16:25:37 GMT + etag: W/"datetime'2021-05-05T16%3A25%3A38.3818248Z'" + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 200 + message: Ok + url: https://seankaneprim.table.cosmos.azure.com/uttable224a1d39(PartitionKey='pk224a1d39',RowKey='rk224a1d39') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:38 GMT + If-Match: + - W/"datetime'2021-05-05T16%3A25%3A38.2396936Z'" + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:38 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable224a1d39(PartitionKey='pk224a1d39',RowKey='rk224a1d39') + response: + body: + string: "{\"odata.error\":{\"code\":\"UpdateConditionNotSatisfied\",\"message\"\ + :{\"lang\":\"en-us\",\"value\":\"The update condition specified in the request\ + \ was not satisfied.\\nRequestID:86f0b5c2-adbe-11eb-8cc3-002b67128e4c\\n\"\ + }}}\r\n" + headers: + content-type: application/json;odata=fullmetadata + date: Wed, 05 May 2021 16:25:38 GMT + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 412 + message: Precondition Failed + url: https://seankaneprim.table.cosmos.azure.com/uttable224a1d39(PartitionKey='pk224a1d39',RowKey='rk224a1d39') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Wed, 05 May 2021 16:25:38 GMT + If-Match: + - W/"datetime'2021-05-05T16%3A25%3A38.3818248Z'" + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:38 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable224a1d39(PartitionKey='pk224a1d39',RowKey='rk224a1d39') + response: + body: + string: '' + headers: + content-length: '0' + date: Wed, 05 May 2021 16:25:38 GMT + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/uttable224a1d39(PartitionKey='pk224a1d39',RowKey='rk224a1d39') +- request: + body: null + headers: + Accept: + - application/json + Date: + - Wed, 05 May 2021 16:25:38 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Wed, 05 May 2021 16:25:38 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable224a1d39') + response: + body: + string: '' + headers: + content-length: '0' + date: Wed, 05 May 2021 16:25:38 GMT + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/Tables('uttable224a1d39') +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/test_table_batch.py b/sdk/tables/azure-data-tables/tests/test_table_batch.py index 97cf32cba1eb..6fe8bf82407b 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_batch.py +++ b/sdk/tables/azure-data-tables/tests/test_table_batch.py @@ -792,6 +792,32 @@ def test_new_delete_nonexistent_entity(self, tables_storage_account_name, tables finally: self._tear_down() + @pytest.mark.skipif(sys.version_info < (3, 0), reason="requires Python3") + @tables_decorator + def test_delete_batch_with_bad_kwarg(self, tables_storage_account_name, tables_primary_storage_account_key): + # Arrange + self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity = self._create_random_entity_dict('001', 'batch_negative_1') + self.table.create_entity(entity) + + received = self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + good_etag = received.metadata["etag"] + received.metadata["etag"] = u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"' + + batch = [('delete', received, {"match_condition": MatchConditions.IfNotModified})] + + with pytest.raises(TableTransactionError): + self.table.submit_transaction(batch) + + received.metadata["etag"] = good_etag + batch = [('delete', received, {"match_condition": MatchConditions.IfNotModified})] + resp = self.table.submit_transaction(batch) + + assert resp is not None + finally: + self._tear_down() + @pytest.mark.skipif(sys.version_info < (3, 0), reason="requires Python3") @pytest.mark.live_test_only @tables_decorator diff --git a/sdk/tables/azure-data-tables/tests/test_table_batch_async.py b/sdk/tables/azure-data-tables/tests/test_table_batch_async.py index 1588bc38c9cb..5be870c48547 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_batch_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_batch_async.py @@ -760,3 +760,29 @@ async def test_batch_request_too_large(self, tables_storage_account_name, tables finally: await self._tear_down() + @pytest.mark.skipif(sys.version_info < (3, 0), reason="requires Python3") + @tables_decorator_async + async def test_delete_batch_with_bad_kwarg(self, tables_storage_account_name, tables_primary_storage_account_key): + # Arrange + await self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity = self._create_random_entity_dict('001', 'batch_negative_1') + await self.table.create_entity(entity) + + received = await self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + good_etag = received.metadata["etag"] + received.metadata["etag"] = u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"' + + batch = [('delete', received, {"match_condition": MatchConditions.IfNotModified})] + + with pytest.raises(TableTransactionError): + await self.table.submit_transaction(batch) + + received.metadata["etag"] = good_etag + batch = [('delete', received, {"match_condition": MatchConditions.IfNotModified})] + resp = await self.table.submit_transaction(batch) + + assert resp is not None + finally: + await self._tear_down() + diff --git a/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos.py b/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos.py index aa0874eeb4ba..0627bd8399a8 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos.py +++ b/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos.py @@ -584,6 +584,32 @@ def test_new_delete_nonexistent_entity(self, tables_cosmos_account_name, tables_ finally: self._tear_down() + @pytest.mark.skipif(sys.version_info < (3, 0), reason="requires Python3") + @cosmos_decorator + def test_delete_batch_with_bad_kwarg(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # Arrange + self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity = self._create_random_entity_dict('001', 'batch_negative_1') + self.table.create_entity(entity) + + received = self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + good_etag = received.metadata["etag"] + received.metadata["etag"] = u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"' + + batch = [('delete', received, {"match_condition": MatchConditions.IfNotModified})] + + with pytest.raises(TableTransactionError): + self.table.submit_transaction(batch) + + received.metadata["etag"] = good_etag + batch = [('delete', received, {"match_condition": MatchConditions.IfNotModified})] + resp = self.table.submit_transaction(batch) + + assert resp is not None + finally: + self._tear_down() + @pytest.mark.skipif(sys.version_info < (3, 0), reason="requires Python3") @pytest.mark.live_test_only # Request bodies are very large @cosmos_decorator diff --git a/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos_async.py b/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos_async.py index 94a0074ef208..a80413e173f4 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos_async.py @@ -665,3 +665,29 @@ async def test_batch_request_too_large(self, tables_cosmos_account_name, tables_ finally: await self._tear_down() + @pytest.mark.skipif(sys.version_info < (3, 0), reason="requires Python3") + @cosmos_decorator_async + async def test_delete_batch_with_bad_kwarg(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # Arrange + await self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity = self._create_random_entity_dict('001', 'batch_negative_1') + await self.table.create_entity(entity) + + received = await self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + good_etag = received.metadata["etag"] + received.metadata["etag"] = u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"' + + batch = [('delete', received, {"match_condition": MatchConditions.IfNotModified})] + + with pytest.raises(TableTransactionError): + await self.table.submit_transaction(batch) + + received.metadata["etag"] = good_etag + batch = [('delete', received, {"match_condition": MatchConditions.IfNotModified})] + resp = await self.table.submit_transaction(batch) + + assert resp is not None + finally: + await self._tear_down() + diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity.py b/sdk/tables/azure-data-tables/tests/test_table_entity.py index 136e66fbf8ea..001d4880d59e 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity.py @@ -898,23 +898,69 @@ def test_get_entity_if_match(self, tables_storage_account_name, tables_primary_s 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']) + entity = self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) self.table.delete_entity( - {"PartitionKey": resp['PartitionKey'], "RowKey": resp['RowKey']}, + entity, etag=etag, match_condition=MatchConditions.IfNotModified ) with pytest.raises(ResourceNotFoundError): - resp = self.table.get_entity(partition_key=entity['PartitionKey'], - row_key=entity['RowKey']) + self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) + finally: + self._tear_down() - # Assert + @tables_decorator + def test_get_entity_if_match_entity_bad_etag(self, tables_storage_account_name, tables_primary_storage_account_key): + # Arrange + self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity, old_etag = self._insert_random_entity() + + entity["value"] = 10 + self.table.update_entity(entity) + + # Get Entity and set old etag + e = self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + new_etag = e.metadata["etag"] + e.metadata["etag"] = old_etag + + with pytest.raises(HttpResponseError): + self.table.delete_entity(e, match_condition=MatchConditions.IfNotModified) + + # Try delete with correct etag + self.table.delete_entity(e, etag=new_etag, match_condition=MatchConditions.IfNotModified) + + finally: + self._tear_down() + + @tables_decorator + def test_delete_entity_if_match_table_entity(self, tables_storage_account_name, tables_primary_storage_account_key): + # Arrange + self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity, etag = self._insert_random_entity() + table_entity = TableEntity(**entity) + + entity = self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) + + with pytest.raises(ValueError): + self.table.delete_entity(table_entity, match_condition=MatchConditions.IfNotModified) + + self.table.delete_entity(table_entity, etag=etag, match_condition=MatchConditions.IfNotModified) + + with pytest.raises(ResourceNotFoundError): + self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) finally: self._tear_down() 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 index e5caba04a829..2fb03808c62a 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py @@ -629,21 +629,71 @@ async def test_get_entity_if_match(self, tables_storage_account_name, tables_pri 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']) + entity = await self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) await self.table.delete_entity( - {"PartitionKey": resp['PartitionKey'], "RowKey": resp['RowKey']}, + entity, etag=etag, match_condition=MatchConditions.IfNotModified ) - # Assert + with pytest.raises(ResourceNotFoundError): + await self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) + finally: + await self._tear_down() + + @tables_decorator_async + async def test_get_entity_if_match_entity_bad_etag(self, tables_storage_account_name, tables_primary_storage_account_key): + # Arrange + await self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity, old_etag = await self._insert_random_entity() + + entity["value"] = 10 + await self.table.update_entity(entity) + + # Get Entity and set old etag + e = await self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + new_etag = e.metadata["etag"] + e.metadata["etag"] = old_etag + + with pytest.raises(HttpResponseError): + await self.table.delete_entity(e, match_condition=MatchConditions.IfNotModified) + + # Try delete with correct etag + await self.table.delete_entity(e, etag=new_etag, match_condition=MatchConditions.IfNotModified) + finally: await self._tear_down() + @tables_decorator_async + async def test_delete_entity_if_match_table_entity(self, tables_storage_account_name, tables_primary_storage_account_key): + # Arrange + await self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity, etag = await self._insert_random_entity() + table_entity = TableEntity(**entity) + + entity = await self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) + + with pytest.raises(ValueError): + await self.table.delete_entity(table_entity, match_condition=MatchConditions.IfNotModified) + + await self.table.delete_entity(table_entity, etag=etag, match_condition=MatchConditions.IfNotModified) + + with pytest.raises(ResourceNotFoundError): + await self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + + finally: + self._tear_down() @tables_decorator_async async def test_get_entity_full_metadata(self, tables_storage_account_name, tables_primary_storage_account_key): diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py index f1933620933a..d731b44c97f5 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py @@ -858,23 +858,73 @@ def test_get_entity_if_match(self, tables_cosmos_account_name, tables_primary_co 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']) + entity = self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) self.table.delete_entity( - {"PartitionKey": resp['PartitionKey'], "RowKey": resp['RowKey']}, + entity, etag=etag, match_condition=MatchConditions.IfNotModified ) - # Assert + with pytest.raises(ResourceNotFoundError): + self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) finally: self._tear_down() self.sleep(SLEEP_DELAY) + @cosmos_decorator + def test_get_entity_if_match_entity_bad_etag(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # Arrange + self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity, old_etag = self._insert_random_entity() + + entity["value"] = 10 + self.table.update_entity(entity) + + # Get Entity and set old etag + e = self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + new_etag = e.metadata["etag"] + e.metadata["etag"] = old_etag + + with pytest.raises(HttpResponseError): + self.table.delete_entity(e, match_condition=MatchConditions.IfNotModified) + + # Try delete with correct etag + self.table.delete_entity(e, etag=new_etag, match_condition=MatchConditions.IfNotModified) + + finally: + self._tear_down() + + @cosmos_decorator + def test_delete_entity_if_match_table_entity(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # Arrange + self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity, etag = self._insert_random_entity() + table_entity = TableEntity(**entity) + + entity = self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) + + with pytest.raises(ValueError): + self.table.delete_entity(table_entity, match_condition=MatchConditions.IfNotModified) + + self.table.delete_entity(table_entity, etag=etag, match_condition=MatchConditions.IfNotModified) + + with pytest.raises(ResourceNotFoundError): + self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + finally: + self._tear_down() + @cosmos_decorator def test_get_entity_full_metadata(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): # Arrange diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py index c5e013598fcd..f661514a37f4 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py @@ -597,20 +597,73 @@ async def test_get_entity_if_match(self, tables_cosmos_account_name, tables_prim try: entity, etag = await self._insert_random_entity() - # Act - resp = await self.table.get_entity(partition_key=entity['PartitionKey'], - row_key=entity['RowKey']) + entity = await self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) await self.table.delete_entity( - {"PartitionKey": resp['PartitionKey'], "RowKey": resp['RowKey']}, + entity, etag=etag, match_condition=MatchConditions.IfNotModified ) - # Assert + with pytest.raises(ResourceNotFoundError): + await self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) finally: await self._tear_down() + @cosmos_decorator_async + async def test_get_entity_if_match_entity_bad_etag(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # Arrange + await self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity, old_etag = await self._insert_random_entity() + + entity["value"] = 10 + await self.table.update_entity(entity) + + # Get Entity and set old etag + e = await self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + new_etag = e.metadata["etag"] + e.metadata["etag"] = old_etag + + with pytest.raises(HttpResponseError): + await self.table.delete_entity(e, match_condition=MatchConditions.IfNotModified) + + # Try delete with correct etag + await self.table.delete_entity(e, etag=new_etag, match_condition=MatchConditions.IfNotModified) + + finally: + await self._tear_down() + + @cosmos_decorator_async + async def test_delete_entity_if_match_table_entity(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # Arrange + await self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity, etag = await self._insert_random_entity() + table_entity = TableEntity(**entity) + + entity = await self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) + + with pytest.raises(ValueError): + await self.table.delete_entity(table_entity, match_condition=MatchConditions.IfNotModified) + + await self.table.delete_entity(table_entity, etag=etag, match_condition=MatchConditions.IfNotModified) + + with pytest.raises(ResourceNotFoundError): + await self.table.get_entity(entity["PartitionKey"], entity["RowKey"]) + + finally: + self._tear_down() + @cosmos_decorator_async async def test_get_entity_full_metadata(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): # Arrange diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py index 37658af05c62..5aa5b37c1a00 100644 --- a/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/recording_processors.py @@ -216,6 +216,7 @@ def process_response(self, response): body = response['body']['string'] response['body']['string'].decode('utf8', 'backslashreplace').replace(old, new).encode('utf8', 'backslashreplace') self.replace_header(response, 'location', old, new) + self.replace_header(response, 'operation-location', old, new) self.replace_header(response, 'azure-asyncoperation', old, new) return response