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

[feature] ClientInitialization/ParamAlias Implementation #4366

Open
chunyu3 opened this issue Sep 9, 2024 · 1 comment
Open

[feature] ClientInitialization/ParamAlias Implementation #4366

chunyu3 opened this issue Sep 9, 2024 · 1 comment
Assignees
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Comments

@chunyu3
Copy link
Contributor

chunyu3 commented Sep 9, 2024

Is it possible to move parameters that persist on each operation to the client instead with a decorator of some sort? In EventGrid this shows up in the case of

client()
publish(topic_name, events)
receive(topic_name, subscription_name, max_events)
ack(topic_name, subscription_name, lock_tokens)

to

client(topic_name, subscription_name)
publish(events)
receive(max_events)
ack(lock_tokens)

tcgc will introduce a decorator @clientInitialization to bump a operation parameter to client level, Azure/typespec-azure#914

.NET codegen will adopt the bump information to generate the client with the bumped parameter, methods will not take this parameter in signature.
When the client is sub-client, the bumped parameter will be the parameter in the GetAccossor method in parent client
e.g.
parent.GetSubClient(topic_name)

@chunyu3 chunyu3 self-assigned this Sep 9, 2024
@chunyu3 chunyu3 added emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp and removed needs-area labels Sep 9, 2024
@JoshLove-msft JoshLove-msft added compiler:core Issues for @typespec/compiler and removed emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp labels Nov 13, 2024
@chunyu3 chunyu3 changed the title [feature] bump a operation paramter to client level [feature] ClientInitialization/ParamAlias Implementation Dec 5, 2024
@chunyu3 chunyu3 added emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp and removed compiler:core Issues for @typespec/compiler labels Dec 5, 2024
@chunyu3
Copy link
Contributor Author

chunyu3 commented Dec 5, 2024

see detail in Azure/autorest.csharp#5131

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp
Projects
None yet
Development

No branches or pull requests

2 participants