From 2600b8c55d676250b3931a1ad4d46f23179f42c8 Mon Sep 17 00:00:00 2001 From: Nasser Anssari Date: Thu, 4 Jul 2024 16:37:57 +0300 Subject: [PATCH] chore: update code to v4.2.0 (#96) --- code/pom.xml | 4 +- .../sdk/rapid/client/rapidClient.kt | 16 +++- .../sdk/rapid/models/ManagementResponse.kt | 73 +++++++++++++++++++ .../expediagroup/sdk/rapid/models/Review.kt | 24 +++++- .../GetPropertyGuestReviewsOperationParams.kt | 20 +++++ 5 files changed, 130 insertions(+), 7 deletions(-) create mode 100644 code/src/main/kotlin/com/expediagroup/sdk/rapid/models/ManagementResponse.kt diff --git a/code/pom.xml b/code/pom.xml index 8967b07ba..dfa5c2884 100644 --- a/code/pom.xml +++ b/code/pom.xml @@ -5,9 +5,9 @@ com.expediagroup rapid-sdk - 4.1.3 + 4.2.0 EG Rapid SDK for Java - EG Rapid SDK v4.1.3 + EG Rapid SDK v4.2.0 https://github.com/ExpediaGroup/rapid-java-sdk 2022 jar diff --git a/code/src/main/kotlin/com/expediagroup/sdk/rapid/client/rapidClient.kt b/code/src/main/kotlin/com/expediagroup/sdk/rapid/client/rapidClient.kt index c0e2ba345..dc3be1f38 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/rapid/client/rapidClient.kt +++ b/code/src/main/kotlin/com/expediagroup/sdk/rapid/client/rapidClient.kt @@ -1923,6 +1923,8 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat propertyId: kotlin.String, language: kotlin.String, customerSessionId: kotlin.String? = null, + filter: kotlin.collections.List? = null, + tripReason: kotlin.collections.List? = null, billingTerms: kotlin.String? = null, paymentTerms: kotlin.String? = null, partnerPointOfSale: kotlin.String? = null, @@ -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, @@ -1953,6 +1957,8 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat * @param propertyId Expedia Property ID.
* @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.
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) @@ -1967,12 +1973,14 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat propertyId: kotlin.String, language: kotlin.String, customerSessionId: kotlin.String? = null, + filter: kotlin.collections.List? = null, + tripReason: kotlin.collections.List? = 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 } /** @@ -1981,6 +1989,8 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat * @param propertyId Expedia Property ID.
* @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.
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) @@ -1995,6 +2005,8 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat propertyId: kotlin.String, language: kotlin.String, customerSessionId: kotlin.String? = null, + filter: kotlin.collections.List? = null, + tripReason: kotlin.collections.List? = null, billingTerms: kotlin.String? = null, paymentTerms: kotlin.String? = null, partnerPointOfSale: kotlin.String? = null, @@ -2002,7 +2014,7 @@ class RapidClient private constructor(clientConfiguration: RapidClientConfigurat ): Response { 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() diff --git a/code/src/main/kotlin/com/expediagroup/sdk/rapid/models/ManagementResponse.kt b/code/src/main/kotlin/com/expediagroup/sdk/rapid/models/ManagementResponse.kt new file mode 100644 index 000000000..0174bfb60 --- /dev/null +++ b/code/src/main/kotlin/com/expediagroup/sdk/rapid/models/ManagementResponse.kt @@ -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 + ) + } + } +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/rapid/models/Review.kt b/code/src/main/kotlin/com/expediagroup/sdk/rapid/models/Review.kt index 31e8c9b52..a5a85c32f 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/rapid/models/Review.kt +++ b/code/src/main/kotlin/com/expediagroup/sdk/rapid/models/Review.kt @@ -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. @@ -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, @@ -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? = null ) { companion object { @JvmStatic @@ -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? = null ) { fun verificationSource(verificationSource: kotlin.String?) = apply { this.verificationSource = verificationSource } @@ -103,12 +115,16 @@ 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?) = apply { this.managementResponses = managementResponses } + fun build(): Review { return Review( verificationSource = verificationSource, @@ -116,9 +132,11 @@ data class Review( dateSubmitted = dateSubmitted, rating = rating, reviewerName = reviewerName, + stayDate = stayDate, tripReason = tripReason, travelCompanion = travelCompanion, - text = text + text = text, + managementResponses = managementResponses ) } } diff --git a/code/src/main/kotlin/com/expediagroup/sdk/rapid/operations/GetPropertyGuestReviewsOperationParams.kt b/code/src/main/kotlin/com/expediagroup/sdk/rapid/operations/GetPropertyGuestReviewsOperationParams.kt index cffb8834d..f8c7d99d8 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/rapid/operations/GetPropertyGuestReviewsOperationParams.kt +++ b/code/src/main/kotlin/com/expediagroup/sdk/rapid/operations/GetPropertyGuestReviewsOperationParams.kt @@ -22,6 +22,8 @@ import com.expediagroup.sdk.core.model.OperationParams * @property propertyId Expedia Property ID.
* @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.
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. @@ -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? = null, + val tripReason: kotlin.collections.List? = null, val billingTerms: kotlin.String? = null, val paymentTerms: kotlin.String? = null, val partnerPointOfSale: kotlin.String? = null, @@ -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? = null, + private var tripReason: kotlin.collections.List? = null, private var billingTerms: kotlin.String? = null, private var paymentTerms: kotlin.String? = null, private var partnerPointOfSale: kotlin.String? = null, @@ -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) = 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) = 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. */ @@ -92,6 +108,8 @@ data class GetPropertyGuestReviewsOperationParams( propertyId = propertyId!!, customerSessionId = customerSessionId, language = language!!, + filter = filter, + tripReason = tripReason, billingTerms = billingTerms, paymentTerms = paymentTerms, partnerPointOfSale = partnerPointOfSale, @@ -118,6 +136,8 @@ data class GetPropertyGuestReviewsOperationParams( override fun getQueryParams(): Map> { 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())) }