All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.api.services.addressvalidation.v1.AddressValidation Maven / Gradle / Ivy

/*
 * 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/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.addressvalidation.v1;

/**
 * Service definition for AddressValidation (v1).
 *
 * 

* The Address Validation API allows developers to verify the accuracy of addresses. Given an address, it returns information about the correctness of the components of the parsed address, a geocode, and a verdict on the deliverability of the parsed address. *

* *

* For more information about this service, see the * API Documentation *

* *

* This service uses {@link AddressValidationRequestInitializer} to initialize global parameters via its * {@link Builder}. *

* * @since 1.3 * @author Google, Inc. */ @SuppressWarnings("javadoc") public class AddressValidation 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 >= 32 || (com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION == 31 && com.google.api.client.googleapis.GoogleUtils.BUGFIX_VERSION >= 1))) || com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION >= 2, "You are currently running with version %s of google-api-client. " + "You need at least version 1.31.1 of google-api-client to run version " + "2.0.0 of the Address Validation 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://addressvalidation.googleapis.com/"; /** * The default encoded mTLS root URL of the service. This is determined when the library is generated * and normally should not be changed. * * @since 1.31 */ public static final String DEFAULT_MTLS_ROOT_URL = "https://addressvalidation.mtls.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 AddressValidation(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 */ AddressValidation(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 V1 collection. * *

The typical use is:

*
   *   {@code AddressValidation addressvalidation = new AddressValidation(...);}
   *   {@code AddressValidation.V1.List request = addressvalidation.v1().list(parameters ...)}
   * 
