Skip to content

Commit 6fe865f

Browse files
dtayehgithub-actions[bot]
authored andcommitted
chore: Publish v5.3.2+ads-SNAPSHOT
1 parent f81e57c commit 6fe865f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1779
-263
lines changed

code/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<dependency>
66
<groupId>com.expediagroup</groupId>
77
<artifactId>rapid-sdk</artifactId>
8-
<version>5.3.2</version>
8+
<version>5.3.2+ads-SNAPSHOT</version>
99
</dependency>
1010
```
1111

code/pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.expediagroup</groupId>
66
<artifactId>rapid-sdk</artifactId>
7-
<version>5.3.2</version>
7+
<version>5.3.2+ads-SNAPSHOT</version>
88
<name>EG rapid-sdk for Java</name>
9-
<description>EG rapid-sdk v5.3.2</description>
9+
<description>EG rapid-sdk v5.3.2+ads-SNAPSHOT</description>
1010
<url>https://github.com/ExpediaGroup/test-sdk</url>
1111
<inceptionYear>2022</inceptionYear>
1212
<packaging>jar</packaging>
@@ -63,7 +63,7 @@
6363
<sdk-title>${project.artifactId}</sdk-title>
6464

6565
<!-- Plugin Versions -->
66-
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
66+
<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
6767
<maven-dependency-plugin.version>3.8.1</maven-dependency-plugin.version>
6868
<maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
6969
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
@@ -79,9 +79,9 @@
7979
<properties.maven.plugin.version>1.2.1</properties.maven.plugin.version>
8080
<maven.licence.plugin.version>4.6</maven.licence.plugin.version>
8181
<flatten.maven.plugin.version>1.6.0</flatten.maven.plugin.version>
82-
<kotlin.version>2.1.0</kotlin.version>
82+
<kotlin.version>2.1.10</kotlin.version>
8383
<kotlinx.coroutines.version>1.10.1</kotlinx.coroutines.version>
84-
<ktor.version>3.0.3</ktor.version>
84+
<ktor.version>3.1.1</ktor.version>
8585
<kotlin-atomic.version>0.27.0</kotlin-atomic.version>
8686
<slf4j.version>2.0.16</slf4j.version>
8787
<maven.nexus-staging.plugin.version>1.7.0</maven.nexus-staging.plugin.version>
@@ -131,7 +131,7 @@
131131
<dependency>
132132
<groupId>com.fasterxml.jackson</groupId>
133133
<artifactId>jackson-bom</artifactId>
134-
<version>2.18.2</version>
134+
<version>2.18.3</version>
135135
<type>pom</type>
136136
<scope>import</scope>
137137
</dependency>
@@ -153,7 +153,7 @@
153153
<dependency>
154154
<groupId>com.fasterxml.jackson.core</groupId>
155155
<artifactId>jackson-annotations</artifactId>
156-
<version>2.18.2</version>
156+
<version>2.18.3</version>
157157
</dependency>
158158
</dependencies>
159159
</dependencyManagement>

code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/LogMaskingRegexProvider.kt

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,38 @@
1616
package com.expediagroup.sdk.core.constant.provider
1717

1818
internal object LogMaskingRegexProvider {
19+
/**
20+
* Generates a regex pattern to match specified fields in a JSON string.
21+
*
22+
* @param maskedBodyFields the set of fields to be masked
23+
* @param valueToMatch regex pattern to match the value of the fields. Default: match any sequence of characters except double quotes.
24+
* @return the regex pattern to match the specified fields and their values
25+
*/
1926
fun getMaskedFieldsRegex(
2027
maskedBodyFields: Set<String>,
21-
value: String = "[^\\\"]+"
28+
valueToMatch: String = "[^\\\"]+"
2229
): Regex {
2330
val fields = maskedBodyFields.joinToString("|")
24-
return "\"($fields)(\\\\*\"\\s*:\\s*\\\\*\")$value(?:\\\\?\"|)".toRegex()
31+
// The pattern matches:
32+
// - The field name (one of the specified fields) captured in group 1.
33+
// - Optional backslash, closing double quotes, colon(:), optional whitespace, and opening double quotes.
34+
// - The value of the field, matching the specified valueToMatch pattern.
35+
// - Optional backslash, followed by a closing double quote
36+
return "\"($fields)(\\\\?\"\\s*:\\s*\\\\*\")$valueToMatch(?:\\\\?\")".toRegex()
2537
}
2638

39+
/**
40+
* Generates a regex pattern to match a specified field in a JSON string.
41+
*
42+
* @param maskedBodyField the field to be masked
43+
* @param valueToMatch regex pattern to match the value of the field. Default: match any sequence of characters except double quotes.
44+
* @return the regex pattern to match the specified field and its value
45+
*/
2746
fun getMaskedFieldsRegex(
2847
maskedBodyField: String,
29-
value: String = "[^\\\"]+"
48+
valueToMatch: String = "[^\\\"]+"
3049
): Regex {
3150
val fields = setOf(maskedBodyField)
32-
return getMaskedFieldsRegex(fields, value)
51+
return getMaskedFieldsRegex(fields, valueToMatch)
3352
}
3453
}

code/src/main/kotlin/com/expediagroup/sdk/rapid/client/RapidClient.kt

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ import com.expediagroup.sdk.rapid.operations.DeleteRoomOperation
4242
import com.expediagroup.sdk.rapid.operations.DeleteRoomOperationParams
4343
import com.expediagroup.sdk.rapid.operations.GetAdditionalAvailabilityOperation
4444
import com.expediagroup.sdk.rapid.operations.GetAdditionalAvailabilityOperationParams
45+
import com.expediagroup.sdk.rapid.operations.GetAdsOperation
46+
import com.expediagroup.sdk.rapid.operations.GetAdsOperationParams
4547
import com.expediagroup.sdk.rapid.operations.GetAvailabilityOperation
4648
import com.expediagroup.sdk.rapid.operations.GetAvailabilityOperationParams
4749
import com.expediagroup.sdk.rapid.operations.GetBookingReceiptOperation
@@ -896,6 +898,107 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat
896898
}
897899
}
898900

901+
/**
902+
*
903+
* Returns relevant ads.
904+
* @param operation [GetAdsOperation]
905+
* @throws ExpediaGroupApiErrorException
906+
* @return a [Response] object with a body of type AdsResponse
907+
*/
908+
fun execute(operation: GetAdsOperation): Response<AdsResponse> = execute<AdsRequest, AdsResponse>(operation)
909+
910+
/**
911+
*
912+
* Returns relevant ads.
913+
* @param operation [GetAdsOperation]
914+
* @throws ExpediaGroupApiErrorException
915+
* @return a [CompletableFuture<Response>] object with a body of type AdsResponse
916+
*/
917+
fun executeAsync(operation: GetAdsOperation): CompletableFuture<Response<AdsResponse>> = executeAsync<AdsRequest, AdsResponse>(operation)
918+
919+
private suspend inline fun kgetAdsWithResponse(
920+
customerId: kotlin.String,
921+
customerIp: kotlin.String? =
922+
null,
923+
customerSessionId: kotlin.String? =
924+
null,
925+
adsRequest: AdsRequest? =
926+
null
927+
): Response<AdsResponse> {
928+
val params =
929+
GetAdsOperationParams(
930+
customerIp = customerIp,
931+
customerSessionId = customerSessionId,
932+
customerId = customerId
933+
)
934+
935+
val operation =
936+
GetAdsOperation(
937+
params,
938+
adsRequest
939+
)
940+
941+
return execute(operation)
942+
}
943+
944+
/**
945+
*
946+
* Returns relevant ads.
947+
* @param customerId An obfuscated unique identifier for each customer. This should not contain any personal information such as email, first or last name.
948+
* @param customerIp IP address of the customer, as captured by your integration. Ensure your integration passes the customer's IP, not your own. Used for fraud recovery and other important analytics. (optional)
949+
* @param customerSessionId Insert your own unique value for each user session, beginning with the first API call. Continue to pass the same value for each subsequent API call during the user's session, using a new value for every new customer session. (optional)
950+
* @param adsRequest (optional)
951+
* @throws ExpediaGroupApiErrorException
952+
* @return AdsResponse
953+
*/
954+
@Throws(
955+
ExpediaGroupApiErrorException::class
956+
)
957+
@JvmOverloads
958+
@Deprecated("Use execute method instead", ReplaceWith("execute(operation: GetAdsOperation)"))
959+
fun getAds(
960+
customerId: kotlin.String,
961+
customerIp: kotlin.String? =
962+
null,
963+
customerSessionId: kotlin.String? =
964+
null,
965+
adsRequest: AdsRequest? =
966+
null
967+
): AdsResponse = getAdsWithResponse(customerId, customerIp, customerSessionId, adsRequest).data
968+
969+
/**
970+
*
971+
* Returns relevant ads.
972+
* @param customerId An obfuscated unique identifier for each customer. This should not contain any personal information such as email, first or last name.
973+
* @param customerIp IP address of the customer, as captured by your integration. Ensure your integration passes the customer's IP, not your own. Used for fraud recovery and other important analytics. (optional)
974+
* @param customerSessionId Insert your own unique value for each user session, beginning with the first API call. Continue to pass the same value for each subsequent API call during the user's session, using a new value for every new customer session. (optional)
975+
* @param adsRequest (optional)
976+
* @throws ExpediaGroupApiErrorException
977+
* @return a [Response] object with a body of type AdsResponse
978+
*/
979+
@Throws(
980+
ExpediaGroupApiErrorException::class
981+
)
982+
@JvmOverloads
983+
@Deprecated("Use execute method instead", ReplaceWith("execute(operation: GetAdsOperation)"))
984+
fun getAdsWithResponse(
985+
customerId: kotlin.String,
986+
customerIp: kotlin.String? =
987+
null,
988+
customerSessionId: kotlin.String? =
989+
null,
990+
adsRequest: AdsRequest? =
991+
null
992+
): Response<AdsResponse> {
993+
try {
994+
return GlobalScope.future(Dispatchers.IO) {
995+
kgetAdsWithResponse(customerId, customerIp, customerSessionId, adsRequest)
996+
}.get()
997+
} catch (exception: Exception) {
998+
exception.handle()
999+
}
1000+
}
1001+
8991002
/**
9001003
* Get property room rates and availability
9011004
* Returns rates on available room types for specified properties (maximum of 250 properties per request). The response includes rate details such as promos, whether the rate is refundable, cancellation penalties and a full price breakdown to meet the price display requirements for your market. _Note_: If there are no available rooms, the response will be an empty array. * Multiple rooms of the same type may be requested by including multiple instances of the `occupancy` parameter. * The `nightly` array includes each individual night's charges. When the total price includes fees, charges, or adjustments that are not divided by night, these amounts will be included in the `stay` rate array, which details charges applied to the entire stay (each check-in).

0 commit comments

Comments
 (0)