address

package
v0.0.0-...-13341bd Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for address API

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client

func (*Client) V1AddressGeocode

func (a *Client) V1AddressGeocode(params *V1AddressGeocodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AddressGeocodeOK, error)
V1AddressGeocode geocodes an unstructured address string

**Description**<br><br>

Geocode a single address. This parses the input address and matches it against our records to produce the geocoded result.

This does a best-attempt to geocode the given address in the face of human errors in the input data. This can be the wrong city ("New York City" instead of "New York") a missing postal code, a misspelled street name, house numbers that don't exist, etc.

As more corrections are needed, the certainty in the result drops. This can be tuned with a minimum certainty parameter. If our confidence in the result is less than the minimum certainty, it will not be returned. The default is 30. 30 was chosen to be robust against unclean data without returning results that are unlikely to be true. We don't recommend setting this parameter above 90 because exact matching is too restrictive for the mistakes that people typically make when writing addresses -- even people writing their own addresses will make mistakes that are never corrected.

**Lookup cost**

This query requires an account. Please sign up at https://geo.codes/signup and get your API key at https://geo.codes/account/api

One query counts as one lookup. It only costs a query if it returns data. If you have exceeded your account quota, the request will not succeed.

func (*Client) V1AddressStructuredGeocode

func (a *Client) V1AddressStructuredGeocode(params *V1AddressStructuredGeocodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AddressStructuredGeocodeOK, error)
V1AddressStructuredGeocode geocodes structured addresses

**Description**<br>

Geocode a single structured address. This takes address components (street, city, state, etc) and matches it against our records to produce the geocoded result.

This does a best-attempt to geocode the given address in the face of human errors in the input data. This can be the wrong city ("New York City" instead of "New York") a missing postal code, a misspelled street name, house numbers that don't exist, etc.

As more corrections are needed, the certainty in the result drops. This can be tuned with a minimum certainty parameter. If our confidence in the result is less than the minimum certainty, it will not be returned. The default is 30%. 30% was chosen to be robust against unclean data without returning results that are unlikely to be true. We don't recommend setting this parameter above 90% because exact matching is too restrictive for the mistakes that people typically make when writing addresses -- even people writing their own addresses will make mistakes that are never corrected because they Just Work.

**Lookup cost**<br>

This query requires an account. Please sign up at https://geo.codes/signup and get your API key at https://geo.codes/account/api

One query counts as one lookup. It only costs a query if it returns data. If you have exceeded your account quota, the request will not succeed.

type ClientOption

type ClientOption func(*runtime.ClientOperation)

ClientOption is the option for Client methods

type ClientService

type ClientService interface {
	V1AddressGeocode(params *V1AddressGeocodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AddressGeocodeOK, error)

	V1AddressStructuredGeocode(params *V1AddressStructuredGeocodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AddressStructuredGeocodeOK, error)

	SetTransport(transport runtime.ClientTransport)
}

ClientService is the interface for Client methods

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService

New creates a new address API client.

type V1AddressGeocodeOK

type V1AddressGeocodeOK struct {
	Payload *models.Geocoding
}
V1AddressGeocodeOK describes a response with status code 200, with default header values.

OK

func NewV1AddressGeocodeOK

func NewV1AddressGeocodeOK() *V1AddressGeocodeOK

NewV1AddressGeocodeOK creates a V1AddressGeocodeOK with default headers values

func (*V1AddressGeocodeOK) Error

func (o *V1AddressGeocodeOK) Error() string

func (*V1AddressGeocodeOK) GetPayload

func (o *V1AddressGeocodeOK) GetPayload() *models.Geocoding

type V1AddressGeocodeParams

