private void checkResponseObject(Method method, MethodKind kind) { if (kind != MethodKind.NONE) { WellKnownType wkt = TypeRef.of(method.getOutputMessage()).getWellKnownType(); if (!wkt.allowedAsHttpRequestResponse()) { error( ResolvedLocation.create(method.getLocation()), "type '%s' is not allowed as a response because it does not render as " + "a JSON object.", method.getOutputMessage().getFullName()); } } }
private void checkResponseObject(Method method, MethodKind kind) { if (kind != MethodKind.NONE) { WellKnownType wkt = TypeRef.of(method.getOutputMessage()).getWellKnownType(); if (!wkt.allowedAsHttpRequestResponse()) { error( ResolvedLocation.create(method.getLocation()), "type '%s' is not allowed as a response because it does not render as " + "a JSON object.", method.getOutputMessage().getFullName()); } } }
String classInfo = getParamTypeName(typeTable, methodModel.getOutputType()); String callbackType; if (isProtobufEmpty(method.getOutputMessage())) { callbackType = "function(?Error)"; } else if (methodConfig.isPageStreaming()) { "@param {" + callbackType + "} [callback]", " The function which will be called with the result of the API call."); if (!isProtobufEmpty(method.getOutputMessage())) { callbackLines.add("", " The second parameter to the callback is " + returnTypeDoc + "."); if (methodConfig.isPageStreaming()) {
+ " for write() method."); } else { if (isProtobufEmpty(method.getOutputMessage())) { returnMessageLines.add( "@returns {Promise} - The promise which resolves when API call finishes.");
@Visits void reach(Method method) { mustBeInScope(method, method.getInputMessage()); mustBeInScope(method, method.getOutputMessage()); markAsReachable(method); // Check whether any HTTP bounded fields are visible. HttpAttribute http = method.getAttribute(HttpAttribute.KEY); if (http != null) { for (HttpAttribute binding : http.getAllBindings()) { Iterable<FieldSelector> selectors = binding.getPathSelectors(); if (!binding.bodyCapturesUnboundFields()) { // Only add body fields if '*' is not used, otherwise they aren't required. selectors = Iterables.concat(selectors, binding.getBodySelectors()); } for (FieldSelector selector : selectors) { for (Field field : selector.getFields()) { if (!isReachable(field)) { errorSince( 2, field, "Field '%s' required by HTTP binding of method '%s' cannot be hidden. %s.", field.getFullName(), method.getFullName(), reasonForUnreachable(field)); } } } } } }
@Visits void reach(Method method) { mustBeInScope(method, method.getInputMessage()); mustBeInScope(method, method.getOutputMessage()); markAsReachable(method); // Check whether any HTTP bounded fields are visible. HttpAttribute http = method.getAttribute(HttpAttribute.KEY); if (http != null) { for (HttpAttribute binding : http.getAllBindings()) { Iterable<FieldSelector> selectors = binding.getPathSelectors(); if (!binding.bodyCapturesUnboundFields()) { // Only add body fields if '*' is not used, otherwise they aren't required. selectors = Iterables.concat(selectors, binding.getBodySelectors()); } for (FieldSelector selector : selectors) { for (Field field : selector.getFields()) { if (!isReachable(field)) { errorSince( 2, field, "Field '%s' required by HTTP binding of method '%s' cannot be hidden. %s.", field.getFullName(), method.getFullName(), reasonForUnreachable(field)); } } } } } }