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

Update NextLinkOperationImplementation to support LRO rehydration #2843

Closed
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5775771
implement operation id
fengzhou-msft Oct 27, 2022
218c786
calculate operation id
fengzhou-msft Nov 7, 2022
a1ef6ce
add GetOperationId method
fengzhou-msft Nov 14, 2022
2c74c21
update shared source
fengzhou-msft Nov 16, 2022
8604360
implement LRO id
fengzhou-msft Nov 16, 2022
7b52195
temporary update on DownloadSharedSource.ps1
fengzhou-msft Nov 16, 2022
3518408
Merge branch 'feature/v3' of github.com:Azure/autorest.csharp into su…
fengzhou-msft Nov 16, 2022
fc1f157
fix comment in ps
fengzhou-msft Nov 16, 2022
d67dc92
update shared files
fengzhou-msft Nov 18, 2022
a80f359
update LRO creation
fengzhou-msft Nov 18, 2022
5881c40
update shared files
fengzhou-msft Nov 18, 2022
e77551a
Merge branch 'feature/v3' of github.com:Azure/autorest.csharp into su…
fengzhou-msft Nov 18, 2022
09f8b95
Merge branch 'feature/v3' of github.com:Azure/autorest.csharp into su…
fengzhou-msft Nov 29, 2022
1a892e0
Merge branch 'feature/v3' of github.com:Azure/autorest.csharp into su…
fengzhou-msft Dec 13, 2022
cd9e928
changes for .NET 7
fengzhou-msft Dec 14, 2022
38f069e
Merge branch 'feature/v3' of github.com:Azure/autorest.csharp into su…
fengzhou-msft Dec 14, 2022
5ac5c30
update shared code
fengzhou-msft Dec 15, 2022
56d0460
revert IOperationSource change
fengzhou-msft Dec 15, 2022
96d330e
Merge branch 'feature/v3' of github.com:Azure/autorest.csharp into su…
fengzhou-msft Jan 9, 2023
176a1f3
revert samples and tests
fengzhou-msft Jan 9, 2023
92d5e20
update shared code
fengzhou-msft Jan 12, 2023
f343c36
Merge branch 'feature/v3' of github.com:Azure/autorest.csharp into su…
fengzhou-msft Jan 12, 2023
b30f757
remove FinalResponse from id
fengzhou-msft Feb 10, 2023
6fd0f01
merge feature/v3
fengzhou-msft Feb 10, 2023
ed449de
update DownloadSharedSource
fengzhou-msft Mar 1, 2023
a238aa5
Merge branch 'feature/v3' of github.com:Azure/autorest.csharp into su…
fengzhou-msft Mar 1, 2023
325718a
update shared source
fengzhou-msft Mar 1, 2023
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
3 changes: 2 additions & 1 deletion eng/DownloadSharedSource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ $files = @('AsyncLockWithValue.cs', 'ClientDiagnostics.cs', 'DiagnosticScope.cs'
'Multipart/MultipartContent.cs', 'AzureKeyCredentialPolicy.cs', 'AppContextSwitchHelper.cs',
'ConstantDelayStrategy.cs', 'DelayStrategy.cs', 'ExponentialDelayStrategy.cs', 'OperationPoller.cs', 'RetryAfterDelayStrategy.cs',
'ForwardsClientCallsAttribute.cs', 'AsyncLockWithValue.cs', 'VoidValue.cs')
$baseUrl = 'https://raw.githubusercontent.com/Azure/azure-sdk-for-net/main/sdk/core/Azure.Core/src/Shared/'
# TODO: temporary change to target at support_lro_rehydration branch
$baseUrl = 'https://raw.githubusercontent.com/Azure/azure-sdk-for-net/support_lro_rehydration/sdk/core/Azure.Core/src/Shared/'
Comment on lines +22 to +23
Copy link
Member Author

Choose a reason for hiding this comment

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

Revert before merge.

DownloadAll $files $baseUrl $downloadPath

#Download management Shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ internal StorageArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline p
_operation = new OperationInternal(clientDiagnostics, nextLinkOperation, response, "StorageArmOperation", fallbackStrategy: new ExponentialDelayStrategy());
}

internal StorageArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string id)
{
var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, id, out string finalResponse);
_operation = OperationInternal.Create(clientDiagnostics, nextLinkOperation, finalResponse, "StorageArmOperation", fallbackStrategy: new ExponentialDelayStrategy());
}

