Skip to content

Commit

Permalink
Merge branch 'main' into EWS-38452-ActivitySDK
Browse files Browse the repository at this point in the history
  • Loading branch information
v-bfeng committed Jan 27, 2025
2 parents 4b6bfef + 6dbfc00 commit cf21852
Show file tree
Hide file tree
Showing 62 changed files with 7,193 additions and 51 deletions.
5 changes: 3 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# dependabot configuration available at: https://docs.github.com/en/code-security/dependabot
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand All @@ -15,7 +14,9 @@ updates:
- Dependabot

- package-ecosystem: maven
directory: "/code"
directories:
- "/examples"
- "/tests/integration"
schedule:
interval: daily
time: "11:30"
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/generate-and-publish-sdk-sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ on:

jobs:
generate-and-publish-sources:
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-full-workflow.yaml@v20241126
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-full-workflow.yaml@v20241217
secrets: inherit
with:
name: xap
version: ${{ inputs.version }}
transformations: "--headers key --operationIdsToTags"
repository: 'ExpediaGroup/xap-java-sdk'
ref: ${{ github.head_ref || github.ref_name }}
repository: 'ExpediaGroup/xap-java-sdk'
sdk_repo_ref: 'v20241217'
transformations: '--headers key --operationIdsToTags'
version: ${{ inputs.version }}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
mvn clean install
- name: Run Integration Tests
working-directory: sdk-repo/integrations
working-directory: sdk-repo/tests/integration
run: |
mvn verify \
-Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/release-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,19 @@ on:
default: ''

jobs:
run-examples:
integration-tests:
strategy:
matrix:
jdk: [ 8, 11, 17, 21 ]
uses: ./.github/workflows/run-examples.yaml
secrets: inherit
with:
branch: ${{ inputs.branch }}
jdk: ${{ matrix.jdk }}

integration-test:
strategy:
matrix:
jdk: [ 8, 11, 17, 21 ]
uses: ./.github/workflows/integration-test.yaml
uses: ./.github/workflows/integration-tests.yaml
secrets: inherit
with:
branch: ${{ inputs.branch }}
jdk: ${{ matrix.jdk }}

release-sdk:
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-release-sdk.yaml@v20241126
needs: [ run-examples ]
uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-release-sdk.yaml@v20241217
needs: [ integration-tests ]
secrets: inherit
with:
branch: ${{ inputs.branch }}
60 changes: 60 additions & 0 deletions .github/workflows/verify-examples-and-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Verify Examples and Integration Tests
on:
pull_request:
branches:
- 'main'
jobs:
detect-changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
examples: ${{ steps.filter.outputs.examples }}
integration-tests: ${{ steps.filter.outputs.integration-tests }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
examples:
- 'examples/**'
integration-tests:
- 'tests/integration/**'
verify-examples:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.examples == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: verify examples
working-directory: examples
run: |
mvn verify \
-Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \
-Dcom.expediagroup.xapjavasdk.apisecret="${{ secrets.API_SECRET }}" \
-Dcom.expediagroup.xapjavasdk.vrbokey="${{ secrets.VRBO_KEY }}" \
-Dcom.expediagroup.xapjavasdk.vrbosecret="${{ secrets.VRBO_SECRET }}" \
verify-integration-tests:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.integration-tests == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: verify integration tests
working-directory: tests/integration
run: |
mvn verify \
-Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \
-Dcom.expediagroup.xapjavasdk.apisecret="${{ secrets.API_SECRET }}" \
-Dcom.expediagroup.xapjavasdk.vrbokey="${{ secrets.VRBO_KEY }}" \
-Dcom.expediagroup.xapjavasdk.vrbosecret="${{ secrets.VRBO_SECRET }}"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and less on the technical details of the API.
You can find code examples for multiple use cases in the [examples](examples) directory.

### Integration Tests
Integration tests are placed in the [integrations](integrations) directory.
Integration tests are placed in the [integrations](tests/integration) directory.

---

Expand All @@ -27,4 +27,4 @@ If you have any questions or need help with XAP, please refer to the
[XAP Support](https://developers.expediagroup.com/xap/support) page.

If you experience any issues with the SDK, please raise an issue on the
[GitHub repository](https://github.com/ExpediaGroup/xap-java-sdk/issues).
[GitHub repository](https://github.com/ExpediaGroup/xap-java-sdk/issues).
2 changes: 1 addition & 1 deletion code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<dependency>
<groupId>com.expediagroup</groupId>
<artifactId>xap-sdk</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
</dependency>
```

Expand Down
14 changes: 7 additions & 7 deletions code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.expediagroup</groupId>
<artifactId>xap-sdk</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
<name>EG xap-sdk for Java</name>
<description>EG xap-sdk v1.0.0</description>
<description>EG xap-sdk v1.1.0</description>
<url>https://github.com/ExpediaGroup/test-sdk</url>
<inceptionYear>2022</inceptionYear>
<packaging>jar</packaging>
Expand Down Expand Up @@ -82,7 +82,7 @@
<kotlin.version>2.0.21</kotlin.version>
<kotlinx.coroutines.version>1.9.0</kotlinx.coroutines.version>
<ktor.version>2.3.13</ktor.version>
<kotlin-atomic.version>0.26.0</kotlin-atomic.version>
<kotlin-atomic.version>0.26.1</kotlin-atomic.version>
<slf4j.version>2.0.16</slf4j.version>
<maven.nexus-staging.plugin.version>1.7.0</maven.nexus-staging.plugin.version>
<maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
Expand Down Expand Up @@ -131,7 +131,7 @@
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.18.1</version>
<version>2.18.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -153,7 +153,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.18.1</version>
<version>2.18.2</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -744,13 +744,13 @@
<dependency>
<groupId>com.ebay.ejmask</groupId>
<artifactId>ejmask-api</artifactId>
<version>1.0.3</version>
<version>1.3.0</version>
</dependency>

<dependency>
<groupId>com.ebay.ejmask</groupId>
<artifactId>ejmask-extensions</artifactId>
<version>1.0.3</version>
<version>1.3.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ abstract class BaseRapidClient(
private val engine: HttpClientEngine =
_configurationProvider.okHttpClient?.let {
OkHttp.create {
preconfigured = it
config {
preconfigured = it
dispatcher(it.dispatcher)
}
}
} ?: httpClientEngine

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ abstract class BaseXapClient(
private val engine: HttpClientEngine =
_configurationProvider.okHttpClient?.let {
OkHttp.create {
preconfigured = it
config {
preconfigured = it
dispatcher(it.dispatcher)
}
}
} ?: httpClientEngine

Expand Down
47 changes: 47 additions & 0 deletions code/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ import com.expediagroup.sdk.xap.models.*
import com.expediagroup.sdk.xap.models.exception.ErrorObjectMapper
import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiAPIGatewayErrorException
import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiAPIMErrorException
import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiActivitiesErrorsException
import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiCarsErrorsException
import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiErrorsException
import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiLodgingErrorsException
import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiPresignedUrlResponseException
import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiSdpAPIMErrorException
import com.expediagroup.sdk.xap.operations.GetActivityDetailsOperation
import com.expediagroup.sdk.xap.operations.GetActivityListingsOperation
import com.expediagroup.sdk.xap.operations.GetCarDetailsOperation
import com.expediagroup.sdk.xap.operations.GetCarsListingsOperation
import com.expediagroup.sdk.xap.operations.GetFeedDownloadUrlOperation
Expand Down Expand Up @@ -154,6 +157,50 @@ class XapClient private constructor(clientConfiguration: XapClientConfiguration)
}
}

/**
*
* The Activity Details API provides detailed information about one selected activity.
* @param operation [GetActivityDetailsOperation]
* @throws ExpediaGroupApiActivitiesErrorsException
* @throws ExpediaGroupApiAPIMErrorException
* @throws ExpediaGroupApiException
* @return a [Response] object with a body of type ActivityDetailsResponse
*/
fun execute(operation: GetActivityDetailsOperation): Response<ActivityDetailsResponse> = execute<Nothing, ActivityDetailsResponse>(operation)

/**
*
* The Activity Details API provides detailed information about one selected activity.
* @param operation [GetActivityDetailsOperation]
* @throws ExpediaGroupApiActivitiesErrorsException
* @throws ExpediaGroupApiAPIMErrorException
* @throws ExpediaGroupApiException
* @return a [CompletableFuture<Response>] object with a body of type ActivityDetailsResponse
*/
fun executeAsync(operation: GetActivityDetailsOperation): CompletableFuture<Response<ActivityDetailsResponse>> = executeAsync<Nothing, ActivityDetailsResponse>(operation)

/**
*
* The Activities Search API allows partners to search for Expedia Activity inventory.
* @param operation [GetActivityListingsOperation]
* @throws ExpediaGroupApiActivitiesErrorsException
* @throws ExpediaGroupApiAPIMErrorException
* @throws ExpediaGroupApiException
* @return a [Response] object with a body of type ActivityListingsResponse
*/
fun execute(operation: GetActivityListingsOperation): Response<ActivityListingsResponse> = execute<Nothing, ActivityListingsResponse>(operation)

/**
*
* The Activities Search API allows partners to search for Expedia Activity inventory.
* @param operation [GetActivityListingsOperation]
* @throws ExpediaGroupApiActivitiesErrorsException
* @throws ExpediaGroupApiAPIMErrorException
* @throws ExpediaGroupApiException
* @return a [CompletableFuture<Response>] object with a body of type ActivityListingsResponse
*/
fun executeAsync(operation: GetActivityListingsOperation): CompletableFuture<Response<ActivityListingsResponse>> = executeAsync<Nothing, ActivityListingsResponse>(operation)

/**
* Get Extended information with a single car offer
* Extended information about the rates, charges, fees, and other terms associated with a single car offer.
Expand Down
Loading

0 comments on commit cf21852

Please sign in to comment.