Skip to content

Commit 93888e4

Browse files
Simon-Wong-hjzSimon Jingzhe Huang
andauthored
chore: add lodging id search examples (#26)
Co-authored-by: Simon Jingzhe Huang <[email protected]>
1 parent aaa456a commit 93888e4

File tree

8 files changed

+882
-12
lines changed

8 files changed

+882
-12
lines changed

examples/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,26 @@ Currently, the following scenarios are included:
1717
This example demonstrates how to search for properties with a location keyword with filters
1818
applied in Lodging Listings API.
1919

20+
- [`HotelIdsSearchEndToEndScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/ListingsHotelIdsSearchScenario.java):
21+
22+
This example demonstrates how to retrieve accessible property ids from SDP DownloadURL API and
23+
then get the content and prices of these properties using the Lodging Listings API.
24+
2025
- [`QuotesQuickStartScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/QuotesQuickStartScenario.java):
2126

22-
This example demonstrates how to search for property quotes with property IDs in Lodging Quotes API.
27+
This example demonstrates how to search for property quotes with property IDs in
28+
Lodging Quotes API.
29+
30+
- [`VrboPropertySearchEndToEndScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboPropertySearchEndToEndScenario.java):
31+
32+
This example demonstrates how to retrieve accessible Vrbo property ids and location content from
33+
SDP DownloadURL API and then get the prices of these properties using the Lodging Quotes API.
2334

2435
- [
2536
`AvailabilityCalendarsQuickStartScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/AvailabilityCalendarsQuickStartScenario.java):
2637

27-
This example demonstrates how to search for availability calendars with property IDs in Lodging Availability Calendar API.
38+
This example demonstrates how to use Availability Calendar api with simple search.
39+
In terms of how to get property ids, you can refer to `QuotesQuickStartScenario.java`.
2840

2941
### Car
3042

examples/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
<artifactId>log4j-slf4j2-impl</artifactId>
6666
<version>2.23.1</version>
6767
</dependency>
68+
69+
<dependency>
70+
<groupId>com.fasterxml.jackson.core</groupId>
71+
<artifactId>jackson-databind</artifactId>
72+
<version>2.18.1</version>
73+
</dependency>
6874
</dependencies>
6975

7076
<build>

examples/src/main/java/com/expediagroup/sdk/xap/examples/XapSdkDemoTestRun.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
import com.expediagroup.sdk.xap.examples.scenarios.car.CarDetailsQuickStartScenario;
2020
import com.expediagroup.sdk.xap.examples.scenarios.car.CarListingsQuickStartScenario;
2121
import com.expediagroup.sdk.xap.examples.scenarios.lodging.AvailabilityCalendarsQuickStartScenario;
22+
import com.expediagroup.sdk.xap.examples.scenarios.lodging.HotelIdsSearchEndToEndScenario;
2223
import com.expediagroup.sdk.xap.examples.scenarios.lodging.ListingsQuickStartScenario;
23-
import com.expediagroup.sdk.xap.examples.scenarios.lodging.QuotesQuickStartScenario;
24+
import com.expediagroup.sdk.xap.examples.scenarios.lodging.VrboPropertySearchEndToEndScenario;
2425
import org.slf4j.Logger;
2526
import org.slf4j.LoggerFactory;
2627

@@ -46,8 +47,13 @@ public static void main(String[] args) {
4647
ListingsQuickStartScenario listingsQuickStartScenario = new ListingsQuickStartScenario();
4748
listingsQuickStartScenario.run();
4849

49-
QuotesQuickStartScenario quotesQuickStartScenario = new QuotesQuickStartScenario();
50-
quotesQuickStartScenario.run();
50+
HotelIdsSearchEndToEndScenario hotelIdsSearchEndToEndScenario =
51+
new HotelIdsSearchEndToEndScenario();
52+
hotelIdsSearchEndToEndScenario.run();
53+
54+
VrboPropertySearchEndToEndScenario vrboPropertySearchEndToEndScenario =
55+
new VrboPropertySearchEndToEndScenario();
56+
vrboPropertySearchEndToEndScenario.run();
5157

5258
logger.info(
5359
"=============================== End of Lodging Scenarios ==============================");

examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/AvailabilityCalendarsQuickStartScenario.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727

2828
/**
2929
* This example demonstrates how to use Availability Calendar api with simple search.
30-
* Note: this is a Vrbo scenario. You need a key that is enabled for Vrbo brand to run this.
30+
* In terms of how to get property ids, you can refer to {@link VrboPropertySearchEndToEndScenario}.
31+
*
32+
* <p>Note: this is a Vrbo scenario. You need a key that is enabled for Vrbo brand to run this.
3133
*/
3234
public class AvailabilityCalendarsQuickStartScenario implements VrboScenario {
3335

@@ -56,7 +58,7 @@ public void run() {
5658
GetLodgingAvailabilityCalendarsOperationParams.builder()
5759
.partnerTransactionId(PARTNER_TRANSACTION_ID)
5860
// Set of Expedia Property IDs.
59-
.propertyIds(new HashSet<>(Arrays.asList("87704892", "12410858")))
61+
.propertyIds(new HashSet<>(Arrays.asList("87704892", "36960201")))
6062
.build();
6163

6264
XapClient xapClient = createClient();

0 commit comments

Comments
 (0)