/// <inheritdoc />
#pragma warning disable CA1822
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public override string Id => throw new NotImplementedException();
#pragma warning restore CA1822
public override string Id => _operation.GetOperationId();

/// <inheritdoc />
public override bool HasCompleted => _operation.HasCompleted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ internal StorageArmOperation(IOperationSource<T> source, ClientDiagnostics clien
_operation = new OperationInternal<T>(clientDiagnostics, nextLinkOperation, response, "StorageArmOperation", fallbackStrategy: new ExponentialDelayStrategy());
}

internal StorageArmOperation(IOperationSource<T> source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string id)
{
var nextLinkOperation = NextLinkOperationImplementation.Create(source, pipeline, id, out string finalResponse);
_operation = OperationInternal<T>.Create(source, clientDiagnostics, nextLinkOperation, finalResponse, "StorageArmOperation", fallbackStrategy: new ExponentialDelayStrategy());
}

/// <inheritdoc />
#pragma warning disable CA1822
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public override string Id => throw new NotImplementedException();
#pragma warning restore CA1822
public override string Id => _operation.GetOperationId();

/// <inheritdoc />
public override T Value => _operation.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ internal SampleArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pi
_operation = new OperationInternal(clientDiagnostics, nextLinkOperation, response, "SampleArmOperation", fallbackStrategy: new ExponentialDelayStrategy());
}

internal SampleArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string id)
{
var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, id, out string finalResponse);
_operation = OperationInternal.Create(clientDiagnostics, nextLinkOperation, finalResponse, "SampleArmOperation", fallbackStrategy: new ExponentialDelayStrategy());
}

/// <inheritdoc />
#pragma warning disable CA1822
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public override string Id => throw new NotImplementedException();
#pragma warning restore CA1822
public override string Id => _operation.GetOperationId();

/// <inheritdoc />
public override bool HasCompleted => _operation.HasCompleted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ internal SampleArmOperation(IOperationSource<T> source, ClientDiagnostics client
_operation = new OperationInternal<T>(clientDiagnostics, nextLinkOperation, response, "SampleArmOperation", fallbackStrategy: new ExponentialDelayStrategy());
}

internal SampleArmOperation(IOperationSource<T> source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string id)
{
var nextLinkOperation = NextLinkOperationImplementation.Create(source, pipeline, id, out string finalResponse);
_operation = OperationInternal<T>.Create(source, clientDiagnostics, nextLinkOperation, finalResponse, "SampleArmOperation", fallbackStrategy: new ExponentialDelayStrategy());
}

/// <inheritdoc />
#pragma warning disable CA1822
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public override string Id => throw new NotImplementedException();
#pragma warning restore CA1822
public override string Id => _operation.GetOperationId();

/// <inheritdoc />
public override T Value => _operation.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,17 @@ public void Write()
}
_writer.Line();

using (_writer.Scope($"internal {_name}({_operationSourceString}{typeof(ClientDiagnostics)} clientDiagnostics, {typeof(HttpPipeline)} pipeline, {typeof(string)} id)"))
{
var nextLinkOperation = new CodeWriterDeclaration("nextLinkOperation");
_writer.Line($"var {nextLinkOperation:D} = {typeof(NextLinkOperationImplementation)}.{nameof(NextLinkOperationImplementation.Create)}({_sourceString}pipeline, id, out {typeof(string)} finalResponse);");
_writer.Line($"_operation = {_operationInternalType}.Create({_sourceString}clientDiagnostics, {nextLinkOperation}, finalResponse, {_name:L}, fallbackStrategy: new {typeof(ExponentialDelayStrategy)}());");
}
_writer.Line();

_writer.WriteXmlDocumentationInheritDoc();
_writer
.LineRaw("#pragma warning disable CA1822")
.LineRaw($"[{typeof(EditorBrowsableAttribute)}({typeof(EditorBrowsableState)}.{nameof(EditorBrowsableState.Never)})]")
.LineRaw("public override string Id => throw new NotImplementedException();")
.LineRaw("#pragma warning restore CA1822")
.LineRaw("public override string Id => _operation.GetOperationId();")
.Line();

if (_isGeneric)
Expand Down
Loading