From dc6acd7ff1d0bfd56a26d567941f578b55c5b700 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 29 May 2023 01:06:25 -0700 Subject: [PATCH] Update AutoRest C# version to 3.0.0-beta.20230528.2 (#36574) * Update Generator Version 3.0.0-beta.20230528.2 * Update SDK codes --- eng/Packages.Data.props | 2 +- eng/emitter-package.json | 2 +- .../api/Azure.AI.ContentSafety.netstandard2.0.cs | 2 +- .../src/Generated/AnalyzeTextOptions.Serialization.cs | 11 ++--------- .../src/Generated/Docs/ContentSafetyClient.xml | 8 ++++---- .../src/Generated/ImageData.Serialization.cs | 2 +- .../Azure.AI.ContentSafety/src/Generated/ImageData.cs | 4 ++-- .../Generated/Samples/Samples_ContentSafetyClient.cs | 6 +++--- 8 files changed, 15 insertions(+), 22 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index ab29f8b63e0bc..b868fb2a29835 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -171,7 +171,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package.json b/eng/emitter-package.json index a78c6d26bb26f..01e2c2811c414 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,6 +1,6 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20230525.3" + "@azure-tools/typespec-csharp": "0.2.0-beta.20230528.2" } } diff --git a/sdk/contentsafety/Azure.AI.ContentSafety/api/Azure.AI.ContentSafety.netstandard2.0.cs b/sdk/contentsafety/Azure.AI.ContentSafety/api/Azure.AI.ContentSafety.netstandard2.0.cs index 20751e206f4d0..57459e5009305 100644 --- a/sdk/contentsafety/Azure.AI.ContentSafety/api/Azure.AI.ContentSafety.netstandard2.0.cs +++ b/sdk/contentsafety/Azure.AI.ContentSafety/api/Azure.AI.ContentSafety.netstandard2.0.cs @@ -121,7 +121,7 @@ internal ImageAnalyzeSeverityResult() { } public partial class ImageData { public ImageData() { } - public string BlobUrl { get { throw null; } set { } } + public System.Uri BlobUrl { get { throw null; } set { } } public System.BinaryData Content { get { throw null; } set { } } } public partial class RemoveBlockItemsOptions diff --git a/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/AnalyzeTextOptions.Serialization.cs b/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/AnalyzeTextOptions.Serialization.cs index e3e9a158a1a51..91c37f38eb2f6 100644 --- a/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/AnalyzeTextOptions.Serialization.cs +++ b/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/AnalyzeTextOptions.Serialization.cs @@ -39,15 +39,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } if (Optional.IsDefined(BreakByBlocklists)) { - if (BreakByBlocklists != null) - { - writer.WritePropertyName("breakByBlocklists"u8); - writer.WriteBooleanValue(BreakByBlocklists.Value); - } - else - { - writer.WriteNull("breakByBlocklists"); - } + writer.WritePropertyName("breakByBlocklists"u8); + writer.WriteBooleanValue(BreakByBlocklists.Value); } writer.WriteEndObject(); } diff --git a/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/Docs/ContentSafetyClient.xml b/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/Docs/ContentSafetyClient.xml index 5e9bb53506d6b..5ea3b7b39fe57 100644 --- a/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/Docs/ContentSafetyClient.xml +++ b/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/Docs/ContentSafetyClient.xml @@ -166,7 +166,7 @@ var client = new ContentSafetyClient(endpoint, credential); var body = new AnalyzeImageOptions(new ImageData() { Content = BinaryData.FromString(""), - BlobUrl = "", + BlobUrl = new Uri("http://localhost:3000"), }) { Categories = @@ -189,7 +189,7 @@ var client = new ContentSafetyClient(endpoint, credential); var body = new AnalyzeImageOptions(new ImageData() { Content = BinaryData.FromString(""), - BlobUrl = "", + BlobUrl = new Uri("http://localhost:3000"), }) { Categories = @@ -227,7 +227,7 @@ var client = new ContentSafetyClient(endpoint, credential); var data = new { image = new { content = new {}, - blobUrl = "", + blobUrl = "http://localhost:3000", }, categories = new[] { "Hate" @@ -274,7 +274,7 @@ var client = new ContentSafetyClient(endpoint, credential); var data = new { image = new { content = new {}, - blobUrl = "", + blobUrl = "http://localhost:3000", }, categories = new[] { "Hate" diff --git a/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ImageData.Serialization.cs b/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ImageData.Serialization.cs index a074cf932c4c7..371e0d0e17c9d 100644 --- a/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ImageData.Serialization.cs +++ b/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ImageData.Serialization.cs @@ -23,7 +23,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) if (Optional.IsDefined(BlobUrl)) { writer.WritePropertyName("blobUrl"u8); - writer.WriteStringValue(BlobUrl); + writer.WriteStringValue(BlobUrl.AbsoluteUri); } writer.WriteEndObject(); } diff --git a/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ImageData.cs b/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ImageData.cs index 5ee0fa1b57327..2bc5e852d0c56 100644 --- a/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ImageData.cs +++ b/sdk/contentsafety/Azure.AI.ContentSafety/src/Generated/ImageData.cs @@ -20,7 +20,7 @@ public ImageData() /// Initializes a new instance of ImageData. /// Base64 encoding of image. /// The blob url of image. - internal ImageData(BinaryData content, string blobUrl) + internal ImageData(BinaryData content, Uri blobUrl) { Content = content; BlobUrl = blobUrl; @@ -44,6 +44,6 @@ internal ImageData(BinaryData content, string blobUrl) /// public BinaryData Content { get; set; } /// The blob url of image. - public string BlobUrl { get; set; } + public Uri BlobUrl { get; set; } } } diff --git a/sdk/contentsafety/Azure.AI.ContentSafety/tests/Generated/Samples/Samples_ContentSafetyClient.cs b/sdk/contentsafety/Azure.AI.ContentSafety/tests/Generated/Samples/Samples_ContentSafetyClient.cs index 7c95afd6d1cc9..d12c6a3804238 100644 --- a/sdk/contentsafety/Azure.AI.ContentSafety/tests/Generated/Samples/Samples_ContentSafetyClient.cs +++ b/sdk/contentsafety/Azure.AI.ContentSafety/tests/Generated/Samples/Samples_ContentSafetyClient.cs @@ -188,7 +188,7 @@ public void Example_AnalyzeImage_AllParameters() image = new { content = new { }, - blobUrl = "", + blobUrl = "http://localhost:3000", }, categories = new[] { "Hate" @@ -240,7 +240,7 @@ public async Task Example_AnalyzeImage_AllParameters_Async() image = new { content = new { }, - blobUrl = "", + blobUrl = "http://localhost:3000", }, categories = new[] { "Hate" @@ -271,7 +271,7 @@ public async Task Example_AnalyzeImage_Convenience_Async() var body = new AnalyzeImageOptions(new ImageData() { Content = BinaryData.FromString(""), - BlobUrl = "", + BlobUrl = new Uri("http://localhost:3000"), }) { Categories =