Retrieves a geographic Region.
A RegionResponse containing the requested Region.
The GetRegion - Method is used to query a Region entity. A Region represents a geographic area which itself can contain Regions or Locations. In most cases, you will want to use a Region to narrow down to or specify a rental location.
To comprehend the responsibility of a Region within the complete car rental process, it may be helpful to imagine the regional structure as a tree-node-like datastructure:
Keeping this visualization in mind, a Region may have a parent region and a root region. The root region is the topmost (aka first-level, country level) region. In consequence, a Region also may contain one or more child regions. This way, a tree-node-like datastructure (composite) is designed.
Moreover, it is important to know that a Region may have assigned one or more Locations. a Location is a physical geographic point which represents a car rental facility or office. If a Region has Locations assigned, you may use the GetLocations - Method using this region to aquire all assigned locations.
As a result, a Region has two major reponsibilities within the complete car rental process:
Once you have found a region having locations assigned, you may use this region directly to request Rates (using GetRates - Method). This way, you can query rates for a whole region instead of querying for a specific location. This functionality has major advantages and affects the complete car rental process.
For a detailed discussion about this regional rate query principle, see CarRentalAgentService SDK - Reference Manual
Use Case Scenario | Resolution Path |
---|---|
You want to check and obtain a region for an Airport, because the user has entered his destination airport where he wants a car rental. |
|
parameters | GetRegionP1 | GetRegionP2 |
---|---|---|
token | required | required |
id | required | not applicable |
airportCode | not applicable | required |
languageCode | optional | optional |
withChilds | obsolete | obsolete |
Description : | This variant returns the region identified by the given id. | This variant returns the region identified by the given airportCode. |
Error Code | Description |
---|---|
E_INTERNAL_SERVICE | An internal service error occured during the process. |
E_TICKET_TOKEN_INVALID | The provided token is invalid. This error occurs if:
|
E_REGION_NOT_FOUND | The requested region cannot be found. This error occurs if:
|
E_AIRPORT_NOT_FOUND | The associated airport for specified airport code was not found. |
E_REQUEST_AMBIGIOUS | The performed request ambigious. This error occurs if:
|
E_REQUEST_INVALID | The performed request is invalid or malformed. |
Warning Code | Description |
---|---|
W_LANGUAGE_NOT_SUPPORTED | The requested language code is not supported for localization. Using default language instead. |
Example: Loading a Region with Id 96 (Bavaria) with all child regions and in dutch language.
[C#]
RegionRequest rq = new RegionRequest();
rq.Ticket = this.serviceTicket;
rq.Operation.Target = OperationTarget.Test;
rq.Id = 96;
rq.LanguageCode = "NL";
rq.WithChilds = true;
RegionResponse rs = this.service.GetRegion(rq);
Region bavaria = rs.Region;
CarRentalAgentService Class | SunnyCars.Services.Osi.WsReservation Namespace