/// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public CheckRateRQ toCheckRateRQ()
        {
            try
            {
                CheckRateRQ checkRateRQ = new CheckRateRQ();
                checkRateRQ.rooms = new List<hotel_api_model.auto.model.BookingRoom>();

                for (int i = 0; i < this.rooms.Count; i++)
                {
                    BookingRoom bookingRoom = new BookingRoom();
                    bookingRoom.rateKey = rooms[i].rateKey;
                    bookingRoom.paxes = new List<Pax>();
                    Pax[] paxes = new Pax[this.rooms[i].details.Count];
                    for (int d = 0; d < this.rooms[i].details.Count; d++)
                    {
                        Pax pax = new Pax();
                        pax.type = rooms[i].details[d].getType() == RoomDetail.GuestType.ADULT ? SimpleTypes.HotelbedsCustomerType.AD : SimpleTypes.HotelbedsCustomerType.CH;
                        pax.age = rooms[i].details[d].getAge();
                        pax.name = rooms[i].details[d].getName();
                        pax.surname = rooms[i].details[d].getSurname();
                        paxes[d] = pax;
                    }
                    bookingRoom.paxes.AddRange(paxes);
                    checkRateRQ.rooms.Add(bookingRoom);
                }

                checkRateRQ.Validate();

                return checkRateRQ;
            }
            catch(HotelSDKException e)
            {
                throw e;
            }
        }
        public BookingRQ toBookingRQ()
        {
            BookingRQ bookingRQ = new BookingRQ();
            bookingRQ.holder = this.holder;
            bookingRQ.clientReference = this.clientReference;
            bookingRQ.remark = this.remark;
            if ( !String.IsNullOrEmpty(cardType) && !String.IsNullOrEmpty(cardNumber) && !String.IsNullOrEmpty(cardHolderName) && !String.IsNullOrEmpty(expiryDate) && cardCVC != null ||
                !String.IsNullOrEmpty(email) && !String.IsNullOrEmpty(phoneNumber))
            {
                PaymentData paymentData = new PaymentData();
                if ( !String.IsNullOrEmpty(cardType) && !String.IsNullOrEmpty(cardNumber) && !String.IsNullOrEmpty(cardHolderName) && !String.IsNullOrEmpty(expiryDate) && !String.IsNullOrEmpty(cardCVC))
                    paymentData.paymentCard = new PaymentCard() { cardType = cardType, cardNumber = cardNumber, cardHolderName = cardHolderName, expiryDate = expiryDate, cardCVC = cardCVC  };

                if (!String.IsNullOrEmpty(email) && !String.IsNullOrEmpty(phoneNumber))
                    paymentData.contactData = new PaymentContactData() { email = email, phoneNumber = phoneNumber };

                bookingRQ.paymentData = paymentData;
            }

            for(int i = 0; i < rooms.Count; i++)
            {
                BookingRoom room = new BookingRoom();
                room.rateKey = rooms[i].rateKey;
                room.paxes = new List<Pax>();
                for(int p = 0; p < rooms[i].details.Count; p++)
                {
                    Pax pax = new Pax();
                    pax.type = (rooms[i].details[p].getType() == RoomDetail.GuestType.ADULT) ? SimpleTypes.HotelbedsCustomerType.AD : SimpleTypes.HotelbedsCustomerType.CH;
                    pax.age = rooms[i].details[p].getAge();
                    pax.name = rooms[i].details[p].getName();
                    pax.surname = rooms[i].details[p].getSurname();
                    pax.roomId = rooms[i].details[p].getRoomId();
                    room.paxes.Add(pax);
                }
                bookingRQ.rooms.Add(room);
            }

            bookingRQ.Validate();

            return bookingRQ;
        }