-
Notifications
You must be signed in to change notification settings - Fork 41
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] add client initialization usage #1664
base: main
Are you sure you want to change the base?
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes here
|
export interface SdkInitializationType extends SdkModelType { | ||
properties: SdkParameter[]; | ||
export interface SdkInitializationType { | ||
access: AccessFlags; |
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've realized we can't modify the .access
on our existing SdkInitializationType
to denote whether a client is publicly or internally initialized. There is both the context that the client options model is used, and the client options model itself. In this case, the context that the client options model is used has access
that depends on whether it's a client or og. However, that doesn't change the actual access
of the client options model itself.
This is a breaking change, so want to call this out and will call it out more in our sync
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.
left some comments, and i think for default access settings, we shall consider: #1702.
model: Model, | ||
): SdkInitializationType { | ||
// convert to SDK type | ||
const existingModel = context.modelsMap?.get(model) as SdkModelType<SdkParameter> | undefined; |
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.
do we allow to reuse model in operation as a client initialization model? if so, can we have a test? if not, we could return directly and shall have some lint.
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.
@m-nash since c# appears to be the main sdk using client initialization model generation, is there anything precluding us from having a model be used in both scenarios?
…m/Azure/typespec-azure into tcgc/addClientInitializationUsage
fixes #1518, #1707