Azure / autorest.csharp

Extension for AutoRest (https://github.com/Azure/autorest) that generates C# code
MIT License
142 stars 165 forks source link

[feature] bump a operation paramter to client level #5023

Closed chunyu3 closed 1 week ago

chunyu3 commented 1 month ago

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, https://github.com/Azure/typespec-azure/issues/914

.NET codegen will adopt the bump information to generate the client with the bumped parameter, methods will not take this parameter in signature.

chunyu3 commented 1 week ago

This is already supported in PR https://github.com/Azure/autorest.csharp/pull/5063