From 79550a8ff9fd3a7450a7d5d432f24784dea64a7c Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 29 Jul 2019 11:12:32 -0700 Subject: [PATCH] Update to preview7.19362.9 packages (#7037) --- eng/Packages.Data.props | 8 ++++---- .../src/ConfigurationSettingParser.cs | 4 ++-- .../tests/TestFramework/RecordEntry.cs | 14 +++++++------- .../src/ManagedIdentityClient.cs | 4 ++-- .../src/CertificateAttributes.cs | 8 ++++---- .../src/Page.cs | 2 +- .../tests/Shared/StorageRecordMatcher.cs | 18 +++++++++--------- .../Shared/StorageRecordedTestSanitizer.cs | 12 ++++++------ 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 04f42ab83cd9d..e7284825e8b39 100755 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -100,13 +100,13 @@ - + - - - + + + \ No newline at end of file diff --git a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationSettingParser.cs b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationSettingParser.cs index 60e4cf0b3f5b7..a94aac6562a7f 100644 --- a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationSettingParser.cs +++ b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationSettingParser.cs @@ -45,7 +45,7 @@ private static ConfigurationSetting ReadSetting(JsonElement root) if (root.TryGetProperty("etag", out var eTagValue)) setting.ETag = new ETag(eTagValue.GetString()); if (root.TryGetProperty("last_modified", out var lastModified)) { - if(lastModified.Type == JsonValueType.Null) + if(lastModified.ValueKind == JsonValueKind.Null) { setting.LastModified = null; } @@ -56,7 +56,7 @@ private static ConfigurationSetting ReadSetting(JsonElement root) } if (root.TryGetProperty("locked", out var lockedValue)) { - if(lockedValue.Type == JsonValueType.Null) + if(lockedValue.ValueKind == JsonValueKind.Null) { setting.Locked = null; } diff --git a/sdk/core/Azure.Core/tests/TestFramework/RecordEntry.cs b/sdk/core/Azure.Core/tests/TestFramework/RecordEntry.cs index 2f2f7d0c9eb5c..de9b7b80eb677 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/RecordEntry.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/RecordEntry.cs @@ -70,22 +70,22 @@ public static RecordEntry Deserialize(JsonElement element) private static byte[] DeserializeBody(IDictionary headers, in JsonElement property) { - if (property.Type == JsonValueType.Null) + if (property.ValueKind == JsonValueKind.Null) { return null; } if (IsTextContentType(headers, out Encoding encoding)) { - if (property.Type == JsonValueType.Object) + if (property.ValueKind == JsonValueKind.Object) { var arrayBufferWriter = new ArrayBufferWriter(); using var writer = new Utf8JsonWriter(arrayBufferWriter); - property.WriteAsValue(writer); + property.WriteValue(writer); writer.Flush(); return arrayBufferWriter.WrittenMemory.ToArray(); } - else if (property.Type == JsonValueType.Array) + else if (property.ValueKind == JsonValueKind.Array) { StringBuilder stringBuilder = new StringBuilder(); @@ -102,7 +102,7 @@ private static byte[] DeserializeBody(IDictionary headers, in } } - if (property.Type == JsonValueType.Array) + if (property.ValueKind == JsonValueKind.Array) { return Array.Empty(); } @@ -114,7 +114,7 @@ private static void DeserializeHeaders(IDictionary headers, in { foreach (JsonProperty item in property.EnumerateObject()) { - if (item.Value.Type == JsonValueType.Array) + if (item.Value.ValueKind == JsonValueKind.Array) { var values = new List(); foreach (JsonElement headerValue in item.Value.EnumerateArray()) @@ -170,7 +170,7 @@ private void SerializeBody(Utf8JsonWriter jsonWriter, string name, byte[] reques try { using JsonDocument document = JsonDocument.Parse(requestBody); - document.RootElement.WriteAsProperty(name.AsSpan(), jsonWriter); + document.RootElement.WriteProperty(name.AsSpan(), jsonWriter); return; } catch (Exception) diff --git a/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs b/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs index 78cb190f8470d..74e1e661c004f 100644 --- a/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs +++ b/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs @@ -486,8 +486,8 @@ private static AccessToken Deserialize(JsonElement json) { // the seconds from epoch may be returned as a Json number or a Json string which is a number // depending on the environment. If neither of these are the case we throw an AuthException. - if (!(expiresOnProp.Type == JsonValueType.Number && expiresOnProp.TryGetInt64(out long expiresOnSec)) && - !(expiresOnProp.Type == JsonValueType.String && long.TryParse(expiresOnProp.GetString(), out expiresOnSec))) + if (!(expiresOnProp.ValueKind == JsonValueKind.Number && expiresOnProp.TryGetInt64(out long expiresOnSec)) && + !(expiresOnProp.ValueKind == JsonValueKind.String && long.TryParse(expiresOnProp.GetString(), out expiresOnSec))) { throw new AuthenticationFailedException(AuthenticationResponseInvalidFormatError); } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateAttributes.cs b/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateAttributes.cs index c5de799137b37..9776b47d406c5 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateAttributes.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateAttributes.cs @@ -52,7 +52,7 @@ internal void ReadProperties(JsonElement json) if (json.TryGetProperty("nbf", out JsonElement nbf)) { - if (nbf.Type == JsonValueType.Null) + if (nbf.ValueKind == JsonValueKind.Null) { NotBefore = null; } @@ -64,7 +64,7 @@ internal void ReadProperties(JsonElement json) if (json.TryGetProperty("exp", out JsonElement exp)) { - if (exp.Type == JsonValueType.Null) + if (exp.ValueKind == JsonValueKind.Null) { Expires = null; } @@ -76,7 +76,7 @@ internal void ReadProperties(JsonElement json) if (json.TryGetProperty("created", out JsonElement created)) { - if (created.Type == JsonValueType.Null) + if (created.ValueKind == JsonValueKind.Null) { Created = null; } @@ -88,7 +88,7 @@ internal void ReadProperties(JsonElement json) if (json.TryGetProperty("updated", out JsonElement updated)) { - if (updated.Type == JsonValueType.Null) + if (updated.ValueKind == JsonValueKind.Null) { Updated = null; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/Page.cs b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/Page.cs index 6e76cb8f60100..c1b137b32fe62 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/Page.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/Page.cs @@ -37,7 +37,7 @@ internal override void ReadProperties(JsonElement json) { if (json.TryGetProperty("value", out JsonElement value)) { - if(value.Type != JsonValueType.Null) + if(value.ValueKind != JsonValueKind.Null) { _items = new T[value.GetArrayLength()]; diff --git a/sdk/storage/Azure.Storage.Common/tests/Shared/StorageRecordMatcher.cs b/sdk/storage/Azure.Storage.Common/tests/Shared/StorageRecordMatcher.cs index 79a43caef36d2..d99ddba06914d 100644 --- a/sdk/storage/Azure.Storage.Common/tests/Shared/StorageRecordMatcher.cs +++ b/sdk/storage/Azure.Storage.Common/tests/Shared/StorageRecordMatcher.cs @@ -294,22 +294,22 @@ private static object ParseJsonBody(byte[] body) object Parse(JsonElement element) { - switch (element.Type) + switch (element.ValueKind) { // Keep all primitives (except null) as strings - case JsonValueType.False: return "false"; - case JsonValueType.True: return "true"; - case JsonValueType.Undefined: return "undefined"; - case JsonValueType.Number: return element.GetRawText(); - case JsonValueType.String: return element.GetString(); - case JsonValueType.Object: + case JsonValueKind.False: return "false"; + case JsonValueKind.True: return "true"; + case JsonValueKind.Undefined: return "undefined"; + case JsonValueKind.Number: return element.GetRawText(); + case JsonValueKind.String: return element.GetString(); + case JsonValueKind.Object: var obj = new Dictionary(); foreach (var property in element.EnumerateObject()) { obj.Add(property.Name, Parse(property.Value)); } return obj; - case JsonValueType.Array: + case JsonValueKind.Array: var values = new Dictionary(); var index = 0; foreach (var value in element.EnumerateArray()) @@ -317,7 +317,7 @@ object Parse(JsonElement element) values.Add(index++.ToString(CultureInfo.InvariantCulture), Parse(value)); } return values; - case JsonValueType.Null: + case JsonValueKind.Null: default: return null; diff --git a/sdk/storage/Azure.Storage.Common/tests/Shared/StorageRecordedTestSanitizer.cs b/sdk/storage/Azure.Storage.Common/tests/Shared/StorageRecordedTestSanitizer.cs index f8a1a4d6f5005..da6bec3a3d7f4 100644 --- a/sdk/storage/Azure.Storage.Common/tests/Shared/StorageRecordedTestSanitizer.cs +++ b/sdk/storage/Azure.Storage.Common/tests/Shared/StorageRecordedTestSanitizer.cs @@ -60,21 +60,21 @@ public override string SanitizeTextBody(string contentType, string body) writer.WriteStartObject(); foreach (var property in doc.RootElement.EnumerateObject()) { - switch (doc.RootElement.GetProperty(property.Name).Type) + switch (doc.RootElement.GetProperty(property.Name).ValueKind) { - case JsonValueType.Null: + case JsonValueKind.Null: writer.WriteNull(property.Name); break; - case JsonValueType.True: + case JsonValueKind.True: writer.WriteBoolean(property.Name, true); break; - case JsonValueType.False: + case JsonValueKind.False: writer.WriteBoolean(property.Name, false); break; - case JsonValueType.Number: + case JsonValueKind.Number: writer.WriteNumber(property.Name, property.Value.GetDouble()); break; - case JsonValueType.String: + case JsonValueKind.String: writer.WriteString( property.Name, property.Name == "access_token" ?