Documentation ¶
Index ¶
- Constants
- func ValidateAttribute(key string, value string) (isValidated bool, errorsArray []validator.FieldError)
- func ValidateClaimAttributes() (isValidated bool, errorsArray []validator.FieldError)
- func ValidateClaimWithPasswordAttributes() (isValidated bool, errorsArray []validator.FieldError)
- func ValidateCourierInfoItem() (isValidated bool, errorsArray []validator.FieldError)
- func ValidateCourierTrackingUrl() (isValidated bool, errorsArray []validator.FieldError)
- func ValidateCurrentStatusRecord() (isValidated bool, errorsArray []validator.FieldError)
- func ValidatePacketAttributes() (isValidated bool, errorsArray []validator.FieldError)
- func ValidatePacketInfo() (isValidated bool, errorsArray []validator.FieldError)
- func ValidateSize(s Size) (isValidated bool, errorsArray []validator.FieldError)
- type Attribute
- type AttributeCollection
- type BarcodePng
- type ClaimAttributes
- type ClaimAttributesValid
- type ClaimWithPasswordAttributes
- type CourierBarcodes
- type CourierInfo
- type CourierInfoItem
- type CourierNumbers
- type CourierTrackingNumbers
- type CourierTrackingUrl
- type CourierTrackingUrls
- type CreatePacket
- type CreatePacketClaim
- type CreatePacketClaimWithPassword
- type CreatePacketResponse
- type CreatePacketResult
- type CurrentStatusRecord
- type Detail
- type ErrorAttributes
- type Fault
- type Ids
- type Item
- type ItemCollection
- type PacketAttributes
- type PacketAttributesFault
- type PacketAttributesValid
- type PacketDetail
- type PacketGetStoredUntil
- type PacketIdDetail
- type PacketInfo
- type PacketInfoResponse
- type PacketInfoResult
- type PacketLabelPdf
- type PacketStatus
- type PacketTracking
- type PacketsLabelsPdf
- type Size
- type StatusRecord
- type StatusRecords
- type ZasilkovnaDate
- type ZasilkovnaDateTime
Constants ¶
View Source
const ( CurrencyCZK = "CZK" CurrencyEUR = "EUR" CurrencyHUF = "HUF" CurrencyPLN = "PLN" CurrencyRON = "RON" )
View Source
const ( ResponseStatusOk = "ok" ResponseStatusFault = "fault" )
Variables ¶
This section is empty.
Functions ¶
func ValidateAttribute ¶
func ValidateClaimAttributes ¶
func ValidateClaimAttributes() (isValidated bool, errorsArray []validator.FieldError)
func ValidateClaimWithPasswordAttributes ¶
func ValidateClaimWithPasswordAttributes() (isValidated bool, errorsArray []validator.FieldError)
func ValidateCourierInfoItem ¶
func ValidateCourierInfoItem() (isValidated bool, errorsArray []validator.FieldError)
func ValidateCourierTrackingUrl ¶
func ValidateCourierTrackingUrl() (isValidated bool, errorsArray []validator.FieldError)
func ValidateCurrentStatusRecord ¶
func ValidateCurrentStatusRecord() (isValidated bool, errorsArray []validator.FieldError)
func ValidatePacketAttributes ¶
func ValidatePacketAttributes() (isValidated bool, errorsArray []validator.FieldError)
func ValidatePacketInfo ¶
func ValidatePacketInfo() (isValidated bool, errorsArray []validator.FieldError)
func ValidateSize ¶
Types ¶
type Attribute ¶
type Attribute struct { Key string `xml:"key" validate:"required"` Value string `xml:"value" validate:"required"` }
func NewAttribute ¶
type AttributeCollection ¶
type AttributeCollection struct {
Attribute []Attribute `xml:"attribute"`
}
func NewAttributeCollection ¶
func NewAttributeCollection(Attribute []Attribute) *AttributeCollection
type BarcodePng ¶
type BarcodePng struct { XMLName xml.Name `xml:"barcodePng"` ApiPassword string `xml:"apiPassword" validate:"required"` Barcode string `xml:"barcode" validate:"required"` }
func NewBarcodePng ¶
func NewBarcodePng(ApiPassword string, Barcode string) *BarcodePng
type ClaimAttributes ¶
type ClaimAttributes struct { Id int `xml:"id,omitempty"` Number string `xml:"number" validate:"required"` Email string `xml:"email" validate:"required,email"` Phone string `xml:"phone" validate:"required"` Value float32 `xml:"value" validate:"required"` Currency string `xml:"currency,omitempty"` Eshop string `xml:"eshop" validate:"required"` // Required when using more senders SendLabelToEmail bool `xml:"SendLabelToEmail,omitempty"` }
func NewClaimAttributes ¶
type ClaimAttributesValid ¶
type ClaimAttributesValid struct { XMLName xml.Name `xml:"packetClaimAttributesValid"` ApiPassword string `xml:"apiPassword" validate:"required"` ClaimAttributes ClaimAttributes `xml:"claimAttributes" validate:"required"` }
func NewClaimAttributesValid ¶
func NewClaimAttributesValid(ApiPassword string, ClaimAttributes ClaimAttributes) *ClaimAttributesValid
type ClaimWithPasswordAttributes ¶
type ClaimWithPasswordAttributes struct { Id int `xml:"id" validate:"required"` Number string `xml:"number" validate:"required"` Email string `xml:"email" validate:"required,email"` Phone string `xml:"phone" validate:"required"` Value float32 `xml:"value" validate:"required"` Currency string `xml:"currency,omitempty"` Eshop string `xml:"eshop" validate:"required"` ConsignCountry string `xml:"consign_country" validate:"required"` SendEmailToCustomer bool `xml:"send_email_to_customer,omitempty"` }
type CourierBarcodes ¶
type CourierInfo ¶
type CourierInfo struct { XMLName xml.Name `xml:"courierInfo"` CourierInfoItem []CourierInfoItem `xml:"courierInfoItem"` }
type CourierInfoItem ¶
type CourierInfoItem struct { XMLName xml.Name `xml:"courierInfoItem"` CourierId int `xml:"courierId" validate:"required"` CourierName string `xml:"courierName" validate:"required"` CourierNumbers []CourierNumbers `xml:"courierNumbers,omitempty"` CourierBarcodes []CourierBarcodes `xml:"courierBarcodes,omitempty"` CourierTrackingNumbers []CourierTrackingNumbers `xml:"courierTrackingNumbers,omitempty"` CourierTrackingUrls []CourierTrackingUrls `xml:"courierTrackingUrls,omitempty"` }
func NewCourierInfoItem ¶
func NewCourierInfoItem(CourierId int, CourierName string, CourierNumbers []CourierNumbers, CourierBarcodes []CourierBarcodes, CourierTrackingNumbers []CourierTrackingNumbers, CourierTrackingUrls []CourierTrackingUrls) *CourierInfoItem
func NewCourierInfoItemRequired ¶
func NewCourierInfoItemRequired(CourierId int, CourierName string) *CourierInfoItem
type CourierNumbers ¶
type CourierTrackingNumbers ¶
type CourierTrackingUrl ¶
type CourierTrackingUrl struct { XMLName xml.Name `xml:"courierTrackingUrl"` Lang string `xml:"lang" validate:"required"` Url string `xml:"url" validate:"required"` }
func NewCourierTrackingUrls ¶
func NewCourierTrackingUrls(Lang string, Url string) *CourierTrackingUrl
type CourierTrackingUrls ¶
type CourierTrackingUrls struct { XMLName xml.Name `xml:"courierTrackingUrls"` CourierTrackingUrl CourierTrackingUrl `xml:"courierTrackingUrl"` }
type CreatePacket ¶
type CreatePacket struct { XMLName xml.Name `xml:"createPacket"` ApiPassword string `xml:"apiPassword" validate:"required"` PacketAttributes PacketAttributes `xml:"packetAttributes" validate:"required"` }
func NewCreatePacket ¶
func NewCreatePacket(ApiPassword string, PacketAttributes PacketAttributes) *CreatePacket
type CreatePacketClaim ¶
type CreatePacketClaim struct { XMLName xml.Name `xml:"createPacketClaim"` ApiPassword string `xml:"apiPassword" validate:"required"` ClaimAttributes ClaimAttributes `xml:"claimAttributes" validate:"required"` }
func NewCreatePacketClaim ¶
func NewCreatePacketClaim(apiPassword string, ClaimAttributes ClaimAttributes) *CreatePacketClaim
type CreatePacketClaimWithPassword ¶
type CreatePacketClaimWithPassword struct { XMLName xml.Name `xml:"createPacketClaimWithPassword"` ApiPassword string `xml:"apiPassword" validate:"required"` CreatePacketClaimWithPassword ClaimWithPasswordAttributes `xml:"createPacketClaimWithPassword" validate:"required"` }
func NewCreatePacketClaimWithPassword ¶
func NewCreatePacketClaimWithPassword(apiPassword string, c ClaimWithPasswordAttributes) *CreatePacketClaimWithPassword
type CreatePacketResponse ¶ added in v0.0.3
type CreatePacketResponse struct { XMLName xml.Name `xml:"response"` Status string `xml:"status"` Result CreatePacketResult `xml:"result"` }
type CreatePacketResult ¶ added in v0.0.3
type CurrentStatusRecord ¶
type CurrentStatusRecord struct { DateTime ZasilkovnaDateTime `xml:"dateTime" validate:"required"` StatusCode int `xml:"statusCode" validate:"required"` CodeText string `xml:"codeText" validate:"required"` StatusText string `xml:"statusText" validate:"required"` BranchId int `xml:"branchId" validate:"required"` DestinationBranchId int `xml:"destinationBranchId" validate:"required"` ExternalTrackingCode string `xml:"externalTrackingCode,omitempty"` IsReturning *bool `xml:"isReturning" validate:"required"` // *bool bcs of required StoredUntil ZasilkovnaDate `xml:"storedUntil" validate:"required"` CarrierId int `xml:"carrierId,omitempty"` CarrierName string `xml:"carrierName,omitempty"` }
func NewCurrentStatusRecord ¶
func NewCurrentStatusRecord(DateTime ZasilkovnaDateTime, StatusCode int, CodeText string, StatusText string, BranchId int, DestinationBranchId int, ExternalTrackingCode string, IsReturning *bool, StoredUntil ZasilkovnaDate, CarrierId int, CarrierName string) *CurrentStatusRecord
func NewCurrentStatusRecordRequired ¶
func NewCurrentStatusRecordRequired(DateTime ZasilkovnaDateTime, StatusCode int, CodeText string, StatusText string, BranchId int, DestinationBranchId int, IsReturning *bool, StoredUntil ZasilkovnaDate) *CurrentStatusRecord
type Detail ¶
type Detail struct {
Attributes ErrorAttributes `xml:"attributes"`
}
type ErrorAttributes ¶
type ErrorAttributes struct {
Fault []Fault `xml:"fault"`
}
type ItemCollection ¶
type ItemCollection struct {
Item []Item `xml:"item"`
}
func NewItemCollection ¶
func NewItemCollection(Item []Item) *ItemCollection
type PacketAttributes ¶
type PacketAttributes struct { Id int `xml:"id,omitempty"` Number string `xml:"number" validate:"required"` Name string `xml:"name" validate:"required"` Surname string `xml:"surname" validate:"required"` Company string `xml:"company,omitempty"` Email string `xml:"email" validate:"required"` //Required email or phone Phone string `xml:"phone" validate:"required"` //Required email or phone AddressId int `xml:"addressId" validate:"required"` Currency string `xml:"currency,omitempty"` Cod float32 `xml:"cod,omitempty"` Value float32 `xml:"value" validate:"required"` Weight float32 `xml:"weight" validate:"max=10"` DeliverOn ZasilkovnaDate `xml:"deliverOn,omitempty"` Eshop string `xml:"eshop" validate:"required"` AdultContent bool `xml:"adultContent,omitempty"` Note string `xml:"note,omitempty"` Street string `xml:"street"` HouseNumber string `xml:"houseNumber"` City string `xml:"city"` Province string `xml:"province,omitempty"` Zip string `xml:"zip"` CarrierService string `xml:"carrierService,omitempty"` CustomerBarcode string `xml:"customerBarcode,omitempty"` CarrierPickupPoint string `xml:"carrierPickupPoint"` // Required for some carriers CustomsDeclaration ItemCollection `xml:"customsDeclaration"` // Required on address delivery outside EU Size Size `xml:"size"` // Required for some carriers AttributeCollection AttributeCollection `xml:"attributeCollection"` // Required for some carriers Items ItemCollection `xml:"items"` // Required for some carriers }
func NewPacketAttributes ¶
func NewPacketAttributes(Id int, Number string, Name string, Surname string, Company string, Email string, Phone string, AddressId int, Currency string, Cod float32, Value float32, Weight float32, DeliverOn ZasilkovnaDate, Eshop string, AdultContent bool, Note string, Street string, HouseNumber string, City string, Province string, Zip string, CarrierService string, CustomerBarcode string, CarrierPickupPoint string, CustomsDeclaration ItemCollection, Size Size, AttributeCollection AttributeCollection, Items ItemCollection) *PacketAttributes
func NewPacketAttributesRequired ¶
func NewPacketAttributesRequired(Number string, Name string, Surname string, Email string, Phone string, AddressId int, Value float32, Weight float32, Eshop string, Street string, HouseNumber string, City string, Zip string, CarrierPickupPoint string, CustomsDeclaration ItemCollection, Size Size, AttributeCollection AttributeCollection, Items ItemCollection) *PacketAttributes
type PacketAttributesFault ¶ added in v0.1.0
type PacketAttributesFault struct { XMLName xml.Name `xml:"response"` Status string `xml:"status"` Fault string `xml:"fault"` String string `xml:"string"` Detail Detail `xml:"detail"` }
func ToErrorResponse ¶ added in v0.1.0
func ToErrorResponse(err error) PacketAttributesFault
func (PacketAttributesFault) Error ¶ added in v0.1.0
func (e PacketAttributesFault) Error() string
Error - Returns error string.
func (*PacketAttributesFault) ToRfc7807Error ¶ added in v0.1.0
func (e *PacketAttributesFault) ToRfc7807Error(code int) error
type PacketAttributesValid ¶
type PacketAttributesValid struct { XMLName xml.Name `xml:"packetAttributesValid"` ApiPassword string `xml:"apiPassword" validate:"required"` PacketAttributes PacketAttributes `xml:"packetAttributes" validate:"required"` }
func NewPacketAttributesValid ¶
func NewPacketAttributesValid(ApiPassword string, PacketAttributes PacketAttributes) *PacketAttributesValid
type PacketDetail ¶
type PacketGetStoredUntil ¶
type PacketGetStoredUntil struct { XMLName xml.Name `xml:"packetGetStoredUntil"` ApiPassword string `xml:"apiPassword" validate:"required"` PacketId int `xml:"packetId" validate:"required"` }
func NewPacketGetStoredUntil ¶
func NewPacketGetStoredUntil(apiPassword string, packetId int) *PacketGetStoredUntil
type PacketIdDetail ¶
type PacketIdDetail struct { XMLName xml.Name `xml:"packetIdDetail"` Id int `xml:"id"` Barcode string `xml:"barcode"` BarcodeText string `xml:"barcodeText"` }
func NewPacketIdDetail ¶
func NewPacketIdDetail(Id int, Barcode string, BarcodeText string) *PacketIdDetail
type PacketInfo ¶
type PacketInfo struct { XMLName xml.Name `xml:"packetInfo"` ApiPassword string `xml:"apiPassword" validate:"required"` PacketId int `xml:"packetId" validate:"required"` }
func NewPacketInfo ¶
func NewPacketInfo(ApiPassword string, PacketId int) *PacketInfo
type PacketInfoResponse ¶
type PacketInfoResponse struct { XMLName xml.Name `xml:"response"` Status string `xml:"status"` Result PacketInfoResult `xml:"result"` }
func NewPacketInfoResponse ¶
func NewPacketInfoResponse(Status string, Result PacketInfoResult) *PacketInfoResponse
type PacketInfoResult ¶
type PacketInfoResult struct { XMLName xml.Name `xml:"result"` BranchId int `xml:"branchId" validate:"required"` InvoicedWeightGrams int `xml:"invoicedWeightGrams"` CourierInfo CourierInfo `xml:"courierInfo"` }
func NewPacketInfoResult ¶
func NewPacketInfoResult(BranchId int, InvoicedWeightGrams int, CourierInfo CourierInfo) *PacketInfoResult
type PacketLabelPdf ¶
type PacketLabelPdf struct { XMLName xml.Name `xml:"packetLabelPdf"` ApiPassword string `xml:"apiPassword" validate:"required"` PacketId int `xml:"packetId" validate:"required"` Format string `xml:"format" validate:"required"` Offset int `xml:"offset" validate:"required"` }
func NewPacketLabelPdf ¶
func NewPacketLabelPdf(ApiPassword string, PacketId int, Format string, Offset int) *PacketLabelPdf
type PacketStatus ¶
type PacketStatus struct { XMLName xml.Name `xml:"packetStatus"` ApiPassword string `xml:"apiPassword" validate:"required"` PacketId int `xml:"packetId" validate:"required"` }
func NewPacketStatus ¶
func NewPacketStatus(apiPassword string, packetId int) *PacketStatus
type PacketTracking ¶
type PacketsLabelsPdf ¶
type PacketsLabelsPdf struct { XMLName xml.Name `xml:"packetsLabelsPdf"` ApiPassword string `xml:"apiPassword" validate:"required"` PacketIds Ids `xml:"packetIds" validate:"required"` Format string `xml:"format" validate:"required"` Offset int `xml:"offset" validate:"required"` }
func NewPacketsLabelsPdf ¶
func NewPacketsLabelsPdf(ApiPassword string, PacketIds Ids, Format string, Offset int) *PacketsLabelsPdf
type Size ¶
type StatusRecord ¶
type StatusRecord struct { XMLName xml.Name `xml:"statusRecord"` DateTime ZasilkovnaDateTime `xml:"dateTime" validate:"required"` StatusCode int `xml:"statusCode" validate:"required"` CodeText string `xml:"codeText" validate:"required"` StatusText string `xml:"statusText" validate:"required"` BranchId int `xml:"branchId" validate:"required"` DestinationBranchId int `xml:"destinationBranchId" validate:"required"` ExternalTrackingCode string `xml:"externalTrackingCode,omitempty"` }
func NewStatusRecord ¶
func NewStatusRecord(DateTime ZasilkovnaDateTime, StatusCode int, CodeText string, StatusText string, BranchId int, DestinationBranchId int, ExternalTrackingCode string) *StatusRecord
func NewStatusRecordRequired ¶
func NewStatusRecordRequired(DateTime ZasilkovnaDateTime, StatusCode int, CodeText string, StatusText string, BranchId int, DestinationBranchId int) *StatusRecord
type StatusRecords ¶
type StatusRecords struct {
StatusRecord []StatusRecord `xml:"statusRecords"`
}
type ZasilkovnaDate ¶
type ZasilkovnaDateTime ¶
Source Files ¶
- attribute.go
- barcode-png.go
- claim-attributes.go
- claim-with-password-attributes.go
- constants.go
- courier-data-types.go
- courier-info-item.go
- courier-tracking-url.go
- current-status-record.go
- date-time.go
- item.go
- packet-attributes-fault.go
- packet-attributes.go
- packet-get-stored-until.go
- packet-info.go
- packet-label-pdf.go
- size.go
- status-record.go
Click to show internal directories.
Click to hide internal directories.