Skip to content

Commit

Permalink
chore: add lodging id search examples (#26)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Jingzhe Huang <[email protected]>
  • Loading branch information
Simon-Wong-hjz and Simon Jingzhe Huang authored Dec 3, 2024
1 parent aaa456a commit 93888e4
Show file tree
Hide file tree
Showing 8 changed files with 882 additions and 12 deletions.
16 changes: 14 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,26 @@ Currently, the following scenarios are included:
This example demonstrates how to search for properties with a location keyword with filters
applied in Lodging Listings API.

- [`HotelIdsSearchEndToEndScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/ListingsHotelIdsSearchScenario.java):

This example demonstrates how to retrieve accessible property ids from SDP DownloadURL API and
then get the content and prices of these properties using the Lodging Listings API.

- [`QuotesQuickStartScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/QuotesQuickStartScenario.java):

This example demonstrates how to search for property quotes with property IDs in Lodging Quotes API.
This example demonstrates how to search for property quotes with property IDs in
Lodging Quotes API.

- [`VrboPropertySearchEndToEndScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboPropertySearchEndToEndScenario.java):

This example demonstrates how to retrieve accessible Vrbo property ids and location content from
SDP DownloadURL API and then get the prices of these properties using the Lodging Quotes API.

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

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

### Car

Expand Down
6 changes: 6 additions & 0 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.23.1</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.18.1</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
import com.expediagroup.sdk.xap.examples.scenarios.car.CarDetailsQuickStartScenario;
import com.expediagroup.sdk.xap.examples.scenarios.car.CarListingsQuickStartScenario;
import com.expediagroup.sdk.xap.examples.scenarios.lodging.AvailabilityCalendarsQuickStartScenario;
import com.expediagroup.sdk.xap.examples.scenarios.lodging.HotelIdsSearchEndToEndScenario;
import com.expediagroup.sdk.xap.examples.scenarios.lodging.ListingsQuickStartScenario;
import com.expediagroup.sdk.xap.examples.scenarios.lodging.QuotesQuickStartScenario;
import com.expediagroup.sdk.xap.examples.scenarios.lodging.VrboPropertySearchEndToEndScenario;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

QuotesQuickStartScenario quotesQuickStartScenario = new QuotesQuickStartScenario();
quotesQuickStartScenario.run();
HotelIdsSearchEndToEndScenario hotelIdsSearchEndToEndScenario =
new HotelIdsSearchEndToEndScenario();
hotelIdsSearchEndToEndScenario.run();

VrboPropertySearchEndToEndScenario vrboPropertySearchEndToEndScenario =
new VrboPropertySearchEndToEndScenario();
vrboPropertySearchEndToEndScenario.run();

logger.info(
"=============================== End of Lodging Scenarios ==============================");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@

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

Expand Down Expand Up @@ -56,7 +58,7 @@ public void run() {
GetLodgingAvailabilityCalendarsOperationParams.builder()
.partnerTransactionId(PARTNER_TRANSACTION_ID)
// Set of Expedia Property IDs.
.propertyIds(new HashSet<>(Arrays.asList("87704892", "12410858")))
.propertyIds(new HashSet<>(Arrays.asList("87704892", "36960201")))
.build();

XapClient xapClient = createClient();
Expand Down
Loading

0 comments on commit 93888e4

Please sign in to comment.