Open MaryGao opened 2 months ago
prefer to generate KnownVersions and update the document link in ClientOptions.
Can we just emit a fixed union and have users cast to any if they need to provide an unknown api version?
export interface EdgeZonesClientOptionalParams extends ClientOptions {
/** The API version to use for this operation. */
apiVersion?: "2024-04-01-preview";
}
@joheredi Personally I prefer here to generate as string and with document enhancement for knownable values. Let me know how you think of this!
Firstly I'd like to clarify one thing here, there will be two concepts of api version,
apiVersion
parameter which is defined as client-level or method-level parameter with type string
in TCGC included in getAllOperationsVersions
enum which is included in getAllModels in TCGC with Usage.VersionRegarding the types these two versions are independent with each other but considering only one client-leve apiVesion case, we are talking about - if we could be smart to indicate the possible values for that parameter. I think a weak linkage between them would be better with following considerations:
generate what tsp defined
string
type is a better open door for them with changing default one.Offline confired with Jose, we agreed to go with Option 2 - Generate as KnownVersions and link it to client option.
This is from the discussion. With the case we have client-level api version defined.
Then we would generate
string
as client options. And also generating a fixed & orphan Versions enum from getAllModels with Usage.Version.This may not be proper because the api version is an extensible enum which allows customers to pass a list outside the enums.
To solve this we could either ignore this value or generate as extensible enum
export interface EdgeZonesClientOptionalParams extends ClientOptions { /** The API version to use for this operation.
Both are okay for me and personally i prefer generating as KnownVersions which could help suggest values in client side.