The protocol methods AutoRest-Java generates look like this:
Response<BinaryData> methodCallWithResponse(String param1, String param2, BinaryData body, RequestOptions options);
Mono<Response<BinaryData>> methodCallWithResponse(String param1, String param2, BinaryData body, RequestOptions options);
Compared to the high level methods, here are some of the advantages protocol methods have against breaking changes:
When the service adds a new operation, we generate a method for it. This operation will have a new name and so it will be generated as a new method on the SDK, so there is no impact to existing methods.
Protocol methods do not inspect the body of a response and so any changes made by the service team have no impact on the SDK itself.
However status code still matters.
Changes to the Request BodyProtocol methods do not inspect the body of a request so any changes the service team makes to the shape of the body of a request do not have any impact on the SDK itself.
Adding New Optional ParametersOptional parameters are provided on RequestOptions
through addQueryParam()
and addHeader()
methods. Therefore any changes made by the service have no impact on the SDK itself.
When convenience methods are added, we expect our clients to contain both convenience methods and the protocol methods:
Foo methodCall(String param1, String param2, Bar body); Foo methodCall(String param1, String param2, Bar body, String optionalParam1, int operationParam2); Response<Foo> methodCallWithResponse(String param1, String param2, Bar body, String optionalParam1, int operationParam2, Context context); Response<BinaryData> methodCallWithResponse(String param1, String param2, BinaryData body, RequestOptions options);
Mono<Foo> methodCall(String param1, String param2, Bar body); Mono<Foo> methodCall(String param1, String param2, Bar body, String optionalParam1, int operationParam2); Mono<Response<Foo>> methodCallWithResponse(String param1, String param2, Bar body, String optionalParam1, int operationParam2); Mono<Response<BinaryData>> methodCallWithResponse(String param1, String param2, BinaryData body, RequestOptions options);Generate code in files with hand-written code
See Partial Update and Customization.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4