com.google.api.services.safebrowsing.Safebrowsing Maven / Gradle / Ivy
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/google/apis-client-generator/
* (build: 2018-10-08 17:45:39 UTC)
* on 2018-10-24 at 19:34:02 UTC
* Modify at your own risk.
*/
package com.google.api.services.safebrowsing;
/**
* Service definition for Safebrowsing (v4).
*
*
* Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources.
*
*
*
* For more information about this service, see the
* API Documentation
*
*
*
* This service uses {@link SafebrowsingRequestInitializer} to initialize global parameters via its
* {@link Builder}.
*
*
* @since 1.3
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public class Safebrowsing extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient {
// Note: Leave this static initializer at the top of the file.
static {
com.google.api.client.util.Preconditions.checkState(
com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 15,
"You are currently running with version %s of google-api-client. " +
"You need at least version 1.15 of google-api-client to run version " +
"1.23.0 of the Safe Browsing API library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
}
/**
* The default encoded root URL of the service. This is determined when the library is generated
* and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_ROOT_URL = "https://safebrowsing.googleapis.com/";
/**
* The default encoded service path of the service. This is determined when the library is
* generated and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_SERVICE_PATH = "";
/**
* The default encoded batch path of the service. This is determined when the library is
* generated and normally should not be changed.
*
* @since 1.23
*/
public static final String DEFAULT_BATCH_PATH = "batch";
/**
* The default encoded base URL of the service. This is determined when the library is generated
* and normally should not be changed.
*/
public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;
/**
* Constructor.
*
*
* Use {@link Builder} if you need to specify any of the optional parameters.
*
*
* @param transport HTTP transport, which should normally be:
*
* - Google App Engine:
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}
* - Android: {@code newCompatibleTransport} from
* {@code com.google.api.client.extensions.android.http.AndroidHttp}
* - Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
*
*
* @param jsonFactory JSON factory, which may be:
*
* - Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}
* - Google GSON: {@code com.google.api.client.json.gson.GsonFactory}
* - Android Honeycomb or higher:
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}
*
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public Safebrowsing(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
this(new Builder(transport, jsonFactory, httpRequestInitializer));
}
/**
* @param builder builder
*/
Safebrowsing(Builder builder) {
super(builder);
}
@Override
protected void initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest> httpClientRequest) throws java.io.IOException {
super.initialize(httpClientRequest);
}
/**
* An accessor for creating requests from the EncodedFullHashes collection.
*
* The typical use is:
*
* {@code Safebrowsing safebrowsing = new Safebrowsing(...);}
* {@code Safebrowsing.EncodedFullHashes.List request = safebrowsing.encodedFullHashes().list(parameters ...)}
*
*
* @return the resource collection
*/
public EncodedFullHashes encodedFullHashes() {
return new EncodedFullHashes();
}
/**
* The "encodedFullHashes" collection of methods.
*/
public class EncodedFullHashes {
/**
* Create a request for the method "encodedFullHashes.get".
*
* This request holds the parameters needed by the safebrowsing server. After setting any optional
* parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param encodedRequest A serialized FindFullHashesRequest proto.
* @return the request
*/
public Get get(java.lang.String encodedRequest) throws java.io.IOException {
Get result = new Get(encodedRequest);
initialize(result);
return result;
}
public class Get extends SafebrowsingRequest {
private static final String REST_PATH = "v4/encodedFullHashes/{encodedRequest}";
/**
* Create a request for the method "encodedFullHashes.get".
*
* This request holds the parameters needed by the the safebrowsing server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param encodedRequest A serialized FindFullHashesRequest proto.
* @since 1.13
*/
protected Get(java.lang.String encodedRequest) {
super(Safebrowsing.this, "GET", REST_PATH, null, com.google.api.services.safebrowsing.model.FindFullHashesResponse.class);
this.encodedRequest = com.google.api.client.util.Preconditions.checkNotNull(encodedRequest, "Required parameter encodedRequest must be specified.");
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/** A serialized FindFullHashesRequest proto. */
@com.google.api.client.util.Key
private java.lang.String encodedRequest;
/** A serialized FindFullHashesRequest proto.
*/
public java.lang.String getEncodedRequest() {
return encodedRequest;
}
/** A serialized FindFullHashesRequest proto. */
public Get setEncodedRequest(java.lang.String encodedRequest) {
this.encodedRequest = encodedRequest;
return this;
}
/**
* A client ID that (hopefully) uniquely identifies the client implementation of the Safe
* Browsing API.
*/
@com.google.api.client.util.Key
private java.lang.String clientId;
/** A client ID that (hopefully) uniquely identifies the client implementation of the Safe Browsing
API.
*/
public java.lang.String getClientId() {
return clientId;
}
/**
* A client ID that (hopefully) uniquely identifies the client implementation of the Safe
* Browsing API.
*/
public Get setClientId(java.lang.String clientId) {
this.clientId = clientId;
return this;
}
/** The version of the client implementation. */
@com.google.api.client.util.Key
private java.lang.String clientVersion;
/** The version of the client implementation.
*/
public java.lang.String getClientVersion() {
return clientVersion;
}
/** The version of the client implementation. */
public Get setClientVersion(java.lang.String clientVersion) {
this.clientVersion = clientVersion;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the EncodedUpdates collection.
*
* The typical use is:
*
* {@code Safebrowsing safebrowsing = new Safebrowsing(...);}
* {@code Safebrowsing.EncodedUpdates.List request = safebrowsing.encodedUpdates().list(parameters ...)}
*
*
* @return the resource collection
*/
public EncodedUpdates encodedUpdates() {
return new EncodedUpdates();
}
/**
* The "encodedUpdates" collection of methods.
*/
public class EncodedUpdates {
/**
* Create a request for the method "encodedUpdates.get".
*
* This request holds the parameters needed by the safebrowsing server. After setting any optional
* parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param encodedRequest A serialized FetchThreatListUpdatesRequest proto.
* @return the request
*/
public Get get(java.lang.String encodedRequest) throws java.io.IOException {
Get result = new Get(encodedRequest);
initialize(result);
return result;
}
public class Get extends SafebrowsingRequest {
private static final String REST_PATH = "v4/encodedUpdates/{encodedRequest}";
/**
* Create a request for the method "encodedUpdates.get".
*
* This request holds the parameters needed by the the safebrowsing server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param encodedRequest A serialized FetchThreatListUpdatesRequest proto.
* @since 1.13
*/
protected Get(java.lang.String encodedRequest) {
super(Safebrowsing.this, "GET", REST_PATH, null, com.google.api.services.safebrowsing.model.FetchThreatListUpdatesResponse.class);
this.encodedRequest = com.google.api.client.util.Preconditions.checkNotNull(encodedRequest, "Required parameter encodedRequest must be specified.");
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/** A serialized FetchThreatListUpdatesRequest proto. */
@com.google.api.client.util.Key
private java.lang.String encodedRequest;
/** A serialized FetchThreatListUpdatesRequest proto.
*/
public java.lang.String getEncodedRequest() {
return encodedRequest;
}
/** A serialized FetchThreatListUpdatesRequest proto. */
public Get setEncodedRequest(java.lang.String encodedRequest) {
this.encodedRequest = encodedRequest;
return this;
}
/**
* A client ID that uniquely identifies the client implementation of the Safe Browsing API.
*/
@com.google.api.client.util.Key
private java.lang.String clientId;
/** A client ID that uniquely identifies the client implementation of the Safe Browsing API.
*/
public java.lang.String getClientId() {
return clientId;
}
/**
* A client ID that uniquely identifies the client implementation of the Safe Browsing API.
*/
public Get setClientId(java.lang.String clientId) {
this.clientId = clientId;
return this;
}
/** The version of the client implementation. */
@com.google.api.client.util.Key
private java.lang.String clientVersion;
/** The version of the client implementation.
*/
public java.lang.String getClientVersion() {
return clientVersion;
}
/** The version of the client implementation. */
public Get setClientVersion(java.lang.String clientVersion) {
this.clientVersion = clientVersion;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the FullHashes collection.
*
* The typical use is:
*
* {@code Safebrowsing safebrowsing = new Safebrowsing(...);}
* {@code Safebrowsing.FullHashes.List request = safebrowsing.fullHashes().list(parameters ...)}
*
*
* @return the resource collection
*/
public FullHashes fullHashes() {
return new FullHashes();
}
/**
* The "fullHashes" collection of methods.
*/
public class FullHashes {
/**
* Finds the full hashes that match the requested hash prefixes.
*
* Create a request for the method "fullHashes.find".
*
* This request holds the parameters needed by the safebrowsing server. After setting any optional
* parameters, call the {@link Find#execute()} method to invoke the remote operation.
*
* @param content the {@link com.google.api.services.safebrowsing.model.FindFullHashesRequest}
* @return the request
*/
public Find find(com.google.api.services.safebrowsing.model.FindFullHashesRequest content) throws java.io.IOException {
Find result = new Find(content);
initialize(result);
return result;
}
public class Find extends SafebrowsingRequest {
private static final String REST_PATH = "v4/fullHashes:find";
/**
* Finds the full hashes that match the requested hash prefixes.
*
* Create a request for the method "fullHashes.find".
*
* This request holds the parameters needed by the the safebrowsing server. After setting any
* optional parameters, call the {@link Find#execute()} method to invoke the remote operation.
* {@link Find#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param content the {@link com.google.api.services.safebrowsing.model.FindFullHashesRequest}
* @since 1.13
*/
protected Find(com.google.api.services.safebrowsing.model.FindFullHashesRequest content) {
super(Safebrowsing.this, "POST", REST_PATH, content, com.google.api.services.safebrowsing.model.FindFullHashesResponse.class);
}
@Override
public Find set$Xgafv(java.lang.String $Xgafv) {
return (Find) super.set$Xgafv($Xgafv);
}
@Override
public Find setAccessToken(java.lang.String accessToken) {
return (Find) super.setAccessToken(accessToken);
}
@Override
public Find setAlt(java.lang.String alt) {
return (Find) super.setAlt(alt);
}
@Override
public Find setCallback(java.lang.String callback) {
return (Find) super.setCallback(callback);
}
@Override
public Find setFields(java.lang.String fields) {
return (Find) super.setFields(fields);
}
@Override
public Find setKey(java.lang.String key) {
return (Find) super.setKey(key);
}
@Override
public Find setOauthToken(java.lang.String oauthToken) {
return (Find) super.setOauthToken(oauthToken);
}
@Override
public Find setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Find) super.setPrettyPrint(prettyPrint);
}
@Override
public Find setQuotaUser(java.lang.String quotaUser) {
return (Find) super.setQuotaUser(quotaUser);
}
@Override
public Find setUploadType(java.lang.String uploadType) {
return (Find) super.setUploadType(uploadType);
}
@Override
public Find setUploadProtocol(java.lang.String uploadProtocol) {
return (Find) super.setUploadProtocol(uploadProtocol);
}
@Override
public Find set(String parameterName, Object value) {
return (Find) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the ThreatHits collection.
*
* The typical use is:
*
* {@code Safebrowsing safebrowsing = new Safebrowsing(...);}
* {@code Safebrowsing.ThreatHits.List request = safebrowsing.threatHits().list(parameters ...)}
*
*
* @return the resource collection
*/
public ThreatHits threatHits() {
return new ThreatHits();
}
/**
* The "threatHits" collection of methods.
*/
public class ThreatHits {
/**
* Reports a Safe Browsing threat list hit to Google. Only projects with TRUSTED_REPORTER visibility
* can use this method.
*
* Create a request for the method "threatHits.create".
*
* This request holds the parameters needed by the safebrowsing server. After setting any optional
* parameters, call the {@link Create#execute()} method to invoke the remote operation.
*
* @param content the {@link com.google.api.services.safebrowsing.model.ThreatHit}
* @return the request
*/
public Create create(com.google.api.services.safebrowsing.model.ThreatHit content) throws java.io.IOException {
Create result = new Create(content);
initialize(result);
return result;
}
public class Create extends SafebrowsingRequest {
private static final String REST_PATH = "v4/threatHits";
/**
* Reports a Safe Browsing threat list hit to Google. Only projects with TRUSTED_REPORTER
* visibility can use this method.
*
* Create a request for the method "threatHits.create".
*
* This request holds the parameters needed by the the safebrowsing server. After setting any
* optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
* {@link
* Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor.
*
* @param content the {@link com.google.api.services.safebrowsing.model.ThreatHit}
* @since 1.13
*/
protected Create(com.google.api.services.safebrowsing.model.ThreatHit content) {
super(Safebrowsing.this, "POST", REST_PATH, content, com.google.api.services.safebrowsing.model.Empty.class);
}
@Override
public Create set$Xgafv(java.lang.String $Xgafv) {
return (Create) super.set$Xgafv($Xgafv);
}
@Override
public Create setAccessToken(java.lang.String accessToken) {
return (Create) super.setAccessToken(accessToken);
}
@Override
public Create setAlt(java.lang.String alt) {
return (Create) super.setAlt(alt);
}
@Override
public Create setCallback(java.lang.String callback) {
return (Create) super.setCallback(callback);
}
@Override
public Create setFields(java.lang.String fields) {
return (Create) super.setFields(fields);
}
@Override
public Create setKey(java.lang.String key) {
return (Create) super.setKey(key);
}
@Override
public Create setOauthToken(java.lang.String oauthToken) {
return (Create) super.setOauthToken(oauthToken);
}
@Override
public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Create) super.setPrettyPrint(prettyPrint);
}
@Override
public Create setQuotaUser(java.lang.String quotaUser) {
return (Create) super.setQuotaUser(quotaUser);
}
@Override
public Create setUploadType(java.lang.String uploadType) {
return (Create) super.setUploadType(uploadType);
}
@Override
public Create setUploadProtocol(java.lang.String uploadProtocol) {
return (Create) super.setUploadProtocol(uploadProtocol);
}
@Override
public Create set(String parameterName, Object value) {
return (Create) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the ThreatListUpdates collection.
*
* The typical use is:
*
* {@code Safebrowsing safebrowsing = new Safebrowsing(...);}
* {@code Safebrowsing.ThreatListUpdates.List request = safebrowsing.threatListUpdates().list(parameters ...)}
*
*
* @return the resource collection
*/
public ThreatListUpdates threatListUpdates() {
return new ThreatListUpdates();
}
/**
* The "threatListUpdates" collection of methods.
*/
public class ThreatListUpdates {
/**
* Fetches the most recent threat list updates. A client can request updates for multiple lists at
* once.
*
* Create a request for the method "threatListUpdates.fetch".
*
* This request holds the parameters needed by the safebrowsing server. After setting any optional
* parameters, call the {@link Fetch#execute()} method to invoke the remote operation.
*
* @param content the {@link com.google.api.services.safebrowsing.model.FetchThreatListUpdatesRequest}
* @return the request
*/
public Fetch fetch(com.google.api.services.safebrowsing.model.FetchThreatListUpdatesRequest content) throws java.io.IOException {
Fetch result = new Fetch(content);
initialize(result);
return result;
}
public class Fetch extends SafebrowsingRequest {
private static final String REST_PATH = "v4/threatListUpdates:fetch";
/**
* Fetches the most recent threat list updates. A client can request updates for multiple lists at
* once.
*
* Create a request for the method "threatListUpdates.fetch".
*
* This request holds the parameters needed by the the safebrowsing server. After setting any
* optional parameters, call the {@link Fetch#execute()} method to invoke the remote operation.
* {@link
* Fetch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor.
*
* @param content the {@link com.google.api.services.safebrowsing.model.FetchThreatListUpdatesRequest}
* @since 1.13
*/
protected Fetch(com.google.api.services.safebrowsing.model.FetchThreatListUpdatesRequest content) {
super(Safebrowsing.this, "POST", REST_PATH, content, com.google.api.services.safebrowsing.model.FetchThreatListUpdatesResponse.class);
}
@Override
public Fetch set$Xgafv(java.lang.String $Xgafv) {
return (Fetch) super.set$Xgafv($Xgafv);
}
@Override
public Fetch setAccessToken(java.lang.String accessToken) {
return (Fetch) super.setAccessToken(accessToken);
}
@Override
public Fetch setAlt(java.lang.String alt) {
return (Fetch) super.setAlt(alt);
}
@Override
public Fetch setCallback(java.lang.String callback) {
return (Fetch) super.setCallback(callback);
}
@Override
public Fetch setFields(java.lang.String fields) {
return (Fetch) super.setFields(fields);
}
@Override
public Fetch setKey(java.lang.String key) {
return (Fetch) super.setKey(key);
}
@Override
public Fetch setOauthToken(java.lang.String oauthToken) {
return (Fetch) super.setOauthToken(oauthToken);
}
@Override
public Fetch setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Fetch) super.setPrettyPrint(prettyPrint);
}
@Override
public Fetch setQuotaUser(java.lang.String quotaUser) {
return (Fetch) super.setQuotaUser(quotaUser);
}
@Override
public Fetch setUploadType(java.lang.String uploadType) {
return (Fetch) super.setUploadType(uploadType);
}
@Override
public Fetch setUploadProtocol(java.lang.String uploadProtocol) {
return (Fetch) super.setUploadProtocol(uploadProtocol);
}
@Override
public Fetch set(String parameterName, Object value) {
return (Fetch) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the ThreatLists collection.
*
* The typical use is:
*
* {@code Safebrowsing safebrowsing = new Safebrowsing(...);}
* {@code Safebrowsing.ThreatLists.List request = safebrowsing.threatLists().list(parameters ...)}
*
*
* @return the resource collection
*/
public ThreatLists threatLists() {
return new ThreatLists();
}
/**
* The "threatLists" collection of methods.
*/
public class ThreatLists {
/**
* Lists the Safe Browsing threat lists available for download.
*
* Create a request for the method "threatLists.list".
*
* This request holds the parameters needed by the safebrowsing server. After setting any optional
* parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @return the request
*/
public List list() throws java.io.IOException {
List result = new List();
initialize(result);
return result;
}
public class List extends SafebrowsingRequest {
private static final String REST_PATH = "v4/threatLists";
/**
* Lists the Safe Browsing threat lists available for download.
*
* Create a request for the method "threatLists.list".
*
* This request holds the parameters needed by the the safebrowsing server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @since 1.13
*/
protected List() {
super(Safebrowsing.this, "GET", REST_PATH, null, com.google.api.services.safebrowsing.model.ListThreatListsResponse.class);
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the ThreatMatches collection.
*
* The typical use is:
*
* {@code Safebrowsing safebrowsing = new Safebrowsing(...);}
* {@code Safebrowsing.ThreatMatches.List request = safebrowsing.threatMatches().list(parameters ...)}
*
*
* @return the resource collection
*/
public ThreatMatches threatMatches() {
return new ThreatMatches();
}
/**
* The "threatMatches" collection of methods.
*/
public class ThreatMatches {
/**
* Finds the threat entries that match the Safe Browsing lists.
*
* Create a request for the method "threatMatches.find".
*
* This request holds the parameters needed by the safebrowsing server. After setting any optional
* parameters, call the {@link Find#execute()} method to invoke the remote operation.
*
* @param content the {@link com.google.api.services.safebrowsing.model.FindThreatMatchesRequest}
* @return the request
*/
public Find find(com.google.api.services.safebrowsing.model.FindThreatMatchesRequest content) throws java.io.IOException {
Find result = new Find(content);
initialize(result);
return result;
}
public class Find extends SafebrowsingRequest {
private static final String REST_PATH = "v4/threatMatches:find";
/**
* Finds the threat entries that match the Safe Browsing lists.
*
* Create a request for the method "threatMatches.find".
*
* This request holds the parameters needed by the the safebrowsing server. After setting any
* optional parameters, call the {@link Find#execute()} method to invoke the remote operation.
* {@link Find#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param content the {@link com.google.api.services.safebrowsing.model.FindThreatMatchesRequest}
* @since 1.13
*/
protected Find(com.google.api.services.safebrowsing.model.FindThreatMatchesRequest content) {
super(Safebrowsing.this, "POST", REST_PATH, content, com.google.api.services.safebrowsing.model.FindThreatMatchesResponse.class);
}
@Override
public Find set$Xgafv(java.lang.String $Xgafv) {
return (Find) super.set$Xgafv($Xgafv);
}
@Override
public Find setAccessToken(java.lang.String accessToken) {
return (Find) super.setAccessToken(accessToken);
}
@Override
public Find setAlt(java.lang.String alt) {
return (Find) super.setAlt(alt);
}
@Override
public Find setCallback(java.lang.String callback) {
return (Find) super.setCallback(callback);
}
@Override
public Find setFields(java.lang.String fields) {
return (Find) super.setFields(fields);
}
@Override
public Find setKey(java.lang.String key) {
return (Find) super.setKey(key);
}
@Override
public Find setOauthToken(java.lang.String oauthToken) {
return (Find) super.setOauthToken(oauthToken);
}
@Override
public Find setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Find) super.setPrettyPrint(prettyPrint);
}
@Override
public Find setQuotaUser(java.lang.String quotaUser) {
return (Find) super.setQuotaUser(quotaUser);
}
@Override
public Find setUploadType(java.lang.String uploadType) {
return (Find) super.setUploadType(uploadType);
}
@Override
public Find setUploadProtocol(java.lang.String uploadProtocol) {
return (Find) super.setUploadProtocol(uploadProtocol);
}
@Override
public Find set(String parameterName, Object value) {
return (Find) super.set(parameterName, value);
}
}
}
/**
* Builder for {@link Safebrowsing}.
*
*
* Implementation is not thread-safe.
*
*
* @since 1.3.0
*/
public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {
/**
* Returns an instance of a new builder.
*
* @param transport HTTP transport, which should normally be:
*
* - Google App Engine:
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}
* - Android: {@code newCompatibleTransport} from
* {@code com.google.api.client.extensions.android.http.AndroidHttp}
* - Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
*
*
* @param jsonFactory JSON factory, which may be:
*
* - Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}
* - Google GSON: {@code com.google.api.client.json.gson.GsonFactory}
* - Android Honeycomb or higher:
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}
*
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
super(
transport,
jsonFactory,
DEFAULT_ROOT_URL,
DEFAULT_SERVICE_PATH,
httpRequestInitializer,
false);
setBatchPath(DEFAULT_BATCH_PATH);
}
/** Builds a new instance of {@link Safebrowsing}. */
@Override
public Safebrowsing build() {
return new Safebrowsing(this);
}
@Override
public Builder setRootUrl(String rootUrl) {
return (Builder) super.setRootUrl(rootUrl);
}
@Override
public Builder setServicePath(String servicePath) {
return (Builder) super.setServicePath(servicePath);
}
@Override
public Builder setBatchPath(String batchPath) {
return (Builder) super.setBatchPath(batchPath);
}
@Override
public Builder setHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
}
@Override
public Builder setApplicationName(String applicationName) {
return (Builder) super.setApplicationName(applicationName);
}
@Override
public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
}
@Override
public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) {
return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks);
}
@Override
public Builder setSuppressAllChecks(boolean suppressAllChecks) {
return (Builder) super.setSuppressAllChecks(suppressAllChecks);
}
/**
* Set the {@link SafebrowsingRequestInitializer}.
*
* @since 1.12
*/
public Builder setSafebrowsingRequestInitializer(
SafebrowsingRequestInitializer safebrowsingRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(safebrowsingRequestInitializer);
}
@Override
public Builder setGoogleClientRequestInitializer(
com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
}
}
}