-
Notifications
You must be signed in to change notification settings - Fork 207
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
http-client-java, remove logics that uses raw_lro_meta_data #4741
base: main
Are you sure you want to change the base?
http-client-java, remove logics that uses raw_lro_meta_data #4741
Conversation
No changes needing a change description found. |
export function modelIs(model: Model, name: string, namespace: string): boolean { | ||
let currentModel: Model | undefined = model; | ||
export function modelIs(model: SdkModelType | undefined, name: string, namespace: string): boolean { | ||
// use raw model because SdkModelType does not have sourceModel information |
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.
Currently I'm using raw model because SdkModelType
does not have sourceModel
information and this is by TCGC's design.
A more straightforward way is to use model.crossLanguageDefinitionId
to do the comparison and not compare for source model. Code like below:
function modelIs(model: SdkModelType | undefined, crosslanguageDefinitionId: string) {
return model.crosslanguageDefinitionId === crosslanguageDefinitionId;
}
But for model A is Azure.Core.Foundations.OperationStatus
case, model A will be generated.
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.
Yeah, this logic handle the sourceModel too.
Wondering whether TCGC have similar function.
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.
No, TCGC does not have similar function. They said for model A is Azure.Core.Foundations.OperationStatus
case, model A
be generated is expected, because when using is
definition, it is a different model. If we really want to no generate model A
, we need to use raw. /cc @tadelesh
name: string | undefined, | ||
namespace: string, | ||
): boolean { | ||
let currentOp: Operation | undefined = operation.__raw.operation; |
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 also using the raw operation currently. Because SdkHttpOperation
does not have name
and namespace
properties. But I checked the usages of operationIs
function, it is only used to check if an operation is an azure core operation. So maybe we can have below helper function.
function operationIsInAzureCore(operation: SdkHttpOperation) {
operation.crossLanguageDefinitionId.contains("Azure.Core");
}
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.
The func checks sourceOperation
too. I guess TCGC does not have this on operation yet.
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.
Yes, it's similar, TCGC does not this on operation.
You can try these changes here
|
@@ -217,8 +218,9 @@ export function getUnionDescription(union: Union, typeNameOptions: TypeNameOptio | |||
return name; | |||
} | |||
|
|||
export function modelIs(model: Model, name: string, namespace: string): boolean { | |||
let currentModel: Model | undefined = model; | |||
export function modelIs(model: SdkModelType | undefined, name: string, namespace: string): boolean { |
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 don't think model=undefined
case should be handled in this func.
It should be handled before getting into this (if no polling model, is it still an LRO?).
Not very sure about mgmt-plane, kind of remember it still have a polling model (but we probably didn't use).
No description provided.