feat: Add ApiVersion Support by lqiu96 · Pull Request #2462 · googleapis/google-api-java-client

/** * @param client Google client * @param method HTTP Method * @param uriTemplate URI template for the path relative to the base URL. If it starts with a "/" * the base path from the base URL will be stripped out. The URI template can also be a full * URL. URI template expansion is done using {@link UriTemplate#expand(String, String, Object, * boolean)} * @param content HTTP content or {@code null} for none * @param responseClass response class to parse into * @param apiVersion ApiVersion to be passed to the header */ public MockGoogleClientRequest( AbstractGoogleClient client, String method, String uriTemplate, HttpContent content, Class<T> responseClass, String apiVersion) { super(client, method, uriTemplate, content, responseClass); // Matches generator code: Null or Empty String is not set to the header if (!Strings.isNullOrEmpty(apiVersion)) { getRequestHeaders().set(API_VERSION_HEADER, apiVersion); }