-
Notifications
You must be signed in to change notification settings - Fork 46
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
[tcgc] client initialization #2027
base: release/january-2025
Are you sure you want to change the base?
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes here
|
c37f03e
to
cc35540
Compare
two things to be discussed:
|
Note that for Java, we again want to know whether the e.g. It maybe supported by 2 ways.
I am not sure whether JavaScript have similar ask. |
i think tcgc could give you a flag to not set default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love it, thanks for the quick turnaround @tadelesh!
* @deprecated Use `init.paramters` instead. | ||
*/ | ||
initialization: SdkInitializationType; | ||
init: SdkClientInitializationType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, personally I'd like the full word initialization
. But appears here we name it init
because we need to handle the deprecate procedure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not 100% like current name. but not have more idea. @iscai-msft do you have any suggestion. this pr will not break anything, but just deprecate things, so we could not use previous property name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could change the whole thing to "constructor" instead of "initialization"? Don't know if it's that much work though, I'm ok with init
if we want to keep it that way
Current design (not finalized) in Java would be an emitter option to control what emitter handles the subclients on "parent". Therefore, no flag needed, at present. |
Design doc is included in this PR.
1.Change
@clientInitialization
decorator'soptions
parameter toClientInitializationOptions
type. The options now could set how to initialize the client. Though the implementation could support backward compatibility, it's better to have all specs that use this decorator change from@clientInitialization(CustomizedOption)
to@clientInitialization({parameters: CustomizedOption})
. A new helpergetClientInitializationOptions
is added for getting the newClientInitializationOptions
info from the@clientInitialization
decorator.2. Add new
children
property toSdkClientType
to include all the sub client belong to that client.3. Add
init
property toSdkClientType
. Its type isSdkClientInitializationType
which includes the initialization parameters and how to initialize the client.4. Deprecate
initialization
property ofSdkClientType
. Useinit.paramters
ofSdkClientType
instead.5. Deprecate
SdkClientAccessor
type. Useparent
andchildren
property fromSdkClientType
to find client hierarchy instead.Also resolve: #1696, #1702, #1707, #1715