addressvalidationep

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressValidationSvcConfig

type AddressValidationSvcConfig struct {
	// CoreClient (required) is the core-service gRPC client.
	CoreClient pb.CoreServiceClient
}

type AutocompleteAddressEndpoint

type AutocompleteAddressEndpoint struct{}

Returns address suggestions for partial address text, for use in type-ahead address entry.

Only street addresses are suggested; cities, regions, and business listings are not returned. Suggestions are lookup results, not saved addresses in your account. Pass a suggestion's `id` to the address details endpoint to get the full parsed address.

type AutocompleteAddressRequest

type AutocompleteAddressRequest struct {
	// Partial address text to generate suggestions for.
	Input string `query:"input" validate:"required"`
	// Opaque token that groups a series of related autocomplete requests into a single session.
	//
	// Reuse the same token for each keystroke of one address entry, and again when you retrieve the details of the suggestion the user picks, so the whole entry is treated as one lookup.
	SessionToken *string `query:"session_token"` // #nosec G117 -- not a secret, Google Maps session correlation token
}

Request for address autocomplete.

type RetrieveAddressDetailsEndpoint

type RetrieveAddressDetailsEndpoint struct{}

Returns the full parsed address for a suggestion returned by address autocomplete.

Use this after the user picks a suggestion to get the street, city, state, postal code, and country to prefill an address form. Nothing is saved by this lookup; create an address separately to keep it.

type RetrieveAddressDetailsRequest

type RetrieveAddressDetailsRequest struct {
	// The place ID to look up, as returned in the `id` field of an address suggestion.
	PlaceID string `path:"id" validate:"required"`
	// Opaque token that ties this lookup to the autocomplete requests the suggestion came from.
	//
	// Pass the same token used for those autocomplete requests so the whole address entry is treated as one lookup.
	SessionToken *string `query:"session_token"` // #nosec G117 -- not a secret, Google Maps session correlation token
}

Request to get details for a place.

type ValidateAddressEndpoint

type ValidateAddressEndpoint struct{}

Checks an address against an address validation service and returns a standardized version of it.

Nothing is created or modified. Use this before creating or updating an address to confirm it is complete and to pick up corrected values. When the service can standardize the address, `formatted_address` and `components` carry the corrected values, and `validation_messages` explains anything that was inferred, replaced, or could not be confirmed.

type ValidateAddressRequest

type ValidateAddressRequest struct {
	// First line of the street address.
	AddressLine1 string `json:"address_line_1" validate:"required"`
	// Second line of the street address.
	AddressLine2 field.Optional[string] `json:"address_line_2,omitzero"`
	// City or locality.
	City string `json:"city" validate:"required"`
	// State or administrative area.
	State string `json:"state" validate:"required"`
	// Postal or ZIP code.
	PostalCode string `json:"postal_code" validate:"required"`
	// Two-letter country code, such as `US`.
	//
	// A full country name such as `United States` is recognized for a handful of common countries; send the two-letter code for anywhere else.
	Country string `json:"country" validate:"required"`
}

Request to validate an address.

func (*ValidateAddressRequest) SchemaExample

func (*ValidateAddressRequest) SchemaExample() any

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL