Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add lodging id search examples #26

Merged
merged 7 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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