-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[ServiceLinker] SDK validation for TypeSpec #52773
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
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
82ef0b5
regen-1
HarveyLink 3faed7f
regen-2
HarveyLink 84b9094
polish
HarveyLink a7378a2
fix tests
HarveyLink 885a2c1
update
HarveyLink 1a842a0
Merge remote-tracking branch 'upstream/main' into v-minghc-Servicelinker
HarveyLink 252f980
Add raname
HarveyLink 3f8f62f
fix comments
HarveyLink 06dccb1
rename one more
HarveyLink 10d96bd
Fix comment
HarveyLink 653462f
export api
HarveyLink 8fed577
regen samples
HarveyLink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
713 changes: 710 additions & 3 deletions
713
...ker/Azure.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.net8.0.cs
Large diffs are not rendered by default.
Oops, something went wrong.
713 changes: 710 additions & 3 deletions
713
...e.ResourceManager.ServiceLinker/api/Azure.ResourceManager.ServiceLinker.netstandard2.0.cs
Large diffs are not rendered by default.
Oops, something went wrong.
84 changes: 84 additions & 0 deletions
84
...vicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/ArmServiceLinkerModelFactory.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System.ComponentModel; | ||
| using Azure.Core; | ||
| using Azure.ResourceManager.Models; | ||
|
|
||
| namespace Azure.ResourceManager.ServiceLinker.Models | ||
| { | ||
| public static partial class ArmServiceLinkerModelFactory | ||
| { | ||
| // Add this method back due to the breaking change of models: `VnetSolution` & `SecretStore` have more properties in version 2024-07-01-preview. | ||
| /// <summary> Initializes a new instance of <see cref="Models.LinkerResourcePatch"/>. </summary> | ||
| /// <param name="targetService"> | ||
| /// The target service properties | ||
| /// Please note <see cref="TargetServiceBaseInfo"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. | ||
| /// The available derived classes include <see cref="AzureResourceInfo"/>, <see cref="ConfluentBootstrapServerInfo"/> and <see cref="ConfluentSchemaRegistryInfo"/>. | ||
| /// </param> | ||
| /// <param name="authInfo"> | ||
| /// The authentication type. | ||
| /// Please note <see cref="AuthBaseInfo"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. | ||
| /// The available derived classes include <see cref="SecretAuthInfo"/>, <see cref="ServicePrincipalCertificateAuthInfo"/>, <see cref="ServicePrincipalSecretAuthInfo"/>, <see cref="SystemAssignedIdentityAuthInfo"/> and <see cref="UserAssignedIdentityAuthInfo"/>. | ||
| /// </param> | ||
| /// <param name="clientType"> The application client type. </param> | ||
| /// <param name="provisioningState"> The provisioning state. </param> | ||
| /// <param name="solutionType"> The VNet solution. </param> | ||
| /// <param name="secretStoreKeyVaultId"> An option to store secret value in secure place. </param> | ||
| /// <param name="scope"> connection scope in source service. </param> | ||
| /// <returns> A new <see cref="Models.LinkerResourcePatch"/> instance for mocking. </returns> | ||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||
| public static LinkerResourcePatch LinkerResourcePatch(TargetServiceBaseInfo targetService, AuthBaseInfo authInfo, LinkerClientType? clientType, string provisioningState, VnetSolutionType? solutionType, ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) | ||
| { | ||
| return LinkerResourcePatch( | ||
| targetService, | ||
| authInfo, | ||
| clientType, | ||
| provisioningState, | ||
| solutionType != null ? new VnetSolution() { SolutionType = solutionType } : null, | ||
| secretStoreKeyVaultId != null ? new LinkerSecretStore() { KeyVaultId = secretStoreKeyVaultId } : null, | ||
| scope); | ||
| } | ||
|
|
||
| // Add this method back due to the breaking change of models: `VnetSolution` & `SecretStore` have more properties in version 2024-07-01-preview. | ||
| /// <summary> Initializes a new instance of <see cref="ServiceLinker.LinkerResourceData"/>. </summary> | ||
| /// <param name="id"> The id. </param> | ||
| /// <param name="name"> The name. </param> | ||
| /// <param name="resourceType"> The resourceType. </param> | ||
| /// <param name="systemData"> The systemData. </param> | ||
| /// <param name="targetService"> | ||
| /// The target service properties | ||
| /// Please note <see cref="TargetServiceBaseInfo"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. | ||
| /// The available derived classes include <see cref="AzureResourceInfo"/>, <see cref="ConfluentBootstrapServerInfo"/> and <see cref="ConfluentSchemaRegistryInfo"/>. | ||
| /// </param> | ||
| /// <param name="authInfo"> | ||
| /// The authentication type. | ||
| /// Please note <see cref="AuthBaseInfo"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. | ||
| /// The available derived classes include <see cref="SecretAuthInfo"/>, <see cref="ServicePrincipalCertificateAuthInfo"/>, <see cref="ServicePrincipalSecretAuthInfo"/>, <see cref="SystemAssignedIdentityAuthInfo"/> and <see cref="UserAssignedIdentityAuthInfo"/>. | ||
| /// </param> | ||
| /// <param name="clientType"> The application client type. </param> | ||
| /// <param name="provisioningState"> The provisioning state. </param> | ||
| /// <param name="solutionType"> The VNet solution. </param> | ||
| /// <param name="secretStoreKeyVaultId"> An option to store secret value in secure place. </param> | ||
| /// <param name="scope"> connection scope in source service. </param> | ||
| /// <returns> A new <see cref="ServiceLinker.LinkerResourceData"/> instance for mocking. </returns> | ||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||
| public static LinkerResourceData LinkerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, TargetServiceBaseInfo targetService, AuthBaseInfo authInfo, LinkerClientType? clientType, string provisioningState, VnetSolutionType? solutionType, ResourceIdentifier secretStoreKeyVaultId = null, string scope = null) | ||
| { | ||
| return LinkerResourceData( | ||
| id, | ||
| name, | ||
| resourceType, | ||
| systemData, | ||
| targetService, | ||
| authInfo, | ||
| clientType, | ||
| provisioningState, | ||
| solutionType != null ? new VnetSolution() { SolutionType = solutionType } : null, | ||
| secretStoreKeyVaultId != null ? new LinkerSecretStore() { KeyVaultId = secretStoreKeyVaultId } : null, | ||
| scope); | ||
| } | ||
| } | ||
| } |
41 changes: 41 additions & 0 deletions
41
sdk/servicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/LinkerResourceData.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System.ComponentModel; | ||
| using Azure.Core; | ||
| using Azure.ResourceManager.ServiceLinker.Models; | ||
|
|
||
| namespace Azure.ResourceManager.ServiceLinker | ||
| { | ||
| // Add the properties back due to the breaking change of models: `VnetSolution` & `SecretStore` have more properties in version 2024-07-01-preview. | ||
| public partial class LinkerResourceData | ||
| { | ||
| /// <summary> Type of VNet solution. </summary> | ||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||
| public VnetSolutionType? SolutionType | ||
| { | ||
| get => VnetSolution is null ? default : VnetSolution.SolutionType; | ||
| set | ||
| { | ||
| if (VnetSolution is null) | ||
| VnetSolution = new VnetSolution(); | ||
| VnetSolution.SolutionType = value; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> The key vault id to store secret. </summary> | ||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||
| public ResourceIdentifier SecretStoreKeyVaultId | ||
| { | ||
| get => SecretStore is null ? default : SecretStore.KeyVaultId; | ||
| set | ||
| { | ||
| if (SecretStore is null) | ||
| SecretStore = new LinkerSecretStore(); | ||
| SecretStore.KeyVaultId = value; | ||
| } | ||
| } | ||
| } | ||
| } | ||
40 changes: 40 additions & 0 deletions
40
...ervicelinker/Azure.ResourceManager.ServiceLinker/src/Custom/Models/LinkerResourcePatch.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System.ComponentModel; | ||
| using Azure.Core; | ||
|
|
||
| namespace Azure.ResourceManager.ServiceLinker.Models | ||
| { | ||
| // Add the properties back due to the breaking change of models: `VnetSolution` & `SecretStore` have more properties in version 2024-07-01-preview. | ||
|
ArcturusZhang marked this conversation as resolved.
|
||
| public partial class LinkerResourcePatch | ||
| { | ||
| /// <summary> Type of VNet solution. </summary> | ||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||
| public VnetSolutionType? SolutionType | ||
| { | ||
| get => VnetSolution is null ? default : VnetSolution.SolutionType; | ||
| set | ||
| { | ||
| if (VnetSolution is null) | ||
| VnetSolution = new VnetSolution(); | ||
| VnetSolution.SolutionType = value; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> The key vault id to store secret. </summary> | ||
| [EditorBrowsable(EditorBrowsableState.Never)] | ||
| public ResourceIdentifier SecretStoreKeyVaultId | ||
| { | ||
| get => SecretStore is null ? default : SecretStore.KeyVaultId; | ||
| set | ||
| { | ||
| if (SecretStore is null) | ||
| SecretStore = new LinkerSecretStore(); | ||
| SecretStore.KeyVaultId = value; | ||
| } | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.