Skip to content

Commit

Permalink
chore: update code to v4.2.0 (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
anssari1 committed Jul 4, 2024
1 parent 20ee8c9 commit 2600b8c
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 7 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.3</version>
<version>4.2.0</version>
<name>EG Rapid SDK for Java</name>
<description>EG Rapid SDK v4.1.3</description>
<description>EG Rapid SDK v4.2.0</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 @@ -1923,6 +1923,8 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat
propertyId: kotlin.String,
language: kotlin.String,
customerSessionId: kotlin.String? = null,
filter: kotlin.collections.List<kotlin.String>? = null,
tripReason: kotlin.collections.List<kotlin.String>? = null,
billingTerms: kotlin.String? = null,
paymentTerms: kotlin.String? = null,
partnerPointOfSale: kotlin.String? = null,
Expand All @@ -1933,6 +1935,8 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat
propertyId = propertyId,
customerSessionId = customerSessionId,
language = language,
filter = filter,
tripReason = tripReason,
billingTerms = billingTerms,
paymentTerms = paymentTerms,
partnerPointOfSale = partnerPointOfSale,
Expand All @@ -1953,6 +1957,8 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat
* @param propertyId Expedia Property ID.<br>
* @param language Desired language for the response as a subset of BCP47 format that only uses hyphenated pairs of two-digit language and country codes. Use only ISO 639-1 alpha-2 language codes and ISO 3166-1 alpha-2 country codes. See [https://www.w3.org/International/articles/language-tags/](https://www.w3.org/International/articles/language-tags/) Language Options: [https://developers.expediagroup.com/docs/rapid/resources/reference/language-options](https://developers.expediagroup.com/docs/rapid/resources/reference/language-options)
* @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.<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. (optional)
* @param filter Single filter value. Send multiple instances of this parameter to request multiple filters. * `language` - Filters reviews to only those that match the specified `language` parameter value. Without this filter, the matching language will be preferred, but other language results can be returned. Specifying this filter could produce an error when there are no matching results. (optional)
* @param tripReason Desired reason provided for the reviewer's trip that you wish to display. This parameter can be supplied multiple times with different values, which will include reviews that match any of the requested trip reasons. (optional)
* @param billingTerms This parameter is to specify the terms of how a resulting booking should be billed. If this field is needed, the value for this will be provided to you separately. (optional)
* @param paymentTerms This parameter is to specify what terms should be used when being paid for a resulting booking. If this field is needed, the value for this will be provided to you separately. (optional)
* @param partnerPointOfSale This parameter is to specify what point of sale is being used to shop and book. If this field is needed, the value for this will be provided to you separately. (optional)
Expand All @@ -1967,12 +1973,14 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat
propertyId: kotlin.String,
language: kotlin.String,
customerSessionId: kotlin.String? = null,
filter: kotlin.collections.List<kotlin.String>? = null,
tripReason: kotlin.collections.List<kotlin.String>? = null,
billingTerms: kotlin.String? = null,
paymentTerms: kotlin.String? = null,
partnerPointOfSale: kotlin.String? = null,
platformName: kotlin.String? = null
): GuestReviews {
return getPropertyGuestReviewsWithResponse(propertyId, language, customerSessionId, billingTerms, paymentTerms, partnerPointOfSale, platformName).data
return getPropertyGuestReviewsWithResponse(propertyId, language, customerSessionId, filter, tripReason, billingTerms, paymentTerms, partnerPointOfSale, platformName).data
}

/**
Expand All @@ -1981,6 +1989,8 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat
* @param propertyId Expedia Property ID.<br>
* @param language Desired language for the response as a subset of BCP47 format that only uses hyphenated pairs of two-digit language and country codes. Use only ISO 639-1 alpha-2 language codes and ISO 3166-1 alpha-2 country codes. See [https://www.w3.org/International/articles/language-tags/](https://www.w3.org/International/articles/language-tags/) Language Options: [https://developers.expediagroup.com/docs/rapid/resources/reference/language-options](https://developers.expediagroup.com/docs/rapid/resources/reference/language-options)
* @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.<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. (optional)
* @param filter Single filter value. Send multiple instances of this parameter to request multiple filters. * `language` - Filters reviews to only those that match the specified `language` parameter value. Without this filter, the matching language will be preferred, but other language results can be returned. Specifying this filter could produce an error when there are no matching results. (optional)
* @param tripReason Desired reason provided for the reviewer's trip that you wish to display. This parameter can be supplied multiple times with different values, which will include reviews that match any of the requested trip reasons. (optional)
* @param billingTerms This parameter is to specify the terms of how a resulting booking should be billed. If this field is needed, the value for this will be provided to you separately. (optional)
* @param paymentTerms This parameter is to specify what terms should be used when being paid for a resulting booking. If this field is needed, the value for this will be provided to you separately. (optional)
* @param partnerPointOfSale This parameter is to specify what point of sale is being used to shop and book. If this field is needed, the value for this will be provided to you separately. (optional)
Expand All @@ -1995,14 +2005,16 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat
propertyId: kotlin.String,
language: kotlin.String,
customerSessionId: kotlin.String? = null,
filter: kotlin.collections.List<kotlin.String>? = null,
tripReason: kotlin.collections.List<kotlin.String>? = null,
billingTerms: kotlin.String? = null,
paymentTerms: kotlin.String? = null,
partnerPointOfSale: kotlin.String? = null,
platformName: kotlin.String? = null
): Response<GuestReviews> {
try {
return GlobalScope.future(Dispatchers.IO) {
kgetPropertyGuestReviewsWithResponse(propertyId, language, customerSessionId, billingTerms, paymentTerms, partnerPointOfSale, platformName)
kgetPropertyGuestReviewsWithResponse(propertyId, language, customerSessionId, filter, tripReason, billingTerms, paymentTerms, partnerPointOfSale, platformName)
}.get()
} catch (exception: Exception) {
exception.handle()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Copyright (C) 2022 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.expediagroup.sdk.rapid.models

/*
* Copyright (C) 2022 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import com.fasterxml.jackson.annotation.JsonProperty
import javax.validation.Valid

/**
* A reply from the property management to the review left by the traveler.
* @param text The text of the management response itself.
* @param date When this management response was made, in ISO 8601 format.
*/
data class ManagementResponse(
// The text of the management response itself.
@JsonProperty("text")
@field:Valid
val text: kotlin.String? = null,
// When this management response was made, in ISO 8601 format.
@JsonProperty("date")
@field:Valid
val date: kotlin.String? = null
) {
companion object {
@JvmStatic
fun builder() = Builder()
}

class Builder(
private var text: kotlin.String? = null,
private var date: kotlin.String? = null
) {
fun text(text: kotlin.String?) = apply { this.text = text }

fun date(date: kotlin.String?) = apply { this.date = date }

fun build(): ManagementResponse {
return ManagementResponse(
text = text,
date = date
)
}
}
}
24 changes: 21 additions & 3 deletions code/src/main/kotlin/com/expediagroup/sdk/rapid/models/Review.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ import javax.validation.Valid
* @param dateSubmitted When this review was made, in ISO 8601 format.
* @param rating The rating for this property given by the reviewer. Returns a value between 1.0 and 5.0.
* @param reviewerName The name of the person who wrote this review.
* @param stayDate The year and month of the traveler's stay at the property, in ISO 8601 format (YYYY-MM).
* @param tripReason
* @param travelCompanion
* @param text The text of the review itself.
* @param managementResponses A collection of the management responses to this review.
*/
data class Review(
// Where this review has been verified from.
Expand All @@ -67,6 +69,10 @@ data class Review(
@JsonProperty("reviewer_name")
@field:Valid
val reviewerName: kotlin.String? = null,
// The year and month of the traveler's stay at the property, in ISO 8601 format (YYYY-MM).
@JsonProperty("stay_date")
@field:Valid
val stayDate: kotlin.String? = null,
@JsonProperty("trip_reason")
@field:Valid
val tripReason: TripReason? = null,
Expand All @@ -76,7 +82,11 @@ data class Review(
// The text of the review itself.
@JsonProperty("text")
@field:Valid
val text: kotlin.String? = null
val text: kotlin.String? = null,
// A collection of the management responses to this review.
@JsonProperty("management_responses")
@field:Valid
val managementResponses: kotlin.collections.List<ManagementResponse>? = null
) {
companion object {
@JvmStatic
Expand All @@ -89,9 +99,11 @@ data class Review(
private var dateSubmitted: kotlin.String? = null,
private var rating: kotlin.String? = null,
private var reviewerName: kotlin.String? = null,
private var stayDate: kotlin.String? = null,
private var tripReason: TripReason? = null,
private var travelCompanion: TravelCompanion? = null,
private var text: kotlin.String? = null
private var text: kotlin.String? = null,
private var managementResponses: kotlin.collections.List<ManagementResponse>? = null
) {
fun verificationSource(verificationSource: kotlin.String?) = apply { this.verificationSource = verificationSource }

Expand All @@ -103,22 +115,28 @@ data class Review(

fun reviewerName(reviewerName: kotlin.String?) = apply { this.reviewerName = reviewerName }

fun stayDate(stayDate: kotlin.String?) = apply { this.stayDate = stayDate }

fun tripReason(tripReason: TripReason?) = apply { this.tripReason = tripReason }

fun travelCompanion(travelCompanion: TravelCompanion?) = apply { this.travelCompanion = travelCompanion }

fun text(text: kotlin.String?) = apply { this.text = text }

fun managementResponses(managementResponses: kotlin.collections.List<ManagementResponse>?) = apply { this.managementResponses = managementResponses }

fun build(): Review {
return Review(
verificationSource = verificationSource,
title = title,
dateSubmitted = dateSubmitted,
rating = rating,
reviewerName = reviewerName,
stayDate = stayDate,
tripReason = tripReason,
travelCompanion = travelCompanion,
text = text
text = text,
managementResponses = managementResponses
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import com.expediagroup.sdk.core.model.OperationParams
* @property propertyId Expedia Property ID.<br>
* @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 language Desired language for the response as a subset of BCP47 format that only uses hyphenated pairs of two-digit language and country codes. Use only ISO 639-1 alpha-2 language codes and ISO 3166-1 alpha-2 country codes. See [https://www.w3.org/International/articles/language-tags/](https://www.w3.org/International/articles/language-tags/) Language Options: [https://developers.expediagroup.com/docs/rapid/resources/reference/language-options](https://developers.expediagroup.com/docs/rapid/resources/reference/language-options)
* @property filter Single filter value. Send multiple instances of this parameter to request multiple filters. * `language` - Filters reviews to only those that match the specified `language` parameter value. Without this filter, the matching language will be preferred, but other language results can be returned. Specifying this filter could produce an error when there are no matching results.
* @property tripReason Desired reason provided for the reviewer's trip that you wish to display. This parameter can be supplied multiple times with different values, which will include reviews that match any of the requested trip reasons.
* @property billingTerms This parameter is to specify the terms of how a resulting booking should be billed. If this field is needed, the value for this will be provided to you separately.
* @property paymentTerms This parameter is to specify what terms should be used when being paid for a resulting booking. If this field is needed, the value for this will be provided to you separately.
* @property partnerPointOfSale This parameter is to specify what point of sale is being used to shop and book. If this field is needed, the value for this will be provided to you separately.
Expand All @@ -31,6 +33,8 @@ data class GetPropertyGuestReviewsOperationParams(
val propertyId: kotlin.String,
val customerSessionId: kotlin.String? = null,
val language: kotlin.String,
val filter: kotlin.collections.List<kotlin.String>? = null,
val tripReason: kotlin.collections.List<kotlin.String>? = null,
val billingTerms: kotlin.String? = null,
val paymentTerms: kotlin.String? = null,
val partnerPointOfSale: kotlin.String? = null,
Expand All @@ -45,6 +49,8 @@ data class GetPropertyGuestReviewsOperationParams(
private var propertyId: kotlin.String? = null,
private var customerSessionId: kotlin.String? = null,
private var language: kotlin.String? = null,
private var filter: kotlin.collections.List<kotlin.String>? = null,
private var tripReason: kotlin.collections.List<kotlin.String>? = null,
private var billingTerms: kotlin.String? = null,
private var paymentTerms: kotlin.String? = null,
private var partnerPointOfSale: kotlin.String? = null,
Expand All @@ -65,6 +71,16 @@ data class GetPropertyGuestReviewsOperationParams(
*/
fun language(language: kotlin.String) = apply { this.language = language }

/**
* @param filter Single filter value. Send multiple instances of this parameter to request multiple filters. * `language` - Filters reviews to only those that match the specified `language` parameter value. Without this filter, the matching language will be preferred, but other language results can be returned. Specifying this filter could produce an error when there are no matching results.
*/
fun filter(filter: kotlin.collections.List<kotlin.String>) = apply { this.filter = filter }

/**
* @param tripReason Desired reason provided for the reviewer's trip that you wish to display. This parameter can be supplied multiple times with different values, which will include reviews that match any of the requested trip reasons.
*/
fun tripReason(tripReason: kotlin.collections.List<kotlin.String>) = apply { this.tripReason = tripReason }

/**
* @param billingTerms This parameter is to specify the terms of how a resulting booking should be billed. If this field is needed, the value for this will be provided to you separately.
*/
Expand Down Expand Up @@ -92,6 +108,8 @@ data class GetPropertyGuestReviewsOperationParams(
propertyId = propertyId!!,
customerSessionId = customerSessionId,
language = language!!,
filter = filter,
tripReason = tripReason,
billingTerms = billingTerms,
paymentTerms = paymentTerms,
partnerPointOfSale = partnerPointOfSale,
Expand All @@ -118,6 +136,8 @@ data class GetPropertyGuestReviewsOperationParams(
override fun getQueryParams(): Map<String, Iterable<String>> {
return buildMap {
language?.also { put("language", listOf(language.toString())) }
filter?.also { put("filter", filter) }
tripReason?.also { put("trip_reason", tripReason) }
billingTerms?.also { put("billing_terms", listOf(billingTerms.toString())) }
paymentTerms?.also { put("payment_terms", listOf(paymentTerms.toString())) }
partnerPointOfSale?.also { put("partner_point_of_sale", listOf(partnerPointOfSale.toString())) }
Expand Down

0 comments on commit 2600b8c

Please sign in to comment.