* * @return the resource collection */ public V1 v1() { return new V1(); } /** * The "v1" collection of methods. */ public class V1 { /** * Feedback about the outcome of the sequence of validation attempts. This should be the last call * made after a sequence of validation calls for the same address, and should be called once the * transaction is concluded. This should only be sent once for the sequence of `ValidateAddress` * requests needed to validate an address fully. * * Create a request for the method "v1.provideValidationFeedback". * * This request holds the parameters needed by the addressvalidation server. After setting any * optional parameters, call the {@link ProvideValidationFeedback#execute()} method to invoke the * remote operation. * * @param content the {@link com.google.api.services.addressvalidation.v1.model.GoogleMapsAddressvalidationV1ProvideValidationFeedbackRequest} * @return the request */ public ProvideValidationFeedback provideValidationFeedback(com.google.api.services.addressvalidation.v1.model.GoogleMapsAddressvalidationV1ProvideValidationFeedbackRequest content) throws java.io.IOException { ProvideValidationFeedback result = new ProvideValidationFeedback(content); initialize(result); return result; } public class ProvideValidationFeedback extends AddressValidationRequest { private static final String REST_PATH = "v1:provideValidationFeedback"; /** * Feedback about the outcome of the sequence of validation attempts. This should be the last call * made after a sequence of validation calls for the same address, and should be called once the * transaction is concluded. This should only be sent once for the sequence of `ValidateAddress` * requests needed to validate an address fully. * * Create a request for the method "v1.provideValidationFeedback". * * This request holds the parameters needed by the the addressvalidation server. After setting * any optional parameters, call the {@link ProvideValidationFeedback#execute()} method to invoke * the remote operation.

{@link ProvideValidationFeedback#initialize(com.google.api.client.goo * gleapis.services.AbstractGoogleClientRequest)} must be called to initialize this instance * immediately after invoking the constructor.

* * @param content the {@link com.google.api.services.addressvalidation.v1.model.GoogleMapsAddressvalidationV1ProvideValidationFeedbackRequest} * @since 1.13 */ protected ProvideValidationFeedback(com.google.api.services.addressvalidation.v1.model.GoogleMapsAddressvalidationV1ProvideValidationFeedbackRequest content) { super(AddressValidation.this, "POST", REST_PATH, content, com.google.api.services.addressvalidation.v1.model.GoogleMapsAddressvalidationV1ProvideValidationFeedbackResponse.class); } @Override public ProvideValidationFeedback set$Xgafv(java.lang.String $Xgafv) { return (ProvideValidationFeedback) super.set$Xgafv($Xgafv); } @Override public ProvideValidationFeedback setAccessToken(java.lang.String accessToken) { return (ProvideValidationFeedback) super.setAccessToken(accessToken); } @Override public ProvideValidationFeedback setAlt(java.lang.String alt) { return (ProvideValidationFeedback) super.setAlt(alt); } @Override public ProvideValidationFeedback setCallback(java.lang.String callback) { return (ProvideValidationFeedback) super.setCallback(callback); } @Override public ProvideValidationFeedback setFields(java.lang.String fields) { return (ProvideValidationFeedback) super.setFields(fields); } @Override public ProvideValidationFeedback setKey(java.lang.String key) { return (ProvideValidationFeedback) super.setKey(key); } @Override public ProvideValidationFeedback setOauthToken(java.lang.String oauthToken) { return (ProvideValidationFeedback) super.setOauthToken(oauthToken); } @Override public ProvideValidationFeedback setPrettyPrint(java.lang.Boolean prettyPrint) { return (ProvideValidationFeedback) super.setPrettyPrint(prettyPrint); } @Override public ProvideValidationFeedback setQuotaUser(java.lang.String quotaUser) { return (ProvideValidationFeedback) super.setQuotaUser(quotaUser); } @Override public ProvideValidationFeedback setUploadType(java.lang.String uploadType) { return (ProvideValidationFeedback) super.setUploadType(uploadType); } @Override public ProvideValidationFeedback setUploadProtocol(java.lang.String uploadProtocol) { return (ProvideValidationFeedback) super.setUploadProtocol(uploadProtocol); } @Override public ProvideValidationFeedback set(String parameterName, Object value) { return (ProvideValidationFeedback) super.set(parameterName, value); } } /** * Validates an address. * * Create a request for the method "v1.validateAddress". * * This request holds the parameters needed by the addressvalidation server. After setting any * optional parameters, call the {@link ValidateAddress#execute()} method to invoke the remote * operation. * * @param content the {@link com.google.api.services.addressvalidation.v1.model.GoogleMapsAddressvalidationV1ValidateAddressRequest} * @return the request */ public ValidateAddress validateAddress(com.google.api.services.addressvalidation.v1.model.GoogleMapsAddressvalidationV1ValidateAddressRequest content) throws java.io.IOException { ValidateAddress result = new ValidateAddress(content); initialize(result); return result; } public class ValidateAddress extends AddressValidationRequest { private static final String REST_PATH = "v1:validateAddress"; /** * Validates an address. * * Create a request for the method "v1.validateAddress". * * This request holds the parameters needed by the the addressvalidation server. After setting * any optional parameters, call the {@link ValidateAddress#execute()} method to invoke the remote * operation.

{@link ValidateAddress#initialize(com.google.api.client.googleapis.services.Abst * ractGoogleClientRequest)} must be called to initialize this instance immediately after invoking * the constructor.

* * @param content the {@link com.google.api.services.addressvalidation.v1.model.GoogleMapsAddressvalidationV1ValidateAddressRequest} * @since 1.13 */ protected ValidateAddress(com.google.api.services.addressvalidation.v1.model.GoogleMapsAddressvalidationV1ValidateAddressRequest content) { super(AddressValidation.this, "POST", REST_PATH, content, com.google.api.services.addressvalidation.v1.model.GoogleMapsAddressvalidationV1ValidateAddressResponse.class); } @Override public ValidateAddress set$Xgafv(java.lang.String $Xgafv) { return (ValidateAddress) super.set$Xgafv($Xgafv); } @Override public ValidateAddress setAccessToken(java.lang.String accessToken) { return (ValidateAddress) super.setAccessToken(accessToken); } @Override public ValidateAddress setAlt(java.lang.String alt) { return (ValidateAddress) super.setAlt(alt); } @Override public ValidateAddress setCallback(java.lang.String callback) { return (ValidateAddress) super.setCallback(callback); } @Override public ValidateAddress setFields(java.lang.String fields) { return (ValidateAddress) super.setFields(fields); } @Override public ValidateAddress setKey(java.lang.String key) { return (ValidateAddress) super.setKey(key); } @Override public ValidateAddress setOauthToken(java.lang.String oauthToken) { return (ValidateAddress) super.setOauthToken(oauthToken); } @Override public ValidateAddress setPrettyPrint(java.lang.Boolean prettyPrint) { return (ValidateAddress) super.setPrettyPrint(prettyPrint); } @Override public ValidateAddress setQuotaUser(java.lang.String quotaUser) { return (ValidateAddress) super.setQuotaUser(quotaUser); } @Override public ValidateAddress setUploadType(java.lang.String uploadType) { return (ValidateAddress) super.setUploadType(uploadType); } @Override public ValidateAddress setUploadProtocol(java.lang.String uploadProtocol) { return (ValidateAddress) super.setUploadProtocol(uploadProtocol); } @Override public ValidateAddress set(String parameterName, Object value) { return (ValidateAddress) super.set(parameterName, value); } } } /** * Builder for {@link AddressValidation}. * *

* Implementation is not thread-safe. *

* * @since 1.3.0 */ public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder { private static String chooseEndpoint(com.google.api.client.http.HttpTransport transport) { // If the GOOGLE_API_USE_MTLS_ENDPOINT environment variable value is "always", use mTLS endpoint. // If the env variable is "auto", use mTLS endpoint if and only if the transport is mTLS. // Use the regular endpoint for all other cases. String useMtlsEndpoint = System.getenv("GOOGLE_API_USE_MTLS_ENDPOINT"); useMtlsEndpoint = useMtlsEndpoint == null ? "auto" : useMtlsEndpoint; if ("always".equals(useMtlsEndpoint) || ("auto".equals(useMtlsEndpoint) && transport != null && transport.isMtls())) { return DEFAULT_MTLS_ROOT_URL; } return DEFAULT_ROOT_URL; } /** * 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, Builder.chooseEndpoint(transport), DEFAULT_SERVICE_PATH, httpRequestInitializer, false); setBatchPath(DEFAULT_BATCH_PATH); } /** Builds a new instance of {@link AddressValidation}. */ @Override public AddressValidation build() { return new AddressValidation(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 AddressValidationRequestInitializer}. * * @since 1.12 */ public Builder setAddressValidationRequestInitializer( AddressValidationRequestInitializer addressvalidationRequestInitializer) { return (Builder) super.setGoogleClientRequestInitializer(addressvalidationRequestInitializer); } @Override public Builder setGoogleClientRequestInitializer( com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) { return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer); } @Override public Builder setUniverseDomain(String universeDomain) { return (Builder) super.setUniverseDomain(universeDomain); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy