models

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddressObjectSourceFullyEntered     = "FULLY_ENTERED"
	AddressObjectSourcePartiallyEntered = "PARTIALLY_ENTERED"
	AddressObjectSourceValidator        = "VALIDATOR"
)
View Source
const (
	CarrierAustraliaPost = "australia_post"
	CarrierCanadaPost    = "canada_post"
	CarrierDeutschePost  = "deutsche_post"
	CarrierDHLGermany    = "dhl_germany"
	CarrierDHLeCommerce  = "dhl_ecommerce"
	CarrierDHLExpress    = "dhl_express"
	CarrierFedEx         = "fedex"
	CarrierGLSGermany    = "gls_de"
	CarrierGLSFrance     = "gls_fr"
	CarrierLasership     = "lasership"
	CarrierMondialRelay  = "mondial_relay"
	CarrierNewgistics    = "newgistics"
	CarrierOnTrac        = "ontrac"
	CarrierPurolator     = "purolator"
	CarrierUPS           = "ups"
	CarrierUSPS          = "usps"

	ObjectStateValid   = "VALID"
	ObjectStateInvalid = "INVALID"

	StatusWaiting           = "WAITING"
	StatusQueued            = "QUEUED"
	StatusSuccess           = "SUCCESS"
	StatusError             = "ERROR"
	StatusRefunded          = "REFUNDED"
	StatusRefundPending     = "REFUNDPENDING"
	StatusRefundRejected    = "REFUNDREJECTED"
	StatusPending           = "PENDING"
	StatusValidating        = "VALIDATING"
	StatusValid             = "VALID"
	StatusInvalid           = "INVALID"
	StatusPurchasing        = "PURCHASING"
	StatusPurchased         = "PURCHASED"
	StatusIncomplete        = "INCOMPLETE"
	StatusTransactionFailed = "TRANSACTION_FAILED"

	InsuranceProviderFedEx  = "FEDEX"
	InsuranceProviderUPS    = "UPS"
	InsuranceProviderOnTrac = "ONTRAC"

	CODPaymentMethodSecuredFunds = "SECURED_FUNDS"
	CODPaymentMethodCash         = "CASH"
	CODPaymentMethodAny          = "ANY"

	DistanceUnitCentiMeter = "cm"
	DistanceUnitInch       = "in"
	DistanceUnitFoot       = "ft"
	DistanceUnitMilliMeter = "mm"
	DistanceUnitMeter      = "m"
	DistanceUnitYard       = "yd"

	MassUnitGram     = "g"
	MassUnitOunce    = "oz"
	MassUnitPound    = "lb"
	MassUnitKiloGram = "kg"

	LabelFileTypePNG    = "PNG"
	LabelFileTypePDF    = "PDF"
	LabelFileTypePDF4X6 = "PDF_4X6"
	LabelFileTypeZPLII  = "ZPLII"
)
View Source
const (
	CustomsNonDeliveryOptionAbandon = "ABANDON"
	CustomsNonDeliveryOptionReturn  = "RETURN"

	CustomsContentsTypeDocuments            = "DOCUMENTS"
	CustomsContentsTypeGift                 = "GIFT"
	CustomsContentsTypeSample               = "SAMPLE"
	CustomsContentsTypeHumanitarianDonation = "HUMANITARIAN_DONATION"
	CustomsContentsTypeReturnMerchandise    = "RETURN_MERCHANDISE"
	CustomsContentsTypeOther                = "OTHER"

	CustomsEEL_PFC_NOEEI_30_37_A = "NOEEI_30_37_a"
	CustomsEEL_PFC_NOEEI_30_37_H = "NOEEI_30_37_h"
	CustomsEEL_PFC_NOEEI_30_37_F = "NOEEI_30_37_f"
	CustomsEEL_PFC_NOEEI_30_36   = "NOEEI_30_36"
	CustomsEEL_PFC_AES_ITN       = "AES_ITN"

	CustomsIncotermDDP = "DDP"
	CustomsIncotermDDU = "DDU"
	CustomsIncotermCPT = "CPT"
	CustomsIncotermCIP = "CIP"
)
View Source
const (
	ShipmentExtraSignatureConfirmationStandard  = "STANDARD"
	ShipmentExtraSignatureConfirmationAdult     = "ADULT"
	ShipmentExtraSignatureConfirmationCertified = "CERTIFIED"

	ShipmentBillingTypeSender     = "SENDER"
	ShipmentBillingTypeRecipient  = "RECIPIENT"
	ShipmentBillingTypeThirdParty = "THIRD_PARTY"

	ShipmentUSPSSortTypeNDC          = "NDC"
	ShipmentUSPSSortTypeFiveDigit    = "FiveDigit"
	ShipmentUSPSSortTypeMixedNDC     = "MixedNDC"
	ShipmentUSPSSortTypeNonPresorted = "Nonpresorted"
	ShipmentUSPSSortTypePresorted    = "Presorted"
	ShipmentUSPSSortTypeSCF          = "SCF"
	ShipmentUSPSSortTypeSinglePiece  = "SinglePiece"
	ShipmentUSPSSortTypeThreeDigit   = "ThreeDigit"

	ShipmentUSPSEntryFacilityDNDC  = "DNDC"
	ShipmentUSPSEntryFacilityDDU   = "DDU"
	ShipmentUSPSEntryFacilityDSCF  = "DSCF"
	ShipmentUSPSEntryFacilityONDC  = "ONDC"
	ShipmentUSPSEntryFacilityOther = "Other"

	ShipmentDangerousGoodsCode01 = "01"
	ShipmentDangerousGoodsCode02 = "02"
	ShipmentDangerousGoodsCode03 = "03"
	ShipmentDangerousGoodsCode04 = "04"
	ShipmentDangerousGoodsCode05 = "05"
	ShipmentDangerousGoodsCode06 = "06"
	ShipmentDangerousGoodsCode07 = "07"
	ShipmentDangerousGoodsCode08 = "08"
	ShipmentDangerousGoodsCode09 = "019"
)
View Source
const (
	TrackingStatusStatusUnknown   = "UNKNOWN"
	TrackingStatusStatusDelivered = "DELIVERED"
	TrackingStatusStatusTransit   = "TRANSIT"
	TrackingStatusStatusFailure   = "FAILURE"
	TrackingStatusStatusReturned  = "RETURNED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	AddressInput
	CommonOutputFields
	IsComplete        bool               `json:"is_complete"`
	Test              bool               `json:"test"`
	ValidationResults *ValidationResults `json:"validation_results"`
}

