/** The hostname for this service (e.g. "foo.googleapis.com"). */ public String getServiceAddress(Interface service) { return getProtoExtension(service, AnnotationsProto.defaultHost); }
/** Return the resource reference for the given field, according to the proto annotations. */ public String getResourceReference(Field field) { return getProtoExtension(field, AnnotationsProto.resourceReference); }
/** Return the ResourceSet a resource field. Return null if none found. */ @Nullable public ResourceSet getResourceSet(Field element) { return getProtoExtension(element, AnnotationsProto.resourceSet); }
@Nullable public Resource getResource(Field element) { return getProtoExtension(element, AnnotationsProto.resource); }
@SuppressWarnings("unchecked") /* Return a list of method signatures, aka flattenings, specified on a given method. * This flattens the repeated additionalSignatures into the returned list of MethodSignatures. */ public List<MethodSignature> getMethodSignatures(Method method) { List<MethodSignature> methodSignatures = getProtoExtension(method, AnnotationsProto.methodSignature); if (methodSignatures == null) { return ImmutableList.of(); } return ImmutableList.copyOf(methodSignatures); }
/** The OAuth scopes for this service (e.g. "https://cloud.google.com/auth/cloud-platform"). */ public List<String> getAuthScopes(Interface service) { OAuth oAuth = getProtoExtension(service, AnnotationsProto.oauth); if (oAuth != null) { return ImmutableList.copyOf(oAuth.getScopesList()); } return ImmutableList.of(); }
List<T> resourcesAtFileLevel = getProtoExtension(protoFile, fileExtension); if (resourcesAtFileLevel != null) { T definition = getProtoExtension(field, fieldExtension); if (definition != null) { if (Strings.isNullOrEmpty(getNameFunc.apply(definition))) {