Skip to content

Commit 3b9d343

Browse files
Update TypeSpec emitter version to prerelease 1.0.0-alpha.20250606.3 (Azure#50476)
* Regenerate repository SDK with TypeSpec build 20250606.3 * Update SDK code du_io_2 * backcompat --------- Co-authored-by: jolov <[email protected]>
1 parent 074a031 commit 3b9d343

24 files changed

+185
-197
lines changed

eng/http-client-csharp-emitter-package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/http-client-csharp-emitter-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"main": "dist/src/index.js",
33
"dependencies": {
4-
"@azure-typespec/http-client-csharp": "1.0.0-alpha.20250605.1"
4+
"@azure-typespec/http-client-csharp": "1.0.0-alpha.20250606.3"
55
},
66
"devDependencies": {
77
"@azure-tools/typespec-azure-core": "0.56.0",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using Azure.Core;
5+
6+
namespace Azure.Messaging.EventGrid.Namespaces
7+
{
8+
public partial class AcknowledgeResult
9+
{
10+
/// <param name="acknowledgeResult"> The <see cref="AcknowledgeResult"/> to serialize into <see cref="RequestContent"/>. </param>
11+
public static implicit operator RequestContent(AcknowledgeResult acknowledgeResult)
12+
{
13+
if (acknowledgeResult == null)
14+
{
15+
return null;
16+
}
17+
Utf8JsonBinaryContent content = new Utf8JsonBinaryContent();
18+
content.JsonWriter.WriteObjectValue(acknowledgeResult, ModelSerializationExtensions.WireOptions);
19+
return content;
20+
}
21+
}
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
using System.Text.Json;
5+
using Azure.Core;
6+
47
namespace Azure.Messaging.EventGrid.Namespaces
58
{
69
public partial class BrokerProperties
710
{
11+
/// <param name="brokerProperties"> The <see cref="BrokerProperties"/> to serialize into <see cref="RequestContent"/>. </param>
12+
public static implicit operator RequestContent(BrokerProperties brokerProperties)
13+
{
14+
if (brokerProperties == null)
15+
{
16+
return null;
17+
}
18+
Utf8JsonBinaryContent content = new Utf8JsonBinaryContent();
19+
content.JsonWriter.WriteObjectValue(brokerProperties, ModelSerializationExtensions.WireOptions);
20+
return content;
21+
}
22+
23+
/// <param name="result"> The <see cref="Response"/> to deserialize the <see cref="BrokerProperties"/> from. </param>
24+
public static explicit operator BrokerProperties(Response result)
25+
{
26+
using Response response = result;
27+
using JsonDocument document = JsonDocument.Parse(response.Content);
28+
return DeserializeBrokerProperties(document.RootElement, ModelSerializationExtensions.WireOptions);
29+
}
830
}
931
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System.Text.Json;
5+
using Azure.Core;
6+
7+
namespace Azure.Messaging.EventGrid.Namespaces
8+
{
9+
public partial class FailedLockToken
10+
{
11+
/// <param name="failedLockToken"> The <see cref="FailedLockToken"/> to serialize into <see cref="RequestContent"/>. </param>
12+
public static implicit operator RequestContent(FailedLockToken failedLockToken)
13+
{
14+
if (failedLockToken == null)
15+
{
16+
return null;
17+
}
18+
Utf8JsonBinaryContent content = new Utf8JsonBinaryContent();
19+
content.JsonWriter.WriteObjectValue(failedLockToken, ModelSerializationExtensions.WireOptions);
20+
return content;
21+
}
22+
23+
/// <param name="result"> The <see cref="Response"/> to deserialize the <see cref="FailedLockToken"/> from. </param>
24+
public static explicit operator FailedLockToken(Response result)
25+
{
26+
using Response response = result;
27+
using JsonDocument document = JsonDocument.Parse(response.Content);
28+
return DeserializeFailedLockToken(document.RootElement, ModelSerializationExtensions.WireOptions);
29+
}
30+
}
31+
}

sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces/src/Customization/ReceiveDetails.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.ClientModel.Primitives;
55
using System.Runtime.CompilerServices;
66
using System.Text.Json;
7+
using Azure.Core;
78

89
namespace Azure.Messaging.EventGrid.Namespaces
910
{
@@ -24,5 +25,25 @@ internal static void ReadEvent(JsonProperty property, ref Azure.Messaging.CloudE
2425
{
2526
@event = JsonSerializer.Deserialize<Azure.Messaging.CloudEvent>(property.Value.GetRawText(), new JsonSerializerOptions());
2627
}
28+
29+
/// <param name="receiveDetails"> The <see cref="ReceiveDetails"/> to serialize into <see cref="RequestContent"/>. </param>
30+
public static implicit operator RequestContent(ReceiveDetails receiveDetails)
31+
{
32+
if (receiveDetails == null)
33+
{
34+
return null;
35+
}
36+
Utf8JsonBinaryContent content = new Utf8JsonBinaryContent();
37+
content.JsonWriter.WriteObjectValue(receiveDetails, ModelSerializationExtensions.WireOptions);
38+
return content;
39+
}
40+
41+
/// <param name="result"> The <see cref="Response"/> to deserialize the <see cref="ReceiveDetails"/> from. </param>
42+
public static explicit operator ReceiveDetails(Response result)
43+
{
44+
using Response response = result;
45+
using JsonDocument document = JsonDocument.Parse(response.Content);
46+
return DeserializeReceiveDetails(document.RootElement, ModelSerializationExtensions.WireOptions);
47+
}
2748
}
2849
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
using Azure.Core;
5+
46
namespace Azure.Messaging.EventGrid.Namespaces
57
{
68
public partial class ReceiveResult
79
{
10+
/// <param name="receiveResult"> The <see cref="ReceiveResult"/> to serialize into <see cref="RequestContent"/>. </param>
11+
public static implicit operator RequestContent(ReceiveResult receiveResult)
12+
{
13+
if (receiveResult == null)
14+
{
15+
return null;
16+
}
17+
Utf8JsonBinaryContent content = new Utf8JsonBinaryContent();
18+
content.JsonWriter.WriteObjectValue(receiveResult, ModelSerializationExtensions.WireOptions);
19+
return content;
20+
}
821
}
922
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System.Text.Json;
5+
using Azure.Core;
6+
7+
namespace Azure.Messaging.EventGrid.Namespaces
8+
{
9+
public partial class RejectResult
10+
{
11+
/// <param name="rejectResult"> The <see cref="RejectResult"/> to serialize into <see cref="RequestContent"/>. </param>
12+
public static implicit operator RequestContent(RejectResult rejectResult)
13+
{
14+
if (rejectResult == null)
15+
{
16+
return null;
17+
}
18+
Utf8JsonBinaryContent content = new Utf8JsonBinaryContent();
19+
content.JsonWriter.WriteObjectValue(rejectResult, ModelSerializationExtensions.WireOptions);
20+
return content;
21+
}
22+
}
23+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using Azure.Core;
5+
6+
namespace Azure.Messaging.EventGrid.Namespaces
7+
{
8+
public partial class ReleaseResult
9+
{
10+
/// <param name="releaseResult"> The <see cref="ReleaseResult"/> to serialize into <see cref="RequestContent"/>. </param>
11+
public static implicit operator RequestContent(ReleaseResult releaseResult)
12+
{
13+
if (releaseResult == null)
14+
{
15+
return null;
16+
}
17+
Utf8JsonBinaryContent content = new Utf8JsonBinaryContent();
18+
content.JsonWriter.WriteObjectValue(releaseResult, ModelSerializationExtensions.WireOptions);
19+
return content;
20+
}
21+
}
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using Azure.Core;
5+
6+
namespace Azure.Messaging.EventGrid.Namespaces
7+
{
8+
public partial class RenewLocksResult
9+
{
10+
/// <param name="renewLocksResult"> The <see cref="RenewLocksResult"/> to serialize into <see cref="RequestContent"/>. </param>
11+
public static implicit operator RequestContent(RenewLocksResult renewLocksResult)
12+
{
13+
if (renewLocksResult == null)
14+
{
15+
return null;
16+
}
17+
Utf8JsonBinaryContent content = new Utf8JsonBinaryContent();
18+
content.JsonWriter.WriteObjectValue(renewLocksResult, ModelSerializationExtensions.WireOptions);
19+
return content;
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)