addressvalidation

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package addressvalidation provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.

Index

Constants

View Source
const (
	OAuth2Scopes = "OAuth2.Scopes"
)

Variables

This section is empty.

Functions

func NewAddressValidationRequest

func NewAddressValidationRequest(server string, version string, requestoption int, params *AddressValidationParams, body AddressValidationJSONRequestBody) (*http.Request, error)

NewAddressValidationRequest calls the generic AddressValidation builder with application/json body

func NewAddressValidationRequestWithBody

func NewAddressValidationRequestWithBody(server string, version string, requestoption int, params *AddressValidationParams, contentType string, body io.Reader) (*http.Request, error)

NewAddressValidationRequestWithBody generates requests for AddressValidation with any type of body

func NewDeprecatedAddressValidationRequest

func NewDeprecatedAddressValidationRequest(server string, deprecatedVersion string, requestoption int, params *DeprecatedAddressValidationParams, body DeprecatedAddressValidationJSONRequestBody) (*http.Request, error)

NewDeprecatedAddressValidationRequest calls the generic DeprecatedAddressValidation builder with application/json body

func NewDeprecatedAddressValidationRequestWithBody

func NewDeprecatedAddressValidationRequestWithBody(server string, deprecatedVersion string, requestoption int, params *DeprecatedAddressValidationParams, contentType string, body io.Reader) (*http.Request, error)

NewDeprecatedAddressValidationRequestWithBody generates requests for DeprecatedAddressValidation with any type of body

Types

type AddressValidationJSONRequestBody

type AddressValidationJSONRequestBody = XAVRequestWrapper

AddressValidationJSONRequestBody defines body for AddressValidation for application/json ContentType.

type AddressValidationParams

type AddressValidationParams struct {
	// Regionalrequestindicator Valid values: True or False.  If True, either the region element or any  combination of Political Division 1,  Political Division 2, PostcodePrimaryLow and the PostcodeExtendedLow fields will  be recognized for validation in addition to  the urbanization element. If False or no  indicator, street level address validation  is provided
	Regionalrequestindicator *string `form:"regionalrequestindicator,omitempty" json:"regionalrequestindicator,omitempty"`

	// Maximumcandidatelistsize Valid values: 0 – 50 The maximum number of Candidates to  return for this request. If not provided,  the default size of 15 is returned.
	Maximumcandidatelistsize *int `form:"maximumcandidatelistsize,omitempty" json:"maximumcandidatelistsize,omitempty"`
}

AddressValidationParams defines parameters for AddressValidation.

type AddressValidationResponse

type AddressValidationResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *XAVResponseWrapper
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON403      *ErrorResponse
	JSON429      *ErrorResponse
}

func ParseAddressValidationResponse

func ParseAddressValidationResponse(rsp *http.Response) (*AddressValidationResponse, error)

ParseAddressValidationResponse parses an HTTP response from a AddressValidationWithResponse call

func (AddressValidationResponse) Status

func (r AddressValidationResponse) Status() string

Status returns HTTPResponse.Status

func (AddressValidationResponse) StatusCode

func (r AddressValidationResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CandidateAddressClassification

type CandidateAddressClassification struct {
	// Code Contains the classification code of the address:
	// 0 - UnClassified
	// 1 - Commercial
	// 2 - Residential
	Code string `json:"Code"`

	// Description Contains the text description of the address classification code (see Code above).
	Description string `json:"Description"`
}

CandidateAddressClassification AddressClassification Container.

type CandidateAddressKeyFormat

type CandidateAddressKeyFormat struct {
	// AddressLine Address line (street number, street name and street type, and political division 1, political division 2 and postal code) used for street level information. Additional secondary information (apartment, suite, floor, etc.) Applicable to US and PR only.  Not returned if user selects the RegionalRequestIndicator.
	AddressLine *[]string `json:"AddressLine,omitempty"`

	// AttentionName Name of building. Not returned if user selects the RegionalRequestIndicator.
	AttentionName *string `json:"AttentionName,omitempty"`

	// ConsigneeName Name of business, company or person. Not returned if user selects the RegionalRequestIndicator.
	ConsigneeName *string `json:"ConsigneeName,omitempty"`

	// CountryCode A country or territory code. Required to be returned.
	CountryCode string `json:"CountryCode"`

	// PoliticalDivision1 State/Province.  Returned if the location is within a State/Province/Territory. For International: returned if user enters valid Country or Territory Code, and City/postal code and it has a match.  For Domestic addresses, the value must be a valid 2-character value (per US Mail standards).  For International the full State or Province name will be returned.
	PoliticalDivision1 *string `json:"PoliticalDivision1,omitempty"`

	// PoliticalDivision2 City or Town name.
	PoliticalDivision2 *string `json:"PoliticalDivision2,omitempty"`

	// PostcodeExtendedLow Low-end extended postal code in a range. Example in quotes: Postal Code 30076-'1234'.  Only returned in candidate list. May be alphanumeric
	PostcodeExtendedLow *string `json:"PostcodeExtendedLow,omitempty"`

	// PostcodePrimaryLow Low-end Postal Code. Returned for countries or territories with Postal Codes. May be alphanumeric.
	PostcodePrimaryLow *string `json:"PostcodePrimaryLow,omitempty"`

	// Region Single entry containing in this order  Political Division 2, Political Division 1 and Post Code Primary Low and/or PostcodeExtendedLow.
	Region *string `json:"Region,omitempty"`

	// Urbanization Puerto Rico Political Division 3. Only Valid for Puerto Rico.
	Urbanization *string `json:"Urbanization,omitempty"`
}

CandidateAddressKeyFormat AddressKeyFormat Container.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) AddressValidation

