| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Starting implementation for HTTP/JSON. This was tested by using the surface generated from https://github.com/googleapis/toolkit/tree/discogapic to list, get, insert, and delete Compute Address resources in a live Google Cloud project.
Exception handling and retry logic for http calls.
Merge in updates from the master branch.
…p http status codes to wrapper exception types
|
Made the suggested changes. PTAL |
Sorry, something went wrong.
|
|
||
| @BetaApi | ||
| public interface ApiMessage { | ||
| /* For a each fieldName in a set of fieldNames, fetch that field's List<String> value. */ |
| ApiMessage getRequestBody(); | ||
| ApiMessage getApiMessageRequestBody(); | ||
|
|
||
| Map<String, String> getApiMessagePathParams(); |
|
Made the suggested changes. PTAL |
Sorry, something went wrong.
| apiMessage.populateFieldsInMap(Collections.singleton(resourceNameField)); | ||
|
|
||
| String resourceNamePath = pathParamMap.get(resourceNameField).get(0); | ||
| return resourceNameInstance.parseFrom(resourceNamePath).getFieldValues(); |
| return pathParams; | ||
| public Map<String, String> getPathParams(T apiMessage, String resourceNameField) { | ||
| Map<String, List<String>> pathParamMap = | ||
| apiMessage.populateFieldsInMap(Collections.singleton(resourceNameField)); |
| public interface ResourceNameStruct extends ResourceName { | ||
| /* Fetch the comprehensive mapping of fieldNames to values. The set of keys of the resulting Map | ||
| should be constant, for a given instance of this interface. */ | ||
| Map<String, String> getFieldValues(); |
| Map<String, List<String>> pathParamMap = | ||
| apiMessage.populateFieldsInMap(Collections.singleton(resourceNameField)); | ||
|
|
||
| String resourceNamePath = pathParamMap.get(resourceNameField).get(0); |
|
Blocked on googleapis/api-common-java#46. |
Sorry, something went wrong.
|
PTAL The gradle build task passes for me locally. |
Sorry, something went wrong.
|
|
||
| /* Return a new instance of this interface by parsing a formatted String. This should be treated as a static method. */ | ||
| ResourceNameStruct parseFrom(String formattedString); | ||
| } |
|
I believe that verifyLicense is failing because of #487 ; I think travis might locally merge your changes to master and run the build on that. |
Sorry, something went wrong.
| String resourceNamePath = apiMessage.getFieldStringValue(resourceNameField); | ||
| if (resourceNamePath == null) { | ||
| throw new IOException( | ||
| String.format("Resource name field %s is null in message object.", resourceNameField)); |
| @Override | ||
| public Map<String, String> getPathParams(T apiMessage, String resourceNameField) | ||
| throws IOException { | ||
| throws IllegalArgumentException { |
|
Ok, two api-common releases later and this build passes! Further comments welcome. PTAL |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Moving parsing of ResourceNames to gax-java (instead of generated message classes). See googleapis/gapic-generator#1847.