trackalert

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 trackalert 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 (
	ClientOauth2Scopes = "clientOauth2.Scopes"
	Oauth2Scopes       = "oauth2.Scopes"
)

Variables

This section is empty.

Functions

func NewProcessSubscriptionTypeForTrackingNumberRequest

func NewProcessSubscriptionTypeForTrackingNumberRequest(server string, pType string, params *ProcessSubscriptionTypeForTrackingNumberParams, body ProcessSubscriptionTypeForTrackingNumberJSONRequestBody) (*http.Request, error)

NewProcessSubscriptionTypeForTrackingNumberRequest calls the generic ProcessSubscriptionTypeForTrackingNumber builder with application/json body

func NewProcessSubscriptionTypeForTrackingNumberRequestWithBody

func NewProcessSubscriptionTypeForTrackingNumberRequestWithBody(server string, pType string, params *ProcessSubscriptionTypeForTrackingNumberParams, contentType string, body io.Reader) (*http.Request, error)

NewProcessSubscriptionTypeForTrackingNumberRequestWithBody generates requests for ProcessSubscriptionTypeForTrackingNumber with any type of body

func NewTrackingEvent2Request

func NewTrackingEvent2Request(server string, params *TrackingEvent2Params, body TrackingEvent2JSONRequestBody) (*http.Request, error)

NewTrackingEvent2Request calls the generic TrackingEvent2 builder with application/json body

func NewTrackingEvent2RequestWithBody

func NewTrackingEvent2RequestWithBody(server string, params *TrackingEvent2Params, contentType string, body io.Reader) (*http.Request, error)

NewTrackingEvent2RequestWithBody generates requests for TrackingEvent2 with any type of body

Types

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

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

func (*Client) TrackingEvent2

func (c *Client) TrackingEvent2(ctx context.Context, params *TrackingEvent2Params, body TrackingEvent2JSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) TrackingEvent2WithBody

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

