Skip to content

Commit 6b273e2

Browse files
committed
added QueuePlacePNR
1 parent cc089e6 commit 6b273e2

File tree

3 files changed

+243
-0
lines changed

3 files changed

+243
-0
lines changed

reqstructs/queue_placepnr/structs.go

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
package queue_placepnr
2+
3+
import (
4+
"encoding/xml"
5+
6+
"github.com/kidem/amadeus-ws-go/formats"
7+
)
8+
9+
type QueuePlacePNR struct {
10+
XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A Queue_PlacePNR"`
11+
12+
// specify the type of placement to be done queue place on queue queue place on another queue queue place off queue
13+
PlacementOption *SelectionDetailsTypeI `xml:"placementOption,omitempty"`
14+
15+
TargetDetails *TargetDetails `xml:"targetDetails,omitempty"`
16+
17+
// contains the record locator to be queue placed
18+
RecordLocator *ReservationControlInformationTypeI `xml:"recordLocator,omitempty"`
19+
}
20+
21+
type TargetDetails struct {
22+
23+
// used to specify the target office for which the queue count is to be displayed
24+
TargetOffice *AdditionalBusinessSourceInformationType `xml:"targetOffice,omitempty"`
25+
26+
// used to specify the queue if required
27+
QueueNumber *QueueInformationTypeI `xml:"queueNumber,omitempty"`
28+
29+
// used to select the category
30+
CategoryDetails *SubQueueInformationTypeI `xml:"categoryDetails,omitempty"`
31+
32+
// used to pass the target date/time if not default
33+
PlacementDate *StructuredDateTimeInformationType `xml:"placementDate,omitempty"`
34+
}
35+
36+
type AdditionalBusinessSourceInformationType struct {
37+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A AdditionalBusinessSourceInformationType"`
38+
39+
// SOURCE TYPE
40+
SourceType *SourceTypeDetailsTypeI `xml:"sourceType,omitempty"`
41+
42+
// ORIGINATOR DETAILS
43+
OriginatorDetails *OriginatorIdentificationDetailsTypeI `xml:"originatorDetails,omitempty"`
44+
}
45+
46+
type OriginatorIdentificationDetailsTypeI struct {
47+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A OriginatorIdentificationDetailsTypeI"`
48+
49+
// the office that is being targetted
50+
InHouseIdentification1 formats.AlphaNumericString_Length1To9 `xml:"inHouseIdentification1,omitempty"`
51+
}
52+
53+
type QueueInformationDetailsTypeI struct {
54+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A QueueInformationDetailsTypeI"`
55+
56+
// queue number
57+
Number formats.NumericInteger_Length1To2 `xml:"number,omitempty"`
58+
}
59+
60+
type QueueInformationTypeI struct {
61+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A QueueInformationTypeI"`
62+
63+
// queue identification
64+
QueueDetails *QueueInformationDetailsTypeI `xml:"queueDetails,omitempty"`
65+
}
66+
67+
type ReservationControlInformationDetailsTypeI struct {
68+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A ReservationControlInformationDetailsTypeI"`
69+
70+
// contains the record locator to be queue placed
71+
ControlNumber formats.AlphaNumericString_Length1To8 `xml:"controlNumber,omitempty"`
72+
}
73+
74+
type ReservationControlInformationTypeI struct {
75+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A ReservationControlInformationTypeI"`
76+
77+
// contains the record locator
78+
Reservation *ReservationControlInformationDetailsTypeI `xml:"reservation,omitempty"`
79+
}
80+
81+
type SelectionDetailsInformationTypeI struct {
82+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A SelectionDetailsInformationTypeI"`
83+
84+
// to specify if noramal or delay queue
85+
Option formats.AlphaNumericString_Length1To3 `xml:"option,omitempty"`
86+
}
87+
88+
type SelectionDetailsTypeI struct {
89+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A SelectionDetailsTypeI"`
90+
91+
// specify queue type
92+
SelectionDetails *SelectionDetailsInformationTypeI `xml:"selectionDetails,omitempty"`
93+
}
94+
95+
type SourceTypeDetailsTypeI struct {
96+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A SourceTypeDetailsTypeI"`
97+
98+
// to define if own office or different office being targetted
99+
SourceQualifier1 formats.AlphaNumericString_Length1To3 `xml:"sourceQualifier1,omitempty"`
100+
}
101+
102+
type StructuredDateTimeInformationType struct {
103+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A StructuredDateTimeInformationType"`
104+
105+
// used to select the date range
106+
TimeMode formats.NumericInteger_Length1To1 `xml:"timeMode,omitempty"`
107+
108+
// Convey date and/or time.
109+
DateTime *StructuredDateTimeType `xml:"dateTime,omitempty"`
110+
}
111+
112+
type StructuredDateTimeType struct {
113+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A StructuredDateTimeType"`
114+
115+
// Year number. The format is a little long for short term usage but it can be reduced by implementation if required.
116+
Year formats.Year_YYYY `xml:"year,omitempty"`
117+
118+
// Month number in the year ( begins to 1 )
119+
Month formats.Month_mM `xml:"month,omitempty"`
120+
121+
// Day number in the month ( begins to 1 )
122+
Day formats.Day_nN `xml:"day,omitempty"`
123+
124+
// Hour between 0 and 23
125+
Hour formats.Hour_hH `xml:"hour,omitempty"`
126+
}
127+
128+
type SubQueueInformationDetailsTypeI struct {
129+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A SubQueueInformationDetailsTypeI"`
130+
131+
// E for every category A for cats with items to be worked C for category number N for nickname CN for both category number and nickname numeric for date range
132+
IdentificationType formats.AlphaNumericString_Length1To3 `xml:"identificationType,omitempty"`
133+
134+
// category number
135+
ItemNumber formats.AlphaNumericString_Length1To3 `xml:"itemNumber,omitempty"`
136+
137+
// used for nickname on inbound used for category name on outbound
138+
ItemDescription formats.AlphaNumericString_Length1To35 `xml:"itemDescription,omitempty"`
139+
}
140+
141+
type SubQueueInformationTypeI struct {
142+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCQ_03_1_1A SubQueueInformationTypeI"`
143+
144+
// identifies the category or categories.
145+
SubQueueInfoDetails *SubQueueInformationDetailsTypeI `xml:"subQueueInfoDetails,omitempty"`
146+
}