See https://goshippo.com/docs/reference#addresses

type AddressInput

type AddressInput struct {
	Name          string `json:"name,omitempty"`
	Company       string `json:"company,omitempty"`
	Street1       string `json:"street1,omitempty"`
	StreetNo      string `json:"street_no,omitempty"`
	Street2       string `json:"street2,omitempty"`
	Street3       string `json:"street3,omitempty"`
	City          string `json:"city,omitempty"`
	Zip           string `json:"zip,omitempty"`
	State         string `json:"state,omtiempty"`
	Country       string `json:"country,omitempty"`
	Phone         string `json:"phone,omitempty"`
	Email         string `json:"email,omitempty"`
	IsResidential bool   `json:"is_residential"`
	Validate      bool   `json:"validate"`
	Metadata      string `json:"metadata,omitempty"`
}

See https://goshippo.com/docs/reference#addresses

type Batch

type Batch struct {
	//BatchInput // seems that output format is slightly different
	CommonOutputFields
	Status                   string              `json:"status,omitempty"`
	DefaultCarrierAccount    string              `json:"default_carrier_account,omitempty"`
	DefaultServiceLevelToken string              `json:"default_servicelevel_token,omitempty"`
	LabelFileType            string              `json:"label_filetype,omitempty"`
	Metadata                 string              `json:"metadata,omitempty"`
	BatchShipments           *BatchShipmentList  `json:"batch_shipments"`
	LabelURL                 []string            `json:"label_url"`
	ObjectResults            *BatchObjectResults `json:"object_results"`
}

