Documentation
¶
Index ¶
- type Client
- func (a *Client) SetTransport(transport runtime.ClientTransport)
- func (a *Client) V1AddressReverseZIPCode(params *V1AddressReverseZIPCodeParams, authInfo runtime.ClientAuthInfoWriter, ...) (*V1AddressReverseZIPCodeOK, error)
- func (a *Client) V1AddressZIPCode(params *V1AddressZIPCodeParams, authInfo runtime.ClientAuthInfoWriter, ...) (*V1AddressZIPCodeOK, error)
- type ClientOption
- type ClientService
- type V1AddressReverseZIPCodeOK
- type V1AddressReverseZIPCodeParams
- func NewV1AddressReverseZIPCodeParams() *V1AddressReverseZIPCodeParams
- func NewV1AddressReverseZIPCodeParamsWithContext(ctx context.Context) *V1AddressReverseZIPCodeParams
- func NewV1AddressReverseZIPCodeParamsWithHTTPClient(client *http.Client) *V1AddressReverseZIPCodeParams
- func NewV1AddressReverseZIPCodeParamsWithTimeout(timeout time.Duration) *V1AddressReverseZIPCodeParams
- func (o *V1AddressReverseZIPCodeParams) SetContext(ctx context.Context)
- func (o *V1AddressReverseZIPCodeParams) SetDefaults()
- func (o *V1AddressReverseZIPCodeParams) SetHTTPClient(client *http.Client)
- func (o *V1AddressReverseZIPCodeParams) SetLatitude(latitude float64)
- func (o *V1AddressReverseZIPCodeParams) SetLongitude(longitude float64)
- func (o *V1AddressReverseZIPCodeParams) SetStrict(strict *bool)
- func (o *V1AddressReverseZIPCodeParams) SetTimeout(timeout time.Duration)
- func (o *V1AddressReverseZIPCodeParams) WithContext(ctx context.Context) *V1AddressReverseZIPCodeParams
- func (o *V1AddressReverseZIPCodeParams) WithDefaults() *V1AddressReverseZIPCodeParams
- func (o *V1AddressReverseZIPCodeParams) WithHTTPClient(client *http.Client) *V1AddressReverseZIPCodeParams
- func (o *V1AddressReverseZIPCodeParams) WithLatitude(latitude float64) *V1AddressReverseZIPCodeParams
- func (o *V1AddressReverseZIPCodeParams) WithLongitude(longitude float64) *V1AddressReverseZIPCodeParams
- func (o *V1AddressReverseZIPCodeParams) WithStrict(strict *bool) *V1AddressReverseZIPCodeParams
- func (o *V1AddressReverseZIPCodeParams) WithTimeout(timeout time.Duration) *V1AddressReverseZIPCodeParams
- func (o *V1AddressReverseZIPCodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
- type V1AddressReverseZIPCodeReader
- type V1AddressZIPCodeOK
- type V1AddressZIPCodeParams
- func NewV1AddressZIPCodeParams() *V1AddressZIPCodeParams
- func NewV1AddressZIPCodeParamsWithContext(ctx context.Context) *V1AddressZIPCodeParams
- func NewV1AddressZIPCodeParamsWithHTTPClient(client *http.Client) *V1AddressZIPCodeParams
- func NewV1AddressZIPCodeParamsWithTimeout(timeout time.Duration) *V1AddressZIPCodeParams
- func (o *V1AddressZIPCodeParams) SetContext(ctx context.Context)
- func (o *V1AddressZIPCodeParams) SetDefaults()
- func (o *V1AddressZIPCodeParams) SetHTTPClient(client *http.Client)
- func (o *V1AddressZIPCodeParams) SetTimeout(timeout time.Duration)
- func (o *V1AddressZIPCodeParams) SetZIPCode(zIPCode string)
- func (o *V1AddressZIPCodeParams) WithContext(ctx context.Context) *V1AddressZIPCodeParams
- func (o *V1AddressZIPCodeParams) WithDefaults() *V1AddressZIPCodeParams
- func (o *V1AddressZIPCodeParams) WithHTTPClient(client *http.Client) *V1AddressZIPCodeParams
- func (o *V1AddressZIPCodeParams) WithTimeout(timeout time.Duration) *V1AddressZIPCodeParams
- func (o *V1AddressZIPCodeParams) WithZIPCode(zIPCode string) *V1AddressZIPCodeParams
- func (o *V1AddressZIPCodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
- type V1AddressZIPCodeReader
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 zip code API
func (*Client) SetTransport ¶
func (a *Client) SetTransport(transport runtime.ClientTransport)
SetTransport changes the transport on the client
func (*Client) V1AddressReverseZIPCode ¶
func (a *Client) V1AddressReverseZIPCode(params *V1AddressReverseZIPCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AddressReverseZIPCodeOK, error)
V1AddressReverseZIPCode converts a coordinate to a ZIP code **Description**<br>
Look up a single ZIP Code from the given latitude and longitude.
This performs a lookup based on US Census "ZIP Code Tabulation Areas." These areas are calculated by the US Census based on the most common ZIP Codes within different US Census blocks. This is necessary because in practice, ZIP Codes are not defined by areas but are defined as collections of addresses. They correspond loosely to areas, but not exactly. To get an accurate ZIP Code for an address, see the geocoding endpoints.
For more information on ZIP Code tabulation areas and why ZIP Codes cannot be accurately represented by areas, [click here](https://geo.codes/resources/articles/complete-guide-to-zip-codes#what-are-zip-code-tabulation-areas).
They have the following limitations: - ZIP Code Tabulation Areas do not have full coverage of the land mass of the United States. This only matters in remote areas without deliverable addresses; in practice this is fine. In these cases, the API will return the closest tabulation area unless the ` + "`strict`" + ` parameter is provided. - Addresses within a ZIP Code Tabulation Area might have different ZIP Codes. Geocoding an address is the only way to get a perfect ZIP Code. - The PlusFour field on the return value will always be empty.
**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.
func (*Client) V1AddressZIPCode ¶
func (a *Client) V1AddressZIPCode(params *V1AddressZIPCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AddressZIPCodeOK, error)
V1AddressZIPCode converts a ZIP code to a coordinate **Description**<br>
Convert a single ZIP Code into a latitude and longitude.
By default, this returns a point that is guaranteed to be interior to the given ZIP Code. It may not necessarily be the centroid, because the centroid of some ZIP Codes do not fall within their borders (imagine a ZIP Code that is shaped like a crescent).
If a Plus-4 ZIP code is passed, only the first 5 digits will be used (i.e. the +4 will be ignored).
This performs a lookup based on US Census "ZIP Code Tabulation Areas." These areas are calculated by the US Census based on the most common ZIP Codes within different US Census blocks. This is necessary because in practice, ZIP Codes are not defined by areas but are defined as collections of addresses. They correspond loosely to areas, but not exactly. To get an accurate ZIP Code for an address, see the geocoding endpoints.
For more information on ZIP Code tabulation areas and why ZIP Codes cannot be accurately represented by areas, [click here](https://geo.codes/resources/articles/complete-guide-to-zip-codes#what-are-zip-code-tabulation-areas).
type ClientOption ¶
type ClientOption func(*runtime.ClientOperation)
ClientOption is the option for Client methods
type ClientService ¶
type ClientService interface {
V1AddressReverseZIPCode(params *V1AddressReverseZIPCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AddressReverseZIPCodeOK, error)
V1AddressZIPCode(params *V1AddressZIPCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AddressZIPCodeOK, 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 zip code API client.
type V1AddressReverseZIPCodeOK ¶
type V1AddressReverseZIPCodeOK struct {
Payload *models.ReverseZIPCode
}
V1AddressReverseZIPCodeOK describes a response with status code 200, with default header values.
OK
func NewV1AddressReverseZIPCodeOK ¶
func NewV1AddressReverseZIPCodeOK() *V1AddressReverseZIPCodeOK
NewV1AddressReverseZIPCodeOK creates a V1AddressReverseZIPCodeOK with default headers values
func (*V1AddressReverseZIPCodeOK) Error ¶
func (o *V1AddressReverseZIPCodeOK) Error() string
func (*V1AddressReverseZIPCodeOK) GetPayload ¶
func (o *V1AddressReverseZIPCodeOK) GetPayload() *models.ReverseZIPCode
type V1AddressReverseZIPCodeParams ¶
type V1AddressReverseZIPCodeParams struct {
/* Latitude.
The latitude of the query
*/
Latitude float64
/* Longitude.
The longitude of the query
*/
Longitude float64
/* Strict.
If true, will only return a result if the given point is within a zip code tabulation area, and will not return the closest one.
*/
Strict *bool
Context context.Context
HTTPClient *http.Client
// contains filtered or unexported fields
}
V1AddressReverseZIPCodeParams contains all the parameters to send to the API endpoint
for the v1 address reverse zip code operation. Typically these are written to a http.Request.
func NewV1AddressReverseZIPCodeParams ¶
func NewV1AddressReverseZIPCodeParams() *V1AddressReverseZIPCodeParams
NewV1AddressReverseZIPCodeParams creates a new V1AddressReverseZIPCodeParams 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 NewV1AddressReverseZIPCodeParamsWithContext ¶
func NewV1AddressReverseZIPCodeParamsWithContext(ctx context.Context) *V1AddressReverseZIPCodeParams
NewV1AddressReverseZIPCodeParamsWithContext creates a new V1AddressReverseZIPCodeParams object with the ability to set a context for a request.
func NewV1AddressReverseZIPCodeParamsWithHTTPClient ¶
func NewV1AddressReverseZIPCodeParamsWithHTTPClient(client *http.Client) *V1AddressReverseZIPCodeParams
NewV1AddressReverseZIPCodeParamsWithHTTPClient creates a new V1AddressReverseZIPCodeParams object with the ability to set a custom HTTPClient for a request.
func NewV1AddressReverseZIPCodeParamsWithTimeout ¶
func NewV1AddressReverseZIPCodeParamsWithTimeout(timeout time.Duration) *V1AddressReverseZIPCodeParams
NewV1AddressReverseZIPCodeParamsWithTimeout creates a new V1AddressReverseZIPCodeParams object with the ability to set a timeout on a request.
func (*V1AddressReverseZIPCodeParams) SetContext ¶
func (o *V1AddressReverseZIPCodeParams) SetContext(ctx context.Context)
SetContext adds the context to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) SetDefaults ¶
func (o *V1AddressReverseZIPCodeParams) SetDefaults()
SetDefaults hydrates default values in the v1 address reverse zip code params (not the query body).
All values with no default are reset to their zero value.
func (*V1AddressReverseZIPCodeParams) SetHTTPClient ¶
func (o *V1AddressReverseZIPCodeParams) SetHTTPClient(client *http.Client)
SetHTTPClient adds the HTTPClient to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) SetLatitude ¶
func (o *V1AddressReverseZIPCodeParams) SetLatitude(latitude float64)
SetLatitude adds the latitude to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) SetLongitude ¶
func (o *V1AddressReverseZIPCodeParams) SetLongitude(longitude float64)
SetLongitude adds the longitude to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) SetStrict ¶
func (o *V1AddressReverseZIPCodeParams) SetStrict(strict *bool)
SetStrict adds the strict to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) SetTimeout ¶
func (o *V1AddressReverseZIPCodeParams) SetTimeout(timeout time.Duration)
SetTimeout adds the timeout to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) WithContext ¶
func (o *V1AddressReverseZIPCodeParams) WithContext(ctx context.Context) *V1AddressReverseZIPCodeParams
WithContext adds the context to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) WithDefaults ¶
func (o *V1AddressReverseZIPCodeParams) WithDefaults() *V1AddressReverseZIPCodeParams
WithDefaults hydrates default values in the v1 address reverse zip code params (not the query body).
All values with no default are reset to their zero value.
func (*V1AddressReverseZIPCodeParams) WithHTTPClient ¶
func (o *V1AddressReverseZIPCodeParams) WithHTTPClient(client *http.Client) *V1AddressReverseZIPCodeParams
WithHTTPClient adds the HTTPClient to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) WithLatitude ¶
func (o *V1AddressReverseZIPCodeParams) WithLatitude(latitude float64) *V1AddressReverseZIPCodeParams
WithLatitude adds the latitude to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) WithLongitude ¶
func (o *V1AddressReverseZIPCodeParams) WithLongitude(longitude float64) *V1AddressReverseZIPCodeParams
WithLongitude adds the longitude to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) WithStrict ¶
func (o *V1AddressReverseZIPCodeParams) WithStrict(strict *bool) *V1AddressReverseZIPCodeParams
WithStrict adds the strict to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) WithTimeout ¶
func (o *V1AddressReverseZIPCodeParams) WithTimeout(timeout time.Duration) *V1AddressReverseZIPCodeParams
WithTimeout adds the timeout to the v1 address reverse zip code params
func (*V1AddressReverseZIPCodeParams) WriteToRequest ¶
func (o *V1AddressReverseZIPCodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
WriteToRequest writes these params to a swagger request
type V1AddressReverseZIPCodeReader ¶
type V1AddressReverseZIPCodeReader struct {
// contains filtered or unexported fields
}
V1AddressReverseZIPCodeReader is a Reader for the V1AddressReverseZIPCode structure.
func (*V1AddressReverseZIPCodeReader) ReadResponse ¶
func (o *V1AddressReverseZIPCodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)
ReadResponse reads a server response into the received o.
type V1AddressZIPCodeOK ¶
V1AddressZIPCodeOK describes a response with status code 200, with default header values.
OK
func NewV1AddressZIPCodeOK ¶
func NewV1AddressZIPCodeOK() *V1AddressZIPCodeOK
NewV1AddressZIPCodeOK creates a V1AddressZIPCodeOK with default headers values
func (*V1AddressZIPCodeOK) Error ¶
func (o *V1AddressZIPCodeOK) Error() string
func (*V1AddressZIPCodeOK) GetPayload ¶
func (o *V1AddressZIPCodeOK) GetPayload() *models.ZIPCode
type V1AddressZIPCodeParams ¶
type V1AddressZIPCodeParams struct {
/* ZIPCode.
The ZIP Code of the query. Can be a ZIP Code or a ZIP+4 Code. If a +4 extension is passed, it will be ignored.
*/
ZIPCode string
Context context.Context
HTTPClient *http.Client
// contains filtered or unexported fields
}
V1AddressZIPCodeParams contains all the parameters to send to the API endpoint
for the v1 address zip code operation. Typically these are written to a http.Request.
func NewV1AddressZIPCodeParams ¶
func NewV1AddressZIPCodeParams() *V1AddressZIPCodeParams
NewV1AddressZIPCodeParams creates a new V1AddressZIPCodeParams 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 NewV1AddressZIPCodeParamsWithContext ¶
func NewV1AddressZIPCodeParamsWithContext(ctx context.Context) *V1AddressZIPCodeParams
NewV1AddressZIPCodeParamsWithContext creates a new V1AddressZIPCodeParams object with the ability to set a context for a request.
func NewV1AddressZIPCodeParamsWithHTTPClient ¶
func NewV1AddressZIPCodeParamsWithHTTPClient(client *http.Client) *V1AddressZIPCodeParams
NewV1AddressZIPCodeParamsWithHTTPClient creates a new V1AddressZIPCodeParams object with the ability to set a custom HTTPClient for a request.
func NewV1AddressZIPCodeParamsWithTimeout ¶
func NewV1AddressZIPCodeParamsWithTimeout(timeout time.Duration) *V1AddressZIPCodeParams
NewV1AddressZIPCodeParamsWithTimeout creates a new V1AddressZIPCodeParams object with the ability to set a timeout on a request.
func (*V1AddressZIPCodeParams) SetContext ¶
func (o *V1AddressZIPCodeParams) SetContext(ctx context.Context)
SetContext adds the context to the v1 address zip code params
func (*V1AddressZIPCodeParams) SetDefaults ¶
func (o *V1AddressZIPCodeParams) SetDefaults()
SetDefaults hydrates default values in the v1 address zip code params (not the query body).
All values with no default are reset to their zero value.
func (*V1AddressZIPCodeParams) SetHTTPClient ¶
func (o *V1AddressZIPCodeParams) SetHTTPClient(client *http.Client)
SetHTTPClient adds the HTTPClient to the v1 address zip code params
func (*V1AddressZIPCodeParams) SetTimeout ¶
func (o *V1AddressZIPCodeParams) SetTimeout(timeout time.Duration)
SetTimeout adds the timeout to the v1 address zip code params
func (*V1AddressZIPCodeParams) SetZIPCode ¶
func (o *V1AddressZIPCodeParams) SetZIPCode(zIPCode string)
SetZIPCode adds the zipCode to the v1 address zip code params
func (*V1AddressZIPCodeParams) WithContext ¶
func (o *V1AddressZIPCodeParams) WithContext(ctx context.Context) *V1AddressZIPCodeParams
WithContext adds the context to the v1 address zip code params
func (*V1AddressZIPCodeParams) WithDefaults ¶
func (o *V1AddressZIPCodeParams) WithDefaults() *V1AddressZIPCodeParams
WithDefaults hydrates default values in the v1 address zip code params (not the query body).
All values with no default are reset to their zero value.
func (*V1AddressZIPCodeParams) WithHTTPClient ¶
func (o *V1AddressZIPCodeParams) WithHTTPClient(client *http.Client) *V1AddressZIPCodeParams
WithHTTPClient adds the HTTPClient to the v1 address zip code params
func (*V1AddressZIPCodeParams) WithTimeout ¶
func (o *V1AddressZIPCodeParams) WithTimeout(timeout time.Duration) *V1AddressZIPCodeParams
WithTimeout adds the timeout to the v1 address zip code params
func (*V1AddressZIPCodeParams) WithZIPCode ¶
func (o *V1AddressZIPCodeParams) WithZIPCode(zIPCode string) *V1AddressZIPCodeParams
WithZIPCode adds the zIPCode to the v1 address zip code params
func (*V1AddressZIPCodeParams) WriteToRequest ¶
func (o *V1AddressZIPCodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error
WriteToRequest writes these params to a swagger request
type V1AddressZIPCodeReader ¶
type V1AddressZIPCodeReader struct {
// contains filtered or unexported fields
}
V1AddressZIPCodeReader is a Reader for the V1AddressZIPCode structure.
func (*V1AddressZIPCodeReader) ReadResponse ¶
func (o *V1AddressZIPCodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)
ReadResponse reads a server response into the received o.