Skip to content

Commit ce9cc9a

Browse files
[WebPubSub] Prepare for july 2021 release (Azure#22615)
* [WebPubSub] Prepare for July 2021 release * Restructure test project file Ignore CS1591 in test project * Update WebJobs.Extensions.WebPubSub.Tests project * Add a new service version * Update public API file * Remove earlier preview service version * Fill in changelog details * Revert service version to V2021_05_01_preview * Move type code-gen suppression to definition file * Update changelog entries Co-authored-by: Liangying.Wei <[email protected]> * Update Changelog
1 parent 390d644 commit ce9cc9a

File tree

7 files changed

+124
-51
lines changed

7 files changed

+124
-51
lines changed
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Release History
22

3-
## 1.0.0-beta.2 (Unreleased)
3+
## 1.0.0-beta.2 (2021-07-16)
44

5+
### Features Added
6+
- Added support for [RequestOptions](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md#using-requestoptions-to-customize-behavior) on protocol methods.
7+
- Added support for API management with `ReverseProxyEndpoint` option. https://github.com/Azure/azure-webpubsub/issues/194 describes how to integrate with the API Management service.
8+
- Removed dependency on `System.IdentityModel.Tokens.Jwt`.
9+
10+
### Bugs Fixed
11+
- https://github.com/Azure/azure-webpubsub/issues/166
12+
- https://github.com/Azure/azure-webpubsub/issues/90
513

614
## 1.0.0-beta.1 (2021-04-23)
715
- Initial beta release.

sdk/webpubsub/Azure.Messaging.WebPubSub/src/Azure.Messaging.WebPubSub.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<Description>Azure SDK client library for the WebPubSub service</Description>
44
<AssemblyTitle>Azure SDK for WebPubSub</AssemblyTitle>

sdk/webpubsub/Azure.Messaging.WebPubSub/src/Generated/WebPubSubServiceClientOptions.cs

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System;
5+
using Azure.Core;
6+
7+
[assembly: CodeGenSuppressType("WebPubSubServiceClientOptions")]
8+
9+
#pragma warning disable SA1402 // File may only contain a single type
10+
11+
namespace Azure.Messaging.WebPubSub
12+
{
13+
/// <summary> Provides the client configuration options for connecting to Azure WebPubSub service. </summary>
14+
public partial class WebPubSubServiceClientOptions : ClientOptions
15+
{
16+
/// <summary>
17+
/// The versions of Azure WebPubSub supported by this client library.
18+
/// </summary>
19+
public enum ServiceVersion
20+
{
21+
#pragma warning disable CA1707 // Identifiers should not contain underscores
22+
/// <summary> The 2021_05_01_preview version of the Azure WebPubSub service. </summary>
23+
V2021_05_01_preview = 1,
24+
#pragma warning restore CA1707 // Identifiers should not contain underscores
25+
}
26+
27+
/// <summary>
28+
/// The Latest <see cref="ServiceVersion"/> supported by this client library.
29+
/// </summary>
30+
private const ServiceVersion LatestVersion = ServiceVersion.V2021_05_01_preview;
31+
32+
/// <summary>
33+
/// Gets the version of the service API used when making requests.
34+
/// </summary>
35+
internal string Version { get; }
36+
37+
/// <summary> Initializes a new instance of the <see cref="WebPubSubServiceClientOptions"/>. </summary>
38+
/// <param name="version">
39+
/// An optional <see cref="ServiceVersion"/> to specify the version of the REST API to use.
40+
/// If not provided, the <paramref name="version"/> will default to the latest supported by this client library.
41+
/// It is recommended that application authors allow the version to float to the latest and
42+
/// library authors pin to a specific version.
43+
/// </param>
44+
/// <exception cref="ArgumentOutOfRangeException">
45+
/// Thrown when the <paramref name="version"/> is not supported by this client library.
46+
/// </exception>
47+
public WebPubSubServiceClientOptions(ServiceVersion version = LatestVersion)
48+
{
49+
Version = version.ToVersionString();
50+
}
51+
}
52+
53+
/// <summary>
54+
/// WebPubSub extension methods.
55+
/// </summary>
56+
internal static partial class WebPubSubExtensions
57+
{
58+
/// <summary>
59+
/// Gets a version string, like "2021-05-01-preview", corresponding to a given <see cref="WebPubSubServiceClientOptions.ServiceVersion"/> value.
60+
/// </summary>
61+
/// <param name="version">
62+
/// The <see cref="WebPubSubServiceClientOptions.ServiceVersion"/> value to convert into a version string.
63+
/// </param>
64+
/// <returns> The version string. </returns>
65+
/// <exception cref="ArgumentOutOfRangeException">
66+
/// Thrown when the <paramref name="version"/> is not supported by this client library.
67+
/// </exception>
68+
public static string ToVersionString(this WebPubSubServiceClientOptions.ServiceVersion version) =>
69+
version switch
70+
{
71+
WebPubSubServiceClientOptions.ServiceVersion.V2021_05_01_preview => "2021-05-01-preview",
72+
_ => throw CreateInvalidVersionException(version)
73+
};
74+
75+
/// <summary>
76+
/// Creates an <see cref="ArgumentOutOfRangeException"/> to throw when
77+
/// an invalid <see cref="WebPubSubServiceClientOptions.ServiceVersion"/> value is provided.
78+
/// </summary>
79+
/// <param name="version">The invalid version value.</param>
80+
/// <returns>An exception to throw.</returns>
81+
private static ArgumentOutOfRangeException CreateInvalidVersionException(WebPubSubServiceClientOptions.ServiceVersion version) =>
82+
new ArgumentOutOfRangeException(
83+
nameof(version),
84+
version,
85+
$"The {nameof(WebPubSubServiceClientOptions)}.{nameof(WebPubSubServiceClientOptions.ServiceVersion)} specified is not supported by this library.");
86+
}
87+
}

sdk/webpubsub/Azure.Messaging.WebPubSub/tests/Azure.Messaging.WebPubSub.Tests.csproj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
4+
5+
<!-- We don't care about XML doc comments on test types and members -->
6+
<NoWarn>$(NoWarn);CS1591</NoWarn>
47
</PropertyGroup>
58

9+
<!-- Reference the Client Library -->
610
<ItemGroup>
7-
<PackageReference Include="NUnit" />
8-
<PackageReference Include="NUnit3TestAdapter" />
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" />
10-
<PackageReference Include="Moq" />
11-
<PackageReference Include="System.IdentityModel.Tokens.Jwt" />
11+
<ProjectReference Include="..\src\Azure.Messaging.WebPubSub.csproj" />
1212
</ItemGroup>
1313

1414
<ItemGroup>
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
16+
<PackageReference Include="Moq" />
17+
<PackageReference Include="NUnit" />
18+
<PackageReference Include="NUnit3TestAdapter" />
19+
<PackageReference Include="System.IdentityModel.Tokens.Jwt" />
1520
<ProjectReference Include="$(AzureCoreTestFramework)" />
16-
<ProjectReference Include="..\src\Azure.Messaging.WebPubSub.csproj" />
1721
</ItemGroup>
1822

1923
<ItemGroup>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<!--
3+
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
4+
-->
5+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
6+
<PropertyGroup>
7+
<DocumentationFile>$(IntermediateOutputPath)$(TargetFramework)\$(MSBuildProjectName).xml</DocumentationFile>
8+
</PropertyGroup>
9+
</Project>

sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests.csproj

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
5-
<NoWarn>SA1636</NoWarn>
5+
6+
<!-- We don't care about XML doc comments on test types and members -->
7+
<NoWarn>$(NoWarn);CS1591;SA1636</NoWarn>
68
<IsPackable>false</IsPackable>
79
</PropertyGroup>
810

11+
<!-- Reference the Client Library -->
12+
<ItemGroup>
13+
<ProjectReference Include="..\src\Microsoft.Azure.WebJobs.Extensions.WebPubSub.csproj" />
14+
</ItemGroup>
15+
916
<ItemGroup>
1017
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" />
1118
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1219
<PackageReference Include="Moq" />
1320
<PackageReference Include="NUnit" />
1421
<PackageReference Include="NUnit3TestAdapter" />
1522
</ItemGroup>
16-
17-
<ItemGroup>
18-
<ProjectReference Include="..\src\Microsoft.Azure.WebJobs.Extensions.WebPubSub.csproj" />
19-
</ItemGroup>
20-
2123
</Project>

0 commit comments

Comments
 (0)