tracking

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: 12 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 tracking 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 (
	OAuthScopes = "OAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewGetPackageTrackingRequest

func NewGetPackageTrackingRequest(server string, body GetPackageTrackingJSONRequestBody) (*http.Request, error)

NewGetPackageTrackingRequest calls the generic GetPackageTracking builder with application/json body

func NewGetPackageTrackingRequestWithBody

func NewGetPackageTrackingRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewGetPackageTrackingRequestWithBody generates requests for GetPackageTracking with any type of body

func NewPostPackageTrackingNotificationsRequest

func NewPostPackageTrackingNotificationsRequest(server string, trackingNumber string, body PostPackageTrackingNotificationsJSONRequestBody) (*http.Request, error)

NewPostPackageTrackingNotificationsRequest calls the generic PostPackageTrackingNotifications builder with application/json body

func NewPostPackageTrackingNotificationsRequestWithBody

func NewPostPackageTrackingNotificationsRequestWithBody(server string, trackingNumber string, contentType string, body io.Reader) (*http.Request, error)

NewPostPackageTrackingNotificationsRequestWithBody generates requests for PostPackageTrackingNotifications with any type of body

func NewProofOfDeliveryRequest

func NewProofOfDeliveryRequest(server string, trackingNumber string, body ProofOfDeliveryJSONRequestBody) (*http.Request, error)

NewProofOfDeliveryRequest calls the generic ProofOfDelivery builder with application/json body

func NewProofOfDeliveryRequestWithBody

func NewProofOfDeliveryRequestWithBody(server string, trackingNumber string, contentType string, body io.Reader) (*http.Request, error)

NewProofOfDeliveryRequestWithBody generates requests for ProofOfDelivery with any type of body

Types

type AllEventDate

type AllEventDate = string

AllEventDate defines model for AllEventDate.

type AllGuaranteedDeliveryTimes

type AllGuaranteedDeliveryTimes = string

AllGuaranteedDeliveryTimes Guaranteed Delivery information, if available. Value may follow date, date and time, or text format (e.g. YYYY-MM-DD, YYYY-MM-DDTHH:MI, or "# Business Days").

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) GetPackageTracking

