-
Notifications
You must be signed in to change notification settings - Fork 10
/
structs.go
228 lines (152 loc) · 7.6 KB
/
structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
package pnr_retrieve
import (
"encoding/xml"
"github.com/tmconsulting/amadeus-golang-sdk/formats"
)
type PNRRetrieve struct {
XMLName xml.Name `xml:"http://xml.amadeus.com/PNRRET_11_3_1A PNR_Retrieve"`
Settings *Settings `xml:"settings,omitempty"` // minOccurs="0"
RetrievalFacts *RetrievalFacts `xml:"retrievalFacts"`
}
type Settings struct {
// optional information on what needs to be returned in the PNR , hardcopy print or PNR mode.
Options *OptionalPNRActionsType `xml:"options"`
// Identification of the printer when hardcopy is requested
Printer *PrinterIdentificationType `xml:"printer,omitempty"` // minOccurs="0"
}
type RetrievalFacts struct {
// retrieval type , options , and references related to the PNR content .
Retrieve *RetrievePNRType `xml:"retrieve"`
// Informations needed for retreive by record locator or retreive by customer profile.
ReservationOrProfileIdentifier *ReservationControlInformationType `xml:"reservationOrProfileIdentifier,omitempty"` // minOccurs="0"
PersonalFacts *PersonalFacts `xml:"personalFacts,omitempty"` // minOccurs="0"
// Informations needed for a retreive by frequent flyer .
FrequentFlyer *FrequentTravellerIdentificationCodeType `xml:"frequentFlyer,omitempty"` // minOccurs="0"
// Informations needed for a retreive by account number
Accounting *AccountingInformationElementType `xml:"accounting,omitempty"` // minOccurs="0"
}
type PersonalFacts struct {
// Informations needed for retreive by office and name or retreive by service and name .
TravellerInformation *TravellerInformationType `xml:"travellerInformation"`
// Informations on the travel product
ProductInformation *TravelProductInformationType `xml:"productInformation,omitempty"` // minOccurs="0"
// Ticket number that can be used optionally when retreive by record locator is done .
Ticket *TicketNumberType `xml:"ticket,omitempty"` // minOccurs="0"
}
//
// Complex structs
//
type AccountingElementType struct {
// account number
Number formats.AlphaNumericString_Length1To30 `xml:"number"`
}
type AccountingInformationElementType struct {
// accounting element needed when retreive by account number
Account *AccountingElementType `xml:"account"`
}
type CompanyIdentificationTypeI struct {
// Airline/ provider code
Code formats.AlphaNumericString_Length1To3 `xml:"code"`
}
type FrequentTravellerIdentificationCodeType struct {
// frequent traveler identification needed when retreive by frequent traveller
FrequentTraveller *FrequentTravellerIdentificationTypeI `xml:"frequentTraveller"`
}
type FrequentTravellerIdentificationTypeI struct {
// airline code
CompanyId formats.AlphaNumericString_Length2To2 `xml:"companyId"`
// frequent traveller reference number
MembershipNumber formats.AlphaNumericString_Length1To27 `xml:"membershipNumber"`
}
type LocationTypeI struct {
// Board point or off point
CityCode formats.AlphaString_Length3To3 `xml:"cityCode"`
}
type OptionalPNRActionsType struct {
// 51 - return all RTSVC 52 - return line numbers 53 - return RLRs 55 - do not return individual names of a group 101 - hard copy print 201 - return RTSVC for car 231 - return RTSVC for hotel 261 - return RTSVC for air 300 - TY mode
OptionCode []formats.NumericInteger_Length1To3 `xml:"optionCode"` // maxOccurs="40"
}
type PrinterIdentificationDetailsType struct {
// name of the printer
Name formats.AlphaNumericString_Length5To6 `xml:"name"`
// network id of the printer
Network formats.AlphaNumericString_Length2To2 `xml:"network,omitempty"` // minOccurs="0"
}
type PrinterIdentificationType struct {
// printer identification
IdentifierDetail *PrinterIdentificationDetailsType `xml:"identifierDetail,omitempty"` // minOccurs="0"
// amadeus office id
Office formats.AlphaNumericString_Length9To9 `xml:"office,omitempty"` // minOccurs="0"
// IATA teletype address
TeletypeAddress formats.AlphaNumericString_Length7To7 `xml:"teletypeAddress,omitempty"` // minOccurs="0"
}
type ProductDateTimeTypeI struct {
// Departure/ pick-up/ check-in date
DepDate formats.Date_DDMMYY `xml:"depDate"`
// Only for retrieve by flight/departure time, needed.
DepTime formats.Time24_HHMM `xml:"depTime,omitempty"` // minOccurs="0"
// Return/ drop-off/ check-out date
ArrDate formats.Date_DDMMYY `xml:"arrDate,omitempty"` // minOccurs="0"
}
type ProductIdentificationDetailsTypeI struct {
// Flight number
Identification formats.NumericInteger_Length1To4 `xml:"identification"`
// Flight number alpha suffix
Subtype formats.AlphaString_Length1To1 `xml:"subtype,omitempty"` // minOccurs="0"
}
type ReservationControlInformationDetailsTypeI struct {
// profile or PNR record locator
ControlNumber formats.AlphaNumericString_Length1To20 `xml:"controlNumber"`
}
type ReservationControlInformationType struct {
// record information
Reservation *ReservationControlInformationDetailsTypeI `xml:"reservation"`
}
type RetrievePNRType struct {
// 1 - redisplay 2 - retrieve by record locator 3 - retrieve by office and name 4 - retrieve by service and name 5 - retrieve by frequent traveller 6 - retrieve by account number 7 - retrieve by customer profile 8 - retrieve by Insurance policy number 9 - retrieve by numeric record locator
Type formats.NumericInteger_Length1To1 `xml:"type"`
// information needed for redisplay if RTSVC (AIR, HTL, CAR). Needed for retrieve by service and name . Optional for retrieve by office and name
Service formats.AlphaString_Length3To3 `xml:"service,omitempty"` // minOccurs="0"
// Element tattoo. Optional for redisplay when RTSVC.
Tattoo formats.AlphaNumericString_Length1To5 `xml:"tattoo,omitempty"` // minOccurs="0"
// PNR owner office id
Office formats.AlphaNumericString_Length9To9 `xml:"office,omitempty"` // minOccurs="0"
// Target system for retrieve PNR via claim. Only for retrieve by record locator and retrieve by service and name
TargetSystem formats.AlphaNumericString_Length2To2 `xml:"targetSystem,omitempty"` // minOccurs="0"
// X - RTAXR V - RV Optional for redisplay and retrieval types 2, 3 and 4. N/A otherwise.
Option1 formats.AlphaString_Length1To1 `xml:"option1,omitempty"` // minOccurs="0"
// A - active PNRs only Optional for retrieve by office and name. N/A otherwise.
Option2 formats.AlphaString_Length1To1 `xml:"option2,omitempty"` // minOccurs="0"
}
type TicketNumberType struct {
// airline code
Airline formats.NumericInteger_Length3To3 `xml:"airline"`
// airline ticket number
TicketNumber formats.NumericInteger_Length10To10 `xml:"ticketNumber"`
}
type TravelProductInformationType struct {
// Defaults to current date
Product *ProductDateTimeTypeI `xml:"product,omitempty"` // minOccurs="0"
// Needed for retrieval by flight, optional otherwise.
BoardpointDetail *LocationTypeI `xml:"boardpointDetail,omitempty"` // minOccurs="0"
// needed only if board point is provided.
OffpointDetail *LocationTypeI `xml:"offpointDetail,omitempty"` // minOccurs="0"
// company identification
Company *CompanyIdentificationTypeI `xml:"company,omitempty"` // minOccurs="0"
// needed only for retrieve by flight
ProductDetails *ProductIdentificationDetailsTypeI `xml:"productDetails,omitempty"` // minOccurs="0"
}
type TravellerDetailsTypeI struct {
// Traveler first name
FirstName formats.AlphaString_Length1To56 `xml:"firstName"`
}
type TravellerInformationType struct {
// traveler surname information
Traveller *TravellerSurnameInformationTypeI `xml:"traveller"`
// N/A for retrieve by record locator
Passenger *TravellerDetailsTypeI `xml:"passenger,omitempty"` // minOccurs="0"
}
type TravellerSurnameInformationTypeI struct {
// traveler last name or group name
Surname formats.AlphaString_Length1To57 `xml:"surname"`
}