func (c *Client) AddressValidation(ctx context.Context, version string, requestoption int, params *AddressValidationParams, body AddressValidationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) AddressValidationWithBody

func (c *Client) AddressValidationWithBody(ctx context.Context, version string, requestoption int, params *AddressValidationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeprecatedAddressValidation

func (c *Client) DeprecatedAddressValidation(ctx context.Context, deprecatedVersion string, requestoption int, params *DeprecatedAddressValidationParams, body DeprecatedAddressValidationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeprecatedAddressValidationWithBody

func (c *Client) DeprecatedAddressValidationWithBody(ctx context.Context, deprecatedVersion string, requestoption int, params *DeprecatedAddressValidationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// DeprecatedAddressValidationWithBody request with any body
	DeprecatedAddressValidationWithBody(ctx context.Context, deprecatedVersion string, requestoption int, params *DeprecatedAddressValidationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	DeprecatedAddressValidation(ctx context.Context, deprecatedVersion string, requestoption int, params *DeprecatedAddressValidationParams, body DeprecatedAddressValidationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AddressValidationWithBody request with any body
	AddressValidationWithBody(ctx context.Context, version string, requestoption int, params *AddressValidationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AddressValidation(ctx context.Context, version string, requestoption int, params *AddressValidationParams, body AddressValidationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) AddressValidationWithBodyWithResponse

func (c *ClientWithResponses) AddressValidationWithBodyWithResponse(ctx context.Context, version string, requestoption int, params *AddressValidationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddressValidationResponse, error)

AddressValidationWithBodyWithResponse request with arbitrary body returning *AddressValidationResponse

func (*ClientWithResponses) AddressValidationWithResponse

func (c *ClientWithResponses) AddressValidationWithResponse(ctx context.Context, version string, requestoption int, params *AddressValidationParams, body AddressValidationJSONRequestBody, reqEditors ...RequestEditorFn) (*AddressValidationResponse, error)

func (*ClientWithResponses) DeprecatedAddressValidationWithBodyWithResponse

func (c *ClientWithResponses) DeprecatedAddressValidationWithBodyWithResponse(ctx context.Context, deprecatedVersion string, requestoption int, params *DeprecatedAddressValidationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeprecatedAddressValidationResponse, error)

DeprecatedAddressValidationWithBodyWithResponse request with arbitrary body returning *DeprecatedAddressValidationResponse

func (*ClientWithResponses) DeprecatedAddressValidationWithResponse

func (c *ClientWithResponses) DeprecatedAddressValidationWithResponse(ctx context.Context, deprecatedVersion string, requestoption int, params *DeprecatedAddressValidationParams, body DeprecatedAddressValidationJSONRequestBody, reqEditors ...RequestEditorFn) (*DeprecatedAddressValidationResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// DeprecatedAddressValidationWithBodyWithResponse request with any body
	DeprecatedAddressValidationWithBodyWithResponse(ctx context.Context, deprecatedVersion string, requestoption int, params *DeprecatedAddressValidationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeprecatedAddressValidationResponse, error)

	DeprecatedAddressValidationWithResponse(ctx context.Context, deprecatedVersion string, requestoption int, params *DeprecatedAddressValidationParams, body DeprecatedAddressValidationJSONRequestBody, reqEditors ...RequestEditorFn) (*DeprecatedAddressValidationResponse, error)

	// AddressValidationWithBodyWithResponse request with any body
	AddressValidationWithBodyWithResponse(ctx context.Context, version string, requestoption int, params *AddressValidationParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddressValidationResponse, error)

	AddressValidationWithResponse(ctx context.Context, version string, requestoption int, params *AddressValidationParams, body AddressValidationJSONRequestBody, reqEditors ...RequestEditorFn) (*AddressValidationResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CommonErrorResponse

type CommonErrorResponse struct {
	// Errors The error array containing any errors that occurred.
	Errors *[]ErrorMessage `json:"errors,omitempty"`
}

CommonErrorResponse The error response containing any errors that occurred.

type DeprecatedAddressValidationJSONRequestBody

type DeprecatedAddressValidationJSONRequestBody = XAVRequestWrapper

DeprecatedAddressValidationJSONRequestBody defines body for DeprecatedAddressValidation for application/json ContentType.

type DeprecatedAddressValidationParams

type DeprecatedAddressValidationParams struct {
	// Regionalrequestindicator Valid values: True or False.  If True, either the region element or any  combination of Political Division 1,  Political Division 2, PostcodePrimaryLow and the PostcodeExtendedLow fields will  be recognized for validation in addition to  the urbanization element. If False or no  indicator, street level address validation  is provided
	Regionalrequestindicator *string `form:"regionalrequestindicator,omitempty" json:"regionalrequestindicator,omitempty"`

	// Maximumcandidatelistsize Valid values: 0 – 50 The maximum number of Candidates to  return for this request. If not provided,  the default size of 15 is returned.
	Maximumcandidatelistsize *int `form:"maximumcandidatelistsize,omitempty" json:"maximumcandidatelistsize,omitempty"`
}

DeprecatedAddressValidationParams defines parameters for DeprecatedAddressValidation.

type DeprecatedAddressValidationResponse

type DeprecatedAddressValidationResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *XAVResponseWrapper
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON403      *ErrorResponse
	JSON429      *ErrorResponse
}

func ParseDeprecatedAddressValidationResponse

func ParseDeprecatedAddressValidationResponse(rsp *http.Response) (*DeprecatedAddressValidationResponse, error)

ParseDeprecatedAddressValidationResponse parses an HTTP response from a DeprecatedAddressValidationWithResponse call

func (DeprecatedAddressValidationResponse) Status

Status returns HTTPResponse.Status

func (DeprecatedAddressValidationResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type ErrorMessage

type ErrorMessage struct {
	// Code The error code.
	Code *string `json:"code,omitempty"`

	// Message The error message.
	Message *string `json:"message,omitempty"`
}

ErrorMessage The error response containing any errors that occurred.

type ErrorResponse

type ErrorResponse struct {
	// Response The error response containing any errors that occurred.
	Response *CommonErrorResponse `json:"response,omitempty"`
}

ErrorResponse defines model for ErrorResponse.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type ResponseAlert

type ResponseAlert struct {
	// Code Warning code returned by the system.
	Code string `json:"Code"`

	// Description Warning messages returned by the system.
	Description string `json:"Description"`
}

ResponseAlert defines model for Response_Alert.

type ResponseResponseStatus

type ResponseResponseStatus struct {
	// Code Identifies the success or failure of the transaction. Valid values:
	// 1 = Success
	// 0 = Failure
	Code string `json:"Code"`

	// Description Describes Response Status Code.  Returns text of 'Success' or 'Failure'.
	Description string `json:"Description"`
}

ResponseResponseStatus Response Status Container.

type ResponseTransactionReference

type ResponseTransactionReference struct {
	// CustomerContext The CustomerContext Information which will be echoed during response.
	CustomerContext *string `json:"CustomerContext,omitempty"`
}

ResponseTransactionReference Transaction Reference Container.

type XAVRequest

type XAVRequest struct {
	// AddressKeyFormat AddressKeyFormat container.
	// The Key format is based on addressing standards jointly developed by the Postal Service and mailing industry.  The information provided in the Address Key container will be returned in the same format.
	AddressKeyFormat XAVRequestAddressKeyFormat `json:"AddressKeyFormat"`
}

XAVRequest defines model for XAVRequest.

type XAVRequestAddressKeyFormat

type XAVRequestAddressKeyFormat struct {
	// AddressLine Address line (street number, street name and street type) used for street level information. Additional secondary information (apartment, suite, floor, etc.). Applicable to US and PR only. Ignored if user selects the RegionalRequestIndicator.
	AddressLine *[]string `json:"AddressLine,omitempty"`

	// AttentionName Name of the building. Ignored if user selects the RegionalRequestIndicator.
	AttentionName *string `json:"AttentionName,omitempty"`

	// ConsigneeName Name of business, company or person. Ignored if user selects the RegionalRequestIndicator.
	ConsigneeName *string `json:"ConsigneeName,omitempty"`

	// CountryCode Country or Territory Code. For a list of valid values, refer to the Address Validation API Supported Countries or Territories table in the Appendix.
	CountryCode string `json:"CountryCode"`

	// PoliticalDivision1 State or Province/Territory name.
	PoliticalDivision1 *string `json:"PoliticalDivision1,omitempty"`

	// PoliticalDivision2 City or Town name.
	PoliticalDivision2 *string `json:"PoliticalDivision2,omitempty"`

	// PostcodeExtendedLow 4 digit Postal Code extension. For US use only.
	PostcodeExtendedLow *string `json:"PostcodeExtendedLow,omitempty"`

	// PostcodePrimaryLow Postal Code.
	PostcodePrimaryLow *string `json:"PostcodePrimaryLow,omitempty"`

	// Region If this node is present the following tags will be ignored:
	//
	// - Political Division 2
	// - Political Division 1
	// - PostcodePrimaryLow
	// - PostcodeExtendedLow
	//
	// Valid only for US or PR origins only.  Using this tag for non US/PR origins may cause address format errors.
	Region *string `json:"Region,omitempty"`

	// Urbanization Puerto Rico Political Division 3. Only Valid for Puerto Rico.
	Urbanization *string `json:"Urbanization,omitempty"`
}

XAVRequestAddressKeyFormat AddressKeyFormat container. The Key format is based on addressing standards jointly developed by the Postal Service and mailing industry. The information provided in the Address Key container will be returned in the same format.

type XAVRequestWrapper

type XAVRequestWrapper struct {
	XAVRequest XAVRequest `json:"XAVRequest"`
}

XAVRequestWrapper N/A

type XAVResponse

type XAVResponse struct {
	// AddressClassification AddressClassification Container.
	AddressClassification *XAVResponseAddressClassification `json:"AddressClassification,omitempty"`

	// AmbiguousAddressIndicator Indicates query could not find exact match. Candidate list follows.
	AmbiguousAddressIndicator *string `json:"AmbiguousAddressIndicator,omitempty"`

	// Candidate Candidate Container.
	//
	// **NOTE:** For versions >= v2, this element will always be returned as an array. For requests using version = v1, this element will be returned as an array if there is more than one object and a single object if there is only 1.
	Candidate *[]XAVResponseCandidate `json:"Candidate,omitempty"`

	// NoCandidatesIndicator No Candidate found.
	NoCandidatesIndicator *string `json:"NoCandidatesIndicator,omitempty"`

	// Response Response Container.
	Response XAVResponseResponse `json:"Response"`

	// ValidAddressIndicator Indicates query found a valid match.
	ValidAddressIndicator *string `json:"ValidAddressIndicator,omitempty"`
}

XAVResponse XAV Response Container.

type XAVResponseAddressClassification

type XAVResponseAddressClassification struct {
	// Code Contains the classification code of the input address.
	//
	// Valid values:
	//
	// - 0 - UnClassified
	// - 1 - Commercial
	// - 2 - Residential
	Code string `json:"Code"`

	// Description Contains the text description of the address classification code: UnClassified, Commercial, Residential
	Description string `json:"Description"`
}

XAVResponseAddressClassification AddressClassification Container.

type XAVResponseCandidate

type XAVResponseCandidate struct {
	// AddressClassification AddressClassification Container.
	AddressClassification *CandidateAddressClassification `json:"AddressClassification,omitempty"`

	// AddressKeyFormat AddressKeyFormat Container.
	AddressKeyFormat CandidateAddressKeyFormat `json:"AddressKeyFormat"`
}

XAVResponseCandidate defines model for XAVResponse_Candidate.

type XAVResponseResponse

type XAVResponseResponse struct {
	// Alert Alert Container.  There can be zero to many alert containers with code and description.
	//
	// **NOTE:** For versions >= v2, this element will always be returned as an array. For requests using version = v1, this element will be returned as an array if there is more than one object and a single object if there is only 1.
	Alert *[]ResponseAlert `json:"Alert,omitempty"`

	// ResponseStatus Response Status Container.
	ResponseStatus ResponseResponseStatus `json:"ResponseStatus"`

	// TransactionReference Transaction Reference Container.
	TransactionReference *ResponseTransactionReference `json:"TransactionReference,omitempty"`
}

XAVResponseResponse Response Container.

type XAVResponseWrapper

type XAVResponseWrapper struct {
	// XAVResponse XAV Response Container.
	XAVResponse XAVResponse `json:"XAVResponse"`
}

XAVResponseWrapper N/A

Jump to

Keyboard shortcuts

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