See https://goshippo.com/docs/reference#batches

type BatchInput

type BatchInput struct {
	DefaultCarrierAccount    string                `json:"default_carrier_account,omitempty"`
	DefaultServiceLevelToken string                `json:"default_servicelevel_token,omitempty"`
	LabelFileType            string                `json:"label_filetype,omitempty"`
	Metadata                 string                `json:"metadata,omitempty"`
	BatchShipments           []*BatchShipmentInput `json:"batch_shipments"`
}

See https://goshippo.com/docs/reference#batches

type BatchObjectResults

type BatchObjectResults struct {
	PurchaseSucceeded int `json:"purchase_succeeded"`
	PurchaseFailed    int `json:"purchase_failed"`
	CreationFailed    int `json:"creation_failed"`
	CreationSucceeded int `json:"creation_succeeded"`
}

type BatchShipment

type BatchShipment struct {
	BatchShipmentInput
	CommonOutputFields
	Transaction string            `json:"transaction"`
	Messages    []json.RawMessage `json:"messages"` // cannot find format in documentation
}

See https://goshippo.com/docs/reference#batches-batchshipments

type BatchShipmentInput

type BatchShipmentInput struct {
	CarrierAccount    string `json:"carrier_account,omitempty"`
	ServiceLevelToken string `json:"servicelevel_token,omitempty"`
	Shipment          string `json:"shipment"`
	Metadata          string `json:"metadata,omitempty"`
}

See https://goshippo.com/docs/reference#batches-batchshipments

type BatchShipmentList

type BatchShipmentList struct {
	Count    int              `json:"count"`
	Next     string           `json:"next,omitempty"`
	Previous string           `json:"previous,omitempty"`
	Results  []*BatchShipment `json:"results"`
}

type CarrierAccountInput

type CarrierAccountInput struct {
	Carrier    string                 `json:"carrier"`
	AccountID  string                 `json:"account_id"`
	Parameters map[string]interface{} `json:"parameters"`
	Active     bool                   `json:"active"`
}

See https://goshippo.com/docs/reference#carrier-accounts

type CommonOutputFields

type CommonOutputFields struct {
	ObjectCreated time.Time `json:"object_created,omitempty"`
	ObjectUpdated time.Time `json:"object_updated,omitempty"`
	ObjectID      string    `json:"object_id,omitempty"`
	ObjectOwner   string    `json:"object_owner,omitempty"`
}

type CustomsDeclaration

type CustomsDeclaration struct {
	CustomsDeclarationInput
	CommonOutputFields
	ObjectState string `json:"object_state,omitempty"`
	Test        bool   `json:"test"`
}

See https://goshippo.com/docs/reference#customsdeclarations

type CustomsDeclarationInput

type CustomsDeclarationInput struct {
	CertifySigner       string      `json:"certify_signer"`
	Certify             bool        `json:"certify"`
	Items               interface{} `json:"items"` // []string or []*CustomsItemInput
	NonDeliveryOption   string      `json:"non_delivery_option"`
	ContentsType        string      `json:"contents_type"`
	ContentsExplanation string      `json:"contents_explanation,omitempty"`
	ExporterReference   string      `json:"exporter_reference,omitempty"`

	Invoice     string `json:"invoice,omitempty"`
	License     string `json:"license,omitempty"`
	Certificate string `json:"certificate,omitempty"`
	Notes       string `json:"notes,omitempty"`
	EEL_PFC     string `json:"eel_pfc,omitempty"`
	AES_ITN     string `json:"aes_itn,omitempty"`
	Incoterm    string `json:"incoterm,omitempty"`
	Metadata    string `json:"metadata,omitempty"`
	Disclaimer  string `json:"disclaimer,omitempty"`
	// contains filtered or unexported fields
}