type V1AddressGeocodeParams struct {

	/* MinConfidence.

	   The minimum confidence in the results required to return an address, as a percentage between 0 and 100. Default: 30. To accept only exact data matches, choose 100. To be as permissive as possible, set it to 0. We don't recommend setting this higher than 90. It is very common for people to write their own addresses in ways that deviate from the exact match.
	*/
	MinConfidence *int64

	/* Q.

	   The unstructured address to geocode. Expected to be roughly the format that is used by the USPS to deliver mail.
	*/
	Q string

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

V1AddressGeocodeParams contains all the parameters to send to the API endpoint

for the v1 address geocode operation.

Typically these are written to a http.Request.

func NewV1AddressGeocodeParams

func NewV1AddressGeocodeParams() *V1AddressGeocodeParams

NewV1AddressGeocodeParams creates a new V1AddressGeocodeParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewV1AddressGeocodeParamsWithContext

func NewV1AddressGeocodeParamsWithContext(ctx context.Context) *V1AddressGeocodeParams

NewV1AddressGeocodeParamsWithContext creates a new V1AddressGeocodeParams object with the ability to set a context for a request.

func NewV1AddressGeocodeParamsWithHTTPClient

func NewV1AddressGeocodeParamsWithHTTPClient(client *http.Client) *V1AddressGeocodeParams

NewV1AddressGeocodeParamsWithHTTPClient creates a new V1AddressGeocodeParams object with the ability to set a custom HTTPClient for a request.

func NewV1AddressGeocodeParamsWithTimeout

func NewV1AddressGeocodeParamsWithTimeout(timeout time.Duration) *V1AddressGeocodeParams

NewV1AddressGeocodeParamsWithTimeout creates a new V1AddressGeocodeParams object with the ability to set a timeout on a request.

func (*V1AddressGeocodeParams) SetContext

func (o *V1AddressGeocodeParams) SetContext(ctx context.Context)

SetContext adds the context to the v1 address geocode params

func (*V1AddressGeocodeParams) SetDefaults

func (o *V1AddressGeocodeParams) SetDefaults()

SetDefaults hydrates default values in the v1 address geocode params (not the query body).

All values with no default are reset to their zero value.

func (*V1AddressGeocodeParams) SetHTTPClient

func (o *V1AddressGeocodeParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the v1 address geocode params

func (*V1AddressGeocodeParams) SetMinConfidence

func (o *V1AddressGeocodeParams) SetMinConfidence(minConfidence *int64)

SetMinConfidence adds the minConfidence to the v1 address geocode params

func (*V1AddressGeocodeParams) SetQ

func (o *V1AddressGeocodeParams) SetQ(q string)

SetQ adds the q to the v1 address geocode params

func (*V1AddressGeocodeParams) SetTimeout

func (o *V1AddressGeocodeParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the v1 address geocode params

func (*V1AddressGeocodeParams) WithContext

WithContext adds the context to the v1 address geocode params

func (*V1AddressGeocodeParams) WithDefaults

WithDefaults hydrates default values in the v1 address geocode params (not the query body).

All values with no default are reset to their zero value.

func (*V1AddressGeocodeParams) WithHTTPClient

func (o *V1AddressGeocodeParams) WithHTTPClient(client *http.Client) *V1AddressGeocodeParams

WithHTTPClient adds the HTTPClient to the v1 address geocode params

func (*V1AddressGeocodeParams) WithMinConfidence

func (o *V1AddressGeocodeParams) WithMinConfidence(minConfidence *int64) *V1AddressGeocodeParams

WithMinConfidence adds the minConfidence to the v1 address geocode params

func (*V1AddressGeocodeParams) WithQ

WithQ adds the q to the v1 address geocode params

func (*V1AddressGeocodeParams) WithTimeout

WithTimeout adds the timeout to the v1 address geocode params

func (*V1AddressGeocodeParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type V1AddressGeocodeReader

type V1AddressGeocodeReader struct {
	// contains filtered or unexported fields
}

V1AddressGeocodeReader is a Reader for the V1AddressGeocode structure.

func (*V1AddressGeocodeReader) ReadResponse

func (o *V1AddressGeocodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type V1AddressStructuredGeocodeOK

type V1AddressStructuredGeocodeOK struct {
	Payload *models.Geocoding
}
V1AddressStructuredGeocodeOK describes a response with status code 200, with default header values.

OK

func NewV1AddressStructuredGeocodeOK

func NewV1AddressStructuredGeocodeOK() *V1AddressStructuredGeocodeOK

NewV1AddressStructuredGeocodeOK creates a V1AddressStructuredGeocodeOK with default headers values

func (*V1AddressStructuredGeocodeOK) Error

func (*V1AddressStructuredGeocodeOK) GetPayload

type V1AddressStructuredGeocodeParams

type V1AddressStructuredGeocodeParams struct {

	/* City.

	   The city. Not required, but it's highly recommended that you add either the city or postal_code fields.
	*/
	City *string

	/* MinConfidence.

	   The minimum confidence in the results required to return an address, as a percentage between 0 and 100. Default: 30. To accept only exact data matches, choose 100. To be as permissive as possible, set it to 0. We don't recommend setting this higher than 90. It is very common for people to write their own addresses in ways that deviate from the exact match.
	*/
	MinConfidence *int64

	/* PostalCode.

	   The postal code, for example, a ZIP code. Not required, but if this is not present, we recommend adding the city and the state for best results.
	*/
	PostalCode *string

	/* State.

	   The state with the address. Not required, but it's highly recommended that you add the postal_code if the state is not present.
	*/
	State *string

	/* StreetAddress.

	   The street address line, including the number and street type.
	*/
	StreetAddress string

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

V1AddressStructuredGeocodeParams contains all the parameters to send to the API endpoint

for the v1 address structured geocode operation.

Typically these are written to a http.Request.

func NewV1AddressStructuredGeocodeParams

func NewV1AddressStructuredGeocodeParams() *V1AddressStructuredGeocodeParams

NewV1AddressStructuredGeocodeParams creates a new V1AddressStructuredGeocodeParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewV1AddressStructuredGeocodeParamsWithContext

func NewV1AddressStructuredGeocodeParamsWithContext(ctx context.Context) *V1AddressStructuredGeocodeParams

NewV1AddressStructuredGeocodeParamsWithContext creates a new V1AddressStructuredGeocodeParams object with the ability to set a context for a request.

func NewV1AddressStructuredGeocodeParamsWithHTTPClient

func NewV1AddressStructuredGeocodeParamsWithHTTPClient(client *http.Client) *V1AddressStructuredGeocodeParams

NewV1AddressStructuredGeocodeParamsWithHTTPClient creates a new V1AddressStructuredGeocodeParams object with the ability to set a custom HTTPClient for a request.

func NewV1AddressStructuredGeocodeParamsWithTimeout

func NewV1AddressStructuredGeocodeParamsWithTimeout(timeout time.Duration) *V1AddressStructuredGeocodeParams

NewV1AddressStructuredGeocodeParamsWithTimeout creates a new V1AddressStructuredGeocodeParams object with the ability to set a timeout on a request.

func (*V1AddressStructuredGeocodeParams) SetCity

func (o *V1AddressStructuredGeocodeParams) SetCity(city *string)

SetCity adds the city to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) SetContext

SetContext adds the context to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) SetDefaults

func (o *V1AddressStructuredGeocodeParams) SetDefaults()

SetDefaults hydrates default values in the v1 address structured geocode params (not the query body).

All values with no default are reset to their zero value.

func (*V1AddressStructuredGeocodeParams) SetHTTPClient

func (o *V1AddressStructuredGeocodeParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) SetMinConfidence

func (o *V1AddressStructuredGeocodeParams) SetMinConfidence(minConfidence *int64)

SetMinConfidence adds the minConfidence to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) SetPostalCode

func (o *V1AddressStructuredGeocodeParams) SetPostalCode(postalCode *string)

SetPostalCode adds the postalCode to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) SetState

func (o *V1AddressStructuredGeocodeParams) SetState(state *string)

SetState adds the state to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) SetStreetAddress

func (o *V1AddressStructuredGeocodeParams) SetStreetAddress(streetAddress string)

SetStreetAddress adds the streetAddress to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) SetTimeout

func (o *V1AddressStructuredGeocodeParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) WithCity

WithCity adds the city to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) WithContext

WithContext adds the context to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) WithDefaults

WithDefaults hydrates default values in the v1 address structured geocode params (not the query body).

All values with no default are reset to their zero value.

func (*V1AddressStructuredGeocodeParams) WithHTTPClient

WithHTTPClient adds the HTTPClient to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) WithMinConfidence

func (o *V1AddressStructuredGeocodeParams) WithMinConfidence(minConfidence *int64) *V1AddressStructuredGeocodeParams

WithMinConfidence adds the minConfidence to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) WithPostalCode

WithPostalCode adds the postalCode to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) WithState

WithState adds the state to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) WithStreetAddress

func (o *V1AddressStructuredGeocodeParams) WithStreetAddress(streetAddress string) *V1AddressStructuredGeocodeParams

WithStreetAddress adds the streetAddress to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) WithTimeout

WithTimeout adds the timeout to the v1 address structured geocode params

func (*V1AddressStructuredGeocodeParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type V1AddressStructuredGeocodeReader

type V1AddressStructuredGeocodeReader struct {
	// contains filtered or unexported fields
}

V1AddressStructuredGeocodeReader is a Reader for the V1AddressStructuredGeocode structure.

func (*V1AddressStructuredGeocodeReader) ReadResponse

func (o *V1AddressStructuredGeocodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

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