-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix missing constructor parameters in model factory nested UpdateProperties generation #55438
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
17c7c62
Initial plan
Copilot 330015a
Add test TypeSpec for investigating ClusterUpdateProperties pattern
Copilot 860b1e8
Fix missing constructor parameters in nested UpdateProperties generation
Copilot 239e5ee
Add test TypeSpec to verify ClusterUpdateProperties fix
Copilot e57acf5
Merge from latest main and resolve conflicts
Copilot a4f3185
Merge branch 'main' into copilot/fix-xxx-factory-parameters
Copilot 7deac1c
Merge remote-tracking branch 'origin/main' into copilot/fix-xxx-facto…
Copilot 006917b
Address review comment: use Default.CastTo instead of Null
live1206 dbf9606
Merge from main and regenerate test projects
live1206 affcb95
Add test case for issue #55436 - Missing constructor parameters in fa…
live1206 e2c6f6d
Merge remote-tracking branch 'origin/main' into copilot/fix-xxx-facto…
live1206 80720bd
Merge branch 'main' into copilot/fix-xxx-factory-parameters
Copilot ece96eb
Revert package-lock.json changes to match main branch
Copilot 5b78315
Merge branch 'main' into copilot/fix-xxx-factory-parameters
Copilot 58ea361
Merge branch 'main' into copilot/fix-xxx-factory-parameters
Copilot 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
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
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
229 changes: 229 additions & 0 deletions
229
...es/http-client-csharp-mgmt/generator/TestProjects/Local/Mgmt-TypeSpec/redisenterprise.tsp
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,229 @@ | ||
| import "@typespec/http"; | ||
| import "@typespec/rest"; | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
|
|
||
| using TypeSpec.Http; | ||
| using TypeSpec.Rest; | ||
| using Azure.Core; | ||
| using Azure.ResourceManager; | ||
|
|
||
| namespace MgmtTypeSpec { | ||
|
|
||
| @armResourceOperations | ||
| interface Clusters { | ||
| get is ArmResourceRead<Cluster>; | ||
| createOrUpdate is ArmResourceCreateOrReplaceAsync<Cluster>; | ||
| update is ArmResourcePatchAsync<Cluster, ClusterUpdate>; | ||
| delete is ArmResourceDeleteAsync<Cluster>; | ||
| listByResourceGroup is ArmResourceListByParent<Cluster>; | ||
| listBySubscription is ArmListBySubscription<Cluster>; | ||
| } | ||
|
|
||
| model Cluster is TrackedResource<ClusterProperties> { | ||
| ...ResourceNameParameter<Cluster>; | ||
| } | ||
|
|
||
| model ClusterUpdate { | ||
| /** | ||
| * The SKU to create, which affects price, performance, and features. | ||
| */ | ||
| sku?: Sku; | ||
|
|
||
| /** | ||
| * Other properties of the cluster. | ||
| */ | ||
| properties?: ClusterUpdateProperties; | ||
|
|
||
| /** | ||
| * The identity of the resource. | ||
| */ | ||
| identity?: ManagedServiceIdentityProperty; | ||
|
|
||
| /** | ||
| * Resource tags. | ||
| */ | ||
| @visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update) | ||
| tags?: Record<string>; | ||
| } | ||
|
|
||
| model ClusterUpdateProperties extends ClusterProperties { | ||
| /** | ||
| * Whether or not public network traffic can access the Redis cluster. | ||
| */ | ||
| publicNetworkAccess?: PublicNetworkAccess | null; | ||
| } | ||
|
|
||
| model ClusterProperties { | ||
| /** | ||
| * Enabled by default. If highAvailability is disabled, the data set is not replicated. | ||
| */ | ||
| highAvailability?: HighAvailability; | ||
|
|
||
| /** | ||
| * The minimum TLS version for the cluster to support, e.g. '1.2'. | ||
| */ | ||
| minimumTlsVersion?: TlsVersion; | ||
|
|
||
| /** | ||
| * Encryption-at-rest configuration for the cluster. | ||
| */ | ||
| encryption?: ClusterPropertiesEncryption; | ||
|
|
||
| /** | ||
| * Cluster-level maintenance configuration. | ||
| */ | ||
| @visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update) | ||
| maintenanceConfiguration?: MaintenanceConfiguration; | ||
|
|
||
| /** | ||
| * DNS name of the cluster endpoint | ||
| */ | ||
| @visibility(Lifecycle.Read) | ||
| hostName?: string; | ||
|
|
||
| /** | ||
| * Current provisioning status of the cluster | ||
| */ | ||
| @visibility(Lifecycle.Read) | ||
| provisioningState?: ProvisioningState; | ||
|
|
||
| /** | ||
| * Explains the current redundancy strategy of the cluster. | ||
| */ | ||
| @visibility(Lifecycle.Read) | ||
| redundancyMode?: RedundancyMode; | ||
|
|
||
| /** | ||
| * Current resource status of the cluster | ||
| */ | ||
| @visibility(Lifecycle.Read) | ||
| resourceState?: ResourceState; | ||
|
|
||
| /** | ||
| * Version of redis the cluster supports, e.g. '6' | ||
| */ | ||
| @visibility(Lifecycle.Read) | ||
| redisVersion?: string; | ||
|
|
||
| /** | ||
| * List of private endpoint connections | ||
| */ | ||
| @visibility(Lifecycle.Read) | ||
| privateEndpointConnections?: RedisPrivateEndpointConnection[]; | ||
| } | ||
|
|
||
| model Sku { | ||
| name: SkuName; | ||
| capacity?: int32; | ||
| } | ||
|
|
||
| model ClusterPropertiesEncryption { | ||
| customerManagedKeyEncryption?: CustomerManagedKeyEncryption; | ||
| } | ||
|
|
||
| model CustomerManagedKeyEncryption { | ||
| keyEncryptionKeyIdentity?: KeyEncryptionKeyIdentity; | ||
| keyEncryptionKeyUrl?: string; | ||
| } | ||
|
|
||
| model KeyEncryptionKeyIdentity { | ||
| userAssignedIdentityResourceId?: string; | ||
| identityType?: CmkIdentityType; | ||
| } | ||
|
|
||
| model MaintenanceConfiguration { | ||
| maintenanceWindows?: MaintenanceWindow[]; | ||
| } | ||
|
|
||
| model MaintenanceWindow { | ||
| dayOfWeek?: DayOfWeek; | ||
| startHour?: int32; | ||
| duration?: int32; | ||
| } | ||
|
|
||
| enum SkuName { | ||
| Standard, | ||
| Premium, | ||
| } | ||
|
|
||
| enum HighAvailability { | ||
| Enabled, | ||
| Disabled, | ||
| } | ||
|
|
||
| enum TlsVersion { | ||
| "1.0", | ||
| "1.1", | ||
| "1.2", | ||
| } | ||
|
|
||
| enum PublicNetworkAccess { | ||
| Enabled, | ||
| Disabled, | ||
| } | ||
|
|
||
| enum ProvisioningState { | ||
| Succeeded, | ||
| Failed, | ||
| Canceled, | ||
| Creating, | ||
| Updating, | ||
| Deleting, | ||
| } | ||
|
|
||
| enum RedundancyMode { | ||
| Disabled, | ||
| GeoReplicated, | ||
| ZoneReplicated, | ||
| } | ||
|
|
||
| enum ResourceState { | ||
| Running, | ||
| Creating, | ||
| Updating, | ||
| Deleting, | ||
| Disabled, | ||
| } | ||
|
|
||
| enum CmkIdentityType { | ||
| SystemAssignedIdentity, | ||
| UserAssignedIdentity, | ||
| } | ||
|
|
||
| enum DayOfWeek { | ||
| Monday, | ||
| Tuesday, | ||
| Wednesday, | ||
| Thursday, | ||
| Friday, | ||
| Saturday, | ||
| Sunday, | ||
| } | ||
|
|
||
| model RedisPrivateEndpointConnection is ProxyResource<RedisPrivateEndpointConnectionProperties> { | ||
| ...ResourceNameParameter<RedisPrivateEndpointConnection>; | ||
| } | ||
|
|
||
| model RedisPrivateEndpointConnectionProperties { | ||
| privateEndpoint?: RedisPrivateEndpoint; | ||
| privateLinkServiceConnectionState: RedisPrivateLinkServiceConnectionState; | ||
| provisioningState?: ProvisioningState; | ||
| } | ||
|
|
||
| model RedisPrivateEndpoint { | ||
| id?: string; | ||
| } | ||
|
|
||
| model RedisPrivateLinkServiceConnectionState { | ||
| status?: RedisPrivateEndpointServiceConnectionStatus; | ||
| description?: string; | ||
| actionsRequired?: string; | ||
| } | ||
|
|
||
| enum RedisPrivateEndpointServiceConnectionStatus { | ||
| Pending, | ||
| Approved, | ||
| Rejected, | ||
| } | ||
| } |
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.