See https://goshippo.com/docs/reference#customsdeclarations

type CustomsItem

type CustomsItem struct {
	CustomsItemInput
	CommonOutputFields
	ObjectState string `json:"object_state,omitempty"`
	Test        bool   `json:"test"`
}

See https://goshippo.com/docs/reference#customsitems

type CustomsItemInput

type CustomsItemInput struct {
	Description   string `json:"description"`
	Quantity      int    `json:"quantity"`
	NetWeight     string `json:"net_weight"`
	MassUnit      string `json:"mass_unit"`
	ValueAmount   string `json:"value_amount"`
	ValueCurrency string `json:"value_currency"`
	OriginCountry string `json:"origin_country"`
	TariffNumber  string `json:"tariff_number,omitempty"`
	Metadata      string `json:"metadata,omitempty"`
}

See https://goshippo.com/docs/reference#customsitems

type ListAPIOutput

type ListAPIOutput struct {
	Count           int               `json:"count"`
	NextPageURL     *string           `json:"next"`
	PreviousPageURL *string           `json:"previous"`
	Results         []json.RawMessage `json:"results"`
}

type Manifest

type Manifest struct {
	ManifestInput
	CommonOutputFields
	State string `json:"state,omitempty"`
}

See https://goshippo.com/docs/reference#manifests

type ManifestInput

type ManifestInput struct {
	CarrierAccount string    `json:"carrier_account,omitempty"`
	ShipmentDate   time.Time `json:"shipment_date,omitempty"`
	AddressFrom    string    `json:"address_from,omitempty"`
	Transactions   []string  `json:"transactions,omitempty"`
	Documents      []string  `json:"documents,omitempty"`
	Async          bool      `json:"async"`
}

See https://goshippo.com/docs/reference#manifests

type OutputMessage

