Skip to content

Commit 8f2c869

Browse files
Updating RemoteRendering SDK to be based on latest API spec and make classes more mockable (Azure#18694)
This PR regenerated the SDK based on minor API changes (Azure/azure-rest-api-specs#12920) and makes the classes more mockable. # All SDK Contribution checklist: This checklist is used to make sure that common guidelines for a pull request are followed. - [ ] **Please open PR in `Draft` mode if it is:** - Work in progress or not intended to be merged. - Encountering multiple pipeline failures and working on fixes. - [x] If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above. - [ ] **I have read the [contribution guidelines](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md).** - [x] **The pull request does not introduce [breaking changes](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/breaking-change-rules.md).** ### [General Guidelines and Best Practices](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md#general-guidelines) - [x] Title of the pull request is clear and informative. - [x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### [Testing Guidelines](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md#testing-guidelines) - [x] Pull request includes test coverage for the included changes. ### [SDK Generation Guidelines](https://github.com/Azure/azure-sdk-for-net/blob/master/CONTRIBUTING.md#sdk-generation-guidelines) - [] The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code. (Track 2 only) - [ ] The `*.csproj` and `AssemblyInfo.cs` files have been updated with the new version of the SDK. Please double check nuget.org current release version. ## Additional management plane SDK specific contribution checklist: Note: Only applies to `Microsoft.Azure.Management.[RP]` or `Azure.ResourceManager.[RP]` - [ ] Include updated [management metadata](https://github.com/Azure/azure-sdk-for-net/tree/master/eng/mgmt/mgmtmetadata). - [ ] Update AzureRP.props to add/remove version info to maintain up to date API versions. ### Management plane SDK Troubleshooting - If this is very first SDK for a services and you are adding new service folders directly under /SDK, please add `new service` label and/or contact assigned reviewer. - If the check fails at the `Verify Code Generation` step, please ensure: - Do not modify any code in generated folders. - Do not selectively include/remove generated files in the PR. - Do use `generate.ps1/cmd` to generate this PR instead of calling `autorest` directly. Please pay attention to the @microsoft.csharp version output after running generate.ps1. If it is lower than current released version (2.3.82), please run it again as it should pull down the latest version, ### Old outstanding PR cleanup Please note: If PRs (including draft) has been out for more than 60 days and there are no responses from our query or followups, they will be closed to maintain a concise list for our reviewers.
1 parent f222afc commit 8f2c869

28 files changed

+202
-163
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Release History
22

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

5+
## 1.0.0-beta.2 (2021-02-11)
6+
- Reflect minor REST API improvements.
7+
- Make more classes mockable.
58

69
## 1.0.0-beta.1 (2021-02-10)
710
- Initial version of client.

sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/AssetConversionOperation.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,10 @@ public async override ValueTask<Response<AssetConversion>> WaitForCompletionAsyn
108108
}
109109
return _response;
110110
}
111+
112+
/// <summary> Initializes a new instance of AssetConversionOperation for mocking. </summary>
113+
protected AssetConversionOperation()
114+
{
115+
}
111116
}
112117
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.ComponentModel;
7+
using System.Text;
8+
9+
namespace Azure.MixedReality.RemoteRendering
10+
{
11+
/// <summary>
12+
/// Model factory that enables mocking for the Remote Rendering library.
13+
/// </summary>
14+
public static class RemoteRenderingModelFactory
15+
{
16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="AssetConversionOutput"/> class for mocking purposes.
18+
/// </summary>
19+
public static AssetConversionOutput AssetConversionOutput(Uri outputAssetUri)
20+
=> new AssetConversionOutput(outputAssetUri.ToString());
21+
22+
/// <summary>
23+
/// Initializes a new instance of the <see cref="RemoteRenderingServiceError"/> class for mocking purposes.
24+
/// </summary>
25+
public static RemoteRenderingServiceError RemoteRenderingServiceError(string code, string message, IReadOnlyList<RemoteRenderingServiceError> details, string target, RemoteRenderingServiceError innerError)
26+
=> new RemoteRenderingServiceError(code, message, details, target, innerError);
27+
28+
/// <summary>
29+
/// Initializes a new instance of the <see cref="AssetConversion"/> class for mocking purposes.
30+
/// </summary>
31+
public static AssetConversion AssetConversion(string conversionId, AssetConversionOptions options, AssetConversionOutput output, RemoteRenderingServiceError error, AssetConversionStatus status, DateTimeOffset createdOn)
32+
=> new AssetConversion(conversionId, options, output, error, status, createdOn);
33+
34+
/// <summary>
35+
/// Initializes a new instance of the <see cref="RenderingSession"/> class for mocking purposes.
36+
/// </summary>
37+
public static RenderingSession RenderingSession(string sessionId, int? arrInspectorPort, int? handshakePort, int? elapsedTimeMinutes, string host, int? maxLeaseTimeMinutes, RenderingServerSize size, RenderingSessionStatus status, float? teraflops, RemoteRenderingServiceError error, DateTimeOffset? createdOn)
38+
=> new RenderingSession(sessionId, arrInspectorPort, handshakePort, elapsedTimeMinutes, host, maxLeaseTimeMinutes, size, status, teraflops, error, createdOn);
39+
}
40+
}

sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversion.cs

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

sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionInputOptions.cs

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

sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOptions.cs

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

sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutput.cs

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

sdk/mixedreality/Azure.MixedReality.RemoteRendering/src/Generated/Models/AssetConversionOutputOptions.cs

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

0 commit comments

Comments
 (0)