Clear and concise description of the problem
We should have an option to generate the max overloads (WithResponse methods) with models instead of BinaryData. We should have support for generating with just models, just BinaryData or both.
In tspconfig.yaml:
"@azure-tools/typespec-java":
namespace: "com.azure.sample.library"
partial-update: true
flavor: azure
max-overload: all
The above config should generate the following two methods:
public Response<BinaryData> createFooWithResponse(BinaryData createFooOptions, RequestOptions requestOptions); // protocol method
public Response<FooDetails> createFooWithResponse(CreateFooOptions createFooOptions, RequestOptions requestOptions); // max overload with models
The other values for max-overload config would be protocol or model.
For scenarios where we can only support protocol methods (like patch or MFD), we ignore this flag and generate only protocol methods.
When the config is set to all and the WithResponse overloads for protocol and model differs only in the return type (i.e. the input params are identical and therefore cannot have overloads based on just return type), then we fall back to protocol method (existing behavior).
Checklist
Clear and concise description of the problem
We should have an option to generate the max overloads (
WithResponsemethods) with models instead ofBinaryData. We should have support for generating with just models, justBinaryDataor both.In tspconfig.yaml:
The above config should generate the following two methods:
The other values for
max-overloadconfig would beprotocolormodel.For scenarios where we can only support protocol methods (like patch or MFD), we ignore this flag and generate only protocol methods.
When the config is set to
alland theWithResponseoverloads for protocol and model differs only in the return type (i.e. the input params are identical and therefore cannot have overloads based on just return type), then we fall back to protocol method (existing behavior).Checklist