type OutputMessage struct {
	Code    string `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
	Text    string `json:"text,omitempty"`
	Source  string `json:"source,omitempty"`
}

type Parcel

type Parcel struct {
	ParcelInput
	CommonOutputFields
	ObjectState string `json:"object_state,omitempty"`
	Test        bool   `json:"test"`
}

See https://goshippo.com/docs/reference#parcels

type ParcelCOD

type ParcelCOD struct {
	Amount        string `json:"amount"`
	Currency      string `json:"currency"`
	PaymentMethod string `json:"payment_method"`
}

type ParcelExtra

type ParcelExtra struct {
	COD        *ParcelCOD       `json:"COD,omitempty"`
	Insurance  *ParcelInsurance `json:"insurance,omitempty"`
	Reference1 string           `json:"reference_1,omitempty"`
	Reference2 string           `json:"reference_2,omitempty"`
}

type ParcelInput

type ParcelInput struct {
	Length       string       `json:"length"`
	Width        string       `json:"width"`
	Height       string       `json:"height"`
	DistanceUnit string       `json:"distance_unit"`
	Weight       string       `json:"weight"`
	MassUnit     string       `json:"mass_unit"`
	Template     string       `json:"template,omitempty"` // https://goshippo.com/docs/reference#parceltemplates
	Extra        *ParcelExtra `json:"extra,omitempty"`
	Metadata     string       `json:"metadata,omitempty"`
}

See https://goshippo.com/docs/reference#parcels

type ParcelInsurance

type ParcelInsurance struct {
	Amount   string `json:"amount"`
	Currency string `json:"currency"`
	Provider string `json:"provider"`
	Content  string `json:"content"`
}

type Rate

type Rate struct {
	CommonOutputFields
	Attributes       []string         `json:"attributes"`
	AmountLocal      string           `json:"amount_local"`
	CurrencyLocal    string           `json:"currency_local"`
	Amount           string           `json:"amount"`
	Currency         string           `json:"currency"`
	Provider         string           `json:"provider"`
	ProviderImage75  string           `json:"provider_image_75"`
	ProviderImage200 string           `json:"provider_image_200"`
	ServiceLevel     *ServiceLevel    `json:"servicelevel"`
	Days             int              `json:"days"`
	DurationTerms    string           `json:"duration_terms"`
	CarrierAccount   string           `json:"carrier_account"`
	Zone             string           `json:"zone"`
	Messages         []*OutputMessage `json:"messages"`
	Test             bool             `json:"test"`
}

See https://goshippo.com/docs/reference#rates

type Refund

type Refund struct {
	RefundInput
	CommonOutputFields
	Status string `json:"status,omitempty"`
	Test   bool   `json:"test"`
}

See https://goshippo.com/docs/reference#refunds

type RefundInput

type RefundInput struct {
	Transaction string `json:"transaction"`
	Async       bool   `json:"async"`
}

See https://goshippo.com/docs/reference#refunds

type ServiceLevel

type ServiceLevel struct {
	Name  string `json:"name"`
	Token string `json:"token"` // https://goshippo.com/docs/reference#servicelevels
	Terms string `json:"terms"`
}

type Shipment

type Shipment struct {
	CommonOutputFields
	Status             string              `json:"status,omitempty"`
	AddressFrom        *Address            `json:"address_from,omitempty"`
	AddressTo          *Address            `json:"address_to,omitempty"`
	Parcels            []*Parcel           `json:"parcels,omitempty"`
	AddressReturn      *Address            `json:"address_return,omitempty"`
	CustomsDeclaration *CustomsDeclaration `json:"customs_declaration,omitempty"`
	Rates              []*Rate             `json:"rates,omitempty"`
	Messages           []*OutputMessage    `json:"messages,omitempty"`
	Test               bool                `json:"test,omitempty"`
}

See https://goshippo.com/docs/reference#shipments

type ShipmentBilling

type ShipmentBilling struct {
	Type    string `json:"type"`
	Account string `json:"account"`
	Zip     string `json:"zip"`
	Country string `json:"country"`
}

type ShipmentCOD

type ShipmentCOD struct {
	Amount        string `json:"amount"`
	Currency      string `json:"currency"`
	PaymentMethod string `json:"payment_method"`
}

type ShipmentExtra

type ShipmentExtra struct {
	SignatureConfirmation   string             `json:"signature_confirmation,omitempty"`
	SaturdayDelivery        bool               `json:"saturday_delivery"`
	BypassAddressValidation bool               `json:"bypass_address_validation"`
	RequestRetailRates      bool               `json:"request_retail_rates"`
	CustomerBranch          string             `json:"customer_branch,omitempty"`
	Billing                 *ShipmentBilling   `json:"billing,omitempty"`
	COD                     *ShipmentCOD       `json:"COD,omitempty"`
	Insurance               *ShipmentInsurance `json:"insurance,omitempty"`
	USPSSortType            string             `json:"usps_sort_type,omitempty"`
	USPSEntryFacility       string             `json:"usps_entry_facility,omitempty"`
	DangerousGoodsCode      string             `json:"dangerous_goods_code,omitempty"`
	IsReturn                bool               `json:"is_return,omitempty"`
	Reference1              string             `json:"reference_1,omitempty"`
	Reference2              string             `json:"reference_2,omitempty"`
}

type ShipmentInput

type ShipmentInput struct {
	AddressFrom        interface{}    `json:"address_from"`                  // string or *AddressInput
	AddressTo          interface{}    `json:"address_to"`                    // string or *AddressInput
	Parcels            interface{}    `json:"parcels"`                       // string, []string, *ParcelInput, or []*ParcelInput
	AddressReturn      interface{}    `json:"address_return,omitempty"`      // string or *AddressInput
	CustomsDeclaration interface{}    `json:"customs_declaration,omitempty"` // string or *CustomsDeclarationInput
	ShipmentDate       time.Time      `json:"shipment_date,omitempty"`
	CarrierAccounts    []string       `json:"carrier_accounts,omitempty"`
	Metadata           string         `json:"metadata,omitempty"`
	Extra              *ShipmentExtra `json:"extra,omitempty"`
	Async              bool           `json:"async"`
}

See https://goshippo.com/docs/reference#shipments

type ShipmentInsurance

type ShipmentInsurance struct {
	Amount   string `json:"amount"`
	Currency string `json:"currency"`
	Provider string `json:"provider"`
	Content  string `json:"content"`
}

type TrackingStatus

type TrackingStatus struct {
	TrackingStatusInput
	AddressFrom     *TrackingStatusLocation `json:"address_from,omitempty"`
	AddressTo       *TrackingStatusLocation `json:"address_to,omitempty"`
	ETA             time.Time               `json:"eta"`
	ServiceLevel    *ServiceLevel           `json:"servicelevel,omitempty"`
	TrackingStatus  *TrackingStatusDict     `json:"tracking_status,omitempty"`
	TrackingHistory []*TrackingStatusDict   `json:"tracking_history,omitempty"`
}

See https://goshippo.com/docs/reference#tracks

type TrackingStatusDict

type TrackingStatusDict struct {
	Status        string                  `json:"status,omitempty"`
	StatusDetails string                  `json:"status_details,omitempty"`
	StatusDate    time.Time               `json:"status_date,omitempty"`
	Location      *TrackingStatusLocation `json:"location,omitempty"`
}

type TrackingStatusInput

type TrackingStatusInput struct {
	Carrier        string `json:"carrier"`
	TrackingNumber string `json:"tracking_number"`
	Metadata       string `json:"metadata,omitempty"`
}

See https://goshippo.com/docs/reference#tracks

type TrackingStatusLocation

type TrackingStatusLocation struct {
	City    string `json:"city,omitempty"`
	State   string `json:"state,omitempty"`
	Zip     string `json:"zip,omitempty"`
	Country string `json:"country,omitempty"`
}

type Transaction

type Transaction struct {
	TransactionInput
	CommonOutputFields
	ObjectState          string                `json:"object_state,omitempty"`
	Status               string                `json:"status,omitempty"`
	Test                 bool                  `json:"test"`
	TrackingNumber       string                `json:"tracking_number,omitempty"`
	TrackingStatus       string                `json:"tracking_status,omitempty"`
	TrackingHistory      []*TrackingStatusDict `json:"tracking_history,omitempty"`
	TrackingURLProvider  string                `json:"tracking_url_provider,omitempty"`
	LabelURL             string                `json:"label_url,omitempty"`
	CommercialInvoiceURL string                `json:"commercial_invoice_url,omitempty"`
	Messages             []*OutputMessage      `json:"messages,omitempty"`
	Async                bool                  `json:"async"`
}

See https://goshippo.com/docs/reference#transactions

type TransactionInput

type TransactionInput struct {
	Rate          string `json:"rate,omitempty"`
	Metadata      string `json:"metadata,omitempty"`
	LabelFileType string `json:"label_file_type"`
	Async         bool   `json:"async"`

	Shipment         *ShipmentInput `json:"shipment,omitempty"`              // instant call only: https://goshippo.com/docs/reference#transactions-create-instant
	CarrierAccount   string         `json:"carrier_account,omitempty"`       // instant call only: https://goshippo.com/docs/reference#transactions-create-instant
	ServerLevelToken string         `json:"servericelevel_token, omitempty"` // instant call only: https://goshippo.com/docs/reference#transactions-create-instant
}

See https://goshippo.com/docs/reference#transactions

type ValidationResults

type ValidationResults struct {
	IsValid  bool             `json:"is_valid"`
	Messages []*OutputMessage `json:"messages"`
}

See https://goshippo.com/docs/reference#addresses

Jump to

Keyboard shortcuts

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