11# Amadeus WBS SDK
22
3+ [ ![ CircleCI] ( https://circleci.com/gh/tmconsulting/amadeus-golang-sdk/tree/temass-refactoringsts.svg?style=shield )] ( https://circleci.com/gh/tmconsulting/amadeus-golang-sdk/tree/tests ) [ ![ codecov] ( https://codecov.io/gh/tmconsulting/amadeus-golang-sdk/branch/mass-refactoring/graph/badge.svg )] ( https://codecov.io/gh/tmconsulting/amadeus-golang-sdk )
4+
35This package contains structures, forms, functions and SOAP handler for Amadeus WS.
46
57## Methods implementation progress
@@ -26,6 +28,7 @@ This package contains structures, forms, functions and SOAP handler for Amadeus
2628- [ ] Queue_RemoveItem (03.1)
2729- [x] Security_Authenticate (06.1)
2830- [x] Security_SignOut (04.1)
31+ - [ ] Service_BookPriceService
2932- [x] Ticket_CreateTSTFromPricing (04.1)
3033- [ ] Ticket_CreditCardCheck (06.1)
3134- [x] Ticket_DeleteTST (04.1)
@@ -36,47 +39,51 @@ This package contains structures, forms, functions and SOAP handler for Amadeus
3639
3740It is go gettable and go.mod powered
3841
39- $ go get github.com/tmconsulting/amadeus-golang-sdk@latest
42+ $ go get github.com/tmconsulting/amadeus-golang-sdk@mass-refactoring
4043
4144## Usage
4245
43- Prepare log writer realisation if you need to see outgoing and incoming xmls (null logging used if nil is passed),
44- methods map that you want (and allowed by Amadeus) to run (use ` GetLatestMethodsMap() ` to use latest methods versions
45- that are implemented) and credentials to connect: url, originator, password (not in base64!). Initiate SDK and service:
46+ Prepare log writer realisation if you need to see outgoing and incoming xmls (null logging used if nil is passed).
47+ Check methods version that will be used in SDK (use ` GetLatestMethodsMap() ` to use latest methods versions that are
48+ implemented). Ыуе credentials to connect: url, originator, password (not in base64!). Initiate SDK and service and use
49+ service methods:
4650
4751``` go
4852package main
4953
5054import (
51- " log"
52-
53- " github.com/tmconsulting/amadeus-golang-sdk/logger/stdoutLogger "
54- " github.com/tmconsulting/amadeus-golang-sdk/sdk "
55- " github.com/tmconsulting/amadeus-golang-sdk/service "
55+ " log"
56+
57+ " github.com/tmconsulting/amadeus-golang-sdk/client "
58+ " github.com/tmconsulting/amadeus-golang-sdk/service "
59+ " github.com/tmconsulting/amadeus-golang-sdk/structs/commandCryptic "
5660)
5761
5862func main () {
59- url := " https://nodeD1.test.webservices.amadeus.com/1ASIWXXXXXX"
60- originator := " WSBENXXX"
61- passwordRaw := " dGhlIHBhc3N3b3Jk"
62- officeID := " BRUXX1111"
63- client := sdk. CreateAmadeusClient (url, originator, passwordRaw, officeID, stdoutLogger. Init ())
64-
65- amadeusSDK := service.NewSKD (client, service. GetLatestMethodsMap () )
66-
67- response , err := amadeusSDK .CommandCryptic (" AN20MAYMOWLED /ALH" )
68- if err != nil {
69- log. Fatalf ( " error: %v " , err)
70- }
71-
72- log.Printf (" response : %v \n " , response )
63+ url := " https://nodeD1.test.webservices.amadeus.com/1ASIWXXXXXX"
64+ originator := " WSBENXXX"
65+ passwordRaw := " dGhlIHBhc3N3b3Jk"
66+ officeID := " BRUXX1111"
67+
68+ cl := client. New (client. SetURL (url), client. SetUser (originator), client. SetPassword (passwordRaw), client. SetAgent (officeID))
69+ s := service.New (cl )
70+
71+ resp , err := s .CommandCryptic (" AN20DECMOWLED /ALH" )
72+ if err != nil {
73+ panic ( err)
74+ }
75+
76+ log.Printf (" responses : %v \n " , resp )
7377}
7478```
7579
7680## Testing
7781
78- Create test ` .env ` file from [ test.env-example] ( test.env-example ) , or run with ENV variables ` make test `
79- (or ` go test ./... -v ` )
82+ Run tests (` make test ` or ` go test ./... -v ` ) with ENV variabless:
83+ * URL
84+ * ORIGINATOR
85+ * PASSWORD_RAW
86+ * OFFICE_ID
8087
8188## Contribution
8289
0 commit comments