@azure-typespec/http-client-csharp-mgmt 1.0.0-alpha.20250509.3 → 1.0.0-alpha.20250513.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -6,12 +6,12 @@
6
6
  "compilationOptions": {},
7
7
  "targets": {
8
8
  ".NETCoreApp,Version=v8.0": {
9
- "Azure.Generator.Mgmt/1.0.0-alpha.20250509.1": {
9
+ "Azure.Generator.Mgmt/1.0.0-alpha.20250514.1": {
10
10
  "dependencies": {
11
- "Azure.Core": "1.46.0",
11
+ "Azure.Core": "1.46.1",
12
12
  "Azure.Generator": "1.0.0-alpha.20250508.1",
13
13
  "Azure.ResourceManager": "1.13.0",
14
- "Microsoft.Azure.AutoRest.CSharp": "3.0.0-beta.20250508.1",
14
+ "Microsoft.Azure.AutoRest.CSharp": "3.0.0-beta.20250512.2",
15
15
  "Microsoft.SourceLink.GitHub": "8.0.0",
16
16
  "Microsoft.TypeSpec.Generator.ClientModel": "1.0.0-alpha.20250509.1",
17
17
  "SauceControl.InheritDoc": "1.2.0",
@@ -21,22 +21,22 @@
21
21
  "Azure.Generator.Mgmt.dll": {}
22
22
  }
23
23
  },
24
- "Azure.Core/1.46.0": {
24
+ "Azure.Core/1.46.1": {
25
25
  "dependencies": {
26
26
  "Microsoft.Bcl.AsyncInterfaces": "8.0.0",
27
- "System.ClientModel": "1.4.0",
27
+ "System.ClientModel": "1.4.1",
28
28
  "System.Memory.Data": "8.0.1"
29
29
  },
30
30
  "runtime": {
31
31
  "lib/net8.0/Azure.Core.dll": {
32
- "assemblyVersion": "1.46.0.0",
33
- "fileVersion": "1.4600.25.25604"
32
+ "assemblyVersion": "1.46.1.0",
33
+ "fileVersion": "1.4600.125.25909"
34
34
  }
35
35
  }
36
36
  },
37
37
  "Azure.Generator/1.0.0-alpha.20250508.1": {
38
38
  "dependencies": {
39
- "Azure.Core": "1.46.0",
39
+ "Azure.Core": "1.46.1",
40
40
  "Azure.ResourceManager": "1.13.0",
41
41
  "Microsoft.TypeSpec.Generator.ClientModel": "1.0.0-alpha.20250509.1"
42
42
  },
@@ -49,8 +49,8 @@
49
49
  },
50
50
  "Azure.ResourceManager/1.13.0": {
51
51
  "dependencies": {
52
- "Azure.Core": "1.46.0",
53
- "System.ClientModel": "1.4.0",
52
+ "Azure.Core": "1.46.1",
53
+ "System.ClientModel": "1.4.1",
54
54
  "System.Text.Json": "6.0.9"
55
55
  },
56
56
  "runtime": {
@@ -76,7 +76,7 @@
76
76
  }
77
77
  }
78
78
  },
79
- "Microsoft.Azure.AutoRest.CSharp/3.0.0-beta.20250508.1": {},
79
+ "Microsoft.Azure.AutoRest.CSharp/3.0.0-beta.20250512.2": {},
80
80
  "Microsoft.Bcl.AsyncInterfaces/8.0.0": {
81
81
  "runtime": {
82
82
  "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": {
@@ -386,7 +386,7 @@
386
386
  "Microsoft.TypeSpec.Generator.ClientModel/1.0.0-alpha.20250509.1": {
387
387
  "dependencies": {
388
388
  "Microsoft.TypeSpec.Generator": "1.0.0-alpha.20250509.1",
389
- "System.ClientModel": "1.4.0"
389
+ "System.ClientModel": "1.4.1"
390
390
  },
391
391
  "runtime": {
392
392
  "lib/net8.0/Microsoft.TypeSpec.Generator.ClientModel.dll": {
@@ -445,15 +445,15 @@
445
445
  }
446
446
  },
447
447
  "StyleCop.Analyzers.Unstable/1.2.0.333": {},
448
- "System.ClientModel/1.4.0": {
448
+ "System.ClientModel/1.4.1": {
449
449
  "dependencies": {
450
450
  "Microsoft.Extensions.Logging.Abstractions": "8.0.3",
451
451
  "System.Memory.Data": "8.0.1"
452
452
  },
453
453
  "runtime": {
454
454
  "lib/net8.0/System.ClientModel.dll": {
455
- "assemblyVersion": "1.4.0.0",
456
- "fileVersion": "1.400.25.25204"
455
+ "assemblyVersion": "1.4.1.0",
456
+ "fileVersion": "1.400.125.25905"
457
457
  }
458
458
  }
459
459
  },
@@ -619,17 +619,17 @@
619
619
  }
620
620
  },
621
621
  "libraries": {
622
- "Azure.Generator.Mgmt/1.0.0-alpha.20250509.1": {
622
+ "Azure.Generator.Mgmt/1.0.0-alpha.20250514.1": {
623
623
  "type": "project",
624
624
  "serviceable": false,
625
625
  "sha512": ""
626
626
  },
627
- "Azure.Core/1.46.0": {
627
+ "Azure.Core/1.46.1": {
628
628
  "type": "package",
629
629
  "serviceable": true,
630
- "sha512": "sha512-MNFRFDHqUBZkeViSrDX6bPfQhXsydKJXu64AntycIzSG+nemh39XCkhDvjES0uisJlHsVex/tmkfA2ZQt913DQ==",
631
- "path": "azure.core/1.46.0",
632
- "hashPath": "azure.core.1.46.0.nupkg.sha512"
630
+ "sha512": "sha512-iE5DPOlGsN5kCkF4gN+vasN1RihO0Ypie92oQ5tohQYiokmnrrhLnee+3zcE8n7vB6ZAzhPTfUGAEXX/qHGkYA==",
631
+ "path": "azure.core/1.46.1",
632
+ "hashPath": "azure.core.1.46.1.nupkg.sha512"
633
633
  },
634
634
  "Azure.Generator/1.0.0-alpha.20250508.1": {
635
635
  "type": "package",
@@ -659,12 +659,12 @@
659
659
  "path": "humanizer.core/2.14.1",
660
660
  "hashPath": "humanizer.core.2.14.1.nupkg.sha512"
661
661
  },
662
- "Microsoft.Azure.AutoRest.CSharp/3.0.0-beta.20250508.1": {
662
+ "Microsoft.Azure.AutoRest.CSharp/3.0.0-beta.20250512.2": {
663
663
  "type": "package",
664
664
  "serviceable": true,
665
- "sha512": "sha512-QSgHpzYt4ttN9ZEVUMwqfzeBTPk6S9LIH1tVaq5CaXt4oyPX8MlIL4tQJ/xkIQEmPcsIQ8W7/ASlhlQNk6+l6Q==",
666
- "path": "microsoft.azure.autorest.csharp/3.0.0-beta.20250508.1",
667
- "hashPath": "microsoft.azure.autorest.csharp.3.0.0-beta.20250508.1.nupkg.sha512"
665
+ "sha512": "sha512-5ovPncTIUw3jpI7kLutOHAyH51RFkkQMeo+gMrDLxc2+4V5Fxq4I10YtlRpsR1LyRTiFKFkaR+gVShBhlMzxtg==",
666
+ "path": "microsoft.azure.autorest.csharp/3.0.0-beta.20250512.2",
667
+ "hashPath": "microsoft.azure.autorest.csharp.3.0.0-beta.20250512.2.nupkg.sha512"
668
668
  },
669
669
  "Microsoft.Bcl.AsyncInterfaces/8.0.0": {
670
670
  "type": "package",
@@ -827,12 +827,12 @@
827
827
  "path": "stylecop.analyzers.unstable/1.2.0.333",
828
828
  "hashPath": "stylecop.analyzers.unstable.1.2.0.333.nupkg.sha512"
829
829
  },
830
- "System.ClientModel/1.4.0": {
830
+ "System.ClientModel/1.4.1": {
831
831
  "type": "package",
832
832
  "serviceable": true,
833
- "sha512": "sha512-UIAc1qwbgjXksmpVk7obZbnzPqlpWPzbfkh0LdDnI8+7rXu1zmNNrcpWof8DFUytVgNcMFwFY1lT6lGxxovARw==",
834
- "path": "system.clientmodel/1.4.0",
835
- "hashPath": "system.clientmodel.1.4.0.nupkg.sha512"
833
+ "sha512": "sha512-MY7eFGKp+Hu7Ciub8wigQ0odGrkml4eTjUy8d5Bu2eGAVvm8Qskkq+YuXiiS5wMJGq7iSvqseV4skd5WxTUdDA==",
834
+ "path": "system.clientmodel/1.4.1",
835
+ "hashPath": "system.clientmodel.1.4.1.nupkg.sha512"
836
836
  },
837
837
  "System.Collections.Immutable/8.0.0": {
838
838
  "type": "package",
@@ -217,6 +217,11 @@
217
217
  </list>
218
218
  </returns>
219
219
  </member>
220
+ <member name="M:Azure.Core.IOperation.GetRehydrationToken">
221
+ <summary>
222
+ Get a token that can be used to rehydrate the operation.
223
+ </summary>
224
+ </member>
220
225
  <member name="T:Azure.Core.OperationState">
221
226
  <summary>
222
227
  A helper structure passed to <see cref="T:Azure.Core.OperationInternal"/> to indicate the current operation state. This structure must be
@@ -593,6 +598,11 @@
593
598
  </list>
594
599
  </returns>
595
600
  </member>
601
+ <member name="M:Azure.Core.IOperation`1.GetRehydrationToken">
602
+ <summary>
603
+ Get a token that can be used to rehydrate the operation.
604
+ </summary>
605
+ </member>
596
606
  <member name="T:Azure.Core.OperationState`1">
597
607
  <summary>
598
608
  A helper structure passed to <see cref="T:Azure.Core.OperationInternal`1"/> to indicate the current operation state. This structure must be
@@ -58,17 +58,21 @@ namespace Azure.Core
58
58
  apiVersionStr = !skipApiVersionOverride && TryGetApiVersion(startRequestUri, out ReadOnlySpan<char> apiVersion) ? apiVersion.ToString() : null;
59
59
  }
60
60
  var headerSource = GetHeaderSource(requestMethod, startRequestUri, response, apiVersionStr, out string nextRequestUri, out bool isNextRequestPolling);
61
- if (headerSource == HeaderSource.None && IsFinalState(response, headerSource, out var failureState, out _))
62
- {
63
- return new CompletedOperation(failureState ?? GetOperationStateFromFinalResponse(requestMethod, response));
64
- }
65
61
 
66
62
  string? lastKnownLocation;
67
63
  if (!response.Headers.TryGetValue("Location", out lastKnownLocation))
68
64
  {
69
65
  lastKnownLocation = null;
70
66
  }
71
- return new NextLinkOperationImplementation(pipeline, requestMethod, startRequestUri, nextRequestUri, headerSource, lastKnownLocation, finalStateVia, apiVersionStr, isNextRequestPolling : isNextRequestPolling);
67
+
68
+ NextLinkOperationImplementation operation = new(pipeline, requestMethod, startRequestUri, nextRequestUri, headerSource, lastKnownLocation, finalStateVia, apiVersionStr, isNextRequestPolling: isNextRequestPolling);
69
+
70
+ if (headerSource == HeaderSource.None && IsFinalState(response, headerSource, out var failureState, out _))
71
+ {
72
+ return new CompletedOperation(failureState ?? GetOperationStateFromFinalResponse(requestMethod, response), operation);
73
+ }
74
+
75
+ return operation;
72
76
  }
73
77
 
74
78
  public static IOperation<T> Create<T>(
@@ -647,12 +651,17 @@ namespace Azure.Core
647
651
  {
648
652
  private readonly OperationState _operationState;
649
653
 
650
- public CompletedOperation(OperationState operationState)
654
+ private readonly NextLinkOperationImplementation _operation;
655
+
656
+ public CompletedOperation(OperationState operationState, NextLinkOperationImplementation operation)
651
657
  {
652
658
  _operationState = operationState;
659
+ _operation = operation;
653
660
  }
654
661
 
655
662
  public ValueTask<OperationState> UpdateStateAsync(bool async, CancellationToken cancellationToken) => new(_operationState);
663
+
664
+ public RehydrationToken GetRehydrationToken() => _operation.GetRehydrationToken();
656
665
  }
657
666
 
658
667
  private sealed class OperationToOperationOfT<T> : IOperation<T>
@@ -685,6 +694,8 @@ namespace Azure.Core
685
694
 
686
695
  return OperationState<T>.Pending(state.RawResponse);
687
696
  }
697
+
698
+ public RehydrationToken GetRehydrationToken() => _operation.GetRehydrationToken();
688
699
  }
689
700
  }
690
701
  }
@@ -119,6 +119,8 @@ namespace Azure.Core
119
119
  _operation = operation;
120
120
  }
121
121
 
122
+ public RehydrationToken GetRehydrationToken() => _operation.GetRehydrationToken();
123
+
122
124
  public async ValueTask<OperationState<VoidValue>> UpdateStateAsync(bool async, CancellationToken cancellationToken)
123
125
  {
124
126
  var state = await _operation.UpdateStateAsync(async, cancellationToken).ConfigureAwait(false);
@@ -172,6 +174,11 @@ namespace Azure.Core
172
174
  /// </list>
173
175
  /// </returns>
174
176
  ValueTask<OperationState> UpdateStateAsync(bool async, CancellationToken cancellationToken);
177
+
178
+ /// <summary>
179
+ /// Get a token that can be used to rehydrate the operation.
180
+ /// </summary>
181
+ RehydrationToken GetRehydrationToken();
175
182
  }
176
183
 
177
184
  /// <summary>
@@ -288,6 +288,10 @@ namespace Azure.Core
288
288
  {
289
289
  public ValueTask<OperationState<T>> UpdateStateAsync(bool async, CancellationToken cancellationToken)
290
290
  => throw new NotSupportedException("The operation has already completed");
291
+
292
+ // Unreachable path. _operation.GetRehydrationToken() is never invoked.
293
+ public RehydrationToken GetRehydrationToken()
294
+ => throw new NotSupportedException($"Getting the rehydration token of a {nameof(FinalOperation)} is not supported");
291
295
  }
292
296
  }
293
297
 
@@ -328,6 +332,11 @@ namespace Azure.Core
328
332
  /// </list>
329
333
  /// </returns>
330
334
  ValueTask<OperationState<T>> UpdateStateAsync(bool async, CancellationToken cancellationToken);
335
+
336
+ /// <summary>
337
+ /// Get a token that can be used to rehydrate the operation.
338
+ /// </summary>
339
+ RehydrationToken GetRehydrationToken();
331
340
  }
332
341
 
333
342
  /// <summary>
@@ -6,12 +6,12 @@
6
6
  "compilationOptions": {},
7
7
  "targets": {
8
8
  ".NETCoreApp,Version=v8.0": {
9
- "Azure.Generator.Mgmt/1.0.0-alpha.20250509.1": {
9
+ "Azure.Generator.Mgmt/1.0.0-alpha.20250514.1": {
10
10
  "dependencies": {
11
- "Azure.Core": "1.46.0",
11
+ "Azure.Core": "1.46.1",
12
12
  "Azure.Generator": "1.0.0-alpha.20250508.1",
13
13
  "Azure.ResourceManager": "1.13.0",
14
- "Microsoft.Azure.AutoRest.CSharp": "3.0.0-beta.20250508.1",
14
+ "Microsoft.Azure.AutoRest.CSharp": "3.0.0-beta.20250512.2",
15
15
  "Microsoft.SourceLink.GitHub": "8.0.0",
16
16
  "Microsoft.TypeSpec.Generator.ClientModel": "1.0.0-alpha.20250509.1",
17
17
  "SauceControl.InheritDoc": "1.2.0",
@@ -21,22 +21,22 @@
21
21
  "Azure.Generator.Mgmt.dll": {}
22
22
  }
23
23
  },
24
- "Azure.Core/1.46.0": {
24
+ "Azure.Core/1.46.1": {
25
25
  "dependencies": {
26
26
  "Microsoft.Bcl.AsyncInterfaces": "8.0.0",
27
- "System.ClientModel": "1.4.0",
27
+ "System.ClientModel": "1.4.1",
28
28
  "System.Memory.Data": "8.0.1"
29
29
  },
30
30
  "runtime": {
31
31
  "lib/net8.0/Azure.Core.dll": {
32
- "assemblyVersion": "1.46.0.0",
33
- "fileVersion": "1.4600.25.25604"
32
+ "assemblyVersion": "1.46.1.0",
33
+ "fileVersion": "1.4600.125.25909"
34
34
  }
35
35
  }
36
36
  },
37
37
  "Azure.Generator/1.0.0-alpha.20250508.1": {
38
38
  "dependencies": {
39
- "Azure.Core": "1.46.0",
39
+ "Azure.Core": "1.46.1",
40
40
  "Azure.ResourceManager": "1.13.0",
41
41
  "Microsoft.TypeSpec.Generator.ClientModel": "1.0.0-alpha.20250509.1"
42
42
  },
@@ -49,8 +49,8 @@
49
49
  },
50
50
  "Azure.ResourceManager/1.13.0": {
51
51
  "dependencies": {
52
- "Azure.Core": "1.46.0",
53
- "System.ClientModel": "1.4.0",
52
+ "Azure.Core": "1.46.1",
53
+ "System.ClientModel": "1.4.1",
54
54
  "System.Text.Json": "6.0.9"
55
55
  },
56
56
  "runtime": {
@@ -76,7 +76,7 @@
76
76
  }
77
77
  }
78
78
  },
79
- "Microsoft.Azure.AutoRest.CSharp/3.0.0-beta.20250508.1": {},
79
+ "Microsoft.Azure.AutoRest.CSharp/3.0.0-beta.20250512.2": {},
80
80
  "Microsoft.Bcl.AsyncInterfaces/8.0.0": {
81
81
  "runtime": {
82
82
  "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": {
@@ -386,7 +386,7 @@
386
386
  "Microsoft.TypeSpec.Generator.ClientModel/1.0.0-alpha.20250509.1": {
387
387
  "dependencies": {
388
388
  "Microsoft.TypeSpec.Generator": "1.0.0-alpha.20250509.1",
389
- "System.ClientModel": "1.4.0"
389
+ "System.ClientModel": "1.4.1"
390
390
  },
391
391
  "runtime": {
392
392
  "lib/net8.0/Microsoft.TypeSpec.Generator.ClientModel.dll": {
@@ -445,15 +445,15 @@
445
445
  }
446
446
  },
447
447
  "StyleCop.Analyzers.Unstable/1.2.0.333": {},
448
- "System.ClientModel/1.4.0": {
448
+ "System.ClientModel/1.4.1": {
449
449
  "dependencies": {
450
450
  "Microsoft.Extensions.Logging.Abstractions": "8.0.3",
451
451
  "System.Memory.Data": "8.0.1"
452
452
  },
453
453
  "runtime": {
454
454
  "lib/net8.0/System.ClientModel.dll": {
455
- "assemblyVersion": "1.4.0.0",
456
- "fileVersion": "1.400.25.25204"
455
+ "assemblyVersion": "1.4.1.0",
456
+ "fileVersion": "1.400.125.25905"
457
457
  }
458
458
  }
459
459
  },
@@ -619,17 +619,17 @@
619
619
  }
620
620
  },
621
621
  "libraries": {
622
- "Azure.Generator.Mgmt/1.0.0-alpha.20250509.1": {
622
+ "Azure.Generator.Mgmt/1.0.0-alpha.20250514.1": {
623
623
  "type": "project",
624
624
  "serviceable": false,
625
625
  "sha512": ""
626
626
  },
627
- "Azure.Core/1.46.0": {
627
+ "Azure.Core/1.46.1": {
628
628
  "type": "package",
629
629
  "serviceable": true,
630
- "sha512": "sha512-MNFRFDHqUBZkeViSrDX6bPfQhXsydKJXu64AntycIzSG+nemh39XCkhDvjES0uisJlHsVex/tmkfA2ZQt913DQ==",
631
- "path": "azure.core/1.46.0",
632
- "hashPath": "azure.core.1.46.0.nupkg.sha512"
630
+ "sha512": "sha512-iE5DPOlGsN5kCkF4gN+vasN1RihO0Ypie92oQ5tohQYiokmnrrhLnee+3zcE8n7vB6ZAzhPTfUGAEXX/qHGkYA==",
631
+ "path": "azure.core/1.46.1",
632
+ "hashPath": "azure.core.1.46.1.nupkg.sha512"
633
633
  },
634
634
  "Azure.Generator/1.0.0-alpha.20250508.1": {
635
635
  "type": "package",
@@ -659,12 +659,12 @@
659
659
  "path": "humanizer.core/2.14.1",
660
660
  "hashPath": "humanizer.core.2.14.1.nupkg.sha512"
661
661
  },
662
- "Microsoft.Azure.AutoRest.CSharp/3.0.0-beta.20250508.1": {
662
+ "Microsoft.Azure.AutoRest.CSharp/3.0.0-beta.20250512.2": {
663
663
  "type": "package",
664
664
  "serviceable": true,
665
- "sha512": "sha512-QSgHpzYt4ttN9ZEVUMwqfzeBTPk6S9LIH1tVaq5CaXt4oyPX8MlIL4tQJ/xkIQEmPcsIQ8W7/ASlhlQNk6+l6Q==",
666
- "path": "microsoft.azure.autorest.csharp/3.0.0-beta.20250508.1",
667
- "hashPath": "microsoft.azure.autorest.csharp.3.0.0-beta.20250508.1.nupkg.sha512"
665
+ "sha512": "sha512-5ovPncTIUw3jpI7kLutOHAyH51RFkkQMeo+gMrDLxc2+4V5Fxq4I10YtlRpsR1LyRTiFKFkaR+gVShBhlMzxtg==",
666
+ "path": "microsoft.azure.autorest.csharp/3.0.0-beta.20250512.2",
667
+ "hashPath": "microsoft.azure.autorest.csharp.3.0.0-beta.20250512.2.nupkg.sha512"
668
668
  },
669
669
  "Microsoft.Bcl.AsyncInterfaces/8.0.0": {
670
670
  "type": "package",
@@ -827,12 +827,12 @@
827
827
  "path": "stylecop.analyzers.unstable/1.2.0.333",
828
828
  "hashPath": "stylecop.analyzers.unstable.1.2.0.333.nupkg.sha512"
829
829
  },
830
- "System.ClientModel/1.4.0": {
830
+ "System.ClientModel/1.4.1": {
831
831
  "type": "package",
832
832
  "serviceable": true,
833
- "sha512": "sha512-UIAc1qwbgjXksmpVk7obZbnzPqlpWPzbfkh0LdDnI8+7rXu1zmNNrcpWof8DFUytVgNcMFwFY1lT6lGxxovARw==",
834
- "path": "system.clientmodel/1.4.0",
835
- "hashPath": "system.clientmodel.1.4.0.nupkg.sha512"
833
+ "sha512": "sha512-MY7eFGKp+Hu7Ciub8wigQ0odGrkml4eTjUy8d5Bu2eGAVvm8Qskkq+YuXiiS5wMJGq7iSvqseV4skd5WxTUdDA==",
834
+ "path": "system.clientmodel/1.4.1",
835
+ "hashPath": "system.clientmodel.1.4.1.nupkg.sha512"
836
836
  },
837
837
  "System.Collections.Immutable/8.0.0": {
838
838
  "type": "package",
@@ -217,6 +217,11 @@
217
217
  </list>
218
218
  </returns>
219
219
  </member>
220
+ <member name="M:Azure.Core.IOperation.GetRehydrationToken">
221
+ <summary>
222
+ Get a token that can be used to rehydrate the operation.
223
+ </summary>
224
+ </member>
220
225
  <member name="T:Azure.Core.OperationState">
221
226
  <summary>
222
227
  A helper structure passed to <see cref="T:Azure.Core.OperationInternal"/> to indicate the current operation state. This structure must be
@@ -593,6 +598,11 @@
593
598
  </list>
594
599
  </returns>
595
600
  </member>
601
+ <member name="M:Azure.Core.IOperation`1.GetRehydrationToken">
602
+ <summary>
603
+ Get a token that can be used to rehydrate the operation.
604
+ </summary>
605
+ </member>
596
606
  <member name="T:Azure.Core.OperationState`1">
597
607
  <summary>
598
608
  A helper structure passed to <see cref="T:Azure.Core.OperationInternal`1"/> to indicate the current operation state. This structure must be
@@ -58,17 +58,21 @@ namespace Azure.Core
58
58
  apiVersionStr = !skipApiVersionOverride && TryGetApiVersion(startRequestUri, out ReadOnlySpan<char> apiVersion) ? apiVersion.ToString() : null;
59
59
  }
60
60
  var headerSource = GetHeaderSource(requestMethod, startRequestUri, response, apiVersionStr, out string nextRequestUri, out bool isNextRequestPolling);
61
- if (headerSource == HeaderSource.None && IsFinalState(response, headerSource, out var failureState, out _))
62
- {
63
- return new CompletedOperation(failureState ?? GetOperationStateFromFinalResponse(requestMethod, response));
64
- }
65
61
 
66
62
  string? lastKnownLocation;
67
63
  if (!response.Headers.TryGetValue("Location", out lastKnownLocation))
68
64
  {
69
65
  lastKnownLocation = null;
70
66
  }
71
- return new NextLinkOperationImplementation(pipeline, requestMethod, startRequestUri, nextRequestUri, headerSource, lastKnownLocation, finalStateVia, apiVersionStr, isNextRequestPolling : isNextRequestPolling);
67
+
68
+ NextLinkOperationImplementation operation = new(pipeline, requestMethod, startRequestUri, nextRequestUri, headerSource, lastKnownLocation, finalStateVia, apiVersionStr, isNextRequestPolling: isNextRequestPolling);
69
+
70
+ if (headerSource == HeaderSource.None && IsFinalState(response, headerSource, out var failureState, out _))
71
+ {
72
+ return new CompletedOperation(failureState ?? GetOperationStateFromFinalResponse(requestMethod, response), operation);
73
+ }
74
+
75
+ return operation;
72
76
  }
73
77
 
74
78
  public static IOperation<T> Create<T>(
@@ -647,12 +651,17 @@ namespace Azure.Core
647
651
  {
648
652
  private readonly OperationState _operationState;
649
653
 
650
- public CompletedOperation(OperationState operationState)
654
+ private readonly NextLinkOperationImplementation _operation;
655
+
656
+ public CompletedOperation(OperationState operationState, NextLinkOperationImplementation operation)
651
657
  {
652
658
  _operationState = operationState;
659
+ _operation = operation;
653
660
  }
654
661
 
655
662
  public ValueTask<OperationState> UpdateStateAsync(bool async, CancellationToken cancellationToken) => new(_operationState);
663
+
664
+ public RehydrationToken GetRehydrationToken() => _operation.GetRehydrationToken();
656
665
  }
657
666
 
658
667
  private sealed class OperationToOperationOfT<T> : IOperation<T>
@@ -685,6 +694,8 @@ namespace Azure.Core
685
694
 
686
695
  return OperationState<T>.Pending(state.RawResponse);
687
696
  }
697
+
698
+ public RehydrationToken GetRehydrationToken() => _operation.GetRehydrationToken();
688
699
  }
689
700
  }
690
701
  }
@@ -119,6 +119,8 @@ namespace Azure.Core
119
119
  _operation = operation;
120
120
  }
121
121
 
122
+ public RehydrationToken GetRehydrationToken() => _operation.GetRehydrationToken();
123
+
122
124
  public async ValueTask<OperationState<VoidValue>> UpdateStateAsync(bool async, CancellationToken cancellationToken)
123
125
  {
124
126
  var state = await _operation.UpdateStateAsync(async, cancellationToken).ConfigureAwait(false);
@@ -172,6 +174,11 @@ namespace Azure.Core
172
174
  /// </list>
173
175
  /// </returns>
174
176
  ValueTask<OperationState> UpdateStateAsync(bool async, CancellationToken cancellationToken);
177
+
178
+ /// <summary>
179
+ /// Get a token that can be used to rehydrate the operation.
180
+ /// </summary>
181
+ RehydrationToken GetRehydrationToken();
175
182
  }
176
183
 
177
184
  /// <summary>
@@ -288,6 +288,10 @@ namespace Azure.Core
288
288
  {
289
289
  public ValueTask<OperationState<T>> UpdateStateAsync(bool async, CancellationToken cancellationToken)
290
290
  => throw new NotSupportedException("The operation has already completed");
291
+
292
+ // Unreachable path. _operation.GetRehydrationToken() is never invoked.
293
+ public RehydrationToken GetRehydrationToken()
294
+ => throw new NotSupportedException($"Getting the rehydration token of a {nameof(FinalOperation)} is not supported");
291
295
  }
292
296
  }
293
297
 
@@ -328,6 +332,11 @@ namespace Azure.Core
328
332
  /// </list>
329
333
  /// </returns>
330
334
  ValueTask<OperationState<T>> UpdateStateAsync(bool async, CancellationToken cancellationToken);
335
+
336
+ /// <summary>
337
+ /// Get a token that can be used to rehydrate the operation.
338
+ /// </summary>
339
+ RehydrationToken GetRehydrationToken();
331
340
  }
332
341
 
333
342
  /// <summary>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-typespec/http-client-csharp-mgmt",
3
- "version": "1.0.0-alpha.20250509.3",
3
+ "version": "1.0.0-alpha.20250513.1",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec library for emitting Azure management libraries for C#.",
6
6
  "readme": "https://github.com/Azure/azure-sdk-for-net/blob/main/eng/packages/http-client-csharp-mgmt/README.md",