Documentation
¶
Index ¶
- type AddressParameters
- type AuthorizationHeader
- type Body
- type Client
- type CountryFrom
- type CountryOper
- type Data
- type DataItem
- type DestinationAddress
- type FinanceParameters
- type GetOperationHistoryResponse
- type HistoryRecord
- type ItemParameters
- type MailCtg
- type MailDirect
- type MailRank
- type MailType
- type OperAttr
- type OperType
- type OperationAddress
- type OperationHistoryData
- type OperationHistoryRequest
- type OperationParameters
- type Result
- type SendCtg
- type SoapRequest
- type SoapRequestBody
- type SoapRequestOper
- type UserParameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressParameters ¶
type AddressParameters struct {
DestinationAddress DestinationAddress `xml:"DestinationAddress"`
OperationAddress OperationAddress `xml:"OperationAddress"`
MailDirect MailDirect `xml:"MailDirect"`
CountryOper CountryOper `xml:"CountryOper"`
CountryFrom CountryFrom `xml:"CountryFrom"`
}
AddressParameters Содержит адресные данные с операцией над отправлением
type AuthorizationHeader ¶
type AuthorizationHeader struct {
XMLName xml.Name `xml:"data:AuthorizationHeader"`
MustUnderstand string `xml:"soapenv:mustUnderstand,attr"`
Login string `xml:"data:login"`
Password string `xml:"data:password"`
}
AuthorizationHeader Содержит элементы login и password. Атрибут soapenv:mustUnderstand элемента AuthorizationHeader должен содержать значение 1.
type Body ¶
type Body struct {
GetOperationHistoryResponse GetOperationHistoryResponse `xml:"getOperationHistoryResponse"`
}
Body тело ответа
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client manages communication with the API.
func NewClient ¶
NewClient returns a new API client. If a nil httpClient is provided, http.DefaultClient will be used.
func (*Client) GetOperationHistory ¶
GetOperationHistory возвращает историю операций над отправлением barcode - Идентификатор регистрируемого почтового отправления в одном из форматов:
- внутрироссийский, состоящий из 14 символов (цифровой);
- международный, состоящий из 13 символов (буквенно-цифровой) в формате S10.
messegeType - Тип сообщения. Возможные значения:
0 - история операций для отправления; 1 - история операций для заказного уведомления по данному отправлению.
language - Язык, на котором должны возвращаться названия операций/атрибутов и сообщения об ошибках. Допустимые значения:
RUS – использовать русский язык (используется по умолчанию); ENG – использовать английский язык.
type CountryFrom ¶
type CountryFrom struct {
ID int `xml:"Id"`
Code2A string
Code3A string
NameRU string
NameEN string
}
CountryFrom Содержит данные о стране приема почтового отправления
type CountryOper ¶
type CountryOper struct {
ID int `xml:"Id"`
Code2A string
Code3A string
NameRU string
NameEN string
}
CountryOper Содержит данные о стране проведения операции над почтовым отправлением
type Data ¶
type Data struct {
DataItems []DataItem
}
Data содержит данные об операциях над почтовым отправлением
type DataItem ¶
type DataItem struct {
DestinationAddress string // место назначения
Mass int // вес отправления
OperarationDate string // дата проведения оперрации над отправлением
Operation string // операция над отправлением (тип и атрибут)
OperationLocation string // место проведения операции над отправлением (почтовый индекс, название)
}
DataItem содержит данные об операции над почтовым отправлением
type DestinationAddress ¶
type DestinationAddress struct {
Index string `xml:"Index"`
Description string `xml:"Description"`
}
DestinationAddress Содержит адресные данные места назначения пересылки отправления
type FinanceParameters ¶
type FinanceParameters struct {
Payment int
Value int
MassRate int
InsrRate int
AirRate int
Rate int
CustomDuty int
}
FinanceParameters Содержит финансовые данные, связанные с операцией над почтовым отправлением
type GetOperationHistoryResponse ¶
type GetOperationHistoryResponse struct {
OperationHistoryData OperationHistoryData `xml:"OperationHistoryData"`
}
GetOperationHistoryResponse элемент xml структуры
type HistoryRecord ¶
type HistoryRecord struct {
AddressParameters AddressParameters `xml:"AddressParameters"`
FinanceParameters FinanceParameters `xml:"FinanceParameters"`
ItemParameters ItemParameters `xml:"ItemParameters"`
OperationParameters OperationParameters `xml:"OperationParameters"`
UserParameters UserParameters `xml:"UserParameters"`
}
HistoryRecord содержит информацию об одной операции над отправлением.
type ItemParameters ¶
type ItemParameters struct {
Barcode string
Internum string
ValidRuType string
ValidEnType string
ComplexItemName string
MailRank MailRank `xml:"MailRank"`
MailType MailType `xml:"MailType"`
Mass int
MaxMassRu int
MaxMassEn int
}
ItemParameters Содержит данные о почтовом отправлении
type MailDirect ¶
type MailDirect struct {
ID int `xml:"Id"`
Code2A string
Code3A string
NameRU string
NameEN string
}
MailDirect Содержит данные о стране места назначения пересылки отправления
type OperationAddress ¶
OperationAddress Содержит адресные данные места проведения операции над отправлением
type OperationHistoryData ¶
type OperationHistoryData struct {
HistoryRecords []HistoryRecord `xml:"historyRecord"`
}
OperationHistoryData содержит список элементов historyRecord. Каждый из них содержит информацию об одной операции над отправлением Если над отправлением еще не зарегистрировано ни одной операции, то возвращается пустой список элементов historyRecord
type OperationHistoryRequest ¶
type OperationHistoryRequest struct {
XMLName xml.Name `xml:"data:OperationHistoryRequest"`
Barcode string `xml:"data:Barcode"`
MessageType string `xml:"data:MessageType"`
Language string `xml:"data:Language"`
}
OperationHistoryRequest Содержит элементы Barcode, MessageType, Language
type OperationParameters ¶
type OperationParameters struct {
OperType OperType `xml:"OperType"`
OperAttr OperAttr `xml:"OperAttr"`
OperDate string
}
OperationParameters Cодержит параметры операции над отправлением
type SoapRequest ¶
type SoapRequest struct {
XMLName xml.Name `xml:"soap:Envelope"`
SoapAttr string `xml:"xmlns:soap,attr"`
OperAttr string `xml:"xmlns:oper,attr"`
DataAttr string `xml:"xmlns:data,attr"`
SoapEnvAttr string `xml:"xmlns:soapenv,attr"`
Header string `xml:"soap:Header"`
Body SoapRequestBody
}
SoapRequest структура soap запроса
type SoapRequestBody ¶
type SoapRequestBody struct {
XMLName xml.Name `xml:"soap:Body"`
Oper SoapRequestOper
}
SoapRequestBody тело запроса
type SoapRequestOper ¶
type SoapRequestOper struct {
XMLName xml.Name `xml:"oper:getOperationHistory"`
OperHistReq OperationHistoryRequest
AuthHeader AuthorizationHeader
}
SoapRequestOper вид операции, передаваемой в запросе
type UserParameters ¶
UserParameters Содержит данные субъектов, связанных с операцией над почтовым отправлением