requests.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
pc "github.com/tmconsulting/amadeus-ws-go/reqstructs/pnr_cancel"
88
pr "github.com/tmconsulting/amadeus-ws-go/reqstructs/pnr_retrieve"
99
ql "github.com/tmconsulting/amadeus-ws-go/reqstructs/queue_list"
10+
qpp "github.com/tmconsulting/amadeus-ws-go/reqstructs/queue_placepnr"
1011
qri "github.com/tmconsulting/amadeus-ws-go/reqstructs/queue_removeitem"
1112
sa "github.com/tmconsulting/amadeus-ws-go/reqstructs/security_authenticate"
1213
ss "github.com/tmconsulting/amadeus-ws-go/reqstructs/security_signout"
@@ -19,6 +20,7 @@ import (
1920
pl "github.com/tmconsulting/amadeus-ws-go/respstructs/pnr_list"
2021
prepl "github.com/tmconsulting/amadeus-ws-go/respstructs/pnr_reply"
2122
qlr "github.com/tmconsulting/amadeus-ws-go/respstructs/queue_list_reply"
23+
qppr "github.com/tmconsulting/amadeus-ws-go/respstructs/queue_placepnr_reply"
2224
qrir "github.com/tmconsulting/amadeus-ws-go/respstructs/queue_removeitem_reply"
2325
sar "github.com/tmconsulting/amadeus-ws-go/respstructs/security_authenticate_reply"
2426
ssr "github.com/tmconsulting/amadeus-ws-go/respstructs/security_signout_reply"
@@ -183,3 +185,16 @@ func (service *WebServicesPT) QueueRemoveItem(request *qri.QueueRemoveItem) (*qr
183185

184186
return response, nil
185187
}
188+
189+
func (service *WebServicesPT) QueuePlacePNR(request *qpp.QueuePlacePNR) (*qppr.QueuePlacePNRReply, error) {
190+
soapAction := "QUQPCQ_03_1_1A"
191+
192+
response := new(qppr.QueuePlacePNRReply)
193+
session := new(Session)
194+
err := service.client.Call(url+"/"+service.wsap+"/"+soapAction, request, response, session)
195+
if err != nil {
196+
return nil, err
197+
}
198+
199+
return response, nil
200+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
package queue_placepnr_reply
2+
3+
import (
4+
"encoding/xml"
5+
6+
"github.com/kidem/amadeus-ws-go/formats"
7+
)
8+
9+
type QueuePlacePNRReply struct {
10+
XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCR_03_1_1A Queue_PlacePNRReply"`
11+
12+
ErrorReturn *ErrorReturn `xml:"errorReturn,omitempty"`
13+
14+
// record locator
15+
RecordLocator *ReservationControlInformationTypeI `xml:"recordLocator,omitempty"`
16+
}
17+
18+
type ErrorReturn struct {
19+
20+
// returns the error code
21+
ErrorDefinition *ApplicationErrorInformationTypeI `xml:"errorDefinition,omitempty"`
22+
23+
// contains the text of the error
24+
ErrorText *FreeTextInformationType `xml:"errorText,omitempty"`
25+
}
26+
27+
type ApplicationErrorDetailTypeI struct {
28+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCR_03_1_1A ApplicationErrorDetailTypeI"`
29+
30+
// error code
31+
ErrorCode formats.AlphaNumericString_Length1To3 `xml:"errorCode,omitempty"`
32+
33+
// error category
34+
ErrorCategory formats.AlphaNumericString_Length1To3 `xml:"errorCategory,omitempty"`
35+
36+
// error code owner
37+
ErrorCodeOwner formats.AlphaNumericString_Length1To3 `xml:"errorCodeOwner,omitempty"`
38+
}
39+
40+
type ApplicationErrorInformationTypeI struct {
41+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCR_03_1_1A ApplicationErrorInformationTypeI"`
42+
43+
// error details
44+
ErrorDetails *ApplicationErrorDetailTypeI `xml:"errorDetails,omitempty"`
45+
}
46+
47+
type FreeTextDetailsType struct {
48+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCR_03_1_1A FreeTextDetailsType"`
49+
50+
// qualifier of the following text
51+
TextSubjectQualifier formats.AlphaNumericString_Length1To3 `xml:"textSubjectQualifier,omitempty"`
52+
53+
// Source Details
54+
Source formats.AlphaNumericString_Length1To3 `xml:"source,omitempty"`
55+
56+
// Encoding Informations
57+
Encoding formats.AlphaNumericString_Length1To3 `xml:"encoding,omitempty"`
58+
}
59+
60+
type FreeTextInformationType struct {
61+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCR_03_1_1A FreeTextInformationType"`
62+
63+
// contains only the qualifier.
64+
FreeTextDetails *FreeTextDetailsType `xml:"freeTextDetails,omitempty"`
65+
66+
// Free text
67+
FreeText formats.AlphaNumericString_Length1To199 `xml:"freeText,omitempty"`
68+
}
69+
70+
type ReservationControlInformationDetailsTypeI struct {
71+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCR_03_1_1A ReservationControlInformationDetailsTypeI"`
72+
73+
// contains the record locator to be queue placed
74+
ControlNumber formats.AlphaNumericString_Length1To8 `xml:"controlNumber,omitempty"`
75+
}
76+
77+
type ReservationControlInformationTypeI struct {
78+
// XMLName xml.Name `xml:"http://xml.amadeus.com/QUQPCR_03_1_1A ReservationControlInformationTypeI"`
79+
80+
// contains the record locator
81+
Reservation *ReservationControlInformationDetailsTypeI `xml:"reservation,omitempty"`
82+
}

0 commit comments

Comments
 (0)