/* * Copyright (C) 2023 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { RailSegments } from './RailSegments' import { TravelProduct } from './TravelProduct' import { RailSegmentsMapper } from './RailSegmentsMapper' import { JsonObject, JsonProperty } from 'typescript-json-serializer' import { TravelProductProperties } from './TravelProduct' @JsonObject({ constructorParams: [{}] }) export class Rail extends TravelProduct { /** * The type of route or itinerary for the Rail product, indicating the travel arrangement and pattern. Possible values are: - `MULTIPLE_DESTINATIONS` - The Rail product includes multiple destinations in its itinerary. - `ONE_WAY` - The Rail product represents a one-way journey. - `ROUNDTRIP` - The Rail product represents a roundtrip journey. */ @JsonProperty({ name: 'route_type' }) routeType: RailRouteTypeEnum @JsonProperty({ name: 'rail_segments', type: (property) => RailSegmentsMapper.getType(property), }) railSegments: Array @JsonProperty('type') readonly type = 'RAIL' public constructor(rail: RailProperties) { super({ price: rail.price, inventoryType: rail.inventoryType, inventorySource: rail.inventorySource, travelersReferences: rail.travelersReferences, payLater: rail.payLater, }) this.routeType = rail.routeType this.railSegments = rail.railSegments } } export type RailRouteTypeEnum = | 'MULTIPLE_DESTINATIONS' | 'ONE_WAY' | 'ROUND_TRIP' export interface RailProperties extends TravelProductProperties { routeType: RailRouteTypeEnum railSegments: Array }