public static FunctionDeclaration fromJsonString(String jsonString)
      throws InvalidProtocolBufferException {
    checkArgument(!Strings.isNullOrEmpty(jsonString), "Input String can't be null or empty.");
    FunctionDeclaration.Builder builder = FunctionDeclaration.newBuilder();
    JsonFormat.parser().merge(jsonString, builder);
    FunctionDeclaration declaration = builder.build();
    if (declaration.getName().isEmpty()) {
      throw new IllegalArgumentException("name field must be present.");
    }
    return declaration;
  }
Creates a FunctionDeclaration from a JsonString

@param jsonString A valid Json String that can be parsed to a FunctionDeclaration.
@return a {@link FunctionDeclaration} by parsing the input json String.
@throws InvalidProtocolBufferException if the String can't be parsed into a FunctionDeclaration
    proto.
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/FunctionDeclarationMaker.java