Class: Google::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1ValidateAddressRequest

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/addressvalidation_v1/classes.rb,
lib/google/apis/addressvalidation_v1/representations.rb,
lib/google/apis/addressvalidation_v1/representations.rb

Overview

The request for validating an address.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleMapsAddressvalidationV1ValidateAddressRequest

Returns a new instance of GoogleMapsAddressvalidationV1ValidateAddressRequest.



928
929
930
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 928

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#addressGoogle::Apis::AddressvalidationV1::GoogleTypePostalAddress

Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains). In typical usage an address would be created via user input or from importing existing data, depending on the type of process. Advice on address input / editing: - Use an internationalization-ready address widget such as https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of fields outside countries where that field is used. For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478 Corresponds to the JSON property address



872
873
874
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 872

def address
  @address
end

#enable_usps_cassBoolean Also known as: enable_usps_cass?

Enables USPS CASS compatible mode. This affects only the [google.maps. addressvalidation.v1.ValidationResult.usps_data] field of [google.maps. addressvalidation.v1.ValidationResult]. Note: for USPS CASS enabled requests for addresses in Puerto Rico, a [google.type.PostalAddress.region_code] of the address must be provided as "PR", or an [google.type.PostalAddress. administrative_area] of the address must be provided as "Puerto Rico" (case- insensitive) or "PR". It's recommended to use a componentized address, or alternatively specify at least two [google.type.PostalAddress.address_lines] where the first line contains the street number and name and the second line contains the city, state, and zip code. Corresponds to the JSON property enableUspsCass

Returns:

  • (Boolean)


886
887
888
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 886

def enable_usps_cass
  @enable_usps_cass
end

#language_optionsGoogle::Apis::AddressvalidationV1::GoogleMapsAddressvalidationV1LanguageOptions

Preview: This feature is in Preview (pre-GA). Pre-GA products and features might have limited support, and changes to pre-GA products and features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by the Google Maps Platform Service Specific Terms. For more information, see the launch stage descriptions. Enables the Address Validation API to include additional information in the response. Corresponds to the JSON property languageOptions



898
899
900
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 898

def language_options
  @language_options
end

#previous_response_idString

This field must be empty for the first address validation request. If more requests are necessary to fully validate a single address (for example if the changes the user makes after the initial validation need to be re-validated), then each followup request must populate this field with the response_id from the very first response in the validation sequence. Corresponds to the JSON property previousResponseId

Returns:

  • (String)


907
908
909
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 907

def previous_response_id
  @previous_response_id
end

#session_tokenString

Optional. A string which identifies an Autocomplete session for billing purposes. Must be a URL and filename safe base64 string with at most 36 ASCII characters in length. Otherwise an INVALID_ARGUMENT error is returned. The session begins when the user makes an Autocomplete query, and concludes when they select a place and a call to Place Details or Address Validation is made. Each session can have multiple Autocomplete queries, followed by one Place Details or Address Validation request. The credentials used for each request within a session must belong to the same Google Cloud Console project. Once a session has concluded, the token is no longer valid; your app must generate a fresh token for each session. If the sessionToken parameter is omitted, or if you reuse a session token, the session is charged as if no session token was provided (each request is billed separately). Note: Address Validation can only be used in sessions with the Autocomplete (New) API, not the Autocomplete API. See https://developers.google.com/maps/documentation/places/web-service/ session-pricing for more details. Corresponds to the JSON property sessionToken

Returns:

  • (String)


926
927
928
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 926

def session_token
  @session_token
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



933
934
935
936
937
938
939
# File 'lib/google/apis/addressvalidation_v1/classes.rb', line 933

def update!(**args)
  @address = args[:address] if args.key?(:address)
  @enable_usps_cass = args[:enable_usps_cass] if args.key?(:enable_usps_cass)
  @language_options = args[:language_options] if args.key?(:language_options)
  @previous_response_id = args[:previous_response_id] if args.key?(:previous_response_id)
  @session_token = args[:session_token] if args.key?(:session_token)
end