Skip to content

Commit

Permalink
chore: update code to v4.1.3 (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
anssari1 committed Jul 4, 2024
1 parent c32e218 commit 20ee8c9
Show file tree
Hide file tree
Showing 54 changed files with 52 additions and 86 deletions.
4 changes: 2 additions & 2 deletions code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

<groupId>com.expediagroup</groupId>
<artifactId>rapid-sdk</artifactId>
<version>4.1.2</version>
<version>4.1.3</version>
<name>EG Rapid SDK for Java</name>
<description>EG Rapid SDK v4.1.2</description>
<description>EG Rapid SDK v4.1.3</description>
<url>https://github.com/ExpediaGroup/rapid-java-sdk</url>
<inceptionYear>2022</inceptionYear>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class Operation<T>(
val method: String,
val operationId: String,
val requestBody: T?,
val params: OperationParams
val params: OperationParams?
) {
var transactionId: TransactionId = TransactionId()
private set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,23 @@ import com.expediagroup.sdk.core.constant.LoggingMessage.LOGGING_PREFIX
import org.slf4j.Logger

internal class ExpediaGroupLogger(private val logger: Logger, private val client: Client? = null) : Logger by logger {
override fun info(msg: String) = logger.info(decorate(msg))
override fun info(msg: String) {
if (logger.isInfoEnabled) {
logger.info(decorate(msg))
}
}

override fun warn(msg: String) = logger.warn(decorate(msg))
override fun warn(msg: String) {
if (logger.isWarnEnabled) {
logger.warn(decorate(msg))
}
}

override fun debug(msg: String) = logger.debug(decorate(msg))
override fun debug(msg: String) {
if (logger.isDebugEnabled) {
logger.debug(decorate(msg))
}
}

private fun decorate(msg: String): String = "$LOGGING_PREFIX ${mask(msg, getMaskedBodyFields())}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal data class LoggingConfiguration(
override val httpClientConfiguration: HttpClientConfig<out HttpClientEngineConfig>,
val maskedLoggingHeaders: Set<String>,
val maskedLoggingBodyFields: Set<String>,
val level: LogLevel = LogLevel.ALL,
val level: LogLevel = LogLevel.HEADERS,
val getLogger: (client: Client) -> Logger = createCustomLogger
) : KtorPluginConfiguration(httpClientConfiguration) {
companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat
method = HttpMethod.parse(operation.method)
url(operation.url)

operation.params.getHeaders()?.forEach { (key, value) ->
operation.params?.getHeaders()?.forEach { (key, value) ->
headers.append(key, value)
}

operation.params.getQueryParams()?.forEach { (key, value) ->
operation.params?.getQueryParams()?.forEach { (key, value) ->
url.parameters.appendAll(key, value)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import com.expediagroup.sdk.rapid.models.ChangeRoomDetailsRequest
* Change details of a room.
* @property requestBody [ChangeRoomDetailsRequest]
* @property params [ChangeRoomDetailsOperationParams]
*/
class ChangeRoomDetailsOperation(
requestBody: ChangeRoomDetailsRequest?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ package com.expediagroup.sdk.rapid.operations
import com.expediagroup.sdk.core.model.OperationParams

/**
* @property customerIp IP address of the customer, as captured by your integration.<br> Ensure your integration passes the customer's IP, not your own. This value helps determine their location and assign the correct payment gateway.<br> Also used for fraud recovery and other important analytics.
* @property itineraryId This parameter is used only to prefix the token value - no ID value is used.<br>
* @property roomId Room ID of a property.<br>
* @property token Provided as part of the link object and used to maintain state across calls. This simplifies each subsequent call by limiting the amount of information required at each step and reduces the potential for errors. Token values cannot be viewed or changed.
* @property changeRoomDetailsRequest The request body is required, but only the fields that are being changed need to be passed in. Fields that are not being changed should not be included in the request body.
* @property customerIp IP address of the customer, as captured by your integration.<br> Ensure your integration passes the customer's IP, not your own. This value helps determine their location and assign the correct payment gateway.<br> Also used for fraud recovery and other important analytics.
* @property 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.<br> Including this value greatly eases EPS's internal debugging process for issues with partner requests, as it explicitly links together request paths for individual user's session.
* @property test The change call has a test header that can be used to return set responses with the following keywords:<br> * `standard` - Requires valid test booking. * `service_unavailable` * `unknown_internal_error`
* @property token Provided as part of the link object and used to maintain state across calls. This simplifies each subsequent call by limiting the amount of information required at each step and reduces the potential for errors. Token values cannot be viewed or changed.
*/
data class ChangeRoomDetailsOperationParams(
val itineraryId: kotlin.String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import com.expediagroup.sdk.rapid.models.CommitChangeRoomRequestBody
* Commit a change of itinerary that may require additional payment or refund.
* @property requestBody [CommitChangeRoomRequestBody]
* @property params [CommitChangeOperationParams]
*/
class CommitChangeOperation(
requestBody: CommitChangeRoomRequestBody?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ package com.expediagroup.sdk.rapid.operations
import com.expediagroup.sdk.core.model.OperationParams

/**
* @property customerIp IP address of the customer, as captured by your integration. Send IPV4 addresses only.<br> Ensure your integration passes the customer's IP, not your own. This value helps determine their location and assign the correct payment gateway.<br> Also used for fraud recovery and other important analytics.
* @property itineraryId This parameter is used only to prefix the token value - no ID value is used.<br>
* @property roomId Room ID of a property.<br>
* @property token Provided as part of the link object and used to maintain state across calls. This simplifies each subsequent call by limiting the amount of information required at each step and reduces the potential for errors. Token values cannot be viewed or changed.
* @property customerIp IP address of the customer, as captured by your integration. Send IPV4 addresses only.<br> Ensure your integration passes the customer's IP, not your own. This value helps determine their location and assign the correct payment gateway.<br> Also used for fraud recovery and other important analytics.
* @property 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.<br> Including this value greatly eases EPS's internal debugging process for issues with partner requests, as it explicitly links together request paths for individual user's session.
* @property test The change call has a test header that can be used to return set responses with the following keywords:<br> * `standard` - Requires valid test booking. * `service_unavailable` * `unknown_internal_error`
* @property commitChangeRoomRequestBody The request body is required if additional payment is necessary. The body can optionally contain the `change_reference_id`.
* @property token Provided as part of the link object and used to maintain state across calls. This simplifies each subsequent call by limiting the amount of information required at each step and reduces the potential for errors. Token values cannot be viewed or changed.
*/
data class CommitChangeOperationParams(
val itineraryId: kotlin.String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.expediagroup.sdk.core.model.Operation
/**
* Cancel Held Booking
* @property params [DeleteHeldBookingOperationParams]
*/
class DeleteHeldBookingOperation(
params: DeleteHeldBookingOperationParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ package com.expediagroup.sdk.rapid.operations
import com.expediagroup.sdk.core.model.OperationParams

/**
* @property customerIp IP address of the customer, as captured by your integration.<br> Ensure your integration passes the customer's IP, not your own. This value helps determine their location and assign the correct payment gateway.<br> Also used for fraud recovery and other important analytics.
* @property itineraryId This parameter is used only to prefix the token value - no ID value is used.<br>
* @property token Provided as part of the link object and used to maintain state across calls. This simplifies each subsequent call by limiting the amount of information required at each step and reduces the potential for errors. Token values cannot be viewed or changed.
* @property customerIp IP address of the customer, as captured by your integration.<br> Ensure your integration passes the customer's IP, not your own. This value helps determine their location and assign the correct payment gateway.<br> Also used for fraud recovery and other important analytics.
* @property 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.<br> Including this value greatly eases EPS's internal debugging process for issues with partner requests, as it explicitly links together request paths for individual user's session.
* @property test The cancel call has a test header that can be used to return set responses with the following keywords:<br> * `standard` - Requires valid test held booking. * `service_unavailable` * `internal_server_error` * `post_stay_cancel`
* @property token Provided as part of the link object and used to maintain state across calls. This simplifies each subsequent call by limiting the amount of information required at each step and reduces the potential for errors. Token values cannot be viewed or changed.
*/
data class DeleteHeldBookingOperationParams(
val itineraryId: kotlin.String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.expediagroup.sdk.core.model.Operation
/**
* Cancel a room.
* @property params [DeleteRoomOperationParams]
*/
class DeleteRoomOperation(
params: DeleteRoomOperationParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ package com.expediagroup.sdk.rapid.operations
import com.expediagroup.sdk.core.model.OperationParams

/**
* @property customerIp IP address of the customer, as captured by your integration.<br> Ensure your integration passes the customer's IP, not your own. This value helps determine their location and assign the correct payment gateway.<br> Also used for fraud recovery and other important analytics.
* @property itineraryId This parameter is used only to prefix the token value - no ID value is used.<br>
* @property roomId Room ID of a property.<br>
* @property token Provided as part of the link object and used to maintain state across calls. This simplifies each subsequent call by limiting the amount of information required at each step and reduces the potential for errors. Token values cannot be viewed or changed.
* @property customerIp IP address of the customer, as captured by your integration.<br> Ensure your integration passes the customer's IP, not your own. This value helps determine their location and assign the correct payment gateway.<br> Also used for fraud recovery and other important analytics.
* @property 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.<br> Including this value greatly eases EPS's internal debugging process for issues with partner requests, as it explicitly links together request paths for individual user's session.
* @property test The cancel call has a test header that can be used to return set responses with the following keywords:<br> * `standard` - Requires valid test booking. * `service_unavailable` * `unknown_internal_error` * `post_stay_cancel`
* @property token Provided as part of the link object and used to maintain state across calls. This simplifies each subsequent call by limiting the amount of information required at each step and reduces the potential for errors. Token values cannot be viewed or changed.
*/
data class DeleteRoomOperationParams(
val itineraryId: kotlin.String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.expediagroup.sdk.core.model.Operation
/**
* Get additional property room rates and availability
* @property params [GetAdditionalAvailabilityOperationParams]
*/
class GetAdditionalAvailabilityOperation(
params: GetAdditionalAvailabilityOperationParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import com.expediagroup.sdk.core.model.OperationParams

/**
* @property propertyId Expedia Property ID.<br>
* @property token A hashed collection of query parameters. Used to maintain state across calls. This token is provided as part of the `additional_rates` link from the shop response, or the `shop` link on a `sold_out` price check response. It is also provided from the `shop_for_change` link on an itinerary retrieve.
* @property customerIp IP address of the customer, as captured by your integration.<br> Ensure your integration passes the customer's IP, not your own. This value helps determine their location and assign the correct payment gateway.<br> Also used for fraud recovery and other important analytics.
* @property 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.<br> Including this value greatly eases EPS's internal debugging process for issues with partner requests, as it explicitly links together request paths for individual user's session.
* @property test Shop calls have a test header that can be used to return set responses with the following keywords:<br> * `standard` * `service_unavailable` * `unknown_internal_error` * `no_availability` * `forbidden`
* @property token A hashed collection of query parameters. Used to maintain state across calls. This token is provided as part of the `additional_rates` link from the shop response, or the `shop` link on a `sold_out` price check response. It is also provided from the `shop_for_change` link on an itinerary retrieve.
* @property checkin Check-in date, in ISO 8601 format (YYYY-MM-DD). This can be up to 365 days in the future. Some partner configurations may extend this up to 500 days.<br> Note: Only needed for hard change if desired check-in date is different than original booking. If specified must also specify `checkout`.
* @property checkout Check-out date, in ISO 8601 format (YYYY-MM-DD). Total length of stay cannot exceed 28 nights or 365 nights depending on Vacation Rental configurations.<br> Note: Only needed for hard change if desired check-out date is different than original booking. If specified must also specify `checkin`.<br>
* @property exclusion Single exclusion type. Send multiple instances of this parameter to request multiple exclusions.<br> Note: Optional parameter for use with hard change requests. <br> * `refundable_damage_deposit` - Excludes rates with refundable damage deposits from the response.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import com.expediagroup.sdk.core.model.Operation

/**
* Get property room rates and availability
* @property params [GetAvailabilityOperationParams]
*/
class GetAvailabilityOperation(
params: GetAvailabilityOperationParams
Expand Down
Loading

0 comments on commit 20ee8c9

Please sign in to comment.