func (c *Client) GetPackageTracking(ctx context.Context, body GetPackageTrackingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetPackageTrackingWithBody

func (c *Client) GetPackageTrackingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostPackageTrackingNotifications

func (c *Client) PostPackageTrackingNotifications(ctx context.Context, trackingNumber string, body PostPackageTrackingNotificationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostPackageTrackingNotificationsWithBody

func (c *Client) PostPackageTrackingNotificationsWithBody(ctx context.Context, trackingNumber string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ProofOfDelivery

func (c *Client) ProofOfDelivery(ctx context.Context, trackingNumber string, body ProofOfDeliveryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ProofOfDeliveryWithBody

func (c *Client) ProofOfDeliveryWithBody(ctx context.Context, trackingNumber string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetPackageTrackingWithBody request with any body
	GetPackageTrackingWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	GetPackageTracking(ctx context.Context, body GetPackageTrackingJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostPackageTrackingNotificationsWithBody request with any body
	PostPackageTrackingNotificationsWithBody(ctx context.Context, trackingNumber string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostPackageTrackingNotifications(ctx context.Context, trackingNumber string, body PostPackageTrackingNotificationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ProofOfDeliveryWithBody request with any body
	ProofOfDeliveryWithBody(ctx context.Context, trackingNumber string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	ProofOfDelivery(ctx context.Context, trackingNumber string, body ProofOfDeliveryJSONRequestBody, 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) GetPackageTrackingWithBodyWithResponse

func (c *ClientWithResponses) GetPackageTrackingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetPackageTrackingResponse, error)

GetPackageTrackingWithBodyWithResponse request with arbitrary body returning *GetPackageTrackingResponse

func (*ClientWithResponses) GetPackageTrackingWithResponse

func (c *ClientWithResponses) GetPackageTrackingWithResponse(ctx context.Context, body GetPackageTrackingJSONRequestBody, reqEditors ...RequestEditorFn) (*GetPackageTrackingResponse, error)

func (*ClientWithResponses) PostPackageTrackingNotificationsWithBodyWithResponse

func (c *ClientWithResponses) PostPackageTrackingNotificationsWithBodyWithResponse(ctx context.Context, trackingNumber string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPackageTrackingNotificationsResponse, error)

PostPackageTrackingNotificationsWithBodyWithResponse request with arbitrary body returning *PostPackageTrackingNotificationsResponse

func (*ClientWithResponses) PostPackageTrackingNotificationsWithResponse

func (c *ClientWithResponses) PostPackageTrackingNotificationsWithResponse(ctx context.Context, trackingNumber string, body PostPackageTrackingNotificationsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostPackageTrackingNotificationsResponse, error)

func (*ClientWithResponses) ProofOfDeliveryWithBodyWithResponse

func (c *ClientWithResponses) ProofOfDeliveryWithBodyWithResponse(ctx context.Context, trackingNumber string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProofOfDeliveryResponse, error)

ProofOfDeliveryWithBodyWithResponse request with arbitrary body returning *ProofOfDeliveryResponse

func (*ClientWithResponses) ProofOfDeliveryWithResponse

func (c *ClientWithResponses) ProofOfDeliveryWithResponse(ctx context.Context, trackingNumber string, body ProofOfDeliveryJSONRequestBody, reqEditors ...RequestEditorFn) (*ProofOfDeliveryResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetPackageTrackingWithBodyWithResponse request with any body
	GetPackageTrackingWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GetPackageTrackingResponse, error)

	GetPackageTrackingWithResponse(ctx context.Context, body GetPackageTrackingJSONRequestBody, reqEditors ...RequestEditorFn) (*GetPackageTrackingResponse, error)

	// PostPackageTrackingNotificationsWithBodyWithResponse request with any body
	PostPackageTrackingNotificationsWithBodyWithResponse(ctx context.Context, trackingNumber string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPackageTrackingNotificationsResponse, error)

	PostPackageTrackingNotificationsWithResponse(ctx context.Context, trackingNumber string, body PostPackageTrackingNotificationsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostPackageTrackingNotificationsResponse, error)

	// ProofOfDeliveryWithBodyWithResponse request with any body
	ProofOfDeliveryWithBodyWithResponse(ctx context.Context, trackingNumber string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProofOfDeliveryResponse, error)

	ProofOfDeliveryWithResponse(ctx context.Context, trackingNumber string, body ProofOfDeliveryJSONRequestBody, reqEditors ...RequestEditorFn) (*ProofOfDeliveryResponse, error)
}

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

type DeliveryDateExpectation

type DeliveryDateExpectation struct {
	// EndOfDay The end of day timeframe provided is the estimated timeframe by when the carrier will attempt to deliver the package.
	EndOfDay *string `json:"endOfDay,omitempty"`

	// ExpectedDeliveryDate Indicates the Expected Delivery Date for an item, if available.
	ExpectedDeliveryDate *openapi_types.Date `json:"expectedDeliveryDate,omitempty"`

	// GuaranteedDeliveryDate Guaranteed Delivery information, if available. Value may follow date, date and time, or text format (e.g. YYYY-MM-DD, YYYY-MM-DDTHH:MI, or "# Business Days").
	GuaranteedDeliveryDate *AllGuaranteedDeliveryTimes `json:"guaranteedDeliveryDate,omitempty"`

	// GuaranteedDetails Special messaging related to the guarantee.
	GuaranteedDetails *string `json:"guaranteedDetails,omitempty"`

	// PredictedDeliveryDate The Predicted Delivery Date for the item, if available.
	PredictedDeliveryDate *openapi_types.Date `json:"predictedDeliveryDate,omitempty"`

	// PredictedDeliverySource The source providing Predicted Delivery details for the item.
	PredictedDeliverySource *string `json:"predictedDeliverySource,omitempty"`

	// PredictedDeliveryWindowEndTime The Predicted Delivery Window end time.
	PredictedDeliveryWindowEndTime *string `json:"predictedDeliveryWindowEndTime,omitempty"`

	// PredictedDeliveryWindowStartTime The Predicted Delivery Window start time.
	PredictedDeliveryWindowStartTime *string `json:"predictedDeliveryWindowStartTime,omitempty"`
}

DeliveryDateExpectation Detailed tracking information relative to when the item is expected to arrive.

type ErrorMessage

type ErrorMessage struct {
	// ApiVersion The version of the API that was used and that raised the error.
	ApiVersion *string `json:"apiVersion,omitempty"`

	// Error The high-level error that has occurred as indicated by the status code.
	Error                *ErrorMessage_Error    `json:"error,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage Standard error message response.

func (ErrorMessage) Get

func (a ErrorMessage) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage. Returns the specified element and whether it was found

func (ErrorMessage) MarshalJSON

func (a ErrorMessage) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage to handle AdditionalProperties

func (*ErrorMessage) Set

func (a *ErrorMessage) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage

func (*ErrorMessage) UnmarshalJSON

func (a *ErrorMessage) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage to handle AdditionalProperties

type ErrorMessage_Error

type ErrorMessage_Error struct {
	// Code The error status code that has been returned in response to the request.
	Code   *string                           `json:"code,omitempty"`
	Errors *[]ErrorMessage_Error_Errors_Item `json:"errors,omitempty"`

	// Message A human-readable message describing the error.
	Message              *string                `json:"message,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage_Error The high-level error that has occurred as indicated by the status code.

func (ErrorMessage_Error) Get

func (a ErrorMessage_Error) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage_Error. Returns the specified element and whether it was found

func (ErrorMessage_Error) MarshalJSON

func (a ErrorMessage_Error) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage_Error to handle AdditionalProperties

func (*ErrorMessage_Error) Set

func (a *ErrorMessage_Error) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage_Error

func (*ErrorMessage_Error) UnmarshalJSON

func (a *ErrorMessage_Error) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage_Error to handle AdditionalProperties

type ErrorMessage_Error_Errors_Item

type ErrorMessage_Error_Errors_Item struct {
	// Code An internal subordinate code used for error diagnosis.
	Code *string `json:"code,omitempty"`

	// Detail A human-readable description of the error that occurred.
	Detail *string `json:"detail,omitempty"`

	// Source The element that is suspected of originating the error.  Helps to pinpoint the problem.
	Source *ErrorMessage_Error_Errors_Source `json:"source,omitempty"`

	// Status The status code response returned to the client.
	Status *string `json:"status,omitempty"`

	// Title A human-readable title that identifies the error.
	Title                *string                `json:"title,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage_Error_Errors_Item defines model for ErrorMessage.Error.Errors.Item.

func (ErrorMessage_Error_Errors_Item) Get

func (a ErrorMessage_Error_Errors_Item) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage_Error_Errors_Item. Returns the specified element and whether it was found

func (ErrorMessage_Error_Errors_Item) MarshalJSON

func (a ErrorMessage_Error_Errors_Item) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage_Error_Errors_Item to handle AdditionalProperties

func (*ErrorMessage_Error_Errors_Item) Set

func (a *ErrorMessage_Error_Errors_Item) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage_Error_Errors_Item

func (*ErrorMessage_Error_Errors_Item) UnmarshalJSON

func (a *ErrorMessage_Error_Errors_Item) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage_Error_Errors_Item to handle AdditionalProperties

type ErrorMessage_Error_Errors_Source

type ErrorMessage_Error_Errors_Source struct {
	// Example An example of a valid value for the input parameter.
	Example *string `json:"example,omitempty"`

	// Parameter The input in the request which caused an error.
	Parameter            *string                `json:"parameter,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage_Error_Errors_Source The element that is suspected of originating the error. Helps to pinpoint the problem.

func (ErrorMessage_Error_Errors_Source) Get

func (a ErrorMessage_Error_Errors_Source) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for ErrorMessage_Error_Errors_Source. Returns the specified element and whether it was found

func (ErrorMessage_Error_Errors_Source) MarshalJSON

func (a ErrorMessage_Error_Errors_Source) MarshalJSON() ([]byte, error)

Override default JSON handling for ErrorMessage_Error_Errors_Source to handle AdditionalProperties

func (*ErrorMessage_Error_Errors_Source) Set

func (a *ErrorMessage_Error_Errors_Source) Set(fieldName string, value interface{})

Setter for additional properties for ErrorMessage_Error_Errors_Source

func (*ErrorMessage_Error_Errors_Source) UnmarshalJSON

func (a *ErrorMessage_Error_Errors_Source) UnmarshalJSON(b []byte) error

Override default JSON handling for ErrorMessage_Error_Errors_Source to handle AdditionalProperties

type EventDate

type EventDate = openapi_types.Date

EventDate The date of the event.

type EventDateTime

type EventDateTime = time.Time

EventDateTime The date and time of the event.

type FailureResponse

type FailureResponse = ErrorMessage

FailureResponse Standard error message response.

type GetPackageTrackingJSONRequestBody

type GetPackageTrackingJSONRequestBody = TrackingRequest

GetPackageTrackingJSONRequestBody defines body for GetPackageTracking for application/json ContentType.

type GetPackageTrackingResponse

type GetPackageTrackingResponse struct {
	Body                                    []byte
	HTTPResponse                            *http.Response
	JSON200                                 *TrackingDetails
	ApplicationvndUspsTrackingDetailJSON200 *TrackingDetails
	XML200                                  *TrackingDetails
	JSON207                                 *MultiStatusResponse
	JSON400                                 *ErrorMessage
	XML400                                  *ErrorMessage
	JSON401                                 *ErrorMessage
	XML401                                  *ErrorMessage
	JSON403                                 *ErrorMessage
	XML403                                  *ErrorMessage
	JSON404                                 *ErrorMessage
	XML404                                  *ErrorMessage
	JSON429                                 *ErrorMessage
	XML429                                  *ErrorMessage
	JSON503                                 *ErrorMessage
	XML503                                  *ErrorMessage
}

func ParseGetPackageTrackingResponse

func ParseGetPackageTrackingResponse(rsp *http.Response) (*GetPackageTrackingResponse, error)

ParseGetPackageTrackingResponse parses an HTTP response from a GetPackageTrackingWithResponse call

func (GetPackageTrackingResponse) Status

Status returns HTTPResponse.Status

func (GetPackageTrackingResponse) StatusCode

func (r GetPackageTrackingResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GuaranteedDeliveryDate

type GuaranteedDeliveryDate = openapi_types.Date

GuaranteedDeliveryDate Guaranteed Delivery Date, date only.

type GuaranteedDeliveryText

type GuaranteedDeliveryText = string

GuaranteedDeliveryText Guaranteed Delivery Date, text only (e.g. 3 Business Days).

type GuaranteedDeliveryTimestamp

type GuaranteedDeliveryTimestamp = time.Time

GuaranteedDeliveryTimestamp Guaranteed Delivery Date, date and time.

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type MailingDate

type MailingDate = openapi_types.Date

MailingDate Used to reconcile duplicate tracking number scenarios.

type MultiStatusResponse

type MultiStatusResponse = []MultiStatusResponse_Item

MultiStatusResponse An array of detailed tracking event information for the requested tracking number in reverse chronological order.

type MultiStatusResponse_Item

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

MultiStatusResponse_Item defines model for MultiStatusResponse.Item.

func (MultiStatusResponse_Item) AsFailureResponse

func (t MultiStatusResponse_Item) AsFailureResponse() (FailureResponse, error)

AsFailureResponse returns the union data inside the MultiStatusResponse_Item as a FailureResponse

func (MultiStatusResponse_Item) AsSuccessResponse

func (t MultiStatusResponse_Item) AsSuccessResponse() (SuccessResponse, error)

AsSuccessResponse returns the union data inside the MultiStatusResponse_Item as a SuccessResponse

func (*MultiStatusResponse_Item) FromFailureResponse

func (t *MultiStatusResponse_Item) FromFailureResponse(v FailureResponse) error

FromFailureResponse overwrites any union data inside the MultiStatusResponse_Item as the provided FailureResponse

func (*MultiStatusResponse_Item) FromSuccessResponse

func (t *MultiStatusResponse_Item) FromSuccessResponse(v SuccessResponse) error

FromSuccessResponse overwrites any union data inside the MultiStatusResponse_Item as the provided SuccessResponse

func (MultiStatusResponse_Item) MarshalJSON

func (t MultiStatusResponse_Item) MarshalJSON() ([]byte, error)

func (*MultiStatusResponse_Item) MergeFailureResponse

func (t *MultiStatusResponse_Item) MergeFailureResponse(v FailureResponse) error

MergeFailureResponse performs a merge with any union data inside the MultiStatusResponse_Item, using the provided FailureResponse

func (*MultiStatusResponse_Item) MergeSuccessResponse

func (t *MultiStatusResponse_Item) MergeSuccessResponse(v SuccessResponse) error

MergeSuccessResponse performs a merge with any union data inside the MultiStatusResponse_Item, using the provided SuccessResponse

func (*MultiStatusResponse_Item) UnmarshalJSON

func (t *MultiStatusResponse_Item) UnmarshalJSON(b []byte) error

type NotifyEventType

type NotifyEventType string

NotifyEventType The tracking activity notification options.

const (
	ALLUPDATES       NotifyEventType = "ALL_UPDATES"
	DELIVERYACTIVITY NotifyEventType = "DELIVERY_ACTIVITY"
	EXPECTEDDELIVERY NotifyEventType = "EXPECTED_DELIVERY"
)

Defines values for NotifyEventType.

type PostPackageTrackingNotificationsJSONRequestBody

type PostPackageTrackingNotificationsJSONRequestBody = TrackingNotificationRequest

PostPackageTrackingNotificationsJSONRequestBody defines body for PostPackageTrackingNotifications for application/json ContentType.

type PostPackageTrackingNotificationsResponse

type PostPackageTrackingNotificationsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *TrackingNotificationAcknowledgement
	XML202       *TrackingNotificationAcknowledgement
	JSON400      *ErrorMessage
	XML400       *ErrorMessage
	JSON401      *ErrorMessage
	XML401       *ErrorMessage
	JSON403      *ErrorMessage
	XML403       *ErrorMessage
	JSON404      *ErrorMessage
	XML404       *ErrorMessage
	JSON429      *ErrorMessage
	XML429       *ErrorMessage
	JSON503      *ErrorMessage
	XML503       *ErrorMessage
}

func ParsePostPackageTrackingNotificationsResponse

func ParsePostPackageTrackingNotificationsResponse(rsp *http.Response) (*PostPackageTrackingNotificationsResponse, error)

ParsePostPackageTrackingNotificationsResponse parses an HTTP response from a PostPackageTrackingNotificationsWithResponse call

func (PostPackageTrackingNotificationsResponse) Status

Status returns HTTPResponse.Status

func (PostPackageTrackingNotificationsResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type ProofOfDeliveryAcknowledgement

type ProofOfDeliveryAcknowledgement struct {
	// TransactionMessage The message returned to the user.
	TransactionMessage *string `json:"transactionMessage,omitempty"`
}

ProofOfDeliveryAcknowledgement The delivery record request response.

type ProofOfDeliveryJSONRequestBody

type ProofOfDeliveryJSONRequestBody = ProofOfDeliveryRequest

ProofOfDeliveryJSONRequestBody defines body for ProofOfDelivery for application/json ContentType.

type ProofOfDeliveryRecipient

type ProofOfDeliveryRecipient = Recipient

ProofOfDeliveryRecipient defines model for ProofOfDeliveryRecipient.

type ProofOfDeliveryRequest

type ProofOfDeliveryRequest struct {
	// CRID Unique 10-byte numeric value that’s associated to each user. A Customer Registration Identification number (CRID) is a USPS-generated numeric code that uniquely identifies a business at a location.
	CRID *string `json:"CRID,omitempty"`

	// LetterType The requested notification: Proof of Delivery (POD) or Return Receipt Electronic (RRE).
	LetterType *ProofOfDeliveryRequestLetterType `json:"letterType,omitempty"`

	// MailingDate The mailing date provided in the Tracking Detail API response.
	MailingDate *openapi_types.Date `json:"mailingDate,omitempty"`

	// Recipients The contact information for up to 3 recipients.
	Recipients []ProofOfDeliveryRecipient `json:"recipients"`

	// UniqueTrackingID The unique tracking identifier provided in the Tracking Detail API response.
	UniqueTrackingID string `json:"uniqueTrackingID"`
}

ProofOfDeliveryRequest defines model for ProofOfDeliveryRequest.

type ProofOfDeliveryRequestLetterType

type ProofOfDeliveryRequestLetterType string

ProofOfDeliveryRequestLetterType The requested notification: Proof of Delivery (POD) or Return Receipt Electronic (RRE).

const (
	PROOFOFDELIVERY         ProofOfDeliveryRequestLetterType = "PROOF_OF_DELIVERY"
	RETURNRECEIPTELECTRONIC ProofOfDeliveryRequestLetterType = "RETURN_RECEIPT_ELECTRONIC"
)

Defines values for ProofOfDeliveryRequestLetterType.

type ProofOfDeliveryResponse

type ProofOfDeliveryResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON202      *ProofOfDeliveryAcknowledgement
	XML202       *ProofOfDeliveryAcknowledgement
	JSON400      *ErrorMessage
	XML400       *ErrorMessage
	JSON401      *ErrorMessage
	XML401       *ErrorMessage
	JSON403      *ErrorMessage
	XML403       *ErrorMessage
	JSON404      *ErrorMessage
	XML404       *ErrorMessage
	JSON429      *ErrorMessage
	XML429       *ErrorMessage
	JSON503      *ErrorMessage
	XML503       *ErrorMessage
}

func ParseProofOfDeliveryResponse

func ParseProofOfDeliveryResponse(rsp *http.Response) (*ProofOfDeliveryResponse, error)

ParseProofOfDeliveryResponse parses an HTTP response from a ProofOfDeliveryWithResponse call

func (ProofOfDeliveryResponse) Status

func (r ProofOfDeliveryResponse) Status() string

Status returns HTTPResponse.Status

func (ProofOfDeliveryResponse) StatusCode

func (r ProofOfDeliveryResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Recipient

type Recipient struct {
	// Email The email address of the recipient.
	Email openapi_types.Email `json:"email"`

	// FirstName The notification recipient first name.
	FirstName *string `json:"firstName,omitempty"`

	// LastName The notification recipient last name.
	LastName *string `json:"lastName,omitempty"`
}

Recipient defines model for Recipient.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type ServicesEligibility

type ServicesEligibility struct {
	// RREEnabled Signifies if Return Receipt Electronic service is enabled.
	RREEnabled bool `json:"RREEnabled"`

	// ProofOfDeliveryEnabled Signifies if Proof of Delivery service is enabled.
	ProofOfDeliveryEnabled bool `json:"proofOfDeliveryEnabled"`

	// TrackingProofOfDeliveryEnabled Signifies if Tracking Proof of Delivery service is enabled.
	TrackingProofOfDeliveryEnabled bool `json:"trackingProofOfDeliveryEnabled"`
}

ServicesEligibility Indicates whether item is eligible for various services.

type SharedTrackingDetail

type SharedTrackingDetail struct {
	// AccessControl Details on if the Tracking request was free or charged based on MID access through an IP Agreement.
	//
	// - `FREE` - The Tracking request was free.
	// - `IP_AGREEMENT` - The tracking request was charged based on MID access through an IP Agreement.
	AccessControl *SharedTrackingDetailAccessControl `json:"accessControl,omitempty"`

	// AssociatedTrackingNumber Additional tracking number on the item.
	AssociatedTrackingNumber *string `json:"associatedTrackingNumber,omitempty"`

	// DestinationCity The destination city. *Note: This field is no longer available as of June 2025.*
	DestinationCity *string `json:"destinationCity,omitempty"`

	// DestinationCountry The two-character destination country code. *Note: This field is no longer available as of June 2025.*
	DestinationCountry *string `json:"destinationCountry,omitempty"`

	// DestinationState The two-character state code. *Note: This field is no longer available as of June 2025.*
	DestinationState *State `json:"destinationState,omitempty"`

	// DestinationZIPCode The destination ZIP Code™. *Note: This field is no longer available as of June 2025.*
	DestinationZIPCode *string `json:"destinationZIPCode,omitempty"`

	// KahalaIndicator Kahala Posts Group (KPG) member indicator.
	KahalaIndicator *bool `json:"kahalaIndicator,omitempty"`

	// MailClass Indicates the mail class of the item.
	MailClass *string `json:"mailClass,omitempty"`

	// MailClassCode Indicates the abbreviated mail class of the item.
	MailClassCode *string `json:"mailClassCode,omitempty"`

	// MailType Indicates the mail type of the item (e.g. Domestic, International Inbound, Military Outbound).
	MailType *string `json:"mailType,omitempty"`

	// MailingDate Used to reconcile duplicate tracking number scenarios.
	MailingDate *MailingDate `json:"mailingDate,omitempty"`

	// OriginCity The origin city. *Note: This field is no longer available as of June 2025.*
	OriginCity *string `json:"originCity,omitempty"`

	// OriginCountry The two-character origin country code. *Note: This field is no longer available as of June 2025.*
	OriginCountry *string `json:"originCountry,omitempty"`

	// OriginState The two-character state code. *Note: This field is no longer available as of June 2025.*
	OriginState *State `json:"originState,omitempty"`

	// OriginZIPCode The origin ZIP Code™. *Note: This field is no longer available as of June 2025.*
	OriginZIPCode *string `json:"originZIPCode,omitempty"`

	// ServiceTypeCode The service type code of the item. Refer to USPS® [Pub 199](http://postalpro.usps.com/pub199) Appendix I: Intelligent Mail Package Barcode Service Type Codes for all possible published values.
	ServiceTypeCode *string `json:"serviceTypeCode,omitempty"`

	// Services Additional services on the item. May be purchased or inherent to the product. Refer to USPS® [Pub 199](http://postalpro.usps.com/pub199) Appendix J: Table 7 Extra Service Codes for all possible published values.
	Services *[]string `json:"services,omitempty"`

	// Status The item status.  Refer to USPS® [Pub 199](http://postalpro.usps.com/pub199) Appendix G-4: USPS Domestic Tracking Scan Events and Appendix G-5: Scan Event Codes - International Mail for all possible values.
	Status *string `json:"status,omitempty"`

	// StatusCategory The item status category.  Refer to USPS® [Pub 199](http://postalpro.usps.com/pub199) Appendix G-4: USPS Domestic Tracking Scan Events and Appendix G-5: Scan Event Codes - International Mail for all possible values.
	StatusCategory *string `json:"statusCategory,omitempty"`

	// StatusSummary The status summary.
	StatusSummary *string `json:"statusSummary,omitempty"`

	// TrackingNumber The human-readable representation of the item, commonly known as a tracking number.
	TrackingNumber *string `json:"trackingNumber,omitempty"`

	// UniqueTrackingID The unique tracking identifier used to reconcile duplicate tracking number scenarios.
	UniqueTrackingID *string `json:"uniqueTrackingID,omitempty"`
}

SharedTrackingDetail Shared tracking attributes between internal and external requests.

type SharedTrackingDetailAccessControl

type SharedTrackingDetailAccessControl string

SharedTrackingDetailAccessControl Details on if the Tracking request was free or charged based on MID access through an IP Agreement.

- `FREE` - The Tracking request was free. - `IP_AGREEMENT` - The tracking request was charged based on MID access through an IP Agreement.

const (
	SharedTrackingDetailAccessControlFREE        SharedTrackingDetailAccessControl = "FREE"
	SharedTrackingDetailAccessControlIPAGREEMENT SharedTrackingDetailAccessControl = "IP_AGREEMENT"
)

Defines values for SharedTrackingDetailAccessControl.

type State

type State = string

State The two-character state code. *Note: This field is no longer available as of June 2025.*

type SuccessResponse

type SuccessResponse = TrackingDetail

SuccessResponse The detailed tracking event information for the requested tracking number in reverse chronological order.

type TrackingDetail

type TrackingDetail struct {
	// AccessControl Details on if the Tracking request was free or charged based on MID access through an IP Agreement.
	//
	// - `FREE` - The Tracking request was free.
	// - `IP_AGREEMENT` - The tracking request was charged based on MID access through an IP Agreement.
	AccessControl *TrackingDetailAccessControl `json:"accessControl,omitempty"`

	// AssociatedTrackingNumber Additional tracking number on the item.
	AssociatedTrackingNumber *string `json:"associatedTrackingNumber,omitempty"`

	// DeliveryDateExpectation Detailed tracking information relative to when the item is expected to arrive.
	DeliveryDateExpectation *DeliveryDateExpectation `json:"deliveryDateExpectation,omitempty"`

	// DestinationCity The destination city. *Note: This field is no longer available as of June 2025.*
	DestinationCity *string `json:"destinationCity,omitempty"`

	// DestinationCountry The two-character destination country code. *Note: This field is no longer available as of June 2025.*
	DestinationCountry *string `json:"destinationCountry,omitempty"`

	// DestinationState The two-character state code. *Note: This field is no longer available as of June 2025.*
	DestinationState *State `json:"destinationState,omitempty"`

	// DestinationZIPCode The destination ZIP Code™. *Note: This field is no longer available as of June 2025.*
	DestinationZIPCode *string `json:"destinationZIPCode,omitempty"`

	// KahalaIndicator Kahala Posts Group (KPG) member indicator.
	KahalaIndicator *bool `json:"kahalaIndicator,omitempty"`

	// MailClass Indicates the mail class of the item.
	MailClass *string `json:"mailClass,omitempty"`

	// MailClassCode Indicates the abbreviated mail class of the item.
	MailClassCode *string `json:"mailClassCode,omitempty"`

	// MailType Indicates the mail type of the item (e.g. Domestic, International Inbound, Military Outbound).
	MailType *string `json:"mailType,omitempty"`

	// MailingDate Used to reconcile duplicate tracking number scenarios.
	MailingDate *MailingDate `json:"mailingDate,omitempty"`

	// OriginCity The origin city. *Note: This field is no longer available as of June 2025.*
	OriginCity *string `json:"originCity,omitempty"`

	// OriginCountry The two-character origin country code. *Note: This field is no longer available as of June 2025.*
	OriginCountry *string `json:"originCountry,omitempty"`

	// OriginState The two-character state code. *Note: This field is no longer available as of June 2025.*
	OriginState *State `json:"originState,omitempty"`

	// OriginZIPCode The origin ZIP Code™. *Note: This field is no longer available as of June 2025.*
	OriginZIPCode *string `json:"originZIPCode,omitempty"`

	// ServiceTypeCode The service type code of the item. Refer to USPS® [Pub 199](http://postalpro.usps.com/pub199) Appendix I: Intelligent Mail Package Barcode Service Type Codes for all possible published values.
	ServiceTypeCode *string `json:"serviceTypeCode,omitempty"`

	// Services Additional services on the item. May be purchased or inherent to the product. Refer to USPS® [Pub 199](http://postalpro.usps.com/pub199) Appendix J: Table 7 Extra Service Codes for all possible published values.
	Services *[]string `json:"services,omitempty"`

	// ServicesEligibility Indicates whether item is eligible for various services.
	ServicesEligibility *ServicesEligibility `json:"servicesEligibility,omitempty"`

	// Status The item status.  Refer to USPS® [Pub 199](http://postalpro.usps.com/pub199) Appendix G-4: USPS Domestic Tracking Scan Events and Appendix G-5: Scan Event Codes - International Mail for all possible values.
	Status *string `json:"status,omitempty"`

	// StatusCategory The item status category.  Refer to USPS® [Pub 199](http://postalpro.usps.com/pub199) Appendix G-4: USPS Domestic Tracking Scan Events and Appendix G-5: Scan Event Codes - International Mail for all possible values.
	StatusCategory *string `json:"statusCategory,omitempty"`

	// StatusSummary The status summary.
	StatusSummary *string `json:"statusSummary,omitempty"`

	// TrackingEvents The detailed tracking event information for the requested tracking number in reverse chronological order
	TrackingEvents *TrackingEvents `json:"trackingEvents,omitempty"`

	// TrackingNumber The human-readable representation of the item, commonly known as a tracking number.
	TrackingNumber *string `json:"trackingNumber,omitempty"`

	// UniqueTrackingID The unique tracking identifier used to reconcile duplicate tracking number scenarios.
	UniqueTrackingID *string `json:"uniqueTrackingID,omitempty"`
}

TrackingDetail defines model for TrackingDetail.

type TrackingDetailAccessControl

type TrackingDetailAccessControl string

TrackingDetailAccessControl Details on if the Tracking request was free or charged based on MID access through an IP Agreement.

- `FREE` - The Tracking request was free. - `IP_AGREEMENT` - The tracking request was charged based on MID access through an IP Agreement.

const (
	TrackingDetailAccessControlFREE        TrackingDetailAccessControl = "FREE"
	TrackingDetailAccessControlIPAGREEMENT TrackingDetailAccessControl = "IP_AGREEMENT"
)

Defines values for TrackingDetailAccessControl.

type TrackingDetails

type TrackingDetails = []TrackingDetail

TrackingDetails An array of detailed tracking event information for the requested tracking number in reverse chronological order.

type TrackingEvent

type TrackingEvent struct {
	// CODAmountDue Collect on delivery amount due. Only applicable for Arrival at Unit (07) or Available for Pickup (14) events.
	CODAmountDue *string `json:"CODAmountDue,omitempty"`

	// GMTOffset The offset of the local time of the event from Greenwich Mean Time (GMT).
	GMTOffset *string `json:"GMTOffset,omitempty"`

	// GMTTimestamp The date and time of the event in Greenwich Mean Time (GMT).
	GMTTimestamp *time.Time `json:"GMTTimestamp,omitempty"`

	// AcceptanceTypeCategory The acceptance type category, which helps to explain if the acceptance activity was completed with a USPS employee, was customer self-service, etc. Only applicable for acceptance events.
	AcceptanceTypeCategory *string `json:"acceptanceTypeCategory,omitempty"`

	// AcceptanceTypeCategoryCode The shorthand code for the acceptance type category. Only applicable for acceptance events.
	AcceptanceTypeCategoryCode *string `json:"acceptanceTypeCategoryCode,omitempty"`

	// ActionCode Action code for the event.
	ActionCode *string `json:"actionCode,omitempty"`

	// EventCity The city where the event occurred.
	EventCity *string `json:"eventCity,omitempty"`

	// EventCode Tracking event code. Refer to Domestic Scan Event list provided in USPS® [Pub 199](http://postalpro.usps.com/pub199) Appendix G for all possible values.
	EventCode *string `json:"eventCode,omitempty"`

	// EventCountry The country where the event occurred.
	EventCountry *string `json:"eventCountry,omitempty"`

	// EventPartner The name of the partner associated to the event.
	EventPartner *string `json:"eventPartner,omitempty"`

	// EventState The state where the event occurred.
	EventState     *string       `json:"eventState,omitempty"`
	EventTimestamp *AllEventDate `json:"eventTimestamp,omitempty"`

	// EventType The description of the event (e.g. Delivery).
	EventType *string `json:"eventType,omitempty"`

	// EventZIPCode The ZIP Code™ of the event.
	EventZIPCode *string `json:"eventZIPCode,omitempty"`

	// Firm The company name if delivered to a company.
	Firm *string `json:"firm,omitempty"`

	// ReasonCode Reason code for the event.
	ReasonCode *string `json:"reasonCode,omitempty"`

	// RecipientName The name of the person signing for delivery (if available).
	RecipientName *string `json:"recipientName,omitempty"`

	// VeriPoint Delivery scan location certified, if applicable.
	VeriPoint *bool `json:"veriPoint,omitempty"`
}

TrackingEvent The detailed tracking event information for the requested tracking number in reverse chronological order.

type TrackingEvents

type TrackingEvents = []TrackingEvent

TrackingEvents The detailed tracking event information for the requested tracking number in reverse chronological order

type TrackingNotificationAcknowledgement

type TrackingNotificationAcknowledgement struct {
	// TransactionMessage The message returned to the user.
	TransactionMessage *string `json:"transactionMessage,omitempty"`
}

TrackingNotificationAcknowledgement The notification request response.

type TrackingNotificationRequest

type TrackingNotificationRequest struct {
	// MailingDate The mailing date provided in the Tracking Detail API response.
	MailingDate *openapi_types.Date `json:"mailingDate,omitempty"`

	// NotifyEventTypes The desired tracking notification(s).
	NotifyEventTypes []NotifyEventType `json:"notifyEventTypes"`

	// Recipients The contact information for up to 3 recipients.
	Recipients []Recipient `json:"recipients"`

	// UniqueTrackingID The unique tracking identifier provided in the Tracking Detail API response.
	UniqueTrackingID string `json:"uniqueTrackingID"`
}

TrackingNotificationRequest defines model for TrackingNotificationRequest.

type TrackingRequest

type TrackingRequest = []TrackingRequestBody

TrackingRequest defines model for TrackingRequest.

type TrackingRequestBody

type TrackingRequestBody struct {
	// DestinationZIPCode Destination 5-digit ZIP Code™
	DestinationZIPCode *string `json:"destinationZIPCode,omitempty"`

	// IncludeVeriPoint Indicate opt-in (true) or opt-out (false) preference to receive veriPoint delivery scan location certified information for the item when available.  This should only be included in the request for VeriPoint-eligible users.
	IncludeVeriPoint *bool `json:"includeVeriPoint,omitempty"`

	// MailingDate Used to reconcile duplicate tracking number scenarios.
	MailingDate *MailingDate `json:"mailingDate,omitempty"`

	// TrackingNumber Tracking ID, must be alphanumeric characters, string length is between 4 and 34.
	TrackingNumber string `json:"trackingNumber"`
}

TrackingRequestBody Parameters that are required to track an item.

Jump to

Keyboard shortcuts

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