Java - update to delete allowed status #697
Java - update to delete allowed status #697shrutiburman merged 2 commits intotwilio-java-generation-modernisationfrom
Conversation
| public boolean delete(final TwilioRestClient client) { | ||
| {{>common/generateUri}} | ||
|
|
||
|
|
There was a problem hiding this comment.
Essentially, this is the expected change in Deleter files.
| path = path.replace("{"+"TestInteger"+"}", this.pathTestInteger.toString()); | ||
|
|
||
|
|
||
| Predicate<Integer> deleteStatues = i -> i != null && i >= 200 && i < 300; |
There was a problem hiding this comment.
Effective change -->
| throw new ApiException(restException); | ||
| } | ||
| return response.getStatusCode() == 204; | ||
| return deleteStatues.test(response.getStatusCode()); |
There was a problem hiding this comment.
Effective change -->
|
Can you create a preview PR in twilio-java with this? |
Is there a cmd or way to do that? Do you want to see the resultant changes? We can see that in here too, I have marked the change with comment "effective change" in file |
| {{>common/generateUri}} | ||
|
|
||
|
|
||
| Predicate<Integer> deleteStatues = i -> i != null && i >= 200 && i < 300; |
There was a problem hiding this comment.
This repeats itself at all classes. What if we create a static method of this and use that?
Less code duplication
There was a problem hiding this comment.
This line is only applicable in case of Delete operations, its present in the deleter files only, not reused. dont see any point of making it a public method.
|
I generated the preview PR - twilio/twilio-java#922 |
src/main/resources/twilio-java/deleter/operationMethod.mustache
Outdated
Show resolved
Hide resolved
|
9e4b097
into
twilio-java-generation-modernisation

Fixes # https://twilio-engineering.atlassian.net/browse/DII-2123
A short description of what this PR does.
Checklist
make test-dockerpython examples/build_twilio_go.py path/to/twilio-oai/spec/yaml path/to/twilio-goand inspect the diffmake testintwilio-gotwilio-goIf you have questions, please create a GitHub Issue in this repository.