type ClientInterface

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

	ProcessSubscriptionTypeForTrackingNumber(ctx context.Context, pType string, params *ProcessSubscriptionTypeForTrackingNumberParams, body ProcessSubscriptionTypeForTrackingNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	TrackingEvent2(ctx context.Context, params *TrackingEvent2Params, body TrackingEvent2JSONRequestBody, 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) ProcessSubscriptionTypeForTrackingNumberWithBodyWithResponse

func (c *ClientWithResponses) ProcessSubscriptionTypeForTrackingNumberWithBodyWithResponse(ctx context.Context, pType string, params *ProcessSubscriptionTypeForTrackingNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessSubscriptionTypeForTrackingNumberResponse, error)

ProcessSubscriptionTypeForTrackingNumberWithBodyWithResponse request with arbitrary body returning *ProcessSubscriptionTypeForTrackingNumberResponse

func (*ClientWithResponses) TrackingEvent2WithBodyWithResponse

func (c *ClientWithResponses) TrackingEvent2WithBodyWithResponse(ctx context.Context, params *TrackingEvent2Params, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TrackingEvent2Response, error)

TrackingEvent2WithBodyWithResponse request with arbitrary body returning *TrackingEvent2Response

func (*ClientWithResponses) TrackingEvent2WithResponse

func (c *ClientWithResponses) TrackingEvent2WithResponse(ctx context.Context, params *TrackingEvent2Params, body TrackingEvent2JSONRequestBody, reqEditors ...RequestEditorFn) (*TrackingEvent2Response, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ProcessSubscriptionTypeForTrackingNumberWithBodyWithResponse request with any body
	ProcessSubscriptionTypeForTrackingNumberWithBodyWithResponse(ctx context.Context, pType string, params *ProcessSubscriptionTypeForTrackingNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessSubscriptionTypeForTrackingNumberResponse, error)

	ProcessSubscriptionTypeForTrackingNumberWithResponse(ctx context.Context, pType string, params *ProcessSubscriptionTypeForTrackingNumberParams, body ProcessSubscriptionTypeForTrackingNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*ProcessSubscriptionTypeForTrackingNumberResponse, error)

	// TrackingEvent2WithBodyWithResponse request with any body
	TrackingEvent2WithBodyWithResponse(ctx context.Context, params *TrackingEvent2Params, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TrackingEvent2Response, error)

	TrackingEvent2WithResponse(ctx context.Context, params *TrackingEvent2Params, body TrackingEvent2JSONRequestBody, reqEditors ...RequestEditorFn) (*TrackingEvent2Response, error)
}

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

type CommonRequest

type CommonRequest struct {
	// CountryCode The physical address <a href="https://www.iso.org/iso-3166-country-codes.html" target="_blank">ISO 3166</a> country or territory code
	CountryCode *Country `json:"countryCode,omitempty"`

	// EventPreferences Represents scan/event preferences for the subscription endpoint. If no value is provided in this array
	// then all activity types will be sent. (This field is only for enhanced users)
	EventPreferences *EventPreferences `json:"eventPreferences,omitempty"`

	// Locale Locale setting is composed of ISO 639 language code and ISO 3166 country code, separated by an underscore. Currently only English (en_US) is supported, but this field is extensible for future locales.
	Locale               Locale                 `json:"locale"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

CommonRequest Common properties for both account and package subscription requests

func (CommonRequest) Get

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

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

func (CommonRequest) MarshalJSON

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

Override default JSON handling for CommonRequest to handle AdditionalProperties

func (*CommonRequest) Set

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

Setter for additional properties for CommonRequest

func (*CommonRequest) UnmarshalJSON

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

Override default JSON handling for CommonRequest to handle AdditionalProperties

type Country

type Country = string

Country The physical address <a href="https://www.iso.org/iso-3166-country-codes.html" target="_blank">ISO 3166</a> country or territory code

type Date

type Date = string

Date defines model for Date.

type ErrorMessage

type ErrorMessage struct {
	// Response Response container to store errors
	Response struct {
		// Errors Unbounded array containing one or more error objects
		Errors []struct {
			// Code error code
			Code string `json:"code"`

			// Message error message
			Message string `json:"message"`
		} `json:"errors"`
	} `json:"response"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

ErrorMessage Response object for errors

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 EventPreferences

type EventPreferences = []string

EventPreferences Represents scan/event preferences for the subscription endpoint. If no value is provided in this array then all activity types will be sent. (This field is only for enhanced users)

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type Locale

type Locale = string

Locale Locale setting is composed of ISO 639 language code and ISO 3166 country code, separated by an underscore. Currently only English (en_US) is supported, but this field is extensible for future locales.

type PackageSubscriptionErrorResponse

type PackageSubscriptionErrorResponse struct {
	// InvalidTrackingNumbers List of tracking numbers associated with errors preventing subscription creation.
	InvalidTrackingNumbers []string `json:"invalidTrackingNumbers"`

	// Response Response container to store errors
	Response struct {
		// Errors Unbounded array containing one or more error objects
		Errors []struct {
			// Code error code
			Code string `json:"code"`

			// Message error message
			Message string `json:"message"`
		} `json:"errors"`
	} `json:"response"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

PackageSubscriptionErrorResponse defines model for PackageSubscriptionErrorResponse.

func (PackageSubscriptionErrorResponse) Get

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

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

func (PackageSubscriptionErrorResponse) MarshalJSON

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

Override default JSON handling for PackageSubscriptionErrorResponse to handle AdditionalProperties

func (*PackageSubscriptionErrorResponse) Set

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

Setter for additional properties for PackageSubscriptionErrorResponse

func (*PackageSubscriptionErrorResponse) UnmarshalJSON

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

Override default JSON handling for PackageSubscriptionErrorResponse to handle AdditionalProperties

type PackageSubscriptionRequest

type PackageSubscriptionRequest struct {
	// CountryCode The physical address <a href="https://www.iso.org/iso-3166-country-codes.html" target="_blank">ISO 3166</a> country or territory code
	CountryCode *Country `json:"countryCode,omitempty"`

	// EventPreferences Represents scan/event preferences for the subscription endpoint. If no value is provided in this array
	// then all activity types will be sent. (This field is only for enhanced users)
	EventPreferences *EventPreferences `json:"eventPreferences,omitempty"`

	// Locale Locale setting is composed of ISO 639 language code and ISO 3166 country code, separated by an underscore. Currently only English (en_US) is supported, but this field is extensible for future locales.
	Locale Locale `json:"locale"`

	// TrackingNumberList Represents list of tracking numbers in request.
	TrackingNumberList   []TrackingNumber       `json:"trackingNumberList"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

PackageSubscriptionRequest defines model for PackageSubscriptionRequest.

func (PackageSubscriptionRequest) Get

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

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

func (PackageSubscriptionRequest) MarshalJSON

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

Override default JSON handling for PackageSubscriptionRequest to handle AdditionalProperties

func (*PackageSubscriptionRequest) Set

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

Setter for additional properties for PackageSubscriptionRequest

func (*PackageSubscriptionRequest) UnmarshalJSON

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

Override default JSON handling for PackageSubscriptionRequest to handle AdditionalProperties

type PackageSubscriptionSuccessResponse

type PackageSubscriptionSuccessResponse struct {
	// InvalidTrackingNumbers List of tracking numbers associated with errors preventing subscription creation.
	InvalidTrackingNumbers *[]string `json:"invalidTrackingNumbers,omitempty"`

	// ValidTrackingNumbers Unbounded list of tracking numbers with successful subscription created.
	ValidTrackingNumbers *[]TrackingNumber `json:"validTrackingNumbers,omitempty"`
}

PackageSubscriptionSuccessResponse container for package subscription response details

type ProcessSubscriptionTypeForTrackingNumberJSONRequestBody

type ProcessSubscriptionTypeForTrackingNumberJSONRequestBody = PackageSubscriptionRequest

ProcessSubscriptionTypeForTrackingNumberJSONRequestBody defines body for ProcessSubscriptionTypeForTrackingNumber for application/json ContentType.

type ProcessSubscriptionTypeForTrackingNumberParams

type ProcessSubscriptionTypeForTrackingNumberParams struct {
	// TransId An identifier unique to the request.
	TransId TransId `json:"transId"`
}

ProcessSubscriptionTypeForTrackingNumberParams defines parameters for ProcessSubscriptionTypeForTrackingNumber.

type ProcessSubscriptionTypeForTrackingNumberResponse

type ProcessSubscriptionTypeForTrackingNumberResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PackageSubscriptionSuccessResponse
	JSON400      *PackageSubscriptionErrorResponse
	JSON401      *ErrorMessage
	JSON404      *ErrorMessage
	JSON500      *ErrorMessage
}

func ParseProcessSubscriptionTypeForTrackingNumberResponse

func ParseProcessSubscriptionTypeForTrackingNumberResponse(rsp *http.Response) (*ProcessSubscriptionTypeForTrackingNumberResponse, error)

ParseProcessSubscriptionTypeForTrackingNumberResponse parses an HTTP response from a ProcessSubscriptionTypeForTrackingNumberWithResponse call

func (ProcessSubscriptionTypeForTrackingNumberResponse) Status

Status returns HTTPResponse.Status

func (ProcessSubscriptionTypeForTrackingNumberResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type Time

type Time = string

Time defines model for Time.

type TrackingEvent2JSONRequestBody

type TrackingEvent2JSONRequestBody = TrackingEventRequest

TrackingEvent2JSONRequestBody defines body for TrackingEvent2 for application/json ContentType.

type TrackingEvent2Params

type TrackingEvent2Params struct {
	// XApiKey It is a string filed in header, which holds the clientID of the OAUTH token used for authentication. This is required for OAUTH clients and optional for non-OAUTH clients.
	XApiKey *string `json:"x-api-key,omitempty"`

	// UserAgent Represents Track Alert application with value 'UPSPubSubTrackingService'.
	UserAgent string `json:"User-Agent"`
}

TrackingEvent2Params defines parameters for TrackingEvent2.

type TrackingEvent2Response

type TrackingEvent2Response struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseTrackingEvent2Response

func ParseTrackingEvent2Response(rsp *http.Response) (*TrackingEvent2Response, error)

ParseTrackingEvent2Response parses an HTTP response from a TrackingEvent2WithResponse call

func (TrackingEvent2Response) Status

func (r TrackingEvent2Response) Status() string

Status returns HTTPResponse.Status

func (TrackingEvent2Response) StatusCode

func (r TrackingEvent2Response) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type TrackingEventRequest

type TrackingEventRequest struct {
	// ActivityLocation The container which has the current package activity location.
	ActivityLocation *struct {
		// City The physical address city.
		City *string `json:"city,omitempty"`

		// Country The physical address <a href="https://www.iso.org/iso-3166-country-codes.html" target="_blank">ISO 3166</a> country or territory code
		Country *Country `json:"country,omitempty"`

		// PostalCode The physical address postal code (This field is blank until the delivery event occurs).
		PostalCode *string `json:"postalCode,omitempty"`

		// StateProvince The physical address state or province.
		StateProvince *string `json:"stateProvince,omitempty"`
	} `json:"activityLocation,omitempty"`

	// ActivityStatus The container which has the current package activity status.
	ActivityStatus struct {
		// Code The current activity status code. See the 'Status Codes' document for more details.
		Code *string `json:"code,omitempty"`

		// Description The current activity status description.
		Description *string `json:"description,omitempty"`

		// Type The current activity status type.
		Type *TrackingEventRequestActivityStatusType `json:"type,omitempty"`
	} `json:"activityStatus"`
	ActualDeliveryDate *Date `json:"actualDeliveryDate,omitempty"`
	ActualDeliveryTime *Time `json:"actualDeliveryTime,omitempty"`

	// AlternateTrackingNumber Alternate tracking number for the package.
	AlternateTrackingNumber *string `json:"alternateTrackingNumber,omitempty"`
	DeliveryEndTime         *Time   `json:"deliveryEndTime,omitempty"`

	// DeliveryPhoto Base64 encoded image of the delivery photo (This field is blank until the delivery photo is made available for enhanced subscriptions).
	DeliveryPhoto     *string `json:"deliveryPhoto,omitempty"`
	DeliveryStartTime *Time   `json:"deliveryStartTime,omitempty"`

	// DeliveryTimeDescription The date of this delivery detail.
	DeliveryTimeDescription *string `json:"deliveryTimeDescription,omitempty"`
	GmtActivityDate         *Date   `json:"gmtActivityDate,omitempty"`
	GmtActivityTime         *Time   `json:"gmtActivityTime,omitempty"`

	// GmtOffset A field that shows how local time was calculated. In the format (-/+)HH.MM (24 hr)
	GmtOffset         *string `json:"gmtOffset,omitempty"`
	LocalActivityDate *Date   `json:"localActivityDate,omitempty"`
	LocalActivityTime *Time   `json:"localActivityTime,omitempty"`

	// ReceivedBy Clarified signature provided with delivery, when available. (This field is only available for enhanced users)
	ReceivedBy            *string `json:"receivedBy,omitempty"`
	ScheduledDeliveryDate *Date   `json:"scheduledDeliveryDate,omitempty"`

	// TrackingNumber Represents tracking numbers starting with '1Z' followed by 16 alphanumeric characters, or '1R' followed by 14 or 26 alphanumeric characters, in request.
	TrackingNumber TrackingNumber `json:"trackingNumber"`
}

TrackingEventRequest Package event update payload.

type TrackingEventRequestActivityStatusType

type TrackingEventRequestActivityStatusType string

TrackingEventRequestActivityStatusType The current activity status type.

type TrackingNumber

type TrackingNumber = string

TrackingNumber Represents tracking numbers starting with '1Z' followed by 16 alphanumeric characters, or '1R' followed by 14 or 26 alphanumeric characters, in request.

type TransId

type TransId = string

TransId defines model for transId.

Jump to

Keyboard shortcuts

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