Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved WebPubSum to generated surface area + extensions #21549

Merged
merged 22 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d93305a
Move WebPubSub to LLC + extensions
KrzysztofCwalina May 4, 2021
967733d
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina May 10, 2021
5abae0c
Small changes
KrzysztofCwalina May 10, 2021
5854d56
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina May 10, 2021
a13a76e
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina May 11, 2021
6f53c29
merge
KrzysztofCwalina May 12, 2021
36af753
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina May 12, 2021
cb246a8
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina May 13, 2021
85ebf55
Moved to LLC + extensions
KrzysztofCwalina May 13, 2021
493b0f4
changes
KrzysztofCwalina May 13, 2021
216f24d
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina May 25, 2021
78892f9
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina May 27, 2021
7b609f8
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina Jun 1, 2021
456e077
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina Jun 2, 2021
42a4485
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina Jun 2, 2021
3289f3a
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina Jun 3, 2021
be1b341
Finished moving to generated surface area
KrzysztofCwalina Jun 3, 2021
2702228
updated API file
KrzysztofCwalina Jun 3, 2021
6d4c97f
PR review feedback incorporated
KrzysztofCwalina Jun 4, 2021
dceffed
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-net i…
KrzysztofCwalina Jun 4, 2021
38fa14b
regenerated APIs
KrzysztofCwalina Jun 4, 2021
b336aa5
fixed a bug
KrzysztofCwalina Jun 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions sdk/webpubsub/Azure.Messaging.WebPubSub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ serviceClient.SendToAll("Hello World!");
```C# Snippet:WebPubSubSendJson
var serviceClient = new WebPubSubServiceClient(new Uri(endpoint), "some_hub", new AzureKeyCredential(key));

serviceClient.SendToAll(
serviceClient.SendToAll("application/json",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider either updating https://github.com/Azure/azure-webpubsub/blob/main/docs/references/server-sdks/csharp-server-sdks.md as well or working with them to link to this file so we don't have out of date copies.

RequestContent.Create(
new
{
Expand All @@ -95,9 +95,7 @@ serviceClient.SendToAll(
var serviceClient = new WebPubSubServiceClient(new Uri(endpoint), "some_hub", new AzureKeyCredential(key));

Stream stream = BinaryData.FromString("Hello World!").ToStream();
serviceClient.SendToAll(
RequestContent.Create(stream),
HttpHeader.Common.OctetStreamContentType.Value);
serviceClient.SendToAll("application/octet-stream", RequestContent.Create(stream));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just create it from the BinaryData instead of a Stream?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Service team wanted a stream sample as their users will often have a stream.

```

## Troubleshooting
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Azure SDK client library for the WebPubSub service</Description>
<AssemblyTitle>Azure SDK for WebPubSub</AssemblyTitle>
<Version>1.0.0-beta.2</Version>
<PackageTags>Azure, WebPubSub, SignalR</PackageTags>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<NoWarn>$(NoWarn);419</NoWarn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - consider saying what you're ignoring so folks know when/if it's safe to add back.

</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Core" />
<PackageReference Include="Azure.Core.Experimental" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>
Expand All @@ -24,31 +26,7 @@
<Compile Include="$(AzureCoreSharedSources)TaskExtensions.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" />
<Compile Include="$(AzureCoreSharedSources)OperationHelpers.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" />
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" />
<Compile Include="$(AzureCoreSharedSources)Argument.cs" LinkBase="Shared" />
</ItemGroup>

<!-- HACK -->
<!-- Hack around lack of support for RequestContent in the code generators -->
<UsingTask TaskName="ReplaceText" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was amazing while it lasted, but I am happy to see it gone :-)

<ParameterGroup>
<FileName ParameterType="System.String" Required="true" />
<Pattern ParameterType="System.String" Required="true" />
<Replacement ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Text.RegularExpressions" />
<Code Type="Fragment" Language="cs">
<![CDATA[
File.WriteAllText(FileName, Regex.Replace(File.ReadAllText(FileName), Pattern, Replacement));
]]>
</Code>
</Task>
</UsingTask>
<Target Name="HackGeneratedCode" AfterTargets="GenerateCode" Condition="'$(_GenerateCode)' == 'true'">
<Message Importance="high" Text="Hacking RequestContent into Generated Code" />
<ReplaceText Filename="$(MSBuildThisFileDirectory)\Generated\WebPubSubRestClient.cs" Pattern="Stream message" Replacement="RequestContent message" />
<ReplaceText Filename="$(MSBuildThisFileDirectory)\Generated\WebPubSubRestClient.cs" Pattern="RequestContent\.Create\(message\)" Replacement="message" />
</Target>
<!-- /HACK -->
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

This file was deleted.

Loading