diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIGatewayError.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIGatewayError.kt index 09112ca39..b630c862a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIGatewayError.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIGatewayError.kt @@ -13,80 +13,43 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param message - */ +*/ data class APIGatewayError( @JsonProperty("message") - @field:Valid - val message: kotlin.String? = null + val message: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() } class Builder( - private var message: kotlin.String? = null + private var message: kotlin.String? = null, ) { fun message(message: kotlin.String?) = apply { this.message = message } fun build(): APIGatewayError { val instance = APIGatewayError( - message = message + message = message, ) - validate(instance) - return instance } - - private fun validate(instance: APIGatewayError) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( - message = message + message = message, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIMError.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIMError.kt index 25345be0b..3892da8ce 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIMError.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIMError.kt @@ -13,80 +13,43 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param message - */ +*/ data class APIMError( @JsonProperty("message") - @field:Valid - val message: kotlin.String? = null + val message: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() } class Builder( - private var message: kotlin.String? = null + private var message: kotlin.String? = null, ) { fun message(message: kotlin.String?) = apply { this.message = message } fun build(): APIMError { val instance = APIMError( - message = message + message = message, ) - validate(instance) - return instance } - - private fun validate(instance: APIMError) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( - message = message + message = message, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt index f159e2b55..388d70e35 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt @@ -13,31 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Address information +* Address information * @param address1 Street Number, Street Name, or PO Box. * @param address2 Apartment, Floor, Suite, Bldg * @param suite Suite/apartment number @@ -45,37 +26,33 @@ import javax.validation.Validation * @param province The state or province. * @param country 3-letter code for the country. * @param postalCode Zip/postal code. - */ +*/ data class ActivitiesAddress( // Street Number, Street Name, or PO Box. @JsonProperty("Address1") - @field:Valid val address1: kotlin.String? = null, // Apartment, Floor, Suite, Bldg @JsonProperty("Address2") - @field:Valid val address2: kotlin.String? = null, // Suite/apartment number @JsonProperty("Suite") - @field:Valid val suite: kotlin.String? = null, // The city @JsonProperty("City") - @field:Valid val city: kotlin.String? = null, // The state or province. @JsonProperty("Province") - @field:Valid val province: kotlin.String? = null, // 3-letter code for the country. @JsonProperty("Country") - @field:Valid val country: kotlin.String? = null, // Zip/postal code. @JsonProperty("PostalCode") - @field:Valid - val postalCode: kotlin.String? = null + val postalCode: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -88,7 +65,7 @@ data class ActivitiesAddress( private var city: kotlin.String? = null, private var province: kotlin.String? = null, private var country: kotlin.String? = null, - private var postalCode: kotlin.String? = null + private var postalCode: kotlin.String? = null, ) { fun address1(address1: kotlin.String?) = apply { this.address1 = address1 } @@ -113,31 +90,11 @@ data class ActivitiesAddress( city = city, province = province, country = country, - postalCode = postalCode + postalCode = postalCode, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesAddress) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -148,6 +105,6 @@ data class ActivitiesAddress( city = city, province = province, country = country, - postalCode = postalCode + postalCode = postalCode, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt index 79657c6a7..6871c127b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt @@ -13,54 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for the Cancellation Policy information. +* Container for the Cancellation Policy information. * @param freeCancellation Indicates whether the activity can be canceled free of charge within the cancellation window or not. * @param cancelPolicyDescription The description of Cancellation Policy. * @param freeCancellationMinHours The minimum number of hours before activity when the activity can still be cancelled for free. * @param freeCancellationEndDateTime The date and time after which the activity will not be able to be cancelled for free, stated in the local time to where the activity takes place. - */ +*/ data class ActivitiesCancellationPolicy( // Indicates whether the activity can be canceled free of charge within the cancellation window or not. @JsonProperty("FreeCancellation") - @field:NotNull - @field:Valid val freeCancellation: kotlin.Boolean, // The description of Cancellation Policy. @JsonProperty("CancelPolicyDescription") - @field:Valid val cancelPolicyDescription: kotlin.String? = null, // The minimum number of hours before activity when the activity can still be cancelled for free. @JsonProperty("FreeCancellationMinHours") val freeCancellationMinHours: kotlin.Int? = null, // The date and time after which the activity will not be able to be cancelled for free, stated in the local time to where the activity takes place. @JsonProperty("FreeCancellationEndDateTime") - val freeCancellationEndDateTime: java.time.LocalDateTime? = null + val freeCancellationEndDateTime: java.time.LocalDateTime? = null, ) { + init { + require(freeCancellation != null) { "freeCancellation must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -70,7 +51,7 @@ data class ActivitiesCancellationPolicy( private var freeCancellation: kotlin.Boolean? = null, private var cancelPolicyDescription: kotlin.String? = null, private var freeCancellationMinHours: kotlin.Int? = null, - private var freeCancellationEndDateTime: java.time.LocalDateTime? = null + private var freeCancellationEndDateTime: java.time.LocalDateTime? = null, ) { fun freeCancellation(freeCancellation: kotlin.Boolean) = apply { this.freeCancellation = freeCancellation } @@ -86,31 +67,11 @@ data class ActivitiesCancellationPolicy( freeCancellation = freeCancellation!!, cancelPolicyDescription = cancelPolicyDescription, freeCancellationMinHours = freeCancellationMinHours, - freeCancellationEndDateTime = freeCancellationEndDateTime + freeCancellationEndDateTime = freeCancellationEndDateTime, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesCancellationPolicy) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -118,6 +79,6 @@ data class ActivitiesCancellationPolicy( freeCancellation = freeCancellation!!, cancelPolicyDescription = cancelPolicyDescription, freeCancellationMinHours = freeCancellationMinHours, - freeCancellationEndDateTime = freeCancellationEndDateTime + freeCancellationEndDateTime = freeCancellationEndDateTime, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt index c8b05c7fa..a06a0a08b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt @@ -13,58 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for disambiguation country information +* Container for disambiguation country information * @param name country name * @param isoCode2 2-letter code for the country * @param isoCode3 3-letter code for the country * @param code 3-letter code for the country - */ +*/ data class ActivitiesCountry( // country name @JsonProperty("Name") - @field:NotNull - @field:Valid val name: kotlin.String, // 2-letter code for the country @JsonProperty("IsoCode2") - @field:NotNull - @field:Valid val isoCode2: kotlin.String, // 3-letter code for the country @JsonProperty("IsoCode3") - @field:NotNull - @field:Valid val isoCode3: kotlin.String, // 3-letter code for the country @JsonProperty("Code") - @field:Valid - val code: kotlin.String? = null + val code: kotlin.String? = null, ) { + init { + require(name != null) { "name must not be null" } + + require(isoCode2 != null) { "isoCode2 must not be null" } + + require(isoCode3 != null) { "isoCode3 must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -74,7 +55,7 @@ data class ActivitiesCountry( private var name: kotlin.String? = null, private var isoCode2: kotlin.String? = null, private var isoCode3: kotlin.String? = null, - private var code: kotlin.String? = null + private var code: kotlin.String? = null, ) { fun name(name: kotlin.String) = apply { this.name = name } @@ -90,31 +71,11 @@ data class ActivitiesCountry( name = name!!, isoCode2 = isoCode2!!, isoCode3 = isoCode3!!, - code = code + code = code, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesCountry) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -122,6 +83,6 @@ data class ActivitiesCountry( name = name!!, isoCode2 = isoCode2!!, isoCode3 = isoCode3!!, - code = code + code = code, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt index af0401354..057077a20 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt @@ -13,63 +13,42 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesLocationOption import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for error list. +* Container for error list. * @param code Error code describing the issue * @param description A simple description of what the error is. * @param detailCode Detailed error code describing the issue. * @param locationKeyword The requested location that caused the error. * @param locationOptions List for possible locations from which the customer must choose the best one to be re-submitted in the request. - */ +*/ data class ActivitiesError( // Error code describing the issue @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // A simple description of what the error is. @JsonProperty("Description") - @field:NotNull - @field:Valid val description: kotlin.String, // Detailed error code describing the issue. @JsonProperty("DetailCode") - @field:Valid val detailCode: kotlin.String? = null, // The requested location that caused the error. @JsonProperty("LocationKeyword") - @field:Valid val locationKeyword: kotlin.String? = null, // List for possible locations from which the customer must choose the best one to be re-submitted in the request. @JsonProperty("LocationOptions") - @field:Valid - val locationOptions: kotlin.collections.List? = null + val locationOptions: kotlin.collections.List? = null, ) { + init { + require(code != null) { "code must not be null" } + + require(description != null) { "description must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -80,7 +59,7 @@ data class ActivitiesError( private var description: kotlin.String? = null, private var detailCode: kotlin.String? = null, private var locationKeyword: kotlin.String? = null, - private var locationOptions: kotlin.collections.List? = null + private var locationOptions: kotlin.collections.List? = null, ) { fun code(code: kotlin.String) = apply { this.code = code } @@ -99,31 +78,11 @@ data class ActivitiesError( description = description!!, detailCode = detailCode, locationKeyword = locationKeyword, - locationOptions = locationOptions + locationOptions = locationOptions, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesError) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -132,6 +91,6 @@ data class ActivitiesError( description = description!!, detailCode = detailCode, locationKeyword = locationKeyword, - locationOptions = locationOptions + locationOptions = locationOptions, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt index 1295fed19..5a91094f5 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt @@ -13,51 +13,33 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesError import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * +* * @param errors Container for error list. * @param transactionId A unique identifier for the transaction. - */ +*/ data class ActivitiesErrors( // Container for error list. @JsonProperty("Errors") - @field:NotNull - @field:Valid val errors: kotlin.collections .List< - ActivitiesError + ActivitiesError, >, // A unique identifier for the transaction. @JsonProperty("TransactionId") - @field:NotNull - @field:Valid - val transactionId: kotlin.String + val transactionId: kotlin.String, ) { + init { + require(errors != null) { "errors must not be null" } + + require(transactionId != null) { "transactionId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -65,7 +47,7 @@ data class ActivitiesErrors( class Builder( private var errors: kotlin.collections.List? = null, - private var transactionId: kotlin.String? = null + private var transactionId: kotlin.String? = null, ) { fun errors(errors: kotlin.collections.List) = apply { this.errors = errors } @@ -75,36 +57,16 @@ data class ActivitiesErrors( val instance = ActivitiesErrors( errors = errors!!, - transactionId = transactionId!! + transactionId = transactionId!!, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesErrors) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( errors = errors!!, - transactionId = transactionId!! + transactionId = transactionId!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt index e14ba3684..66a7ed867 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt @@ -13,51 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Geographic information +* Geographic information * @param latitude Latitude of the location. * @param longitude Longitude of the location. * @param obfuscated - */ +*/ data class ActivitiesGeoLocation( // Latitude of the location. @JsonProperty("Latitude") - @field:NotNull - @field:Valid val latitude: kotlin.String, // Longitude of the location. @JsonProperty("Longitude") - @field:NotNull - @field:Valid val longitude: kotlin.String, @JsonProperty("Obfuscated") - @field:Valid - val obfuscated: kotlin.Boolean? = null + val obfuscated: kotlin.Boolean? = null, ) { + init { + require(latitude != null) { "latitude must not be null" } + + require(longitude != null) { "longitude must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -66,7 +47,7 @@ data class ActivitiesGeoLocation( class Builder( private var latitude: kotlin.String? = null, private var longitude: kotlin.String? = null, - private var obfuscated: kotlin.Boolean? = null + private var obfuscated: kotlin.Boolean? = null, ) { fun latitude(latitude: kotlin.String) = apply { this.latitude = latitude } @@ -79,37 +60,17 @@ data class ActivitiesGeoLocation( ActivitiesGeoLocation( latitude = latitude!!, longitude = longitude!!, - obfuscated = obfuscated + obfuscated = obfuscated, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesGeoLocation) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( latitude = latitude!!, longitude = longitude!!, - obfuscated = obfuscated + obfuscated = obfuscated, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt index f34efbe35..46d50af49 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt @@ -13,51 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container of HATEOAS URL's +* Container of HATEOAS URL's * @param href HATEOAS URL to fetch details. * @param accept Accept header. * @param method HTTP method to connect. - */ +*/ data class ActivitiesLink( // HATEOAS URL to fetch details. @JsonProperty("Href") - @field:NotNull - @field:Valid val href: kotlin.String, // Accept header. @JsonProperty("Accept") - @field:Valid val accept: kotlin.String? = null, // HTTP method to connect. @JsonProperty("Method") - @field:Valid - val method: kotlin.String? = null + val method: kotlin.String? = null, ) { + init { + require(href != null) { "href must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -66,7 +46,7 @@ data class ActivitiesLink( class Builder( private var href: kotlin.String? = null, private var accept: kotlin.String? = null, - private var method: kotlin.String? = null + private var method: kotlin.String? = null, ) { fun href(href: kotlin.String) = apply { this.href = href } @@ -79,37 +59,17 @@ data class ActivitiesLink( ActivitiesLink( href = href!!, accept = accept, - method = method + method = method, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesLink) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( href = href!!, accept = accept, - method = method + method = method, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt index 3c3cb2fe0..a70802764 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt @@ -13,35 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesAddress import com.expediagroup.sdk.xap.models.ActivitiesCountry import com.expediagroup.sdk.xap.models.ActivitiesGeoLocation import com.expediagroup.sdk.xap.models.ActivitiesNeighborhood import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * List of location(s) where the activity will happen. +* List of location(s) where the activity will happen. * @param type The type of location code (MULTICITY | METROCODE). * @param id Expedia Region ID of the specified airport. * @param name Location Name @@ -53,47 +34,40 @@ import javax.validation.Validation * @param neighborhood * @param regionId RegionId the location resides in. * @param country - */ +*/ data class ActivitiesLocation( // The type of location code (MULTICITY | METROCODE). @JsonProperty("Type") - @field:Valid val type: kotlin.String? = null, // Expedia Region ID of the specified airport. @JsonProperty("Id") - @field:Valid val id: kotlin.String? = null, // Location Name @JsonProperty("Name") - @field:Valid val name: kotlin.String? = null, // Location Code @JsonProperty("Code") - @field:Valid val code: kotlin.String? = null, // Location id. @JsonProperty("LocationId") - @field:Valid val locationId: kotlin.String? = null, @JsonProperty("Address") - @field:Valid val address: ActivitiesAddress? = null, @JsonProperty("PointOfInterest") - @field:Valid val pointOfInterest: kotlin.String? = null, @JsonProperty("GeoLocation") - @field:Valid val geoLocation: ActivitiesGeoLocation? = null, @JsonProperty("Neighborhood") - @field:Valid val neighborhood: ActivitiesNeighborhood? = null, // RegionId the location resides in. @JsonProperty("RegionId") val regionId: kotlin.Long? = null, @JsonProperty("Country") - @field:Valid - val country: ActivitiesCountry? = null + val country: ActivitiesCountry? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -110,7 +84,7 @@ data class ActivitiesLocation( private var geoLocation: ActivitiesGeoLocation? = null, private var neighborhood: ActivitiesNeighborhood? = null, private var regionId: kotlin.Long? = null, - private var country: ActivitiesCountry? = null + private var country: ActivitiesCountry? = null, ) { fun type(type: kotlin.String?) = apply { this.type = type } @@ -147,31 +121,11 @@ data class ActivitiesLocation( geoLocation = geoLocation, neighborhood = neighborhood, regionId = regionId, - country = country + country = country, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesLocation) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -186,6 +140,6 @@ data class ActivitiesLocation( geoLocation = geoLocation, neighborhood = neighborhood, regionId = regionId, - country = country + country = country, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt index 88e54b697..b3783b542 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt @@ -13,35 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesCountry import com.expediagroup.sdk.xap.models.ActivitiesGeoLocation import com.expediagroup.sdk.xap.models.ActivitiesLocation import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List for possible locations from which the customer must choose the best one to be re-submitted in the request. +* List for possible locations from which the customer must choose the best one to be re-submitted in the request. * @param requestedLocation Location used in partner request. * @param locations Container for list of possible locations that could be used to disambiguate the query. * @param type Type of the location. @@ -51,48 +31,43 @@ import javax.validation.constraints.NotNull * @param address The address of the location. * @param country * @param geoLocation - */ +*/ data class ActivitiesLocationOption( // Location used in partner request. @JsonProperty("RequestedLocation") - @field:NotNull - @field:Valid val requestedLocation: kotlin.String, // Container for list of possible locations that could be used to disambiguate the query. @JsonProperty("Locations") - @field:NotNull - @field:Valid val locations: kotlin.collections .List< - ActivitiesLocation + ActivitiesLocation, >, // Type of the location. @JsonProperty("Type") - @field:Valid val type: kotlin.String? = null, // RegionId the location resides in. @JsonProperty("RegionId") - @field:Valid val regionId: kotlin.String? = null, // The name of the location which matches the location keyword. @JsonProperty("ShortName") - @field:Valid val shortName: kotlin.String? = null, // Indicates the nearest major airport to the location. @JsonProperty("AirportCode") - @field:Valid val airportCode: kotlin.String? = null, // The address of the location. @JsonProperty("Address") - @field:Valid val address: kotlin.String? = null, @JsonProperty("Country") - @field:Valid val country: ActivitiesCountry? = null, @JsonProperty("GeoLocation") - @field:Valid - val geoLocation: ActivitiesGeoLocation? = null + val geoLocation: ActivitiesGeoLocation? = null, ) { + init { + require(requestedLocation != null) { "requestedLocation must not be null" } + + require(locations != null) { "locations must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -107,7 +82,7 @@ data class ActivitiesLocationOption( private var airportCode: kotlin.String? = null, private var address: kotlin.String? = null, private var country: ActivitiesCountry? = null, - private var geoLocation: ActivitiesGeoLocation? = null + private var geoLocation: ActivitiesGeoLocation? = null, ) { fun requestedLocation(requestedLocation: kotlin.String) = apply { this.requestedLocation = requestedLocation } @@ -138,31 +113,11 @@ data class ActivitiesLocationOption( airportCode = airportCode, address = address, country = country, - geoLocation = geoLocation + geoLocation = geoLocation, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesLocationOption) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -175,6 +130,6 @@ data class ActivitiesLocationOption( airportCode = airportCode, address = address, country = country, - geoLocation = geoLocation + geoLocation = geoLocation, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt index b8ffe6ae0..3e8ca71b1 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt @@ -13,58 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List of activity Media. +* List of activity Media. * @param type type of the media. So far there is only one option: 1: Image * @param propertySize Image size You can find a link to the complete list of Supported Images Sizes in the Related Links section at the bottom of the page. * @param url Image URL * @param title Image title - */ +*/ data class ActivitiesMedia( // type of the media. So far there is only one option: 1: Image @JsonProperty("Type") - @field:NotNull - @field:Valid val type: kotlin.String, // Image size You can find a link to the complete list of Supported Images Sizes in the Related Links section at the bottom of the page. @JsonProperty("Size") - @field:NotNull - @field:Valid val propertySize: kotlin.String, // Image URL @JsonProperty("Url") - @field:NotNull - @field:Valid val url: kotlin.String, // Image title @JsonProperty("Title") - @field:Valid - val title: kotlin.String? = null + val title: kotlin.String? = null, ) { + init { + require(type != null) { "type must not be null" } + + require(propertySize != null) { "propertySize must not be null" } + + require(url != null) { "url must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -74,7 +55,7 @@ data class ActivitiesMedia( private var type: kotlin.String? = null, private var propertySize: kotlin.String? = null, private var url: kotlin.String? = null, - private var title: kotlin.String? = null + private var title: kotlin.String? = null, ) { fun type(type: kotlin.String) = apply { this.type = type } @@ -90,31 +71,11 @@ data class ActivitiesMedia( type = type!!, propertySize = propertySize!!, url = url!!, - title = title + title = title, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesMedia) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -122,6 +83,6 @@ data class ActivitiesMedia( type = type!!, propertySize = propertySize!!, url = url!!, - title = title + title = title, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt index 524a014e2..d612641a1 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt @@ -13,51 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for the discount amount. +* Container for the discount amount. * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class ActivitiesMoney( // The value of the element being defined. @JsonProperty("Value") - @field:NotNull - @field:Valid val `value`: kotlin.String, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:NotNull - @field:Valid val currency: kotlin.String, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: ActivitiesMoney? = null + val localCurrencyPrice: ActivitiesMoney? = null, ) { + init { + require(`value` != null) { "`value` must not be null" } + + require(currency != null) { "currency must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -66,7 +47,7 @@ data class ActivitiesMoney( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: ActivitiesMoney? = null + private var localCurrencyPrice: ActivitiesMoney? = null, ) { fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } @@ -79,37 +60,17 @@ data class ActivitiesMoney( ActivitiesMoney( `value` = `value`!!, currency = currency!!, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesMoney) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`!!, currency = currency!!, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt index a7cec9c15..a6fefde69 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Geography entities which are typically contained within a city. This includes the categories neighborhood and point of interest. Low level regions are not a formally defined concept in the geography model. +* Geography entities which are typically contained within a city. This includes the categories neighborhood and point of interest. Low level regions are not a formally defined concept in the geography model. * @param id Neighborhood id. * @param name Neighborhood name. - */ +*/ data class ActivitiesNeighborhood( // Neighborhood id. @JsonProperty("Id") - @field:NotNull - @field:Valid val id: kotlin.String, // Neighborhood name. @JsonProperty("Name") - @field:NotNull - @field:Valid - val name: kotlin.String + val name: kotlin.String, ) { + init { + require(id != null) { "id must not be null" } + + require(name != null) { "name must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class ActivitiesNeighborhood( class Builder( private var id: kotlin.String? = null, - private var name: kotlin.String? = null + private var name: kotlin.String? = null, ) { fun id(id: kotlin.String) = apply { this.id = id } @@ -71,36 +53,16 @@ data class ActivitiesNeighborhood( val instance = ActivitiesNeighborhood( id = id!!, - name = name!! + name = name!!, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesNeighborhood) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id!!, - name = name!! + name = name!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt index 8af792ad6..dab6fe50b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt @@ -13,56 +13,36 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The phone of the company providing the activity. +* The phone of the company providing the activity. * @param countryCode Country code of traveler's phone number; only digits allowed. * @param number Traveler's phone number; only digits allowed. * @param areaCode Area code of traveler's phone number; only digits allowed. * @param extensionNumber - */ +*/ data class ActivitiesPhone( // Country code of traveler's phone number; only digits allowed. @JsonProperty("CountryCode") - @field:NotNull - @field:Valid val countryCode: kotlin.String, // Traveler's phone number; only digits allowed. @JsonProperty("Number") - @field:NotNull - @field:Valid val number: kotlin.String, // Area code of traveler's phone number; only digits allowed. @JsonProperty("AreaCode") - @field:Valid val areaCode: kotlin.String? = null, @JsonProperty("ExtensionNumber") - @field:Valid - val extensionNumber: kotlin.String? = null + val extensionNumber: kotlin.String? = null, ) { + init { + require(countryCode != null) { "countryCode must not be null" } + + require(number != null) { "number must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -72,7 +52,7 @@ data class ActivitiesPhone( private var countryCode: kotlin.String? = null, private var number: kotlin.String? = null, private var areaCode: kotlin.String? = null, - private var extensionNumber: kotlin.String? = null + private var extensionNumber: kotlin.String? = null, ) { fun countryCode(countryCode: kotlin.String) = apply { this.countryCode = countryCode } @@ -88,31 +68,11 @@ data class ActivitiesPhone( countryCode = countryCode!!, number = number!!, areaCode = areaCode, - extensionNumber = extensionNumber + extensionNumber = extensionNumber, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesPhone) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -120,6 +80,6 @@ data class ActivitiesPhone( countryCode = countryCode!!, number = number!!, areaCode = areaCode, - extensionNumber = extensionNumber + extensionNumber = extensionNumber, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt index 7e469e3ce..88a0cde5c 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt @@ -13,64 +13,41 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesMoney import com.expediagroup.sdk.xap.models.ReferencePrice import com.expediagroup.sdk.xap.models.Savings import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The price of the offer +* The price of the offer * @param totalRate * @param category Type of passenger. Values supported are: ADULT | SENIOR | CHILD * @param totalFees * @param totalTaxesAndFees * @param referencePrice * @param savings - */ +*/ data class ActivitiesPrice( @JsonProperty("TotalRate") - @field:NotNull - @field:Valid val totalRate: ActivitiesMoney, // Type of passenger. Values supported are: ADULT | SENIOR | CHILD @JsonProperty("Category") - @field:Valid val category: kotlin.String? = null, @JsonProperty("TotalFees") - @field:Valid val totalFees: ActivitiesMoney? = null, @JsonProperty("TotalTaxesAndFees") - @field:Valid val totalTaxesAndFees: ActivitiesMoney? = null, @JsonProperty("ReferencePrice") - @field:Valid val referencePrice: ReferencePrice? = null, @JsonProperty("Savings") - @field:Valid - val savings: Savings? = null + val savings: Savings? = null, ) { + init { + require(totalRate != null) { "totalRate must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -82,7 +59,7 @@ data class ActivitiesPrice( private var totalFees: ActivitiesMoney? = null, private var totalTaxesAndFees: ActivitiesMoney? = null, private var referencePrice: ReferencePrice? = null, - private var savings: Savings? = null + private var savings: Savings? = null, ) { fun totalRate(totalRate: ActivitiesMoney) = apply { this.totalRate = totalRate } @@ -104,31 +81,11 @@ data class ActivitiesPrice( totalFees = totalFees, totalTaxesAndFees = totalTaxesAndFees, referencePrice = referencePrice, - savings = savings + savings = savings, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -138,6 +95,6 @@ data class ActivitiesPrice( totalFees = totalFees, totalTaxesAndFees = totalTaxesAndFees, referencePrice = referencePrice, - savings = savings + savings = savings, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt index 2a5297ce5..c0ce2c3c8 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt @@ -13,46 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesPhone import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The details information of company providing the activity. +* The details information of company providing the activity. * @param name The name of the company providing the activity. * @param phone - */ +*/ data class ActivitiesSupplier( // The name of the company providing the activity. @JsonProperty("Name") - @field:NotNull - @field:Valid val name: kotlin.String, @JsonProperty("Phone") - @field:Valid - val phone: ActivitiesPhone? = null + val phone: ActivitiesPhone? = null, ) { + init { + require(name != null) { "name must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -60,7 +41,7 @@ data class ActivitiesSupplier( class Builder( private var name: kotlin.String? = null, - private var phone: ActivitiesPhone? = null + private var phone: ActivitiesPhone? = null, ) { fun name(name: kotlin.String) = apply { this.name = name } @@ -70,36 +51,16 @@ data class ActivitiesSupplier( val instance = ActivitiesSupplier( name = name!!, - phone = phone + phone = phone, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesSupplier) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( name = name!!, - phone = phone + phone = phone, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt index 71c3fae09..9d35ecfc9 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt @@ -13,34 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesLink import com.expediagroup.sdk.xap.models.ActivitiesMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for all warnings generated during the transaction. +* Container for all warnings generated during the transaction. * @param code Standardized warning code. * @param description Standardized warning description message. * @param originalPrice @@ -48,35 +28,32 @@ import javax.validation.constraints.NotNull * @param changedAmount * @param changedPercentage The changed percentage. In the sample 2.97 means the changed percentage is 2.97%. * @param links - */ +*/ data class ActivitiesWarning( // Standardized warning code. @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // Standardized warning description message. @JsonProperty("Description") - @field:NotNull - @field:Valid val description: kotlin.String, @JsonProperty("OriginalPrice") - @field:Valid val originalPrice: ActivitiesMoney? = null, @JsonProperty("NewPrice") - @field:Valid val newPrice: ActivitiesMoney? = null, @JsonProperty("ChangedAmount") - @field:Valid val changedAmount: ActivitiesMoney? = null, // The changed percentage. In the sample 2.97 means the changed percentage is 2.97%. @JsonProperty("ChangedPercentage") - @field:Valid val changedPercentage: kotlin.String? = null, @JsonProperty("Links") - @field:Valid - val links: kotlin.collections.Map? = null + val links: kotlin.collections.Map? = null, ) { + init { + require(code != null) { "code must not be null" } + + require(description != null) { "description must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -89,7 +66,7 @@ data class ActivitiesWarning( private var newPrice: ActivitiesMoney? = null, private var changedAmount: ActivitiesMoney? = null, private var changedPercentage: kotlin.String? = null, - private var links: kotlin.collections.Map? = null + private var links: kotlin.collections.Map? = null, ) { fun code(code: kotlin.String) = apply { this.code = code } @@ -114,31 +91,11 @@ data class ActivitiesWarning( newPrice = newPrice, changedAmount = changedAmount, changedPercentage = changedPercentage, - links = links + links = links, ) - validate(instance) - return instance } - - private fun validate(instance: ActivitiesWarning) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -149,6 +106,6 @@ data class ActivitiesWarning( newPrice = newPrice, changedAmount = changedAmount, changedPercentage = changedPercentage, - links = links + links = links, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt index 420114d70..80f22080a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt @@ -13,24 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesCancellationPolicy import com.expediagroup.sdk.xap.models.ActivitiesLink import com.expediagroup.sdk.xap.models.ActivitiesLocation @@ -40,13 +24,9 @@ import com.expediagroup.sdk.xap.models.ActivitiesSupplier import com.expediagroup.sdk.xap.models.Offer import com.expediagroup.sdk.xap.models.Redemption import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Detailed information on the Activity. +* Detailed information on the Activity. * @param id The numerical identifier for this particular activity * @param title The display title for this activity. * @param description The description of the Activity. @@ -69,61 +49,43 @@ import javax.validation.constraints.NotNull * @param knowBeforeYouBook Web formatted statement of things that a purchaser should be aware of BEFORE they book this activity. * @param knowBeforeYouGo Web formatted statement of things that a purchaser should be aware of BEFORE they go to this activity. * @param offers Offers for the activity. - */ +*/ data class Activity( // The numerical identifier for this particular activity @JsonProperty("Id") val id: kotlin.Int, // The display title for this activity. @JsonProperty("Title") - @field:NotNull - @field:Valid val title: kotlin.String, // The description of the Activity. @JsonProperty("Description") - @field:NotNull - @field:Valid val description: kotlin.String, // List of activity Media. @JsonProperty("Media") - @field:NotNull - @field:Valid val media: kotlin.collections .List< - ActivitiesMedia + ActivitiesMedia, >, // A list of the Activity categories to which this particular activity belongs. Possible values are: Adventures Air, Balloon & Helicopter Tours Attractions Cruises & Water Tours Day Trips & Excursions Food & Drink Hop-on Hop-off Multi-Day & Extended Tours Nightlife Private Tours Private Transfers Shared Transfers Show & Sport Tickets Sightseeing Passes Theme Parks Tours & Sightseeing Walking & Bike Tours Water Activities Wedding Ceremonies Winter Activities @JsonProperty("Categories") - @field:NotNull - @field:Valid val categories: kotlin.collections .List< - kotlin.String + kotlin.String, >, // The anticipated time duration for the activity. Using java jdk Duration parsing. @JsonProperty("Duration") - @field:NotNull - @field:Valid val duration: kotlin.String, // A boolean value describing whether or not this activity reservation can be cancelled without incurring a penalty. @JsonProperty("FreeCancellation") - @field:NotNull - @field:Valid val freeCancellation: kotlin.Boolean, @JsonProperty("Price") - @field:NotNull - @field:Valid val price: ActivitiesPrice, @JsonProperty("Supplier") - @field:NotNull - @field:Valid val supplier: ActivitiesSupplier, @JsonProperty("Redemption") - @field:Valid val redemption: Redemption? = null, // Container of location information where activity happens. @JsonProperty("ActivityLocations") - @field:Valid val activityLocations: kotlin.collections.List? = null, // The overall Expedia score for the activity. @JsonProperty("ReviewScore") @@ -133,40 +95,51 @@ data class Activity( val reviewCount: kotlin.Int? = null, // HATEOAS links included in this response. @JsonProperty("Links") - @field:Valid val links: kotlin.collections.Map? = null, @JsonProperty("CancellationPolicy") - @field:Valid val cancellationPolicy: ActivitiesCancellationPolicy? = null, // Web formatted statement of the Highlight(s) for the activity. @JsonProperty("Highlights") - @field:Valid val highlights: kotlin.collections.List? = null, // Terms and Conditions for the Activity. @JsonProperty("TermsAndConditions") - @field:Valid val termsAndConditions: kotlin.collections.List? = null, // Web formatted statement of what is included in the activity @JsonProperty("Inclusions") - @field:Valid val inclusions: kotlin.collections.List? = null, // Web formatted statement of what is NOT included in the activity @JsonProperty("Exclusions") - @field:Valid val exclusions: kotlin.collections.List? = null, // Web formatted statement of things that a purchaser should be aware of BEFORE they book this activity. @JsonProperty("KnowBeforeYouBook") - @field:Valid val knowBeforeYouBook: kotlin.collections.List? = null, // Web formatted statement of things that a purchaser should be aware of BEFORE they go to this activity. @JsonProperty("KnowBeforeYouGo") - @field:Valid val knowBeforeYouGo: kotlin.collections.List? = null, // Offers for the activity. @JsonProperty("Offers") - @field:Valid - val offers: kotlin.collections.List? = null + val offers: kotlin.collections.List? = null, ) { + init { + require(id != null) { "id must not be null" } + + require(title != null) { "title must not be null" } + + require(description != null) { "description must not be null" } + + require(media != null) { "media must not be null" } + + require(categories != null) { "categories must not be null" } + + require(duration != null) { "duration must not be null" } + + require(freeCancellation != null) { "freeCancellation must not be null" } + + require(price != null) { "price must not be null" } + + require(supplier != null) { "supplier must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -194,7 +167,7 @@ data class Activity( private var exclusions: kotlin.collections.List? = null, private var knowBeforeYouBook: kotlin.collections.List? = null, private var knowBeforeYouGo: kotlin.collections.List? = null, - private var offers: kotlin.collections.List? = null + private var offers: kotlin.collections.List? = null, ) { fun id(id: kotlin.Int) = apply { this.id = id } @@ -264,31 +237,11 @@ data class Activity( exclusions = exclusions, knowBeforeYouBook = knowBeforeYouBook, knowBeforeYouGo = knowBeforeYouGo, - offers = offers + offers = offers, ) - validate(instance) - return instance } - - private fun validate(instance: Activity) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -314,6 +267,6 @@ data class Activity( exclusions = exclusions, knowBeforeYouBook = knowBeforeYouBook, knowBeforeYouGo = knowBeforeYouGo, - offers = offers + offers = offers, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt index 337bba6f7..8397d0405 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt @@ -13,55 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesWarning import com.expediagroup.sdk.xap.models.Activity import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * +* * @param transactionId A unique identifier for this transaction. * @param location The location user searched, translated into the full, unambiguous format. * @param warnings Container for all warnings generated during the transaction. * @param startDate The startDate of activities in YYY-MM-DD format. * @param endDate The endDate of activities in YYY-MM-DD format. * @param activityDetails - */ +*/ data class ActivityDetailsResponse( // A unique identifier for this transaction. @JsonProperty("TransactionId") - @field:NotNull - @field:Valid val transactionId: kotlin.String, // The location user searched, translated into the full, unambiguous format. @JsonProperty("Location") - @field:NotNull - @field:Valid val location: kotlin.String, // Container for all warnings generated during the transaction. @JsonProperty("Warnings") - @field:Valid val warnings: kotlin.collections.List? = null, // The startDate of activities in YYY-MM-DD format. @JsonProperty("StartDate") @@ -70,9 +45,14 @@ data class ActivityDetailsResponse( @JsonProperty("EndDate") val endDate: java.time.LocalDate? = null, @JsonProperty("ActivityDetails") - @field:Valid - val activityDetails: Activity? = null + val activityDetails: Activity? = null, ) { + init { + require(transactionId != null) { "transactionId must not be null" } + + require(location != null) { "location must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -84,7 +64,7 @@ data class ActivityDetailsResponse( private var warnings: kotlin.collections.List? = null, private var startDate: java.time.LocalDate? = null, private var endDate: java.time.LocalDate? = null, - private var activityDetails: Activity? = null + private var activityDetails: Activity? = null, ) { fun transactionId(transactionId: kotlin.String) = apply { this.transactionId = transactionId } @@ -106,31 +86,11 @@ data class ActivityDetailsResponse( warnings = warnings, startDate = startDate, endDate = endDate, - activityDetails = activityDetails + activityDetails = activityDetails, ) - validate(instance) - return instance } - - private fun validate(instance: ActivityDetailsResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -140,6 +100,6 @@ data class ActivityDetailsResponse( warnings = warnings, startDate = startDate, endDate = endDate, - activityDetails = activityDetails + activityDetails = activityDetails, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt index 79cbaf463..ed8d5b8a5 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt @@ -13,35 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesWarning import com.expediagroup.sdk.xap.models.Activity import com.expediagroup.sdk.xap.models.CategoryGroup import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * +* * @param transactionId A unique identifier for this transaction. * @param count The number of activities returned in the response. * @param location The location that the user searched, expressed in the exact format that the inventory system uses to designate the location. @@ -50,24 +30,19 @@ import javax.validation.constraints.NotNull * @param endDate The endDate of returned group of activities in YYYY-MM-DD format. * @param activities List of activities matching the search criteria. * @param categories Container for a breakdown of how many of each type of Activity have been returned in the API response. - */ +*/ data class ActivityListingsResponse( // A unique identifier for this transaction. @JsonProperty("TransactionId") - @field:NotNull - @field:Valid val transactionId: kotlin.String, // The number of activities returned in the response. @JsonProperty("Count") val count: kotlin.Long, // The location that the user searched, expressed in the exact format that the inventory system uses to designate the location. @JsonProperty("Location") - @field:NotNull - @field:Valid val location: kotlin.String, // Container for all warnings generated during the transaction. @JsonProperty("Warnings") - @field:Valid val warnings: kotlin.collections.List? = null, // The startDate of the returned group of activities in YYYY-MM-DD format. @JsonProperty("StartDate") @@ -77,13 +52,19 @@ data class ActivityListingsResponse( val endDate: java.time.LocalDate? = null, // List of activities matching the search criteria. @JsonProperty("Activities") - @field:Valid val activities: kotlin.collections.List? = null, // Container for a breakdown of how many of each type of Activity have been returned in the API response. @JsonProperty("Categories") - @field:Valid - val categories: kotlin.collections.List? = null + val categories: kotlin.collections.List? = null, ) { + init { + require(transactionId != null) { "transactionId must not be null" } + + require(count != null) { "count must not be null" } + + require(location != null) { "location must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -97,7 +78,7 @@ data class ActivityListingsResponse( private var startDate: java.time.LocalDate? = null, private var endDate: java.time.LocalDate? = null, private var activities: kotlin.collections.List? = null, - private var categories: kotlin.collections.List? = null + private var categories: kotlin.collections.List? = null, ) { fun transactionId(transactionId: kotlin.String) = apply { this.transactionId = transactionId } @@ -125,31 +106,11 @@ data class ActivityListingsResponse( startDate = startDate, endDate = endDate, activities = activities, - categories = categories + categories = categories, ) - validate(instance) - return instance } - - private fun validate(instance: ActivityListingsResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -161,6 +122,6 @@ data class ActivityListingsResponse( startDate = startDate, endDate = endDate, activities = activities, - categories = categories + categories = categories, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AdditionalFee.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AdditionalFee.kt index 30241211d..68cdc2732 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AdditionalFee.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AdditionalFee.kt @@ -13,69 +13,49 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsMoney import com.expediagroup.sdk.xap.models.Deductible import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List of additional fees including both mandatory and optional fees.such as young driver fee/drop off fee /CollisionDamageWaiver +* List of additional fees including both mandatory and optional fees.such as young driver fee/drop off fee /CollisionDamageWaiver * @param isRequired Indicates whether this additional fee is mandatory. * @param financeCategory Category of the fee / Coverages * @param financeSubCategory Sub category of the fee / Coverages . * @param amount * @param description Description of the fee. * @param deductible - */ +*/ data class AdditionalFee( // Indicates whether this additional fee is mandatory. @JsonProperty("IsRequired") - @field:NotNull - @field:Valid val isRequired: kotlin.Boolean, // Category of the fee / Coverages @JsonProperty("FinanceCategory") - @field:NotNull - @field:Valid val financeCategory: kotlin.String, // Sub category of the fee / Coverages . @JsonProperty("FinanceSubCategory") - @field:NotNull - @field:Valid val financeSubCategory: kotlin.String, @JsonProperty("Amount") - @field:NotNull - @field:Valid val amount: CarsMoney, // Description of the fee. @JsonProperty("Description") - @field:Valid val description: kotlin.String? = null, @JsonProperty("Deductible") - @field:Valid - val deductible: Deductible? = null + val deductible: Deductible? = null, ) { + init { + require(isRequired != null) { "isRequired must not be null" } + + require(financeCategory != null) { "financeCategory must not be null" } + + require(financeSubCategory != null) { "financeSubCategory must not be null" } + + require(amount != null) { "amount must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -87,7 +67,7 @@ data class AdditionalFee( private var financeSubCategory: kotlin.String? = null, private var amount: CarsMoney? = null, private var description: kotlin.String? = null, - private var deductible: Deductible? = null + private var deductible: Deductible? = null, ) { fun isRequired(isRequired: kotlin.Boolean) = apply { this.isRequired = isRequired } @@ -109,31 +89,11 @@ data class AdditionalFee( financeSubCategory = financeSubCategory!!, amount = amount!!, description = description, - deductible = deductible + deductible = deductible, ) - validate(instance) - return instance } - - private fun validate(instance: AdditionalFee) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -143,6 +103,6 @@ data class AdditionalFee( financeSubCategory = financeSubCategory!!, amount = amount!!, description = description, - deductible = deductible + deductible = deductible, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Address.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Address.kt index d10f7d59c..84feff4d6 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Address.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Address.kt @@ -13,64 +13,42 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * The address information of the location. +* The address information of the location. * @param address1 Street Number, Street Name, or PO Box * @param address2 Apartment, Floor, Suite, Bldg or more specific information about Address1. * @param city The city * @param province The state or province * @param country 3-letter code for the country * @param postalCode Zip/postal code - */ +*/ data class Address( // Street Number, Street Name, or PO Box @JsonProperty("Address1") - @field:Valid val address1: kotlin.String? = null, // Apartment, Floor, Suite, Bldg or more specific information about Address1. @JsonProperty("Address2") - @field:Valid val address2: kotlin.String? = null, // The city @JsonProperty("City") - @field:Valid val city: kotlin.String? = null, // The state or province @JsonProperty("Province") - @field:Valid val province: kotlin.String? = null, // 3-letter code for the country @JsonProperty("Country") - @field:Valid val country: kotlin.String? = null, // Zip/postal code @JsonProperty("PostalCode") - @field:Valid - val postalCode: kotlin.String? = null + val postalCode: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -82,7 +60,7 @@ data class Address( private var city: kotlin.String? = null, private var province: kotlin.String? = null, private var country: kotlin.String? = null, - private var postalCode: kotlin.String? = null + private var postalCode: kotlin.String? = null, ) { fun address1(address1: kotlin.String?) = apply { this.address1 = address1 } @@ -104,31 +82,11 @@ data class Address( city = city, province = province, country = country, - postalCode = postalCode + postalCode = postalCode, ) - validate(instance) - return instance } - - private fun validate(instance: Address) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -138,6 +96,6 @@ data class Address( city = city, province = province, country = country, - postalCode = postalCode + postalCode = postalCode, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AgeClassRestriction.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AgeClassRestriction.kt index a3c948d70..4f20e32f6 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AgeClassRestriction.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AgeClassRestriction.kt @@ -13,35 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Validation /** - * Container for room occupancy rules based on the age of the guests. +* Container for room occupancy rules based on the age of the guests. * @param ageClass Categories for hotel guests, based on age. * @param ageMinimum The minimum age defined in a particular `AgeClass`. * @param ageMaximum The maximum age defined in a particular `AgeClass`. If not specified, the `AgeClass` has no upper bound. * @param maxGuestCount The max guest count allowed in a particular `AgeClass`. - */ +*/ data class AgeClassRestriction( // Categories for hotel guests, based on age. @JsonProperty("AgeClass") @@ -54,8 +36,11 @@ data class AgeClassRestriction( val ageMaximum: kotlin.Int? = null, // The max guest count allowed in a particular `AgeClass`. @JsonProperty("MaxGuestCount") - val maxGuestCount: kotlin.Int? = null + val maxGuestCount: kotlin.Int? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -65,7 +50,7 @@ data class AgeClassRestriction( private var ageClass: AgeClassRestriction.AgeClass? = null, private var ageMinimum: kotlin.Int? = null, private var ageMaximum: kotlin.Int? = null, - private var maxGuestCount: kotlin.Int? = null + private var maxGuestCount: kotlin.Int? = null, ) { fun ageClass(ageClass: AgeClassRestriction.AgeClass?) = apply { this.ageClass = ageClass } @@ -81,31 +66,11 @@ data class AgeClassRestriction( ageClass = ageClass, ageMinimum = ageMinimum, ageMaximum = ageMaximum, - maxGuestCount = maxGuestCount + maxGuestCount = maxGuestCount, ) - validate(instance) - return instance } - - private fun validate(instance: AgeClassRestriction) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -113,14 +78,16 @@ data class AgeClassRestriction( ageClass = ageClass, ageMinimum = ageMinimum, ageMaximum = ageMaximum, - maxGuestCount = maxGuestCount + maxGuestCount = maxGuestCount, ) /** * Categories for hotel guests, based on age. * Values: ALL_AGES,SENIOR,ADULT,CHILD,INFANT,OTHER */ - enum class AgeClass(val value: kotlin.String) { + enum class AgeClass( + val value: kotlin.String, + ) { @JsonProperty("All Ages") ALL_AGES("All Ages"), @@ -137,6 +104,6 @@ data class AgeClassRestriction( INFANT("Infant"), @JsonProperty("Other") - OTHER("Other") + OTHER("Other"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendar.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendar.kt index 9e0076e00..9cbda940c 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendar.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendar.kt @@ -13,32 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.DateRange import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param propertyId The unique property identifier that designates a single property. * @param dateRange * @param availability A string of codes that shows property availability, one for every day in the specified date range. Valid values include Y (available) and N (unavailable). ***Note**: The first code stands for availability on the `StartDate` in the `DateRange` and the last one stands for the `EndDate`.* @@ -46,36 +27,32 @@ import javax.validation.Validation * @param minPriorNotify A comma-separated list of numbers that shows how many days before a reservation the booking must occur, one for every day in the specified date range. Valid values include 0-999, and 0 indicates no prior notification required for a given day. The unit is always day. ***Note**: The first number stands for the minimum advance booking days on the `StartDate` in the `DateRange` and the last one stands for the `EndDate`. No limitation if not returned.* * @param minStay A comma-separated list of numbers that show the minimum number of days a traveler can stay, one for every day in the specified date range. Valid values include 0-999, and 0 indicates no minimum for a given day. The unit is always day. ***Note**: The first number stands for the minimum stay on the `StartDate` in the `DateRange` and the last one stands for the `EndDate`. No limitation if not returned.* * @param maxStay A comma-separated list of numbers that show the maximum number of days a traveler can stay, one for every day in the specified date range. Valid values include 0-999, and 0 indicates no maximum for a given day. The unit is always day. ***Note**: The first number stands for the maximum stay on the `StartDate` in the `DateRange` and the last one stands for the `EndDate`. No limitation if not returned. - */ +*/ data class AvailabilityCalendar( // The unique property identifier that designates a single property. @JsonProperty("PropertyId") - @field:Valid val propertyId: kotlin.String? = null, @JsonProperty("DateRange") - @field:Valid val dateRange: DateRange? = null, // A string of codes that shows property availability, one for every day in the specified date range. Valid values include Y (available) and N (unavailable). ***Note**: The first code stands for availability on the `StartDate` in the `DateRange` and the last one stands for the `EndDate`.* @JsonProperty("Availability") - @field:Valid val availability: kotlin.String? = null, // A string of codes that shows changeover action, one for every day in the specified date range. Valid values include - X (no action possible) - C (check-in, checkout) - O (checkout only) - I (check-in only) ***Note**: The first code stands for possible action on the `StartDate` in the `DateRange` and the last one stands for the `EndDate`. All actions are possible if not returned.* @JsonProperty("ChangeOver") - @field:Valid val changeOver: kotlin.String? = null, // A comma-separated list of numbers that shows how many days before a reservation the booking must occur, one for every day in the specified date range. Valid values include 0-999, and 0 indicates no prior notification required for a given day. The unit is always day. ***Note**: The first number stands for the minimum advance booking days on the `StartDate` in the `DateRange` and the last one stands for the `EndDate`. No limitation if not returned.* @JsonProperty("MinPriorNotify") - @field:Valid val minPriorNotify: kotlin.String? = null, // A comma-separated list of numbers that show the minimum number of days a traveler can stay, one for every day in the specified date range. Valid values include 0-999, and 0 indicates no minimum for a given day. The unit is always day. ***Note**: The first number stands for the minimum stay on the `StartDate` in the `DateRange` and the last one stands for the `EndDate`. No limitation if not returned.* @JsonProperty("MinStay") - @field:Valid val minStay: kotlin.String? = null, // A comma-separated list of numbers that show the maximum number of days a traveler can stay, one for every day in the specified date range. Valid values include 0-999, and 0 indicates no maximum for a given day. The unit is always day. ***Note**: The first number stands for the maximum stay on the `StartDate` in the `DateRange` and the last one stands for the `EndDate`. No limitation if not returned. @JsonProperty("MaxStay") - @field:Valid - val maxStay: kotlin.String? = null + val maxStay: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -88,7 +65,7 @@ data class AvailabilityCalendar( private var changeOver: kotlin.String? = null, private var minPriorNotify: kotlin.String? = null, private var minStay: kotlin.String? = null, - private var maxStay: kotlin.String? = null + private var maxStay: kotlin.String? = null, ) { fun propertyId(propertyId: kotlin.String?) = apply { this.propertyId = propertyId } @@ -113,31 +90,11 @@ data class AvailabilityCalendar( changeOver = changeOver, minPriorNotify = minPriorNotify, minStay = minStay, - maxStay = maxStay + maxStay = maxStay, ) - validate(instance) - return instance } - - private fun validate(instance: AvailabilityCalendar) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -148,6 +105,6 @@ data class AvailabilityCalendar( changeOver = changeOver, minPriorNotify = minPriorNotify, minStay = minStay, - maxStay = maxStay + maxStay = maxStay, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendarResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendarResponse.kt index 1539de6b9..5d105f2ea 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendarResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendarResponse.kt @@ -13,51 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.AvailabilityCalendar import com.expediagroup.sdk.xap.models.LodgingWarning import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param warnings There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. * @param transactionId Unique identifier for the transaction. * @param availabilityCalendars A list of the calendar entities. - */ +*/ data class AvailabilityCalendarResponse( // There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. @JsonProperty("Warnings") - @field:Valid val warnings: kotlin.collections.List? = null, // Unique identifier for the transaction. @JsonProperty("TransactionId") - @field:Valid val transactionId: kotlin.String? = null, // A list of the calendar entities. @JsonProperty("AvailabilityCalendars") - @field:Valid - val availabilityCalendars: kotlin.collections.List? = null + val availabilityCalendars: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -66,7 +47,7 @@ data class AvailabilityCalendarResponse( class Builder( private var warnings: kotlin.collections.List? = null, private var transactionId: kotlin.String? = null, - private var availabilityCalendars: kotlin.collections.List? = null + private var availabilityCalendars: kotlin.collections.List? = null, ) { fun warnings(warnings: kotlin.collections.List?) = apply { this.warnings = warnings } @@ -79,37 +60,17 @@ data class AvailabilityCalendarResponse( AvailabilityCalendarResponse( warnings = warnings, transactionId = transactionId, - availabilityCalendars = availabilityCalendars + availabilityCalendars = availabilityCalendars, ) - validate(instance) - return instance } - - private fun validate(instance: AvailabilityCalendarResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( warnings = warnings, transactionId = transactionId, - availabilityCalendars = availabilityCalendars + availabilityCalendars = availabilityCalendars, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt index 31d96f56d..70a55cf16 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt @@ -13,61 +13,45 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesCancellationPolicy import com.expediagroup.sdk.xap.models.Ticket import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The list of available Time Slots for the activity. +* The list of available Time Slots for the activity. * @param dateTime The date and time when the activity happens. * @param allDayActivity Indicates whether the activity is an all-day activity. * @param cancellationPolicy * @param tickets Container for ticket information. - */ +*/ data class AvailableTimeSlot( // The date and time when the activity happens. @JsonProperty("DateTime") val dateTime: java.time.LocalDateTime, // Indicates whether the activity is an all-day activity. @JsonProperty("AllDayActivity") - @field:NotNull - @field:Valid val allDayActivity: kotlin.Boolean, @JsonProperty("CancellationPolicy") - @field:NotNull - @field:Valid val cancellationPolicy: ActivitiesCancellationPolicy, // Container for ticket information. @JsonProperty("Tickets") - @field:NotNull - @field:Valid val tickets: kotlin.collections .List< - Ticket - > + Ticket, + >, ) { + init { + require(dateTime != null) { "dateTime must not be null" } + + require(allDayActivity != null) { "allDayActivity must not be null" } + + require(cancellationPolicy != null) { "cancellationPolicy must not be null" } + + require(tickets != null) { "tickets must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -77,7 +61,7 @@ data class AvailableTimeSlot( private var dateTime: java.time.LocalDateTime? = null, private var allDayActivity: kotlin.Boolean? = null, private var cancellationPolicy: ActivitiesCancellationPolicy? = null, - private var tickets: kotlin.collections.List? = null + private var tickets: kotlin.collections.List? = null, ) { fun dateTime(dateTime: java.time.LocalDateTime) = apply { this.dateTime = dateTime } @@ -93,31 +77,11 @@ data class AvailableTimeSlot( dateTime = dateTime!!, allDayActivity = allDayActivity!!, cancellationPolicy = cancellationPolicy!!, - tickets = tickets!! + tickets = tickets!!, ) - validate(instance) - return instance } - - private fun validate(instance: AvailableTimeSlot) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -125,6 +89,6 @@ data class AvailableTimeSlot( dateTime = dateTime!!, allDayActivity = allDayActivity!!, cancellationPolicy = cancellationPolicy!!, - tickets = tickets!! + tickets = tickets!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/BedType.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/BedType.kt index 8dd01d693..576476d3c 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/BedType.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/BedType.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Statement of bed types available for this offer. A room may have several bed type options available. **NOTE**: due to the large number of bed type options available, we no longer publish a list of available bed types. More information is available in [Lodging Bed Types](https://developers.expediagroup.com/xap/products/xap/lodging/references/bed-types). +* Statement of bed types available for this offer. A room may have several bed type options available. **NOTE**: due to the large number of bed type options available, we no longer publish a list of available bed types. More information is available in [Lodging Bed Types](https://developers.expediagroup.com/xap/products/xap/lodging/references/bed-types). * @param id The bed type ID * @param description The bed type description. - */ +*/ data class BedType( // The bed type ID @JsonProperty("Id") - @field:Valid val id: kotlin.String? = null, // The bed type description. @JsonProperty("Description") - @field:Valid - val description: kotlin.String? = null + val description: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class BedType( class Builder( private var id: kotlin.String? = null, - private var description: kotlin.String? = null + private var description: kotlin.String? = null, ) { fun id(id: kotlin.String?) = apply { this.id = id } @@ -68,36 +50,16 @@ data class BedType( val instance = BedType( id = id, - description = description + description = description, ) - validate(instance) - return instance } - - private fun validate(instance: BedType) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id, - description = description + description = description, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRule.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRule.kt index 813dd4764..2ff18c011 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRule.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRule.kt @@ -13,56 +13,38 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CancellationPenaltyRulePenaltyPrice import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param penaltyNightCount Specifies the per-stay cancellation fee charged in terms of the cost of the number of nights listed, in addition to any other penalties. The rate charged is based on the earliest night(s) of the stay. * @param penaltyPercentOfStay Specifies the per-stay cancellation fee charged as a percentage of the total rate, in addition to any other penalties listed. * @param penaltyPrice * @param penaltyStartDateTime The beginning of the window of time when the `CancellationPenaltyRule` is in effect. The date and time are expressed in ISO 8601 International Date format, and local to the hotel. * @param penaltyEndDateTime The end of the window of time when the `CancellationPenaltyRule` is in effect. The date and time are expressed in ISO 8601 International Date format, and local to the hotel. - */ +*/ data class CancellationPenaltyRule( // Specifies the per-stay cancellation fee charged in terms of the cost of the number of nights listed, in addition to any other penalties. The rate charged is based on the earliest night(s) of the stay. @JsonProperty("PenaltyNightCount") val penaltyNightCount: kotlin.Int? = null, // Specifies the per-stay cancellation fee charged as a percentage of the total rate, in addition to any other penalties listed. @JsonProperty("PenaltyPercentOfStay") - @field:Valid val penaltyPercentOfStay: kotlin.String? = null, @JsonProperty("PenaltyPrice") - @field:Valid val penaltyPrice: CancellationPenaltyRulePenaltyPrice? = null, // The beginning of the window of time when the `CancellationPenaltyRule` is in effect. The date and time are expressed in ISO 8601 International Date format, and local to the hotel. @JsonProperty("PenaltyStartDateTime") val penaltyStartDateTime: java.time.OffsetDateTime? = null, // The end of the window of time when the `CancellationPenaltyRule` is in effect. The date and time are expressed in ISO 8601 International Date format, and local to the hotel. @JsonProperty("PenaltyEndDateTime") - val penaltyEndDateTime: java.time.OffsetDateTime? = null + val penaltyEndDateTime: java.time.OffsetDateTime? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -73,7 +55,7 @@ data class CancellationPenaltyRule( private var penaltyPercentOfStay: kotlin.String? = null, private var penaltyPrice: CancellationPenaltyRulePenaltyPrice? = null, private var penaltyStartDateTime: java.time.OffsetDateTime? = null, - private var penaltyEndDateTime: java.time.OffsetDateTime? = null + private var penaltyEndDateTime: java.time.OffsetDateTime? = null, ) { fun penaltyNightCount(penaltyNightCount: kotlin.Int?) = apply { this.penaltyNightCount = penaltyNightCount } @@ -92,31 +74,11 @@ data class CancellationPenaltyRule( penaltyPercentOfStay = penaltyPercentOfStay, penaltyPrice = penaltyPrice, penaltyStartDateTime = penaltyStartDateTime, - penaltyEndDateTime = penaltyEndDateTime + penaltyEndDateTime = penaltyEndDateTime, ) - validate(instance) - return instance } - - private fun validate(instance: CancellationPenaltyRule) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -125,6 +87,6 @@ data class CancellationPenaltyRule( penaltyPercentOfStay = penaltyPercentOfStay, penaltyPrice = penaltyPrice, penaltyStartDateTime = penaltyStartDateTime, - penaltyEndDateTime = penaltyEndDateTime + penaltyEndDateTime = penaltyEndDateTime, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRulePenaltyPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRulePenaltyPrice.kt index 448d38b1f..b4c7cd623 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRulePenaltyPrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRulePenaltyPrice.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class CancellationPenaltyRulePenaltyPrice( // The value of the element being defined. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:Valid val currency: kotlin.String? = null, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null + val localCurrencyPrice: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class CancellationPenaltyRulePenaltyPrice( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null + private var localCurrencyPrice: Money? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -77,37 +58,17 @@ data class CancellationPenaltyRulePenaltyPrice( CancellationPenaltyRulePenaltyPrice( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: CancellationPenaltyRulePenaltyPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPolicy.kt index 5a12667ea..e1d667006 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPolicy.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPolicy.kt @@ -13,34 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CancellationPenaltyRule import com.expediagroup.sdk.xap.models.NonRefundableDateRange import com.expediagroup.sdk.xap.models.WaiverPolicy import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for room cancellation policy. +* Container for room cancellation policy. * @param waiverPolicy * @param cancellableOnline Boolean value to identify if the reservation can be cancelled online. If false, the customer will only be able to cancel a refundable room by calling Expedia Customer Service. * @param refundable Indicate whether the rate is refundable or not. @@ -49,39 +30,35 @@ import javax.validation.Validation * @param cancellationPenaltyRules Container for cancellation penalty details. * @param cancelPolicyDescription Additional cancellation policy information available as static text. * @param nonRefundableDateRanges A list of dates ranges that are non-refundable. **Note**: The stay dates in those date ranges will always be charged whenever there is any cancellation penalty rule. - */ +*/ data class CancellationPolicy( @JsonProperty("WaiverPolicy") - @field:Valid val waiverPolicy: WaiverPolicy? = null, // Boolean value to identify if the reservation can be cancelled online. If false, the customer will only be able to cancel a refundable room by calling Expedia Customer Service. @JsonProperty("CancellableOnline") - @field:Valid val cancellableOnline: kotlin.Boolean? = null, // Indicate whether the rate is refundable or not. @JsonProperty("Refundable") - @field:Valid val refundable: kotlin.Boolean? = null, // Indicate whether the room can be cancelled free of charge. @JsonProperty("FreeCancellation") - @field:Valid val freeCancellation: kotlin.Boolean? = null, // The date and time until which the room can be cancelled free of charge. This is expressed in the local time of the Hotel. @JsonProperty("FreeCancellationEndDateTime") val freeCancellationEndDateTime: java.time.OffsetDateTime? = null, // Container for cancellation penalty details. @JsonProperty("CancellationPenaltyRules") - @field:Valid val cancellationPenaltyRules: kotlin.collections.List? = null, // Additional cancellation policy information available as static text. @JsonProperty("CancelPolicyDescription") - @field:Valid val cancelPolicyDescription: kotlin.String? = null, // A list of dates ranges that are non-refundable. **Note**: The stay dates in those date ranges will always be charged whenever there is any cancellation penalty rule. @JsonProperty("NonRefundableDateRanges") - @field:Valid - val nonRefundableDateRanges: kotlin.collections.List? = null + val nonRefundableDateRanges: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -95,7 +72,7 @@ data class CancellationPolicy( private var freeCancellationEndDateTime: java.time.OffsetDateTime? = null, private var cancellationPenaltyRules: kotlin.collections.List? = null, private var cancelPolicyDescription: kotlin.String? = null, - private var nonRefundableDateRanges: kotlin.collections.List? = null + private var nonRefundableDateRanges: kotlin.collections.List? = null, ) { fun waiverPolicy(waiverPolicy: WaiverPolicy?) = apply { this.waiverPolicy = waiverPolicy } @@ -123,31 +100,11 @@ data class CancellationPolicy( freeCancellationEndDateTime = freeCancellationEndDateTime, cancellationPenaltyRules = cancellationPenaltyRules, cancelPolicyDescription = cancelPolicyDescription, - nonRefundableDateRanges = nonRefundableDateRanges + nonRefundableDateRanges = nonRefundableDateRanges, ) - validate(instance) - return instance } - - private fun validate(instance: CancellationPolicy) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -159,6 +116,6 @@ data class CancellationPolicy( freeCancellationEndDateTime = freeCancellationEndDateTime, cancellationPenaltyRules = cancellationPenaltyRules, cancelPolicyDescription = cancelPolicyDescription, - nonRefundableDateRanges = nonRefundableDateRanges + nonRefundableDateRanges = nonRefundableDateRanges, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Capacity.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Capacity.kt index 17fbeb6c1..9b7489776 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Capacity.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Capacity.kt @@ -13,35 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Validation /** - * Capacity for car's properties. +* Capacity for car's properties. * @param adultCount The typical number of adults that can fit comfortably in the car. * @param childCount The typical number of children that can fit comfortably in the car. * @param smallLuggageCount The typical number of small pieces of luggage that fit in the cargo space. * @param largeLuggageCount The typical number of large pieces of luggage that fit in the cargo space. - */ +*/ data class Capacity( // The typical number of adults that can fit comfortably in the car. @JsonProperty("AdultCount") @@ -54,8 +36,12 @@ data class Capacity( val smallLuggageCount: kotlin.Long? = null, // The typical number of large pieces of luggage that fit in the cargo space. @JsonProperty("LargeLuggageCount") - val largeLuggageCount: kotlin.Long? = null + val largeLuggageCount: kotlin.Long? = null, ) { + init { + require(adultCount != null) { "adultCount must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -65,7 +51,7 @@ data class Capacity( private var adultCount: kotlin.Long? = null, private var childCount: kotlin.Long? = null, private var smallLuggageCount: kotlin.Long? = null, - private var largeLuggageCount: kotlin.Long? = null + private var largeLuggageCount: kotlin.Long? = null, ) { fun adultCount(adultCount: kotlin.Long) = apply { this.adultCount = adultCount } @@ -81,31 +67,11 @@ data class Capacity( adultCount = adultCount!!, childCount = childCount, smallLuggageCount = smallLuggageCount, - largeLuggageCount = largeLuggageCount + largeLuggageCount = largeLuggageCount, ) - validate(instance) - return instance } - - private fun validate(instance: Capacity) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -113,6 +79,6 @@ data class Capacity( adultCount = adultCount!!, childCount = childCount, smallLuggageCount = smallLuggageCount, - largeLuggageCount = largeLuggageCount + largeLuggageCount = largeLuggageCount, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Car.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Car.kt index 2e806cdb7..94b1d693e 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Car.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Car.kt @@ -13,24 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.AdditionalFee import com.expediagroup.sdk.xap.models.CarsCancellationPolicy import com.expediagroup.sdk.xap.models.CarsLink @@ -44,13 +28,9 @@ import com.expediagroup.sdk.xap.models.Supplier import com.expediagroup.sdk.xap.models.VehicleDetails import com.expediagroup.sdk.xap.models.VendorLocationDetails import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List of cars matching the search criteria. +* List of cars matching the search criteria. * @param id Uniquely identifies a Car Offer.Note: since pay-online and pay-at-the-counter Car Offers have the same associated Rate Code, the Offer ID is the only unique identifier to differentiate between the two offers when referencing or booking. * @param vehicleDetails * @param supplier @@ -68,73 +48,66 @@ import javax.validation.constraints.NotNull * @param noShowPenalty * @param images List of image resources of the car product. * @param rating - */ +*/ data class Car( // Uniquely identifies a Car Offer.Note: since pay-online and pay-at-the-counter Car Offers have the same associated Rate Code, the Offer ID is the only unique identifier to differentiate between the two offers when referencing or booking. @JsonProperty("Id") - @field:NotNull - @field:Valid val id: kotlin.String, @JsonProperty("VehicleDetails") - @field:NotNull - @field:Valid val vehicleDetails: VehicleDetails, @JsonProperty("Supplier") - @field:NotNull - @field:Valid val supplier: Supplier, @JsonProperty("PickupDetails") - @field:NotNull - @field:Valid val pickupDetails: VendorLocationDetails, @JsonProperty("DropOffDetails") - @field:NotNull - @field:Valid val dropOffDetails: VendorLocationDetails, @JsonProperty("Price") - @field:NotNull - @field:Valid val price: Price, @JsonProperty("CancellationPolicy") - @field:NotNull - @field:Valid val cancellationPolicy: CarsCancellationPolicy, // DataTimeStamp @JsonProperty("DataTimeStamp") val dataTimeStamp: java.time.OffsetDateTime? = null, // Indicate whether the supplier supports online checkin @JsonProperty("OnlineCheckIn") - @field:Valid val onlineCheckIn: kotlin.Boolean? = null, // Indicate whether the supplier supports skip the counter @JsonProperty("SkipTheCounter") - @field:Valid val skipTheCounter: kotlin.Boolean? = null, // A map of links to other Car APIs or Expedia websites. @JsonProperty("Links") - @field:Valid val links: kotlin.collections.Map? = null, @JsonProperty("RateDetails") - @field:Valid val rateDetails: RateDetails? = null, @JsonProperty("ReferencePrice") - @field:Valid val referencePrice: CarsMoney? = null, // List of additional fees including both mandatory and optional fees.such as young driver fee/drop off fee /CollisionDamageWaiver @JsonProperty("AdditionalFees") - @field:Valid val additionalFees: kotlin.collections.List? = null, @JsonProperty("NoShowPenalty") - @field:Valid val noShowPenalty: PenaltyType? = null, // List of image resources of the car product. @JsonProperty("Images") - @field:Valid val images: kotlin.collections.List? = null, @JsonProperty("Rating") - @field:Valid - val rating: RatingWithoutDetails? = null + val rating: RatingWithoutDetails? = null, ) { + init { + require(id != null) { "id must not be null" } + + require(vehicleDetails != null) { "vehicleDetails must not be null" } + + require(supplier != null) { "supplier must not be null" } + + require(pickupDetails != null) { "pickupDetails must not be null" } + + require(dropOffDetails != null) { "dropOffDetails must not be null" } + + require(price != null) { "price must not be null" } + + require(cancellationPolicy != null) { "cancellationPolicy must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -157,7 +130,7 @@ data class Car( private var additionalFees: kotlin.collections.List? = null, private var noShowPenalty: PenaltyType? = null, private var images: kotlin.collections.List? = null, - private var rating: RatingWithoutDetails? = null + private var rating: RatingWithoutDetails? = null, ) { fun id(id: kotlin.String) = apply { this.id = id } @@ -212,31 +185,11 @@ data class Car( additionalFees = additionalFees, noShowPenalty = noShowPenalty, images = images, - rating = rating + rating = rating, ) - validate(instance) - return instance } - - private fun validate(instance: Car) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -257,6 +210,6 @@ data class Car( additionalFees = additionalFees, noShowPenalty = noShowPenalty, images = images, - rating = rating + rating = rating, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarCategory.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarCategory.kt index df984b321..d57f96356 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarCategory.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarCategory.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Car category. Please find list of Car Type Codes in https://expediaintegration.zendesk.com/hc/en-us/articles/115008631767 +* Car category. Please find list of Car Type Codes in https://expediaintegration.zendesk.com/hc/en-us/articles/115008631767 * @param code Car category code. * @param `value` Car category value. - */ +*/ data class CarCategory( // Car category code. @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // Car category value. @JsonProperty("Value") - @field:NotNull - @field:Valid - val `value`: kotlin.String + val `value`: kotlin.String, ) { + init { + require(code != null) { "code must not be null" } + + require(`value` != null) { "`value` must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class CarCategory( class Builder( private var code: kotlin.String? = null, - private var `value`: kotlin.String? = null + private var `value`: kotlin.String? = null, ) { fun code(code: kotlin.String) = apply { this.code = code } @@ -71,36 +53,16 @@ data class CarCategory( val instance = CarCategory( code = code!!, - `value` = `value`!! + `value` = `value`!!, ) - validate(instance) - return instance } - - private fun validate(instance: CarCategory) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( code = code!!, - `value` = `value`!! + `value` = `value`!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetails.kt index e2047620e..32fc904d1 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetails.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetails.kt @@ -13,24 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.AdditionalFee import com.expediagroup.sdk.xap.models.CarPolicy import com.expediagroup.sdk.xap.models.CarsCancellationPolicy @@ -48,13 +32,9 @@ import com.expediagroup.sdk.xap.models.TaxesAndFees import com.expediagroup.sdk.xap.models.VehicleDetails import com.expediagroup.sdk.xap.models.VendorLocationDetails import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Details of requested car. +* Details of requested car. * @param vehicleDetails * @param supplier * @param pickupDetails @@ -74,80 +54,69 @@ import javax.validation.constraints.NotNull * @param carPolicies A list of policies that apply to this car rental. * @param images List of image resources of the car product. * @param rating - */ +*/ data class CarDetails( @JsonProperty("VehicleDetails") - @field:NotNull - @field:Valid val vehicleDetails: VehicleDetails, @JsonProperty("Supplier") - @field:NotNull - @field:Valid val supplier: Supplier, @JsonProperty("PickupDetails") - @field:NotNull - @field:Valid val pickupDetails: VendorLocationDetails, @JsonProperty("DropOffDetails") - @field:NotNull - @field:Valid val dropOffDetails: VendorLocationDetails, @JsonProperty("Price") - @field:NotNull - @field:Valid val price: Price, @JsonProperty("CancellationPolicy") - @field:NotNull - @field:Valid val cancellationPolicy: CarsCancellationPolicy, // Indicate whether the supplier supports online checkin @JsonProperty("OnlineCheckIn") - @field:Valid val onlineCheckIn: kotlin.Boolean? = null, // Indicate whether the supplier supports skip the counter @JsonProperty("SkipTheCounter") - @field:Valid val skipTheCounter: kotlin.Boolean? = null, @JsonProperty("RateDetails") - @field:Valid val rateDetails: RateDetails? = null, @JsonProperty("ReferencePrice") - @field:Valid val referencePrice: CarsMoney? = null, // List of additional fees including both mandatory and optional fees.such as young driver fee/drop off fee /CollisionDamageWaiver @JsonProperty("AdditionalFees") - @field:Valid val additionalFees: kotlin.collections.List? = null, // List of TaxesAndFees Details @JsonProperty("TaxesAndFeesDetails") - @field:Valid val taxesAndFeesDetails: kotlin.collections.List? = null, // List of ExtraFeesDetails @JsonProperty("ExtraFeesDetails") - @field:Valid val extraFeesDetails: kotlin.collections.List? = null, // Description and costs of any optional special equipment that may be rented with the car. @JsonProperty("SpecialEquipments") - @field:Valid val specialEquipments: kotlin.collections.List? = null, @JsonProperty("RentalLimits") - @field:Valid val rentalLimits: RentalLimits? = null, @JsonProperty("NoShowPenalty") - @field:Valid val noShowPenalty: PenaltyType? = null, // A list of policies that apply to this car rental. @JsonProperty("CarPolicies") - @field:Valid val carPolicies: kotlin.collections.List? = null, // List of image resources of the car product. @JsonProperty("Images") - @field:Valid val images: kotlin.collections.List? = null, @JsonProperty("Rating") - @field:Valid - val rating: Rating? = null + val rating: Rating? = null, ) { + init { + require(vehicleDetails != null) { "vehicleDetails must not be null" } + + require(supplier != null) { "supplier must not be null" } + + require(pickupDetails != null) { "pickupDetails must not be null" } + + require(dropOffDetails != null) { "dropOffDetails must not be null" } + + require(price != null) { "price must not be null" } + + require(cancellationPolicy != null) { "cancellationPolicy must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -172,7 +141,7 @@ data class CarDetails( private var noShowPenalty: PenaltyType? = null, private var carPolicies: kotlin.collections.List? = null, private var images: kotlin.collections.List? = null, - private var rating: Rating? = null + private var rating: Rating? = null, ) { fun vehicleDetails(vehicleDetails: VehicleDetails) = apply { this.vehicleDetails = vehicleDetails } @@ -233,31 +202,11 @@ data class CarDetails( noShowPenalty = noShowPenalty, carPolicies = carPolicies, images = images, - rating = rating + rating = rating, ) - validate(instance) - return instance } - - private fun validate(instance: CarDetails) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -280,6 +229,6 @@ data class CarDetails( noShowPenalty = noShowPenalty, carPolicies = carPolicies, images = images, - rating = rating + rating = rating, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetailsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetailsResponse.kt index 3649d3c5d..bb2837c94 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetailsResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetailsResponse.kt @@ -13,64 +13,42 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarDetails import com.expediagroup.sdk.xap.models.CarsLink import com.expediagroup.sdk.xap.models.CarsValidFormsOfPayment import com.expediagroup.sdk.xap.models.CarsWarning import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * +* * @param transactionId A unique identifier for this transaction. * @param warnings Container for warning codes * @param carDetails * @param validFormsOfPayment List of all the forms of payment that will be accepted for the booking of this rental transaction. * @param links A map of links to other Car APIs. possible link name: ApiBooking - */ +*/ data class CarDetailsResponse( // A unique identifier for this transaction. @JsonProperty("TransactionId") - @field:NotNull - @field:Valid val transactionId: kotlin.String, // Container for warning codes @JsonProperty("Warnings") - @field:Valid val warnings: kotlin.collections.List? = null, @JsonProperty("CarDetails") - @field:Valid val carDetails: CarDetails? = null, // List of all the forms of payment that will be accepted for the booking of this rental transaction. @JsonProperty("ValidFormsOfPayment") - @field:Valid val validFormsOfPayment: kotlin.collections.List? = null, // A map of links to other Car APIs. possible link name: ApiBooking @JsonProperty("Links") - @field:Valid - val links: kotlin.collections.Map? = null + val links: kotlin.collections.Map? = null, ) { + init { + require(transactionId != null) { "transactionId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -81,7 +59,7 @@ data class CarDetailsResponse( private var warnings: kotlin.collections.List? = null, private var carDetails: CarDetails? = null, private var validFormsOfPayment: kotlin.collections.List? = null, - private var links: kotlin.collections.Map? = null + private var links: kotlin.collections.Map? = null, ) { fun transactionId(transactionId: kotlin.String) = apply { this.transactionId = transactionId } @@ -100,31 +78,11 @@ data class CarDetailsResponse( warnings = warnings, carDetails = carDetails, validFormsOfPayment = validFormsOfPayment, - links = links + links = links, ) - validate(instance) - return instance } - - private fun validate(instance: CarDetailsResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -133,6 +91,6 @@ data class CarDetailsResponse( warnings = warnings, carDetails = carDetails, validFormsOfPayment = validFormsOfPayment, - links = links + links = links, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarListingsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarListingsResponse.kt index c98eeed36..a86f1a5d4 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarListingsResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarListingsResponse.kt @@ -13,57 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Car import com.expediagroup.sdk.xap.models.CarsWarning import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * +* * @param transactionId A unique identifier for this transaction. * @param carCount The number of cars offers returned in the response. * @param warnings Container for warning codes * @param cars List of cars matching the search criteria. - */ +*/ data class CarListingsResponse( // A unique identifier for this transaction. @JsonProperty("TransactionId") - @field:NotNull - @field:Valid val transactionId: kotlin.String, // The number of cars offers returned in the response. @JsonProperty("CarCount") val carCount: kotlin.Long, // Container for warning codes @JsonProperty("Warnings") - @field:Valid val warnings: kotlin.collections.List? = null, // List of cars matching the search criteria. @JsonProperty("Cars") - @field:Valid - val cars: kotlin.collections.List? = null + val cars: kotlin.collections.List? = null, ) { + init { + require(transactionId != null) { "transactionId must not be null" } + + require(carCount != null) { "carCount must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -73,7 +55,7 @@ data class CarListingsResponse( private var transactionId: kotlin.String? = null, private var carCount: kotlin.Long? = null, private var warnings: kotlin.collections.List? = null, - private var cars: kotlin.collections.List? = null + private var cars: kotlin.collections.List? = null, ) { fun transactionId(transactionId: kotlin.String) = apply { this.transactionId = transactionId } @@ -89,31 +71,11 @@ data class CarListingsResponse( transactionId = transactionId!!, carCount = carCount!!, warnings = warnings, - cars = cars + cars = cars, ) - validate(instance) - return instance } - - private fun validate(instance: CarListingsResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -121,6 +83,6 @@ data class CarListingsResponse( transactionId = transactionId!!, carCount = carCount!!, warnings = warnings, - cars = cars + cars = cars, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarPolicy.kt index 4e181742b..f46c53f83 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarPolicy.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarPolicy.kt @@ -13,46 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * A list of policies that apply to this car rental. +* A list of policies that apply to this car rental. * @param categoryCode The category that this policy applies to (e.g. cancellation, drivers license requirements, driver age requirements) * @param policyText The raw text of the policy.This is generally localized into the requested language, but may be English if no other translations are available. - */ +*/ data class CarPolicy( // The category that this policy applies to (e.g. cancellation, drivers license requirements, driver age requirements) @JsonProperty("CategoryCode") - @field:NotNull - @field:Valid val categoryCode: kotlin.String, // The raw text of the policy.This is generally localized into the requested language, but may be English if no other translations are available. @JsonProperty("PolicyText") - @field:Valid - val policyText: kotlin.String? = null + val policyText: kotlin.String? = null, ) { + init { + require(categoryCode != null) { "categoryCode must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -60,7 +41,7 @@ data class CarPolicy( class Builder( private var categoryCode: kotlin.String? = null, - private var policyText: kotlin.String? = null + private var policyText: kotlin.String? = null, ) { fun categoryCode(categoryCode: kotlin.String) = apply { this.categoryCode = categoryCode } @@ -70,36 +51,16 @@ data class CarPolicy( val instance = CarPolicy( categoryCode = categoryCode!!, - policyText = policyText + policyText = policyText, ) - validate(instance) - return instance } - - private fun validate(instance: CarPolicy) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( categoryCode = categoryCode!!, - policyText = policyText + policyText = policyText, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarType.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarType.kt index e5694075b..cf1e9d517 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarType.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarType.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Car type. Please find list of Car Type Codes in https://expediaintegration.zendesk.com/hc/en-us/articles/115002516708 +* Car type. Please find list of Car Type Codes in https://expediaintegration.zendesk.com/hc/en-us/articles/115002516708 * @param code Car type code. * @param `value` Car type value. - */ +*/ data class CarType( // Car type code. @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // Car type value. @JsonProperty("Value") - @field:NotNull - @field:Valid - val `value`: kotlin.String + val `value`: kotlin.String, ) { + init { + require(code != null) { "code must not be null" } + + require(`value` != null) { "`value` must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class CarType( class Builder( private var code: kotlin.String? = null, - private var `value`: kotlin.String? = null + private var `value`: kotlin.String? = null, ) { fun code(code: kotlin.String) = apply { this.code = code } @@ -71,36 +53,16 @@ data class CarType( val instance = CarType( code = code!!, - `value` = `value`!! + `value` = `value`!!, ) - validate(instance) - return instance } - - private fun validate(instance: CarType) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( code = code!!, - `value` = `value`!! + `value` = `value`!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsAddress.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsAddress.kt index 55c39e7d0..ceafb96fd 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsAddress.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsAddress.kt @@ -13,32 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Address information +* Address information * @param address1 Street Number, Street Name, or PO Box * @param city The city * @param country 3-letter code for the country @@ -46,40 +26,38 @@ import javax.validation.constraints.NotNull * @param suite Suite/apartment number * @param province The state or province * @param postalCode Zip/postal code - */ +*/ data class CarsAddress( // Street Number, Street Name, or PO Box @JsonProperty("Address1") - @field:NotNull - @field:Valid val address1: kotlin.String, // The city @JsonProperty("City") - @field:NotNull - @field:Valid val city: kotlin.String, // 3-letter code for the country @JsonProperty("Country") - @field:NotNull - @field:Valid val country: kotlin.String, // Apartment, Floor, Suite, Bldg # or more specific information about Address1. @JsonProperty("Address2") - @field:Valid val address2: kotlin.String? = null, // Suite/apartment number @JsonProperty("Suite") - @field:Valid val suite: kotlin.String? = null, // The state or province @JsonProperty("Province") - @field:Valid val province: kotlin.String? = null, // Zip/postal code @JsonProperty("PostalCode") - @field:Valid - val postalCode: kotlin.String? = null + val postalCode: kotlin.String? = null, ) { + init { + require(address1 != null) { "address1 must not be null" } + + require(city != null) { "city must not be null" } + + require(country != null) { "country must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -92,7 +70,7 @@ data class CarsAddress( private var address2: kotlin.String? = null, private var suite: kotlin.String? = null, private var province: kotlin.String? = null, - private var postalCode: kotlin.String? = null + private var postalCode: kotlin.String? = null, ) { fun address1(address1: kotlin.String) = apply { this.address1 = address1 } @@ -117,31 +95,11 @@ data class CarsAddress( address2 = address2, suite = suite, province = province, - postalCode = postalCode + postalCode = postalCode, ) - validate(instance) - return instance } - - private fun validate(instance: CarsAddress) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -152,6 +110,6 @@ data class CarsAddress( address2 = address2, suite = suite, province = province, - postalCode = postalCode + postalCode = postalCode, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCancellationPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCancellationPolicy.kt index 5b98a5167..8612c6a72 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCancellationPolicy.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCancellationPolicy.kt @@ -13,59 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.NonCancellableDateTimeRange import com.expediagroup.sdk.xap.models.PenaltyRule import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Cancellation Policy Container. +* Cancellation Policy Container. * @param cancellable Indicates if this car can be cancelled (free cancel or penalty cancel) * @param freeCancellation Indicates if this car may be cancelled without a penalty. * @param freeCancellationEndDateTime Indicates the latest time that the car can be cancelled for free. * @param penaltyRules Container for penalty rules * @param nonCancellableDateTimeRange - */ +*/ data class CarsCancellationPolicy( // Indicates if this car can be cancelled (free cancel or penalty cancel) @JsonProperty("Cancellable") - @field:Valid val cancellable: kotlin.Boolean? = null, // Indicates if this car may be cancelled without a penalty. @JsonProperty("FreeCancellation") - @field:Valid val freeCancellation: kotlin.Boolean? = null, // Indicates the latest time that the car can be cancelled for free. @JsonProperty("FreeCancellationEndDateTime") val freeCancellationEndDateTime: java.time.LocalDateTime? = null, // Container for penalty rules @JsonProperty("PenaltyRules") - @field:Valid val penaltyRules: kotlin.collections.List? = null, @JsonProperty("NonCancellableDateTimeRange") - @field:Valid - val nonCancellableDateTimeRange: NonCancellableDateTimeRange? = null + val nonCancellableDateTimeRange: NonCancellableDateTimeRange? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -76,7 +56,7 @@ data class CarsCancellationPolicy( private var freeCancellation: kotlin.Boolean? = null, private var freeCancellationEndDateTime: java.time.LocalDateTime? = null, private var penaltyRules: kotlin.collections.List? = null, - private var nonCancellableDateTimeRange: NonCancellableDateTimeRange? = null + private var nonCancellableDateTimeRange: NonCancellableDateTimeRange? = null, ) { fun cancellable(cancellable: kotlin.Boolean?) = apply { this.cancellable = cancellable } @@ -95,31 +75,11 @@ data class CarsCancellationPolicy( freeCancellation = freeCancellation, freeCancellationEndDateTime = freeCancellationEndDateTime, penaltyRules = penaltyRules, - nonCancellableDateTimeRange = nonCancellableDateTimeRange + nonCancellableDateTimeRange = nonCancellableDateTimeRange, ) - validate(instance) - return instance } - - private fun validate(instance: CarsCancellationPolicy) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -128,6 +88,6 @@ data class CarsCancellationPolicy( freeCancellation = freeCancellation, freeCancellationEndDateTime = freeCancellationEndDateTime, penaltyRules = penaltyRules, - nonCancellableDateTimeRange = nonCancellableDateTimeRange + nonCancellableDateTimeRange = nonCancellableDateTimeRange, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCountry.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCountry.kt index a77c1f2d7..598296bca 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCountry.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCountry.kt @@ -13,58 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for disambiguation country information +* Container for disambiguation country information * @param name country name * @param isoCode2 2-letter code for the country * @param isoCode3 3-letter code for the country * @param code 3-letter code for the country - */ +*/ data class CarsCountry( // country name @JsonProperty("Name") - @field:NotNull - @field:Valid val name: kotlin.String, // 2-letter code for the country @JsonProperty("IsoCode2") - @field:NotNull - @field:Valid val isoCode2: kotlin.String, // 3-letter code for the country @JsonProperty("IsoCode3") - @field:NotNull - @field:Valid val isoCode3: kotlin.String, // 3-letter code for the country @JsonProperty("Code") - @field:Valid - val code: kotlin.String? = null + val code: kotlin.String? = null, ) { + init { + require(name != null) { "name must not be null" } + + require(isoCode2 != null) { "isoCode2 must not be null" } + + require(isoCode3 != null) { "isoCode3 must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -74,7 +55,7 @@ data class CarsCountry( private var name: kotlin.String? = null, private var isoCode2: kotlin.String? = null, private var isoCode3: kotlin.String? = null, - private var code: kotlin.String? = null + private var code: kotlin.String? = null, ) { fun name(name: kotlin.String) = apply { this.name = name } @@ -90,31 +71,11 @@ data class CarsCountry( name = name!!, isoCode2 = isoCode2!!, isoCode3 = isoCode3!!, - code = code + code = code, ) - validate(instance) - return instance } - - private fun validate(instance: CarsCountry) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -122,6 +83,6 @@ data class CarsCountry( name = name!!, isoCode2 = isoCode2!!, isoCode3 = isoCode3!!, - code = code + code = code, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDateRange.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDateRange.kt index 175d2ab4c..6c5e42c47 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDateRange.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDateRange.kt @@ -13,41 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Validation /** - * Date range of the period. +* Date range of the period. * @param startDate Start date at pickup location of the period. * @param endDate End date at pickup location of the period. - */ +*/ data class CarsDateRange( // Start date at pickup location of the period. @JsonProperty("StartDate") val startDate: java.time.LocalDate, // End date at pickup location of the period. @JsonProperty("EndDate") - val endDate: java.time.LocalDate + val endDate: java.time.LocalDate, ) { + init { + require(startDate != null) { "startDate must not be null" } + + require(endDate != null) { "endDate must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -55,7 +43,7 @@ data class CarsDateRange( class Builder( private var startDate: java.time.LocalDate? = null, - private var endDate: java.time.LocalDate? = null + private var endDate: java.time.LocalDate? = null, ) { fun startDate(startDate: java.time.LocalDate) = apply { this.startDate = startDate } @@ -65,36 +53,16 @@ data class CarsDateRange( val instance = CarsDateRange( startDate = startDate!!, - endDate = endDate!! + endDate = endDate!!, ) - validate(instance) - return instance } - - private fun validate(instance: CarsDateRange) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( startDate = startDate!!, - endDate = endDate!! + endDate = endDate!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDistance.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDistance.kt index 9ddab12f4..922af4f58 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDistance.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDistance.kt @@ -13,51 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The extra distance information. +* The extra distance information. * @param `value` The number of miles/kilometers of the distance (specified by the Unit). * @param unit The unit (KM or MI) for the distance. * @param direction The direction of the location from the search 'center'.Possible values are: N,S,W,E,NW,NE,SW,SE - */ +*/ data class CarsDistance( // The number of miles/kilometers of the distance (specified by the Unit). @JsonProperty("Value") - @field:NotNull - @field:Valid val `value`: kotlin.String, // The unit (KM or MI) for the distance. @JsonProperty("Unit") - @field:Valid val unit: kotlin.String? = null, // The direction of the location from the search 'center'.Possible values are: N,S,W,E,NW,NE,SW,SE @JsonProperty("Direction") - @field:Valid - val direction: kotlin.String? = null + val direction: kotlin.String? = null, ) { + init { + require(`value` != null) { "`value` must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -66,7 +46,7 @@ data class CarsDistance( class Builder( private var `value`: kotlin.String? = null, private var unit: kotlin.String? = null, - private var direction: kotlin.String? = null + private var direction: kotlin.String? = null, ) { fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } @@ -79,37 +59,17 @@ data class CarsDistance( CarsDistance( `value` = `value`!!, unit = unit, - direction = direction + direction = direction, ) - validate(instance) - return instance } - - private fun validate(instance: CarsDistance) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`!!, unit = unit, - direction = direction + direction = direction, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsError.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsError.kt index dee35fba4..56b829f75 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsError.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsError.kt @@ -13,63 +13,42 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsLocationOption import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for error list. +* Container for error list. * @param code Error code describing the issue * @param description A simple description of what the error is. * @param detailCode Detailed error code describing the issue. * @param locationKeyword The requested location that caused the error. * @param locationOptions List for possible locations from which the customer must choose the best one to be re-submitted in the request. - */ +*/ data class CarsError( // Error code describing the issue @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // A simple description of what the error is. @JsonProperty("Description") - @field:NotNull - @field:Valid val description: kotlin.String, // Detailed error code describing the issue. @JsonProperty("DetailCode") - @field:Valid val detailCode: kotlin.String? = null, // The requested location that caused the error. @JsonProperty("LocationKeyword") - @field:Valid val locationKeyword: kotlin.String? = null, // List for possible locations from which the customer must choose the best one to be re-submitted in the request. @JsonProperty("LocationOptions") - @field:Valid - val locationOptions: kotlin.collections.List? = null + val locationOptions: kotlin.collections.List? = null, ) { + init { + require(code != null) { "code must not be null" } + + require(description != null) { "description must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -80,7 +59,7 @@ data class CarsError( private var description: kotlin.String? = null, private var detailCode: kotlin.String? = null, private var locationKeyword: kotlin.String? = null, - private var locationOptions: kotlin.collections.List? = null + private var locationOptions: kotlin.collections.List? = null, ) { fun code(code: kotlin.String) = apply { this.code = code } @@ -99,31 +78,11 @@ data class CarsError( description = description!!, detailCode = detailCode, locationKeyword = locationKeyword, - locationOptions = locationOptions + locationOptions = locationOptions, ) - validate(instance) - return instance } - - private fun validate(instance: CarsError) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -132,6 +91,6 @@ data class CarsError( description = description!!, detailCode = detailCode, locationKeyword = locationKeyword, - locationOptions = locationOptions + locationOptions = locationOptions, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsErrors.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsErrors.kt index 31d0e6c13..0f52c4f60 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsErrors.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsErrors.kt @@ -13,51 +13,33 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsError import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * +* * @param errors Container for error list. * @param transactionId A unique identifier for the transaction. - */ +*/ data class CarsErrors( // Container for error list. @JsonProperty("Errors") - @field:NotNull - @field:Valid val errors: kotlin.collections .List< - CarsError + CarsError, >, // A unique identifier for the transaction. @JsonProperty("TransactionId") - @field:NotNull - @field:Valid - val transactionId: kotlin.String + val transactionId: kotlin.String, ) { + init { + require(errors != null) { "errors must not be null" } + + require(transactionId != null) { "transactionId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -65,7 +47,7 @@ data class CarsErrors( class Builder( private var errors: kotlin.collections.List? = null, - private var transactionId: kotlin.String? = null + private var transactionId: kotlin.String? = null, ) { fun errors(errors: kotlin.collections.List) = apply { this.errors = errors } @@ -75,36 +57,16 @@ data class CarsErrors( val instance = CarsErrors( errors = errors!!, - transactionId = transactionId!! + transactionId = transactionId!!, ) - validate(instance) - return instance } - - private fun validate(instance: CarsErrors) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( errors = errors!!, - transactionId = transactionId!! + transactionId = transactionId!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsGeoLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsGeoLocation.kt index 8f4854918..d0890edd6 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsGeoLocation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsGeoLocation.kt @@ -13,51 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for Geo location. +* Container for Geo location. * @param latitude Latitude of the location. * @param longitude Longitude of the location. * @param obfuscated - */ +*/ data class CarsGeoLocation( // Latitude of the location. @JsonProperty("Latitude") - @field:NotNull - @field:Valid val latitude: kotlin.String, // Longitude of the location. @JsonProperty("Longitude") - @field:NotNull - @field:Valid val longitude: kotlin.String, @JsonProperty("Obfuscated") - @field:Valid - val obfuscated: kotlin.Boolean? = null + val obfuscated: kotlin.Boolean? = null, ) { + init { + require(latitude != null) { "latitude must not be null" } + + require(longitude != null) { "longitude must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -66,7 +47,7 @@ data class CarsGeoLocation( class Builder( private var latitude: kotlin.String? = null, private var longitude: kotlin.String? = null, - private var obfuscated: kotlin.Boolean? = null + private var obfuscated: kotlin.Boolean? = null, ) { fun latitude(latitude: kotlin.String) = apply { this.latitude = latitude } @@ -79,37 +60,17 @@ data class CarsGeoLocation( CarsGeoLocation( latitude = latitude!!, longitude = longitude!!, - obfuscated = obfuscated + obfuscated = obfuscated, ) - validate(instance) - return instance } - - private fun validate(instance: CarsGeoLocation) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( latitude = latitude!!, longitude = longitude!!, - obfuscated = obfuscated + obfuscated = obfuscated, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLink.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLink.kt index 620b2083b..7919e90d1 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLink.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLink.kt @@ -13,51 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * A map of links to other Car APIs. possible link name: ApiBooking +* A map of links to other Car APIs. possible link name: ApiBooking * @param href HATEOAS URL to fetch details. * @param accept Accept header. * @param method HTTP method to connect. - */ +*/ data class CarsLink( // HATEOAS URL to fetch details. @JsonProperty("Href") - @field:NotNull - @field:Valid val href: kotlin.String, // Accept header. @JsonProperty("Accept") - @field:Valid val accept: kotlin.String? = null, // HTTP method to connect. @JsonProperty("Method") - @field:Valid - val method: kotlin.String? = null + val method: kotlin.String? = null, ) { + init { + require(href != null) { "href must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -66,7 +46,7 @@ data class CarsLink( class Builder( private var href: kotlin.String? = null, private var accept: kotlin.String? = null, - private var method: kotlin.String? = null + private var method: kotlin.String? = null, ) { fun href(href: kotlin.String) = apply { this.href = href } @@ -79,37 +59,17 @@ data class CarsLink( CarsLink( href = href!!, accept = accept, - method = method + method = method, ) - validate(instance) - return instance } - - private fun validate(instance: CarsLink) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( href = href!!, accept = accept, - method = method + method = method, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocation.kt index 2c3a77fae..f8a7bc1dd 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocation.kt @@ -13,36 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsAddress import com.expediagroup.sdk.xap.models.CarsCountry import com.expediagroup.sdk.xap.models.CarsGeoLocation import com.expediagroup.sdk.xap.models.CarsNeighborhood import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for list of possible locations that could be used to disambiguate the query. +* Container for list of possible locations that could be used to disambiguate the query. * @param locationId Location id. * @param type The type of location code (MULTICITY | METROCODE). * @param id Expedia Region ID of the specified airport. @@ -54,48 +34,41 @@ import javax.validation.constraints.NotNull * @param neighborhood * @param regionId RegionId the location resides in. * @param country - */ +*/ data class CarsLocation( // Location id. @JsonProperty("LocationId") - @field:NotNull - @field:Valid val locationId: kotlin.String, // The type of location code (MULTICITY | METROCODE). @JsonProperty("Type") - @field:Valid val type: kotlin.String? = null, // Expedia Region ID of the specified airport. @JsonProperty("Id") - @field:Valid val id: kotlin.String? = null, // Location Name @JsonProperty("Name") - @field:Valid val name: kotlin.String? = null, // Location Code @JsonProperty("Code") - @field:Valid val code: kotlin.String? = null, @JsonProperty("Address") - @field:Valid val address: CarsAddress? = null, @JsonProperty("PointOfInterest") - @field:Valid val pointOfInterest: kotlin.String? = null, @JsonProperty("GeoLocation") - @field:Valid val geoLocation: CarsGeoLocation? = null, @JsonProperty("Neighborhood") - @field:Valid val neighborhood: CarsNeighborhood? = null, // RegionId the location resides in. @JsonProperty("RegionId") val regionId: kotlin.Long? = null, @JsonProperty("Country") - @field:Valid - val country: CarsCountry? = null + val country: CarsCountry? = null, ) { + init { + require(locationId != null) { "locationId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -112,7 +85,7 @@ data class CarsLocation( private var geoLocation: CarsGeoLocation? = null, private var neighborhood: CarsNeighborhood? = null, private var regionId: kotlin.Long? = null, - private var country: CarsCountry? = null + private var country: CarsCountry? = null, ) { fun locationId(locationId: kotlin.String) = apply { this.locationId = locationId } @@ -149,31 +122,11 @@ data class CarsLocation( geoLocation = geoLocation, neighborhood = neighborhood, regionId = regionId, - country = country + country = country, ) - validate(instance) - return instance } - - private fun validate(instance: CarsLocation) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -188,6 +141,6 @@ data class CarsLocation( geoLocation = geoLocation, neighborhood = neighborhood, regionId = regionId, - country = country + country = country, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocationOption.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocationOption.kt index 129b2c18a..6a0a20e62 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocationOption.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocationOption.kt @@ -13,35 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsCountry import com.expediagroup.sdk.xap.models.CarsGeoLocation import com.expediagroup.sdk.xap.models.CarsLocation import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List for possible locations from which the customer must choose the best one to be re-submitted in the request. +* List for possible locations from which the customer must choose the best one to be re-submitted in the request. * @param requestedLocation Location used in partner request. * @param locations Container for list of possible locations that could be used to disambiguate the query. * @param type Type of the location. @@ -51,48 +31,43 @@ import javax.validation.constraints.NotNull * @param address The address of the location. * @param country * @param geoLocation - */ +*/ data class CarsLocationOption( // Location used in partner request. @JsonProperty("RequestedLocation") - @field:NotNull - @field:Valid val requestedLocation: kotlin.String, // Container for list of possible locations that could be used to disambiguate the query. @JsonProperty("Locations") - @field:NotNull - @field:Valid val locations: kotlin.collections .List< - CarsLocation + CarsLocation, >, // Type of the location. @JsonProperty("Type") - @field:Valid val type: kotlin.String? = null, // RegionId the location resides in. @JsonProperty("RegionId") - @field:Valid val regionId: kotlin.String? = null, // The name of the location which matches the location keyword. @JsonProperty("ShortName") - @field:Valid val shortName: kotlin.String? = null, // Indicates the nearest major airport to the location. @JsonProperty("AirportCode") - @field:Valid val airportCode: kotlin.String? = null, // The address of the location. @JsonProperty("Address") - @field:Valid val address: kotlin.String? = null, @JsonProperty("Country") - @field:Valid val country: CarsCountry? = null, @JsonProperty("GeoLocation") - @field:Valid - val geoLocation: CarsGeoLocation? = null + val geoLocation: CarsGeoLocation? = null, ) { + init { + require(requestedLocation != null) { "requestedLocation must not be null" } + + require(locations != null) { "locations must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -107,7 +82,7 @@ data class CarsLocationOption( private var airportCode: kotlin.String? = null, private var address: kotlin.String? = null, private var country: CarsCountry? = null, - private var geoLocation: CarsGeoLocation? = null + private var geoLocation: CarsGeoLocation? = null, ) { fun requestedLocation(requestedLocation: kotlin.String) = apply { this.requestedLocation = requestedLocation } @@ -138,31 +113,11 @@ data class CarsLocationOption( airportCode = airportCode, address = address, country = country, - geoLocation = geoLocation + geoLocation = geoLocation, ) - validate(instance) - return instance } - - private fun validate(instance: CarsLocationOption) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -175,6 +130,6 @@ data class CarsLocationOption( airportCode = airportCode, address = address, country = country, - geoLocation = geoLocation + geoLocation = geoLocation, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsMoney.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsMoney.kt index 8cc209bff..e7d364809 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsMoney.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsMoney.kt @@ -13,51 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Price of Special equipment. +* Price of Special equipment. * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class CarsMoney( // The value of the element being defined. @JsonProperty("Value") - @field:NotNull - @field:Valid val `value`: kotlin.String, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:NotNull - @field:Valid val currency: kotlin.String, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: CarsMoney? = null + val localCurrencyPrice: CarsMoney? = null, ) { + init { + require(`value` != null) { "`value` must not be null" } + + require(currency != null) { "currency must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -66,7 +47,7 @@ data class CarsMoney( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: CarsMoney? = null + private var localCurrencyPrice: CarsMoney? = null, ) { fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } @@ -79,37 +60,17 @@ data class CarsMoney( CarsMoney( `value` = `value`!!, currency = currency!!, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: CarsMoney) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`!!, currency = currency!!, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsNeighborhood.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsNeighborhood.kt index 2bff29b2d..a88577f29 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsNeighborhood.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsNeighborhood.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Geography entities which are typically contained within a city. This includes the categories neighborhood and point of interest. Low level regions are not a formally defined concept in the geography model. +* Geography entities which are typically contained within a city. This includes the categories neighborhood and point of interest. Low level regions are not a formally defined concept in the geography model. * @param id Neighborhood id. * @param name Neighborhood name. - */ +*/ data class CarsNeighborhood( // Neighborhood id. @JsonProperty("Id") - @field:NotNull - @field:Valid val id: kotlin.String, // Neighborhood name. @JsonProperty("Name") - @field:NotNull - @field:Valid - val name: kotlin.String + val name: kotlin.String, ) { + init { + require(id != null) { "id must not be null" } + + require(name != null) { "name must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class CarsNeighborhood( class Builder( private var id: kotlin.String? = null, - private var name: kotlin.String? = null + private var name: kotlin.String? = null, ) { fun id(id: kotlin.String) = apply { this.id = id } @@ -71,36 +53,16 @@ data class CarsNeighborhood( val instance = CarsNeighborhood( id = id!!, - name = name!! + name = name!!, ) - validate(instance) - return instance } - - private fun validate(instance: CarsNeighborhood) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id!!, - name = name!! + name = name!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsValidFormsOfPayment.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsValidFormsOfPayment.kt index 96d0a0194..fbf75a987 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsValidFormsOfPayment.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsValidFormsOfPayment.kt @@ -13,53 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List of all the forms of payment that will be accepted for the booking of this rental transaction. +* List of all the forms of payment that will be accepted for the booking of this rental transaction. * @param paymentMethod Method of payment * @param paymentSubMethod Sub method of payment * @param brandName The brand name of the payment sub-method to be displayed to the customer. In many cases it will be the same as the payment sub-method, but \"Visa/Carte Bleue\" and \"Visa/Delta are some of the exceptions. - */ +*/ data class CarsValidFormsOfPayment( // Method of payment @JsonProperty("PaymentMethod") - @field:NotNull - @field:Valid val paymentMethod: kotlin.String, // Sub method of payment @JsonProperty("PaymentSubMethod") - @field:NotNull - @field:Valid val paymentSubMethod: kotlin.String, // The brand name of the payment sub-method to be displayed to the customer. In many cases it will be the same as the payment sub-method, but \"Visa/Carte Bleue\" and \"Visa/Delta are some of the exceptions. @JsonProperty("BrandName") - @field:NotNull - @field:Valid - val brandName: kotlin.String + val brandName: kotlin.String, ) { + init { + require(paymentMethod != null) { "paymentMethod must not be null" } + + require(paymentSubMethod != null) { "paymentSubMethod must not be null" } + + require(brandName != null) { "brandName must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -68,7 +50,7 @@ data class CarsValidFormsOfPayment( class Builder( private var paymentMethod: kotlin.String? = null, private var paymentSubMethod: kotlin.String? = null, - private var brandName: kotlin.String? = null + private var brandName: kotlin.String? = null, ) { fun paymentMethod(paymentMethod: kotlin.String) = apply { this.paymentMethod = paymentMethod } @@ -81,37 +63,17 @@ data class CarsValidFormsOfPayment( CarsValidFormsOfPayment( paymentMethod = paymentMethod!!, paymentSubMethod = paymentSubMethod!!, - brandName = brandName!! + brandName = brandName!!, ) - validate(instance) - return instance } - - private fun validate(instance: CarsValidFormsOfPayment) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( paymentMethod = paymentMethod!!, paymentSubMethod = paymentSubMethod!!, - brandName = brandName!! + brandName = brandName!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsWarning.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsWarning.kt index e94f77176..2e2f01e48 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsWarning.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsWarning.kt @@ -13,34 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsLink import com.expediagroup.sdk.xap.models.CarsMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for warning codes +* Container for warning codes * @param code Standardized warning code. * @param description Standardized warning description message. * @param originalPrice @@ -48,35 +28,32 @@ import javax.validation.constraints.NotNull * @param changedAmount * @param changedPercentage The changed percentage. In the sample 2.97 means the changed percentage is 2.97%. * @param links - */ +*/ data class CarsWarning( // Standardized warning code. @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // Standardized warning description message. @JsonProperty("Description") - @field:NotNull - @field:Valid val description: kotlin.String, @JsonProperty("OriginalPrice") - @field:Valid val originalPrice: CarsMoney? = null, @JsonProperty("NewPrice") - @field:Valid val newPrice: CarsMoney? = null, @JsonProperty("ChangedAmount") - @field:Valid val changedAmount: CarsMoney? = null, // The changed percentage. In the sample 2.97 means the changed percentage is 2.97%. @JsonProperty("ChangedPercentage") - @field:Valid val changedPercentage: kotlin.String? = null, @JsonProperty("Links") - @field:Valid - val links: kotlin.collections.Map? = null + val links: kotlin.collections.Map? = null, ) { + init { + require(code != null) { "code must not be null" } + + require(description != null) { "description must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -89,7 +66,7 @@ data class CarsWarning( private var newPrice: CarsMoney? = null, private var changedAmount: CarsMoney? = null, private var changedPercentage: kotlin.String? = null, - private var links: kotlin.collections.Map? = null + private var links: kotlin.collections.Map? = null, ) { fun code(code: kotlin.String) = apply { this.code = code } @@ -114,31 +91,11 @@ data class CarsWarning( newPrice = newPrice, changedAmount = changedAmount, changedPercentage = changedPercentage, - links = links + links = links, ) - validate(instance) - return instance } - - private fun validate(instance: CarsWarning) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -149,6 +106,6 @@ data class CarsWarning( newPrice = newPrice, changedAmount = changedAmount, changedPercentage = changedPercentage, - links = links + links = links, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt index ec433a734..d208f112a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt @@ -13,61 +13,44 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for a breakdown of how many of each type of Activity have been returned in the API response. +* Container for a breakdown of how many of each type of Activity have been returned in the API response. * @param count The count of the number of categories the returned set of activities map to. * @param groupName The group which the category belongs Possible value is: Recommendations Tours Activities Transportation Promotions Duration * @param groupDisplayName The localized value for category name. * @param categoryName The name of one of the categories. * @param categoryDisplayName - */ +*/ data class CategoryGroup( // The count of the number of categories the returned set of activities map to. @JsonProperty("Count") val count: kotlin.Int, // The group which the category belongs Possible value is: Recommendations Tours Activities Transportation Promotions Duration @JsonProperty("GroupName") - @field:NotNull - @field:Valid val groupName: kotlin.String, // The localized value for category name. @JsonProperty("GroupDisplayName") - @field:NotNull - @field:Valid val groupDisplayName: kotlin.String, // The name of one of the categories. @JsonProperty("CategoryName") - @field:NotNull - @field:Valid val categoryName: kotlin.String, @JsonProperty("CategoryDisplayName") - @field:Valid - val categoryDisplayName: kotlin.String? = null + val categoryDisplayName: kotlin.String? = null, ) { + init { + require(count != null) { "count must not be null" } + + require(groupName != null) { "groupName must not be null" } + + require(groupDisplayName != null) { "groupDisplayName must not be null" } + + require(categoryName != null) { "categoryName must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -78,7 +61,7 @@ data class CategoryGroup( private var groupName: kotlin.String? = null, private var groupDisplayName: kotlin.String? = null, private var categoryName: kotlin.String? = null, - private var categoryDisplayName: kotlin.String? = null + private var categoryDisplayName: kotlin.String? = null, ) { fun count(count: kotlin.Int) = apply { this.count = count } @@ -97,31 +80,11 @@ data class CategoryGroup( groupName = groupName!!, groupDisplayName = groupDisplayName!!, categoryName = categoryName!!, - categoryDisplayName = categoryDisplayName + categoryDisplayName = categoryDisplayName, ) - validate(instance) - return instance } - - private fun validate(instance: CategoryGroup) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -130,6 +93,6 @@ data class CategoryGroup( groupName = groupName!!, groupDisplayName = groupDisplayName!!, categoryName = categoryName!!, - categoryDisplayName = categoryDisplayName + categoryDisplayName = categoryDisplayName, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ChainAndBrandInfo.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ChainAndBrandInfo.kt index 96f6032f4..496a4755b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ChainAndBrandInfo.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ChainAndBrandInfo.kt @@ -13,52 +13,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * The chain and brand information of hotel. Only visible by configuration. Please contact your Expedia Account Manager if you need this node. +* The chain and brand information of hotel. Only visible by configuration. Please contact your Expedia Account Manager if you need this node. * @param chainId The chain id. * @param chainName The name of the chain. * @param brandId The brand id. * @param brandName The name of the brand. - */ +*/ data class ChainAndBrandInfo( // The chain id. @JsonProperty("ChainId") val chainId: kotlin.Int? = null, // The name of the chain. @JsonProperty("ChainName") - @field:Valid val chainName: kotlin.String? = null, // The brand id. @JsonProperty("BrandId") val brandId: kotlin.Int? = null, // The name of the brand. @JsonProperty("BrandName") - @field:Valid - val brandName: kotlin.String? = null + val brandName: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -68,7 +50,7 @@ data class ChainAndBrandInfo( private var chainId: kotlin.Int? = null, private var chainName: kotlin.String? = null, private var brandId: kotlin.Int? = null, - private var brandName: kotlin.String? = null + private var brandName: kotlin.String? = null, ) { fun chainId(chainId: kotlin.Int?) = apply { this.chainId = chainId } @@ -84,31 +66,11 @@ data class ChainAndBrandInfo( chainId = chainId, chainName = chainName, brandId = brandId, - brandName = brandName + brandName = brandName, ) - validate(instance) - return instance } - - private fun validate(instance: ChainAndBrandInfo) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -116,6 +78,6 @@ data class ChainAndBrandInfo( chainId = chainId, chainName = chainName, brandId = brandId, - brandName = brandName + brandName = brandName, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Country.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Country.kt index debe86224..d6aa82193 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Country.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Country.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for disambiguation country information +* Container for disambiguation country information * @param name country name * @param isoCode2 2-letter code for the country * @param isoCode3 3-letter code for the country - */ +*/ data class Country( // country name @JsonProperty("Name") - @field:Valid val name: kotlin.String? = null, // 2-letter code for the country @JsonProperty("IsoCode2") - @field:Valid val isoCode2: kotlin.String? = null, // 3-letter code for the country @JsonProperty("IsoCode3") - @field:Valid - val isoCode3: kotlin.String? = null + val isoCode3: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class Country( class Builder( private var name: kotlin.String? = null, private var isoCode2: kotlin.String? = null, - private var isoCode3: kotlin.String? = null + private var isoCode3: kotlin.String? = null, ) { fun name(name: kotlin.String?) = apply { this.name = name } @@ -77,37 +58,17 @@ data class Country( Country( name = name, isoCode2 = isoCode2, - isoCode3 = isoCode3 + isoCode3 = isoCode3, ) - validate(instance) - return instance } - - private fun validate(instance: Country) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( name = name, isoCode2 = isoCode2, - isoCode3 = isoCode3 + isoCode3 = isoCode3, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateRange.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateRange.kt index fa031697f..9eb4866b8 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateRange.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateRange.kt @@ -13,41 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Validation /** - * The actual date range for the shown availability. +* The actual date range for the shown availability. * @param startDate The initial day of the date range in an ISO 8601 Date format [YYYY-MM-DD]. * @param endDate The final day of the date range in an ISO 8601 Date format [YYYY-MM-DD]. - */ +*/ data class DateRange( // The initial day of the date range in an ISO 8601 Date format [YYYY-MM-DD]. @JsonProperty("StartDate") val startDate: java.time.LocalDate? = null, // The final day of the date range in an ISO 8601 Date format [YYYY-MM-DD]. @JsonProperty("EndDate") - val endDate: java.time.LocalDate? = null + val endDate: java.time.LocalDate? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -55,7 +40,7 @@ data class DateRange( class Builder( private var startDate: java.time.LocalDate? = null, - private var endDate: java.time.LocalDate? = null + private var endDate: java.time.LocalDate? = null, ) { fun startDate(startDate: java.time.LocalDate?) = apply { this.startDate = startDate } @@ -65,36 +50,16 @@ data class DateRange( val instance = DateRange( startDate = startDate, - endDate = endDate + endDate = endDate, ) - validate(instance) - return instance } - - private fun validate(instance: DateRange) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( startDate = startDate, - endDate = endDate + endDate = endDate, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateTimePeriod.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateTimePeriod.kt index 5a8ccf07e..a05b12db1 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateTimePeriod.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateTimePeriod.kt @@ -13,47 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsDateRange import com.expediagroup.sdk.xap.models.TimeRange import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * A List of date time periods to indicate the vendor business hours for the pickup time. +* A List of date time periods to indicate the vendor business hours for the pickup time. * @param dateRange * @param timeRanges A list of time range to indicate the operation hours of the date range. - */ +*/ data class DateTimePeriod( @JsonProperty("DateRange") - @field:NotNull - @field:Valid val dateRange: CarsDateRange, // A list of time range to indicate the operation hours of the date range. @JsonProperty("TimeRanges") - @field:Valid - val timeRanges: kotlin.collections.List? = null + val timeRanges: kotlin.collections.List? = null, ) { + init { + require(dateRange != null) { "dateRange must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +42,7 @@ data class DateTimePeriod( class Builder( private var dateRange: CarsDateRange? = null, - private var timeRanges: kotlin.collections.List? = null + private var timeRanges: kotlin.collections.List? = null, ) { fun dateRange(dateRange: CarsDateRange) = apply { this.dateRange = dateRange } @@ -71,36 +52,16 @@ data class DateTimePeriod( val instance = DateTimePeriod( dateRange = dateRange!!, - timeRanges = timeRanges + timeRanges = timeRanges, ) - validate(instance) - return instance } - - private fun validate(instance: DateTimePeriod) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( dateRange = dateRange!!, - timeRanges = timeRanges + timeRanges = timeRanges, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Deductible.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Deductible.kt index 65516b64c..0e616c9de 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Deductible.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Deductible.kt @@ -13,47 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Indicate whether it is deductible +* Indicate whether it is deductible * @param excessAmount * @param liabilityAmount * @param deductibleAmount - */ +*/ data class Deductible( @JsonProperty("ExcessAmount") - @field:Valid val excessAmount: CarsMoney? = null, @JsonProperty("LiabilityAmount") - @field:Valid val liabilityAmount: CarsMoney? = null, @JsonProperty("DeductibleAmount") - @field:Valid - val deductibleAmount: CarsMoney? = null + val deductibleAmount: CarsMoney? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -62,7 +43,7 @@ data class Deductible( class Builder( private var excessAmount: CarsMoney? = null, private var liabilityAmount: CarsMoney? = null, - private var deductibleAmount: CarsMoney? = null + private var deductibleAmount: CarsMoney? = null, ) { fun excessAmount(excessAmount: CarsMoney?) = apply { this.excessAmount = excessAmount } @@ -75,37 +56,17 @@ data class Deductible( Deductible( excessAmount = excessAmount, liabilityAmount = liabilityAmount, - deductibleAmount = deductibleAmount + deductibleAmount = deductibleAmount, ) - validate(instance) - return instance } - - private fun validate(instance: Deductible) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( excessAmount = excessAmount, liabilityAmount = liabilityAmount, - deductibleAmount = deductibleAmount + deductibleAmount = deductibleAmount, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositDetail.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositDetail.kt index 456f33481..9908fe4bc 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositDetail.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositDetail.kt @@ -13,48 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.When import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for deposit policy details +* Container for deposit policy details * @param type Should be one of the following values: PERCENT The deposit amount is calculated as a percentage of the total booking cost. NIGHT The deposit amount is calculated in terms of nights plus tax. AMOUNT The deposit amount in USD. REMAINDER The deposit amount is equal to the booking cost minus any deposits that have been made before this point. * @param `value` Value to indicate how many/much of the type listed above is going to be charged as a deposit. * @param `when` - */ +*/ data class DepositDetail( // Should be one of the following values: PERCENT The deposit amount is calculated as a percentage of the total booking cost. NIGHT The deposit amount is calculated in terms of nights plus tax. AMOUNT The deposit amount in USD. REMAINDER The deposit amount is equal to the booking cost minus any deposits that have been made before this point. @JsonProperty("Type") val type: DepositDetail.Type? = null, // Value to indicate how many/much of the type listed above is going to be charged as a deposit. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, @JsonProperty("When") - @field:Valid - val `when`: When? = null + val `when`: When? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -63,7 +45,7 @@ data class DepositDetail( class Builder( private var type: DepositDetail.Type? = null, private var `value`: kotlin.String? = null, - private var `when`: When? = null + private var `when`: When? = null, ) { fun type(type: DepositDetail.Type?) = apply { this.type = type } @@ -76,45 +58,27 @@ data class DepositDetail( DepositDetail( type = type, `value` = `value`, - `when` = `when` + `when` = `when`, ) - validate(instance) - return instance } - - private fun validate(instance: DepositDetail) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( type = type, `value` = `value`, - `when` = `when` + `when` = `when`, ) /** * Should be one of the following values: PERCENT The deposit amount is calculated as a percentage of the total booking cost. NIGHT The deposit amount is calculated in terms of nights plus tax. AMOUNT The deposit amount in USD. REMAINDER The deposit amount is equal to the booking cost minus any deposits that have been made before this point. * Values: PERCENT,NIGHT,AMOUNT,REMAINDER */ - enum class Type(val value: kotlin.String) { + enum class Type( + val value: kotlin.String, + ) { @JsonProperty("PERCENT") PERCENT("PERCENT"), @@ -125,6 +89,6 @@ data class DepositDetail( AMOUNT("AMOUNT"), @JsonProperty("REMAINDER") - REMAINDER("REMAINDER") + REMAINDER("REMAINDER"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositPolicy.kt index e9100a633..7bcd4b10a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositPolicy.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositPolicy.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.DepositDetail import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for deposit policy details +* Container for deposit policy details * @param description * @param details Container for deposit policy details - */ +*/ data class DepositPolicy( @JsonProperty("Description") - @field:Valid val description: kotlin.collections.List? = null, // Container for deposit policy details @JsonProperty("Details") - @field:Valid - val details: kotlin.collections.List? = null + val details: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class DepositPolicy( class Builder( private var description: kotlin.collections.List? = null, - private var details: kotlin.collections.List? = null + private var details: kotlin.collections.List? = null, ) { fun description(description: kotlin.collections.List?) = apply { this.description = description } @@ -68,36 +50,16 @@ data class DepositPolicy( val instance = DepositPolicy( description = description, - details = details + details = details, ) - validate(instance) - return instance } - - private fun validate(instance: DepositPolicy) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( description = description, - details = details + details = details, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Description.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Description.kt index 56080fb2f..c9741d227 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Description.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Description.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for the descriptions of the property. +* Container for the descriptions of the property. * @param locationTeaser A description of the property's location. * @param hotelTeaser A description of the features and amenities of the property itself. * @param roomTeaser The common description for all of the rooms in the property. - */ +*/ data class Description( // A description of the property's location. @JsonProperty("LocationTeaser") - @field:Valid val locationTeaser: kotlin.String? = null, // A description of the features and amenities of the property itself. @JsonProperty("HotelTeaser") - @field:Valid val hotelTeaser: kotlin.String? = null, // The common description for all of the rooms in the property. @JsonProperty("RoomTeaser") - @field:Valid - val roomTeaser: kotlin.String? = null + val roomTeaser: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class Description( class Builder( private var locationTeaser: kotlin.String? = null, private var hotelTeaser: kotlin.String? = null, - private var roomTeaser: kotlin.String? = null + private var roomTeaser: kotlin.String? = null, ) { fun locationTeaser(locationTeaser: kotlin.String?) = apply { this.locationTeaser = locationTeaser } @@ -77,37 +58,17 @@ data class Description( Description( locationTeaser = locationTeaser, hotelTeaser = hotelTeaser, - roomTeaser = roomTeaser + roomTeaser = roomTeaser, ) - validate(instance) - return instance } - - private fun validate(instance: Description) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( locationTeaser = locationTeaser, hotelTeaser = hotelTeaser, - roomTeaser = roomTeaser + roomTeaser = roomTeaser, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DisambiguationResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DisambiguationResponse.kt index 9dccf2592..34d0e2c68 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DisambiguationResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DisambiguationResponse.kt @@ -13,51 +13,33 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsError import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * +* * @param errors Container for error list. * @param transactionId A unique identifier for the transaction. - */ +*/ data class DisambiguationResponse( // Container for error list. @JsonProperty("Errors") - @field:NotNull - @field:Valid val errors: kotlin.collections .List< - CarsError + CarsError, >, // A unique identifier for the transaction. @JsonProperty("TransactionId") - @field:NotNull - @field:Valid - val transactionId: kotlin.String + val transactionId: kotlin.String, ) { + init { + require(errors != null) { "errors must not be null" } + + require(transactionId != null) { "transactionId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -65,7 +47,7 @@ data class DisambiguationResponse( class Builder( private var errors: kotlin.collections.List? = null, - private var transactionId: kotlin.String? = null + private var transactionId: kotlin.String? = null, ) { fun errors(errors: kotlin.collections.List) = apply { this.errors = errors } @@ -75,36 +57,16 @@ data class DisambiguationResponse( val instance = DisambiguationResponse( errors = errors!!, - transactionId = transactionId!! + transactionId = transactionId!!, ) - validate(instance) - return instance } - - private fun validate(instance: DisambiguationResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( errors = errors!!, - transactionId = transactionId!! + transactionId = transactionId!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Discount.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Discount.kt index 24e75d55e..3755cfa75 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Discount.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Discount.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List of discount information. +* List of discount information. * @param type Discount type. Supported values : CorpDiscount | Coupon. * @param code Discount code. - */ +*/ data class Discount( // Discount type. Supported values : CorpDiscount | Coupon. @JsonProperty("Type") - @field:NotNull - @field:Valid val type: kotlin.String, // Discount code. @JsonProperty("Code") - @field:NotNull - @field:Valid - val code: kotlin.String + val code: kotlin.String, ) { + init { + require(type != null) { "type must not be null" } + + require(code != null) { "code must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class Discount( class Builder( private var type: kotlin.String? = null, - private var code: kotlin.String? = null + private var code: kotlin.String? = null, ) { fun type(type: kotlin.String) = apply { this.type = type } @@ -71,36 +53,16 @@ data class Discount( val instance = Discount( type = type!!, - code = code!! + code = code!!, ) - validate(instance) - return instance } - - private fun validate(instance: Discount) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( type = type!!, - code = code!! + code = code!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Distance.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Distance.kt index 9230cbaf3..d60450471 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Distance.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Distance.kt @@ -13,47 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for distance information. Only returned for city/address search or `geoLocation` search or single `regionId` search. +* Container for distance information. Only returned for city/address search or `geoLocation` search or single `regionId` search. * @param `value` The distance between the center of the search and the hotel. * @param unit The unit of distance. * @param direction The direction to the hotel from the center point of the search. - */ +*/ data class Distance( // The distance between the center of the search and the hotel. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The unit of distance. @JsonProperty("Unit") val unit: Distance.Unit? = null, // The direction to the hotel from the center point of the search. @JsonProperty("Direction") - val direction: Distance.Direction? = null + val direction: Distance.Direction? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -62,7 +45,7 @@ data class Distance( class Builder( private var `value`: kotlin.String? = null, private var unit: Distance.Unit? = null, - private var direction: Distance.Direction? = null + private var direction: Distance.Direction? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -75,57 +58,41 @@ data class Distance( Distance( `value` = `value`, unit = unit, - direction = direction + direction = direction, ) - validate(instance) - return instance } - - private fun validate(instance: Distance) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, unit = unit, - direction = direction + direction = direction, ) /** * The unit of distance. * Values: KM,MI */ - enum class Unit(val value: kotlin.String) { + enum class Unit( + val value: kotlin.String, + ) { @JsonProperty("km") KM("km"), @JsonProperty("mi") - MI("mi") + MI("mi"), } /** * The direction to the hotel from the center point of the search. * Values: N,S,W,E,NW,NE,SW,SE */ - enum class Direction(val value: kotlin.String) { + enum class Direction( + val value: kotlin.String, + ) { @JsonProperty("N") N("N"), @@ -148,6 +115,6 @@ data class Distance( SW("SW"), @JsonProperty("SE") - SE("SE") + SE("SE"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Duration.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Duration.kt index aa3cffc68..a4d0aca8f 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Duration.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Duration.kt @@ -13,45 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The maximum amount of time for a rental that still qualifies for this rate.This may or may not be the same as the current rental duration. +* The maximum amount of time for a rental that still qualifies for this rate.This may or may not be the same as the current rental duration. * @param unit The unit for minimum amount of time for a rental. * @param count The minimum number of units that qualify for minimum amount of time for a rental. - */ +*/ data class Duration( // The unit for minimum amount of time for a rental. @JsonProperty("Unit") - @field:NotNull - @field:Valid val unit: kotlin.String, // The minimum number of units that qualify for minimum amount of time for a rental. @JsonProperty("Count") - val count: kotlin.Long + val count: kotlin.Long, ) { + init { + require(unit != null) { "unit must not be null" } + + require(count != null) { "count must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -59,7 +43,7 @@ data class Duration( class Builder( private var unit: kotlin.String? = null, - private var count: kotlin.Long? = null + private var count: kotlin.Long? = null, ) { fun unit(unit: kotlin.String) = apply { this.unit = unit } @@ -69,36 +53,16 @@ data class Duration( val instance = Duration( unit = unit!!, - count = count!! + count = count!!, ) - validate(instance) - return instance } - - private fun validate(instance: Duration) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( unit = unit!!, - count = count!! + count = count!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Equipment.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Equipment.kt index 35d65f84c..ce7a573b6 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Equipment.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Equipment.kt @@ -13,57 +13,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Description and costs of any optional special equipment that may be rented with the car. +* Description and costs of any optional special equipment that may be rented with the car. * @param code Special equipment code * @param name Special equipment name * @param ratePeriod Unit indicating the price of special equipment. Support value:Trip,Daily * @param price - */ +*/ data class Equipment( // Special equipment code @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // Special equipment name @JsonProperty("Name") - @field:NotNull - @field:Valid val name: kotlin.String, // Unit indicating the price of special equipment. Support value:Trip,Daily @JsonProperty("RatePeriod") - @field:Valid val ratePeriod: kotlin.String? = null, @JsonProperty("Price") - @field:Valid - val price: CarsMoney? = null + val price: CarsMoney? = null, ) { + init { + require(code != null) { "code must not be null" } + + require(name != null) { "name must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -73,7 +53,7 @@ data class Equipment( private var code: kotlin.String? = null, private var name: kotlin.String? = null, private var ratePeriod: kotlin.String? = null, - private var price: CarsMoney? = null + private var price: CarsMoney? = null, ) { fun code(code: kotlin.String) = apply { this.code = code } @@ -89,31 +69,11 @@ data class Equipment( code = code!!, name = name!!, ratePeriod = ratePeriod, - price = price + price = price, ) - validate(instance) - return instance } - - private fun validate(instance: Equipment) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -121,6 +81,6 @@ data class Equipment( code = code!!, name = name!!, ratePeriod = ratePeriod, - price = price + price = price, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Error.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Error.kt index de9e1b406..7f0a68a32 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Error.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Error.kt @@ -13,60 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.LocationOption import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for error list. +* Container for error list. * @param code Error code describing the issue * @param detailCode Detailed error code describing the issue. * @param description A simple description of what the error is. * @param locationKeyword The requested location that caused the error. * @param locationOptions Container for possible matches to your ambiguous `locationKeyword` query. - */ +*/ data class Error( // Error code describing the issue @JsonProperty("Code") - @field:Valid val code: kotlin.String? = null, // Detailed error code describing the issue. @JsonProperty("DetailCode") - @field:Valid val detailCode: kotlin.String? = null, // A simple description of what the error is. @JsonProperty("Description") - @field:Valid val description: kotlin.String? = null, // The requested location that caused the error. @JsonProperty("LocationKeyword") - @field:Valid val locationKeyword: kotlin.String? = null, // Container for possible matches to your ambiguous `locationKeyword` query. @JsonProperty("LocationOptions") - @field:Valid - val locationOptions: kotlin.collections.List? = null + val locationOptions: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -77,7 +56,7 @@ data class Error( private var detailCode: kotlin.String? = null, private var description: kotlin.String? = null, private var locationKeyword: kotlin.String? = null, - private var locationOptions: kotlin.collections.List? = null + private var locationOptions: kotlin.collections.List? = null, ) { fun code(code: kotlin.String?) = apply { this.code = code } @@ -96,31 +75,11 @@ data class Error( detailCode = detailCode, description = description, locationKeyword = locationKeyword, - locationOptions = locationOptions + locationOptions = locationOptions, ) - validate(instance) - return instance } - - private fun validate(instance: Error) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -129,6 +88,6 @@ data class Error( detailCode = detailCode, description = description, locationKeyword = locationKeyword, - locationOptions = locationOptions + locationOptions = locationOptions, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Errors.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Errors.kt index 41e530928..49b2fcb5d 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Errors.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Errors.kt @@ -13,45 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Error import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param errors Container for error list. * @param transactionId A unique identifier for the transaction. - */ +*/ data class Errors( // Container for error list. @JsonProperty("Errors") - @field:Valid val errors: kotlin.collections.List? = null, // A unique identifier for the transaction. @JsonProperty("TransactionId") - @field:Valid - val transactionId: kotlin.String? = null + val transactionId: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -59,7 +41,7 @@ data class Errors( class Builder( private var errors: kotlin.collections.List? = null, - private var transactionId: kotlin.String? = null + private var transactionId: kotlin.String? = null, ) { fun errors(errors: kotlin.collections.List?) = apply { this.errors = errors } @@ -69,36 +51,16 @@ data class Errors( val instance = Errors( errors = errors, - transactionId = transactionId + transactionId = transactionId, ) - validate(instance) - return instance } - - private fun validate(instance: Errors) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( errors = errors, - transactionId = transactionId + transactionId = transactionId, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraCostPerDistance.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraCostPerDistance.kt index 541d9b2af..d398e97a8 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraCostPerDistance.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraCostPerDistance.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsDistance import com.expediagroup.sdk.xap.models.CarsMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Extra cost for each increment of distance used. +* Extra cost for each increment of distance used. * @param distance * @param cost - */ +*/ data class ExtraCostPerDistance( @JsonProperty("Distance") - @field:NotNull - @field:Valid val distance: CarsDistance, @JsonProperty("Cost") - @field:NotNull - @field:Valid - val cost: CarsMoney + val cost: CarsMoney, ) { + init { + require(distance != null) { "distance must not be null" } + + require(cost != null) { "cost must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class ExtraCostPerDistance( class Builder( private var distance: CarsDistance? = null, - private var cost: CarsMoney? = null + private var cost: CarsMoney? = null, ) { fun distance(distance: CarsDistance) = apply { this.distance = distance } @@ -71,36 +53,16 @@ data class ExtraCostPerDistance( val instance = ExtraCostPerDistance( distance = distance!!, - cost = cost!! + cost = cost!!, ) - validate(instance) - return instance } - - private fun validate(instance: ExtraCostPerDistance) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( distance = distance!!, - cost = cost!! + cost = cost!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraFees.kt index e98dcdc20..5b0c0cb1a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraFees.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraFees.kt @@ -13,51 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List of ExtraFeesDetails +* List of ExtraFeesDetails * @param unit Rate period beyond the base rate. Supported values: ExtraHourly, ExtraDaily * @param unitCount Numbers of period * @param amount - */ +*/ data class ExtraFees( // Rate period beyond the base rate. Supported values: ExtraHourly, ExtraDaily @JsonProperty("Unit") - @field:NotNull - @field:Valid val unit: kotlin.String, // Numbers of period @JsonProperty("UnitCount") val unitCount: kotlin.Long, @JsonProperty("Amount") - @field:NotNull - @field:Valid - val amount: CarsMoney + val amount: CarsMoney, ) { + init { + require(unit != null) { "unit must not be null" } + + require(unitCount != null) { "unitCount must not be null" } + + require(amount != null) { "amount must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -66,7 +50,7 @@ data class ExtraFees( class Builder( private var unit: kotlin.String? = null, private var unitCount: kotlin.Long? = null, - private var amount: CarsMoney? = null + private var amount: CarsMoney? = null, ) { fun unit(unit: kotlin.String) = apply { this.unit = unit } @@ -79,37 +63,17 @@ data class ExtraFees( ExtraFees( unit = unit!!, unitCount = unitCount!!, - amount = amount!! + amount = amount!!, ) - validate(instance) - return instance } - - private fun validate(instance: ExtraFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( unit = unit!!, unitCount = unitCount!!, - amount = amount!! + amount = amount!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Fault.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Fault.kt index cef192a49..95ad9958f 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Fault.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Fault.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * API returned information. +* API returned information. * @param code Fault code. * @param description Fault description. - */ +*/ data class Fault( // Fault code. @JsonProperty("code") - @field:Valid val code: kotlin.String? = null, // Fault description. @JsonProperty("description") - @field:Valid - val description: kotlin.String? = null + val description: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class Fault( class Builder( private var code: kotlin.String? = null, - private var description: kotlin.String? = null + private var description: kotlin.String? = null, ) { fun code(code: kotlin.String?) = apply { this.code = code } @@ -68,36 +50,16 @@ data class Fault( val instance = Fault( code = code, - description = description + description = description, ) - validate(instance) - return instance } - - private fun validate(instance: Fault) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( code = code, - description = description + description = description, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileInfo.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileInfo.kt index fe1a11f85..1acfaf25f 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileInfo.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileInfo.kt @@ -13,34 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.FileSize import com.expediagroup.sdk.xap.models.FilterConditions import com.expediagroup.sdk.xap.models.SdpLink import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param partner The partner associated with the file. List of partners: `Bing`, `Criteo`, `Facebook`, `Google`, `Retarget`, `Snapchat`. * @param brand The brand associated with the file content. List of brand: `Expedia`, `Hotels`, `Hotwire`, `Vrbo`, `HomeAway`, `Abritel`, `Bookabach`, `Stayz`, `Ebbokers`, `Travalocity`, `Orbitz`, `Wotif`. * @param fileContentType The type associated with the file content. List of types: `Amenities`, `Descriptions`, `Images`, `Listings`, `Locations`, `Policies`, `Regions`, `Reviews`, `Summary`, `VacationRental` @@ -52,50 +33,42 @@ import javax.validation.Validation * @param downloadUrlExpires The time about the download Url expires. The format is uuuu-MM-dd'T'HH:mm:ss.SSSX * @param filterConditions * @param bestMatchedLink - */ +*/ data class FileInfo( // The partner associated with the file. List of partners: `Bing`, `Criteo`, `Facebook`, `Google`, `Retarget`, `Snapchat`. @JsonProperty("partner") - @field:Valid val partner: kotlin.String? = null, // The brand associated with the file content. List of brand: `Expedia`, `Hotels`, `Hotwire`, `Vrbo`, `HomeAway`, `Abritel`, `Bookabach`, `Stayz`, `Ebbokers`, `Travalocity`, `Orbitz`, `Wotif`. @JsonProperty("brand") - @field:Valid val brand: kotlin.String? = null, // The type associated with the file content. List of types: `Amenities`, `Descriptions`, `Images`, `Listings`, `Locations`, `Policies`, `Regions`, `Reviews`, `Summary`, `VacationRental` @JsonProperty("fileContentType") - @field:Valid val fileContentType: kotlin.String? = null, // The locale associated with the file content. @JsonProperty("locale") - @field:Valid val locale: kotlin.String? = null, // File name. @JsonProperty("fileName") - @field:Valid val fileName: kotlin.String? = null, @JsonProperty("size") - @field:Valid val propertySize: FileSize? = null, // The time about the file last updated. The format is uuuu-MM-dd'T'HH:mm:ss.SSSX @JsonProperty("fileLastUpdated") - @field:Valid val fileLastUpdated: kotlin.String? = null, // Pre-signed URL is a self signed URL generated for a resource in S3 with a set expiration time. @JsonProperty("downloadUrl") - @field:Valid val downloadUrl: kotlin.String? = null, // The time about the download Url expires. The format is uuuu-MM-dd'T'HH:mm:ss.SSSX @JsonProperty("downloadUrlExpires") - @field:Valid val downloadUrlExpires: kotlin.String? = null, @JsonProperty("filterConditions") - @field:Valid val filterConditions: FilterConditions? = null, @JsonProperty("bestMatchedLink") - @field:Valid - val bestMatchedLink: SdpLink? = null + val bestMatchedLink: SdpLink? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -112,7 +85,7 @@ data class FileInfo( private var downloadUrl: kotlin.String? = null, private var downloadUrlExpires: kotlin.String? = null, private var filterConditions: FilterConditions? = null, - private var bestMatchedLink: SdpLink? = null + private var bestMatchedLink: SdpLink? = null, ) { fun partner(partner: kotlin.String?) = apply { this.partner = partner } @@ -149,31 +122,11 @@ data class FileInfo( downloadUrl = downloadUrl, downloadUrlExpires = downloadUrlExpires, filterConditions = filterConditions, - bestMatchedLink = bestMatchedLink + bestMatchedLink = bestMatchedLink, ) - validate(instance) - return instance } - - private fun validate(instance: FileInfo) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -188,6 +141,6 @@ data class FileInfo( downloadUrl = downloadUrl, downloadUrlExpires = downloadUrlExpires, filterConditions = filterConditions, - bestMatchedLink = bestMatchedLink + bestMatchedLink = bestMatchedLink, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileSize.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileSize.kt index 877fffe0a..f26268d99 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileSize.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileSize.kt @@ -13,41 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Validation /** - * The information about the file size. +* The information about the file size. * @param unit The unit about the file size. * @param `value` The value about the file size. - */ +*/ data class FileSize( // The unit about the file size. @JsonProperty("unit") val unit: FileSize.Unit? = null, // The value about the file size. @JsonProperty("value") - val `value`: kotlin.Long? = null + val `value`: kotlin.Long? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -55,7 +40,7 @@ data class FileSize( class Builder( private var unit: FileSize.Unit? = null, - private var `value`: kotlin.Long? = null + private var `value`: kotlin.Long? = null, ) { fun unit(unit: FileSize.Unit?) = apply { this.unit = unit } @@ -65,44 +50,26 @@ data class FileSize( val instance = FileSize( unit = unit, - `value` = `value` + `value` = `value`, ) - validate(instance) - return instance } - - private fun validate(instance: FileSize) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( unit = unit, - `value` = `value` + `value` = `value`, ) /** * The unit about the file size. * Values: KB,MB,GB */ - enum class Unit(val value: kotlin.String) { + enum class Unit( + val value: kotlin.String, + ) { @JsonProperty("KB") KB("KB"), @@ -110,6 +77,6 @@ data class FileSize( MB("MB"), @JsonProperty("GB") - GB("GB") + GB("GB"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FilterConditions.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FilterConditions.kt index a9359a600..d5171fc34 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FilterConditions.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FilterConditions.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container filter condition for the filtered file. [Filters](https://confluence.expedia.biz/display/EWS/Filtered+Feed+File+Generation+Schedule+and+Access#FilteredFeedFileGenerationScheduleandAccess-Filters) +* Container filter condition for the filtered file. [Filters](https://confluence.expedia.biz/display/EWS/Filtered+Feed+File+Generation+Schedule+and+Access#FilteredFeedFileGenerationScheduleandAccess-Filters) * @param pointOfSupply List of filter condition for PointOfSupplies: `US`, `AT`,`BR`,`CA`,`FR`,`DE`,`GR`,`IT`, `JP`,`KR`,`MX`,`PT`,`ES`,`TR`, `AE`,`GB`. * @param brand List of filter condition for Brands: `VRBO`. * @param structureType List of filter condition for StructureTypes: `VR`, `CONVENTIONAL`. - */ +*/ data class FilterConditions( // List of filter condition for PointOfSupplies: `US`, `AT`,`BR`,`CA`,`FR`,`DE`,`GR`,`IT`, `JP`,`KR`,`MX`,`PT`,`ES`,`TR`, `AE`,`GB`. @JsonProperty("pointOfSupply") - @field:Valid val pointOfSupply: kotlin.String? = null, // List of filter condition for Brands: `VRBO`. @JsonProperty("brand") - @field:Valid val brand: kotlin.String? = null, // List of filter condition for StructureTypes: `VR`, `CONVENTIONAL`. @JsonProperty("structureType") - @field:Valid - val structureType: kotlin.String? = null + val structureType: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class FilterConditions( class Builder( private var pointOfSupply: kotlin.String? = null, private var brand: kotlin.String? = null, - private var structureType: kotlin.String? = null + private var structureType: kotlin.String? = null, ) { fun pointOfSupply(pointOfSupply: kotlin.String?) = apply { this.pointOfSupply = pointOfSupply } @@ -77,37 +58,17 @@ data class FilterConditions( FilterConditions( pointOfSupply = pointOfSupply, brand = brand, - structureType = structureType + structureType = structureType, ) - validate(instance) - return instance } - - private fun validate(instance: FilterConditions) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( pointOfSupply = pointOfSupply, brand = brand, - structureType = structureType + structureType = structureType, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FuelAC.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FuelAC.kt index fb7b26c15..48ae5d7b1 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FuelAC.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FuelAC.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Car fuel type and whether Air Conditioning is included. Please find list of Car Fuel AC Codes in https://expediaintegration.zendesk.com/hc/en-us/articles/115005378328 +* Car fuel type and whether Air Conditioning is included. Please find list of Car Fuel AC Codes in https://expediaintegration.zendesk.com/hc/en-us/articles/115005378328 * @param code Car FuelAC code. * @param `value` Car FuelAC value. - */ +*/ data class FuelAC( // Car FuelAC code. @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // Car FuelAC value. @JsonProperty("Value") - @field:NotNull - @field:Valid - val `value`: kotlin.String + val `value`: kotlin.String, ) { + init { + require(code != null) { "code must not be null" } + + require(`value` != null) { "`value` must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class FuelAC( class Builder( private var code: kotlin.String? = null, - private var `value`: kotlin.String? = null + private var `value`: kotlin.String? = null, ) { fun code(code: kotlin.String) = apply { this.code = code } @@ -71,36 +53,16 @@ data class FuelAC( val instance = FuelAC( code = code!!, - `value` = `value`!! + `value` = `value`!!, ) - validate(instance) - return instance } - - private fun validate(instance: FuelAC) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( code = code!!, - `value` = `value`!! + `value` = `value`!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/GeoLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/GeoLocation.kt index 279c90827..745ec5e72 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/GeoLocation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/GeoLocation.kt @@ -13,48 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for Geo location. +* Container for Geo location. * @param latitude Latitude of the location. * @param longitude Longitude of the location. * @param obfuscated - */ +*/ data class GeoLocation( // Latitude of the location. @JsonProperty("Latitude") - @field:Valid val latitude: kotlin.String? = null, // Longitude of the location. @JsonProperty("Longitude") - @field:Valid val longitude: kotlin.String? = null, @JsonProperty("Obfuscated") - @field:Valid - val obfuscated: kotlin.Boolean? = null + val obfuscated: kotlin.Boolean? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -63,7 +44,7 @@ data class GeoLocation( class Builder( private var latitude: kotlin.String? = null, private var longitude: kotlin.String? = null, - private var obfuscated: kotlin.Boolean? = null + private var obfuscated: kotlin.Boolean? = null, ) { fun latitude(latitude: kotlin.String?) = apply { this.latitude = latitude } @@ -76,37 +57,17 @@ data class GeoLocation( GeoLocation( latitude = latitude, longitude = longitude, - obfuscated = obfuscated + obfuscated = obfuscated, ) - validate(instance) - return instance } - - private fun validate(instance: GeoLocation) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( latitude = latitude, longitude = longitude, - obfuscated = obfuscated + obfuscated = obfuscated, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Hotel.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Hotel.kt index 6856ffcf5..412f9acf8 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Hotel.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Hotel.kt @@ -13,24 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ChainAndBrandInfo import com.expediagroup.sdk.xap.models.Description import com.expediagroup.sdk.xap.models.Distance @@ -45,12 +29,9 @@ import com.expediagroup.sdk.xap.models.Phone import com.expediagroup.sdk.xap.models.PropertyDetails import com.expediagroup.sdk.xap.models.RoomType import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for information on each offered hotel. +* Container for information on each offered hotel. * @param id The unique, Expedia-specific hotel property identifier used to designate a single hotel. * @param hcomId The unique, Hotels.com-specific hotel property identifier used to designate a single hotel. This will only be returned if searching via hcomHotelIds in request. * @param name The common name of the hotel @@ -83,126 +64,100 @@ import javax.validation.Validation * @param accessibility The accessibility options available for the room. Possible accessibility include: - Accessible path of travel - Accessible bathroom - Roll-in shower - Handicapped parking - In-room accessibility - Accessibility equipment for the deaf - Braille or raised signage * @param memberOnlyDealAvailable Indicates whether the property has member only deal rates available. * @param roomTypes Container for all of available room types. - */ +*/ data class Hotel( // The unique, Expedia-specific hotel property identifier used to designate a single hotel. @JsonProperty("Id") - @field:Valid val id: kotlin.String? = null, // The unique, Hotels.com-specific hotel property identifier used to designate a single hotel. This will only be returned if searching via hcomHotelIds in request. @JsonProperty("HcomId") - @field:Valid val hcomId: kotlin.String? = null, // The common name of the hotel @JsonProperty("Name") - @field:Valid val name: kotlin.String? = null, @JsonProperty("PropertyType") - @field:Valid val propertyType: HotelPropertyType? = null, @JsonProperty("PropertyDetails") - @field:Valid val propertyDetails: PropertyDetails? = null, // The Local Currency Code for Hotel (which will be used for any fees that must be paid at the hotel) @JsonProperty("LocalCurrencyCode") - @field:Valid val localCurrencyCode: kotlin.String? = null, @JsonProperty("Location") - @field:Valid val location: HotelLocation? = null, // Container for property phone numbers. Note: PhoneInfos section will not return for Vrbo Vacation Rental properties. @JsonProperty("PhoneInfos") - @field:Valid val phoneInfos: kotlin.collections.List? = null, @JsonProperty("Distance") - @field:Valid val distance: Distance? = null, @JsonProperty("Description") - @field:Valid val description: Description? = null, // Indicates whether there are available offers at the property during the dates requested, as well as information as to why. Note that pricing will only be present in the API response for a status of `AVAILABLE`. If there are no rooms available at the property for the dates requested, then `NOT_AVAILABLE` will be returned. If there are available rooms, but none that meet the specific parameters of the search request, then one of the other messages will be returned. @JsonProperty("Status") val status: Hotel.Status? = null, // The information about renovations and closures @JsonProperty("RenovationsAndClosures") - @field:Valid val renovationsAndClosures: kotlin.collections.List? = null, @JsonProperty("ChainAndBrandInfo") - @field:Valid val chainAndBrandInfo: ChainAndBrandInfo? = null, // URL of the thumbnail image of the hotel. Note that other images sizes are available - You can find a link to the complete list of Supported Hotel Image Sizes in [Lodging Image Captions, IDs, and Sizes](https://developers.expediagroup.com/xap/products/xap/lodging/references/image-captions-ids-and-sizes). @JsonProperty("ThumbnailUrl") - @field:Valid val thumbnailUrl: kotlin.String? = null, // Star rating value of the hotel property. @JsonProperty("StarRating") val starRating: Hotel.StarRating? = null, // Average overall guest rating of the hotel. The value is between 1.0 and 5.0 in 0.1 increments. Higher is better. @JsonProperty("GuestRating") - @field:Valid val guestRating: kotlin.String? = null, // The total count of guest reviews used to create the average `GuestRating` above. @JsonProperty("GuestReviewCount") val guestReviewCount: kotlin.Int? = null, // Indicates whether the property allows certain pets under certain circumstances. Prior to booking, guests should review the PetPolicies information in the Lodging Details API to find out whether a particular pet will be permitted to stay at the property. @JsonProperty("PetFriendly") - @field:Valid val petFriendly: kotlin.Boolean? = null, // This value is returned if the property owner has specifically designated this property as LGBTQIA-friendly. @JsonProperty("LgbtqiaFriendly") - @field:Valid val lgbtqiaFriendly: kotlin.Boolean? = null, @JsonProperty("Links") - @field:Valid val links: HotelLinks? = null, @JsonProperty("Policies") - @field:Valid val policies: HotelPolicies? = null, // Container for all cleanliness and safety measures. The key is the measures category, the values are the information. The category will be: - CLEANLINESS - SOCIAL_DISTANCING - SAFETY - DISCLAIMER @JsonProperty("CleanlinessAndSafety") - @field:Valid val cleanlinessAndSafety: kotlin.collections.Map>? = null, // The optional extras info. @JsonProperty("OptionalExtras") - @field:Valid val optionalExtras: kotlin.collections.List? = null, // The important notices for hotel. @JsonProperty("ImportantNotices") - @field:Valid val importantNotices: kotlin.collections.List? = null, // Container for hotel images @JsonProperty("Media") - @field:Valid val media: kotlin.collections.List? = null, // Container for all hotel amenities. @JsonProperty("HotelAmenities") - @field:Valid val hotelAmenities: kotlin.collections.List? = null, // Container for all hotel amenities in group. The key is amenity category, the values are the amenity information. The category for grouped amenities in hotel level for conventional lodging hotel will be: - PARKING - FOOD_AND_DRINK - INTERNET - THINGS_TO_DO - FAMILY_FRIENDLY - CONVENIENCES - GUEST_SERVICES - BUSINESS_SERVICE - OUTDOOR - ACCESSIBILITY - SPA - ACTIVITIES_NEARBY - LANGS_SPOKEN - MORE The category for grouped amenities in hotel level for Vacation Rental hotel will be: - BEACH - SKI - POOL/SPA - INTERNET - PARKING - FAMILY_FRIENDLY - KITCHEN - DINING - BEDROOM - BATHROOMS - LIVING_SPACES - ENTERTAINMENT - OUTDOORS - LAUNDRY - WORKSPACES - CLIMATE_CONTROL - PETS - SUITABILITY/ACCESSIBILITY - SERVICES_AND_CONVENIENCES - LOCATION_HIGHLIGHTS - THINGS_TO_DO - GENERAL - SAFETY @JsonProperty("HotelDescriptiveAmenities") - @field:Valid val hotelDescriptiveAmenities: kotlin.collections.Map>? = null, // Container for all room amenities. @JsonProperty("RoomAmenities") - @field:Valid val roomAmenities: kotlin.collections.List? = null, // Container for all common room amenities in group. The key is amenity category, the values are the amenity information. The category for grouped amenities in common room level will be: - BEDROOM - BATHROOM - FOOD_AND_DRINK - ENTERTAINMENT - OUTDOOR_SPACE - MORE @JsonProperty("RoomDescriptiveAmenities") - @field:Valid val roomDescriptiveAmenities: kotlin.collections.Map>? = null, // The accessibility options available for the room. Possible accessibility include: - Accessible path of travel - Accessible bathroom - Roll-in shower - Handicapped parking - In-room accessibility - Accessibility equipment for the deaf - Braille or raised signage @JsonProperty("Accessibility") - @field:Valid val accessibility: kotlin.collections.List? = null, // Indicates whether the property has member only deal rates available. @JsonProperty("MemberOnlyDealAvailable") - @field:Valid val memberOnlyDealAvailable: kotlin.Boolean? = null, // Container for all of available room types. @JsonProperty("RoomTypes") - @field:Valid - val roomTypes: kotlin.collections.List? = null + val roomTypes: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -240,7 +195,7 @@ data class Hotel( private var roomDescriptiveAmenities: kotlin.collections.Map>? = null, private var accessibility: kotlin.collections.List? = null, private var memberOnlyDealAvailable: kotlin.Boolean? = null, - private var roomTypes: kotlin.collections.List? = null + private var roomTypes: kotlin.collections.List? = null, ) { fun id(id: kotlin.String?) = apply { this.id = id } @@ -352,31 +307,11 @@ data class Hotel( roomDescriptiveAmenities = roomDescriptiveAmenities, accessibility = accessibility, memberOnlyDealAvailable = memberOnlyDealAvailable, - roomTypes = roomTypes + roomTypes = roomTypes, ) - validate(instance) - return instance } - - private fun validate(instance: Hotel) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -412,14 +347,16 @@ data class Hotel( roomDescriptiveAmenities = roomDescriptiveAmenities, accessibility = accessibility, memberOnlyDealAvailable = memberOnlyDealAvailable, - roomTypes = roomTypes + roomTypes = roomTypes, ) /** * Indicates whether there are available offers at the property during the dates requested, as well as information as to why. Note that pricing will only be present in the API response for a status of `AVAILABLE`. If there are no rooms available at the property for the dates requested, then `NOT_AVAILABLE` will be returned. If there are available rooms, but none that meet the specific parameters of the search request, then one of the other messages will be returned. * Values: AVAILABLE,NOT_AVAILABLE,ERROR,NUMBER_OF_ADULTS_NOT_ACCEPTED,NUMBER_OF_CHILDREN_NOT_ACCEPTED,NUMBER_OF_INFANTS_NOT_ACCEPTED,NUMBER_OF_PERSONS_NOT_ACCEPTED,CHECK_IN_AGE_NOT_ACCEPTED */ - enum class Status(val value: kotlin.String) { + enum class Status( + val value: kotlin.String, + ) { @JsonProperty("AVAILABLE") AVAILABLE("AVAILABLE"), @@ -442,14 +379,16 @@ data class Hotel( NUMBER_OF_PERSONS_NOT_ACCEPTED("NUMBER_OF_PERSONS_NOT_ACCEPTED"), @JsonProperty("CHECK_IN_AGE_NOT_ACCEPTED") - CHECK_IN_AGE_NOT_ACCEPTED("CHECK_IN_AGE_NOT_ACCEPTED") + CHECK_IN_AGE_NOT_ACCEPTED("CHECK_IN_AGE_NOT_ACCEPTED"), } /** * Star rating value of the hotel property. * Values: _1_PERIOD0,_1_PERIOD5,_2_PERIOD0,_2_PERIOD5,_3_PERIOD0,_3_PERIOD5,_4_PERIOD0,_4_PERIOD5,_5_PERIOD0 */ - enum class StarRating(val value: kotlin.String) { + enum class StarRating( + val value: kotlin.String, + ) { @JsonProperty("1.0") _1_PERIOD0("1.0"), @@ -475,6 +414,6 @@ data class Hotel( _4_PERIOD5("4.5"), @JsonProperty("5.0") - _5_PERIOD0("5.0") + _5_PERIOD0("5.0"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponse.kt index 909eca952..f48658156 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponse.kt @@ -13,36 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Hotel import com.expediagroup.sdk.xap.models.HotelDetailsResponseOccupantsInner import com.expediagroup.sdk.xap.models.HotelDetailsResponseStayDates import com.expediagroup.sdk.xap.models.HotelDetailsResponseWarningsInner import com.expediagroup.sdk.xap.models.ValidFormsOfPayment import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param warnings There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. * @param transactionId Unique identifier for the transaction. * @param stayDates @@ -51,18 +32,15 @@ import javax.validation.Validation * @param occupants Container for the list of rooms requested by the traveler. Occupancy for each room is specified in this node. * @param validFormsOfPayment Container for payment information. * @param hotelDetails - */ +*/ data class HotelDetailsResponse( // There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. @JsonProperty("Warnings") - @field:Valid val warnings: kotlin.collections.List? = null, // Unique identifier for the transaction. @JsonProperty("TransactionId") - @field:Valid val transactionId: kotlin.String? = null, @JsonProperty("StayDates") - @field:Valid val stayDates: HotelDetailsResponseStayDates? = null, // The number of stay nights. @JsonProperty("LengthOfStay") @@ -72,16 +50,16 @@ data class HotelDetailsResponse( val numberOfRooms: kotlin.Int? = null, // Container for the list of rooms requested by the traveler. Occupancy for each room is specified in this node. @JsonProperty("Occupants") - @field:Valid val occupants: kotlin.collections.List? = null, // Container for payment information. @JsonProperty("ValidFormsOfPayment") - @field:Valid val validFormsOfPayment: kotlin.collections.List? = null, @JsonProperty("HotelDetails") - @field:Valid - val hotelDetails: Hotel? = null + val hotelDetails: Hotel? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -95,7 +73,7 @@ data class HotelDetailsResponse( private var numberOfRooms: kotlin.Int? = null, private var occupants: kotlin.collections.List? = null, private var validFormsOfPayment: kotlin.collections.List? = null, - private var hotelDetails: Hotel? = null + private var hotelDetails: Hotel? = null, ) { fun warnings(warnings: kotlin.collections.List?) = apply { this.warnings = warnings } @@ -123,31 +101,11 @@ data class HotelDetailsResponse( numberOfRooms = numberOfRooms, occupants = occupants, validFormsOfPayment = validFormsOfPayment, - hotelDetails = hotelDetails + hotelDetails = hotelDetails, ) - validate(instance) - return instance } - - private fun validate(instance: HotelDetailsResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -159,6 +117,6 @@ data class HotelDetailsResponse( numberOfRooms = numberOfRooms, occupants = occupants, validFormsOfPayment = validFormsOfPayment, - hotelDetails = hotelDetails + hotelDetails = hotelDetails, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInner.kt index a2fef6c22..fb0d01f98 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInner.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param adults Specifies the number of adults staying in each room. * @param childAges Specifies the age(s) of each of the children staying in the room, as well as the number of children in the room. - */ +*/ data class HotelDetailsResponseOccupantsInner( // Specifies the number of adults staying in each room. @JsonProperty("Adults") - @field:Valid val adults: kotlin.Any? = null, // Specifies the age(s) of each of the children staying in the room, as well as the number of children in the room. @JsonProperty("ChildAges") - @field:Valid - val childAges: kotlin.Any? = null + val childAges: kotlin.Any? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class HotelDetailsResponseOccupantsInner( class Builder( private var adults: kotlin.Any? = null, - private var childAges: kotlin.Any? = null + private var childAges: kotlin.Any? = null, ) { fun adults(adults: kotlin.Any?) = apply { this.adults = adults } @@ -68,36 +50,16 @@ data class HotelDetailsResponseOccupantsInner( val instance = HotelDetailsResponseOccupantsInner( adults = adults, - childAges = childAges + childAges = childAges, ) - validate(instance) - return instance } - - private fun validate(instance: HotelDetailsResponseOccupantsInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( adults = adults, - childAges = childAges + childAges = childAges, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInnerAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInnerAllOf.kt deleted file mode 100644 index 693532359..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInnerAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param adults Specifies the number of adults staying in each room. - * @param childAges Specifies the age(s) of each of the children staying in the room, as well as the number of children in the room. - */ -data class HotelDetailsResponseOccupantsInnerAllOf( - // Specifies the number of adults staying in each room. - @JsonProperty("Adults") - @field:Valid - val adults: kotlin.Any? = null, - // Specifies the age(s) of each of the children staying in the room, as well as the number of children in the room. - @JsonProperty("ChildAges") - @field:Valid - val childAges: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var adults: kotlin.Any? = null, - private var childAges: kotlin.Any? = null - ) { - fun adults(adults: kotlin.Any?) = apply { this.adults = adults } - - fun childAges(childAges: kotlin.Any?) = apply { this.childAges = childAges } - - fun build(): HotelDetailsResponseOccupantsInnerAllOf { - val instance = - HotelDetailsResponseOccupantsInnerAllOf( - adults = adults, - childAges = childAges - ) - - validate(instance) - - return instance - } - - private fun validate(instance: HotelDetailsResponseOccupantsInnerAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - adults = adults, - childAges = childAges - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDates.kt index 7b5b89bfb..1c086ad04 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDates.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDates.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param checkInDate Check-in date for property stay in an ISO 8601 Date format [YYYY-MM-DD]. This parameter should be used in combination with the `checkOut` parameter. The maximum advanced search window is 330 days in the future. The maximum length of stay is 28 days. * @param checkOutDate Checkout date for property stay in an ISO 8601 Date format [YYYY-MM-DD]. This parameter should be used in combination with the `checkIn` parameter. The maximum advanced search window is 330 days in the future. The maximum length of stay is 28 days. - */ +*/ data class HotelDetailsResponseStayDates( // Check-in date for property stay in an ISO 8601 Date format [YYYY-MM-DD]. This parameter should be used in combination with the `checkOut` parameter. The maximum advanced search window is 330 days in the future. The maximum length of stay is 28 days. @JsonProperty("CheckInDate") - @field:Valid val checkInDate: kotlin.Any? = null, // Checkout date for property stay in an ISO 8601 Date format [YYYY-MM-DD]. This parameter should be used in combination with the `checkIn` parameter. The maximum advanced search window is 330 days in the future. The maximum length of stay is 28 days. @JsonProperty("CheckOutDate") - @field:Valid - val checkOutDate: kotlin.Any? = null + val checkOutDate: kotlin.Any? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class HotelDetailsResponseStayDates( class Builder( private var checkInDate: kotlin.Any? = null, - private var checkOutDate: kotlin.Any? = null + private var checkOutDate: kotlin.Any? = null, ) { fun checkInDate(checkInDate: kotlin.Any?) = apply { this.checkInDate = checkInDate } @@ -68,36 +50,16 @@ data class HotelDetailsResponseStayDates( val instance = HotelDetailsResponseStayDates( checkInDate = checkInDate, - checkOutDate = checkOutDate + checkOutDate = checkOutDate, ) - validate(instance) - return instance } - - private fun validate(instance: HotelDetailsResponseStayDates) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( checkInDate = checkInDate, - checkOutDate = checkOutDate + checkOutDate = checkOutDate, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDatesAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDatesAllOf.kt deleted file mode 100644 index e259006c3..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDatesAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param checkInDate Check-in date for property stay in an ISO 8601 Date format [YYYY-MM-DD]. This parameter should be used in combination with the `checkOut` parameter. The maximum advanced search window is 330 days in the future. The maximum length of stay is 28 days. - * @param checkOutDate Checkout date for property stay in an ISO 8601 Date format [YYYY-MM-DD]. This parameter should be used in combination with the `checkIn` parameter. The maximum advanced search window is 330 days in the future. The maximum length of stay is 28 days. - */ -data class HotelDetailsResponseStayDatesAllOf( - // Check-in date for property stay in an ISO 8601 Date format [YYYY-MM-DD]. This parameter should be used in combination with the `checkOut` parameter. The maximum advanced search window is 330 days in the future. The maximum length of stay is 28 days. - @JsonProperty("CheckInDate") - @field:Valid - val checkInDate: kotlin.Any? = null, - // Checkout date for property stay in an ISO 8601 Date format [YYYY-MM-DD]. This parameter should be used in combination with the `checkIn` parameter. The maximum advanced search window is 330 days in the future. The maximum length of stay is 28 days. - @JsonProperty("CheckOutDate") - @field:Valid - val checkOutDate: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var checkInDate: kotlin.Any? = null, - private var checkOutDate: kotlin.Any? = null - ) { - fun checkInDate(checkInDate: kotlin.Any?) = apply { this.checkInDate = checkInDate } - - fun checkOutDate(checkOutDate: kotlin.Any?) = apply { this.checkOutDate = checkOutDate } - - fun build(): HotelDetailsResponseStayDatesAllOf { - val instance = - HotelDetailsResponseStayDatesAllOf( - checkInDate = checkInDate, - checkOutDate = checkOutDate - ) - - validate(instance) - - return instance - } - - private fun validate(instance: HotelDetailsResponseStayDatesAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - checkInDate = checkInDate, - checkOutDate = checkOutDate - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInner.kt index 09db60810..af67cc130 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInner.kt @@ -13,64 +13,42 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param code The code of the warning. Available values are: - PRICE_DECREASED: The price decreased after shopping. - PRICE_INCREASED: The price increased after shopping. - CURRENCY_CHANGE: You will be charged in a different currency. * @param description A detail information of what happened. * @param originalPrice The original price from the Lodging Search API response. * @param newPrice The new price. * @param changedAmount The difference between `OriginalPrice` and `NewPrice`. * @param changedPercentage The changed percentage. In the sample 2.97 means the changed percentage is 2.97%. - */ +*/ data class HotelDetailsResponseWarningsInner( // The code of the warning. Available values are: - PRICE_DECREASED: The price decreased after shopping. - PRICE_INCREASED: The price increased after shopping. - CURRENCY_CHANGE: You will be charged in a different currency. @JsonProperty("Code") - @field:Valid val code: kotlin.Any? = null, // A detail information of what happened. @JsonProperty("Description") - @field:Valid val description: kotlin.String? = null, // The original price from the Lodging Search API response. @JsonProperty("OriginalPrice") - @field:Valid val originalPrice: kotlin.Any? = null, // The new price. @JsonProperty("NewPrice") - @field:Valid val newPrice: kotlin.Any? = null, // The difference between `OriginalPrice` and `NewPrice`. @JsonProperty("ChangedAmount") - @field:Valid val changedAmount: kotlin.Any? = null, // The changed percentage. In the sample 2.97 means the changed percentage is 2.97%. @JsonProperty("ChangedPercentage") - @field:Valid - val changedPercentage: kotlin.String? = null + val changedPercentage: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -82,7 +60,7 @@ data class HotelDetailsResponseWarningsInner( private var originalPrice: kotlin.Any? = null, private var newPrice: kotlin.Any? = null, private var changedAmount: kotlin.Any? = null, - private var changedPercentage: kotlin.String? = null + private var changedPercentage: kotlin.String? = null, ) { fun code(code: kotlin.Any?) = apply { this.code = code } @@ -104,31 +82,11 @@ data class HotelDetailsResponseWarningsInner( originalPrice = originalPrice, newPrice = newPrice, changedAmount = changedAmount, - changedPercentage = changedPercentage + changedPercentage = changedPercentage, ) - validate(instance) - return instance } - - private fun validate(instance: HotelDetailsResponseWarningsInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -138,6 +96,6 @@ data class HotelDetailsResponseWarningsInner( originalPrice = originalPrice, newPrice = newPrice, changedAmount = changedAmount, - changedPercentage = changedPercentage + changedPercentage = changedPercentage, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInnerAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInnerAllOf.kt deleted file mode 100644 index b26f37431..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInnerAllOf.kt +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param code The code of the warning. Available values are: - PRICE_DECREASED: The price decreased after shopping. - PRICE_INCREASED: The price increased after shopping. - CURRENCY_CHANGE: You will be charged in a different currency. - * @param originalPrice The original price from the Lodging Search API response. - * @param newPrice The new price. - * @param changedAmount The difference between `OriginalPrice` and `NewPrice`. - */ -data class HotelDetailsResponseWarningsInnerAllOf( - // The code of the warning. Available values are: - PRICE_DECREASED: The price decreased after shopping. - PRICE_INCREASED: The price increased after shopping. - CURRENCY_CHANGE: You will be charged in a different currency. - @JsonProperty("Code") - @field:Valid - val code: kotlin.Any? = null, - // The original price from the Lodging Search API response. - @JsonProperty("OriginalPrice") - @field:Valid - val originalPrice: kotlin.Any? = null, - // The new price. - @JsonProperty("NewPrice") - @field:Valid - val newPrice: kotlin.Any? = null, - // The difference between `OriginalPrice` and `NewPrice`. - @JsonProperty("ChangedAmount") - @field:Valid - val changedAmount: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var code: kotlin.Any? = null, - private var originalPrice: kotlin.Any? = null, - private var newPrice: kotlin.Any? = null, - private var changedAmount: kotlin.Any? = null - ) { - fun code(code: kotlin.Any?) = apply { this.code = code } - - fun originalPrice(originalPrice: kotlin.Any?) = apply { this.originalPrice = originalPrice } - - fun newPrice(newPrice: kotlin.Any?) = apply { this.newPrice = newPrice } - - fun changedAmount(changedAmount: kotlin.Any?) = apply { this.changedAmount = changedAmount } - - fun build(): HotelDetailsResponseWarningsInnerAllOf { - val instance = - HotelDetailsResponseWarningsInnerAllOf( - code = code, - originalPrice = originalPrice, - newPrice = newPrice, - changedAmount = changedAmount - ) - - validate(instance) - - return instance - } - - private fun validate(instance: HotelDetailsResponseWarningsInnerAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - code = code, - originalPrice = originalPrice, - newPrice = newPrice, - changedAmount = changedAmount - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInner.kt index 1efdca550..4765a03b3 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInner.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param id The identification number for a hotel amenity. * @param name The description of a hotel amenity. - */ +*/ data class HotelHotelAmenitiesInner( // The identification number for a hotel amenity. @JsonProperty("Id") - @field:Valid val id: kotlin.Any? = null, // The description of a hotel amenity. @JsonProperty("Name") - @field:Valid - val name: kotlin.Any? = null + val name: kotlin.Any? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class HotelHotelAmenitiesInner( class Builder( private var id: kotlin.Any? = null, - private var name: kotlin.Any? = null + private var name: kotlin.Any? = null, ) { fun id(id: kotlin.Any?) = apply { this.id = id } @@ -68,36 +50,16 @@ data class HotelHotelAmenitiesInner( val instance = HotelHotelAmenitiesInner( id = id, - name = name + name = name, ) - validate(instance) - return instance } - - private fun validate(instance: HotelHotelAmenitiesInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id, - name = name + name = name, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInnerAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInnerAllOf.kt deleted file mode 100644 index bccedad58..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInnerAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param id The identification number for a hotel amenity. - * @param name The description of a hotel amenity. - */ -data class HotelHotelAmenitiesInnerAllOf( - // The identification number for a hotel amenity. - @JsonProperty("Id") - @field:Valid - val id: kotlin.Any? = null, - // The description of a hotel amenity. - @JsonProperty("Name") - @field:Valid - val name: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var id: kotlin.Any? = null, - private var name: kotlin.Any? = null - ) { - fun id(id: kotlin.Any?) = apply { this.id = id } - - fun name(name: kotlin.Any?) = apply { this.name = name } - - fun build(): HotelHotelAmenitiesInnerAllOf { - val instance = - HotelHotelAmenitiesInnerAllOf( - id = id, - name = name - ) - - validate(instance) - - return instance - } - - private fun validate(instance: HotelHotelAmenitiesInnerAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - id = id, - name = name - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinks.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinks.kt index 747228435..e7abe2e66 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinks.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinks.kt @@ -13,45 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.HotelLinksApiRateCalendar import com.expediagroup.sdk.xap.models.HotelLinksWebSearchResult import com.expediagroup.sdk.xap.models.Link import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for list of **HATEOAS** links to Expedia website to complete booking. This links section will only return a deeplink to the Website Search Results page by default. If you have selected AD deeplinks they will only appear within the `RoomTypes` section of the response, as the Lodging Details API returns details at the room offer level, and not at the property level. +* Container for list of **HATEOAS** links to Expedia website to complete booking. This links section will only return a deeplink to the Website Search Results page by default. If you have selected AD deeplinks they will only appear within the `RoomTypes` section of the response, as the Lodging Details API returns details at the room offer level, and not at the property level. * @param webSearchResult * @param apiRateCalendar - */ +*/ data class HotelLinks( @JsonProperty("WebSearchResult") - @field:Valid val webSearchResult: HotelLinksWebSearchResult? = null, @JsonProperty("ApiRateCalendar") - @field:Valid - val apiRateCalendar: HotelLinksApiRateCalendar? = null + val apiRateCalendar: HotelLinksApiRateCalendar? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -59,7 +41,7 @@ data class HotelLinks( class Builder( private var webSearchResult: HotelLinksWebSearchResult? = null, - private var apiRateCalendar: HotelLinksApiRateCalendar? = null + private var apiRateCalendar: HotelLinksApiRateCalendar? = null, ) { fun webSearchResult(webSearchResult: HotelLinksWebSearchResult?) = apply { this.webSearchResult = webSearchResult } @@ -69,36 +51,16 @@ data class HotelLinks( val instance = HotelLinks( webSearchResult = webSearchResult, - apiRateCalendar = apiRateCalendar + apiRateCalendar = apiRateCalendar, ) - validate(instance) - return instance } - - private fun validate(instance: HotelLinks) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( webSearchResult = webSearchResult, - apiRateCalendar = apiRateCalendar + apiRateCalendar = apiRateCalendar, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksApiRateCalendar.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksApiRateCalendar.kt index 9e046cb5a..a5f015a35 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksApiRateCalendar.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksApiRateCalendar.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param accept The Accept request header (for API queries only - not included for page URLs). * @param method Method of request. * @param href The URL of the destination web page or API query. - */ +*/ data class HotelLinksApiRateCalendar( // The Accept request header (for API queries only - not included for page URLs). @JsonProperty("Accept") - @field:Valid val accept: kotlin.String? = null, // Method of request. @JsonProperty("Method") - @field:Valid val method: kotlin.String? = null, // The URL of the destination web page or API query. @JsonProperty("Href") - @field:Valid - val href: kotlin.String? = null + val href: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class HotelLinksApiRateCalendar( class Builder( private var accept: kotlin.String? = null, private var method: kotlin.String? = null, - private var href: kotlin.String? = null + private var href: kotlin.String? = null, ) { fun accept(accept: kotlin.String?) = apply { this.accept = accept } @@ -77,37 +58,17 @@ data class HotelLinksApiRateCalendar( HotelLinksApiRateCalendar( accept = accept, method = method, - href = href + href = href, ) - validate(instance) - return instance } - - private fun validate(instance: HotelLinksApiRateCalendar) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( accept = accept, method = method, - href = href + href = href, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksWebSearchResult.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksWebSearchResult.kt index f39b5e4e8..b2c105756 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksWebSearchResult.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksWebSearchResult.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param accept The Accept request header (for API queries only - not included for page URLs). * @param method Method of request. * @param href The URL of the destination web page or API query. - */ +*/ data class HotelLinksWebSearchResult( // The Accept request header (for API queries only - not included for page URLs). @JsonProperty("Accept") - @field:Valid val accept: kotlin.String? = null, // Method of request. @JsonProperty("Method") - @field:Valid val method: kotlin.String? = null, // The URL of the destination web page or API query. @JsonProperty("Href") - @field:Valid - val href: kotlin.String? = null + val href: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class HotelLinksWebSearchResult( class Builder( private var accept: kotlin.String? = null, private var method: kotlin.String? = null, - private var href: kotlin.String? = null + private var href: kotlin.String? = null, ) { fun accept(accept: kotlin.String?) = apply { this.accept = accept } @@ -77,37 +58,17 @@ data class HotelLinksWebSearchResult( HotelLinksWebSearchResult( accept = accept, method = method, - href = href + href = href, ) - validate(instance) - return instance } - - private fun validate(instance: HotelLinksWebSearchResult) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( accept = accept, method = method, - href = href + href = href, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponse.kt index 098fbc5e5..1df832a92 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponse.kt @@ -13,35 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Hotel import com.expediagroup.sdk.xap.models.HotelListingsResponseStayDates import com.expediagroup.sdk.xap.models.Occupant import com.expediagroup.sdk.xap.models.Warning import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param warnings There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. * @param count The number of hotels actually returned in the response. * @param totalHotelCount The number of hotels present in the location. @@ -51,11 +32,10 @@ import javax.validation.Validation * @param numberOfRooms The number of the rooms requested on behalf of the user. * @param occupants Container of occupants. It is an array including occupants of each room. * @param hotels Container for all hotels. - */ +*/ data class HotelListingsResponse( // There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. @JsonProperty("Warnings") - @field:Valid val warnings: kotlin.collections.List? = null, // The number of hotels actually returned in the response. @JsonProperty("Count") @@ -65,10 +45,8 @@ data class HotelListingsResponse( val totalHotelCount: kotlin.Int? = null, // Unique identifier for the transaction. @JsonProperty("TransactionId") - @field:Valid val transactionId: kotlin.String? = null, @JsonProperty("StayDates") - @field:Valid val stayDates: HotelListingsResponseStayDates? = null, // The number of stay nights. @JsonProperty("LengthOfStay") @@ -78,13 +56,14 @@ data class HotelListingsResponse( val numberOfRooms: kotlin.Int? = null, // Container of occupants. It is an array including occupants of each room. @JsonProperty("Occupants") - @field:Valid val occupants: kotlin.collections.List? = null, // Container for all hotels. @JsonProperty("Hotels") - @field:Valid - val hotels: kotlin.collections.List? = null + val hotels: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -99,7 +78,7 @@ data class HotelListingsResponse( private var lengthOfStay: kotlin.Int? = null, private var numberOfRooms: kotlin.Int? = null, private var occupants: kotlin.collections.List? = null, - private var hotels: kotlin.collections.List? = null + private var hotels: kotlin.collections.List? = null, ) { fun warnings(warnings: kotlin.collections.List?) = apply { this.warnings = warnings } @@ -130,31 +109,11 @@ data class HotelListingsResponse( lengthOfStay = lengthOfStay, numberOfRooms = numberOfRooms, occupants = occupants, - hotels = hotels + hotels = hotels, ) - validate(instance) - return instance } - - private fun validate(instance: HotelListingsResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -167,6 +126,6 @@ data class HotelListingsResponse( lengthOfStay = lengthOfStay, numberOfRooms = numberOfRooms, occupants = occupants, - hotels = hotels + hotels = hotels, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponseStayDates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponseStayDates.kt index d01cb1c2d..7f030f4fe 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponseStayDates.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponseStayDates.kt @@ -13,41 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Validation /** - * +* * @param checkInDate The initial day of the hotel stay in an ISO 8601 Date format [YYYY-MM-DD]. * @param checkOutDate The final day of the hotel stay in an ISO 8601 Date format [YYYY-MM-DD]. - */ +*/ data class HotelListingsResponseStayDates( // The initial day of the hotel stay in an ISO 8601 Date format [YYYY-MM-DD]. @JsonProperty("CheckInDate") val checkInDate: java.time.LocalDate? = null, // The final day of the hotel stay in an ISO 8601 Date format [YYYY-MM-DD]. @JsonProperty("CheckOutDate") - val checkOutDate: java.time.LocalDate? = null + val checkOutDate: java.time.LocalDate? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -55,7 +40,7 @@ data class HotelListingsResponseStayDates( class Builder( private var checkInDate: java.time.LocalDate? = null, - private var checkOutDate: java.time.LocalDate? = null + private var checkOutDate: java.time.LocalDate? = null, ) { fun checkInDate(checkInDate: java.time.LocalDate?) = apply { this.checkInDate = checkInDate } @@ -65,36 +50,16 @@ data class HotelListingsResponseStayDates( val instance = HotelListingsResponseStayDates( checkInDate = checkInDate, - checkOutDate = checkOutDate + checkOutDate = checkOutDate, ) - validate(instance) - return instance } - - private fun validate(instance: HotelListingsResponseStayDates) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( checkInDate = checkInDate, - checkOutDate = checkOutDate + checkOutDate = checkOutDate, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLocation.kt index 2e66d5ac5..7a69fd9fb 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLocation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLocation.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Address import com.expediagroup.sdk.xap.models.LocationGeoLocation import com.expediagroup.sdk.xap.models.Neighborhood import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param address * @param geoLocation * @param neighborhood - */ +*/ data class HotelLocation( @JsonProperty("Address") - @field:Valid val address: Address? = null, @JsonProperty("GeoLocation") - @field:Valid val geoLocation: LocationGeoLocation? = null, @JsonProperty("Neighborhood") - @field:Valid - val neighborhood: Neighborhood? = null + val neighborhood: Neighborhood? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class HotelLocation( class Builder( private var address: Address? = null, private var geoLocation: LocationGeoLocation? = null, - private var neighborhood: Neighborhood? = null + private var neighborhood: Neighborhood? = null, ) { fun address(address: Address?) = apply { this.address = address } @@ -77,37 +58,17 @@ data class HotelLocation( HotelLocation( address = address, geoLocation = geoLocation, - neighborhood = neighborhood + neighborhood = neighborhood, ) - validate(instance) - return instance } - - private fun validate(instance: HotelLocation) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( address = address, geoLocation = geoLocation, - neighborhood = neighborhood + neighborhood = neighborhood, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPolicies.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPolicies.kt index 2b71be3d4..7f9a4caf7 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPolicies.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPolicies.kt @@ -13,64 +13,42 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for Hotel policy information. +* Container for Hotel policy information. * @param checkInStartTime Beginning of the standard check-in window on the check in date, and in the local time of the hotel. * @param checkInEndTime End of the standard check-in window on the check in date, and in the local time of the hotel. * @param specialCheckInInstructions Some special instructions needed care by customer when check in. * @param checkOutTime Customers must check out before this time on the check out date, expressed in the local time of the hotel. * @param petPolicies The policy of the property toward having pets stay with guests. * @param childrenAndExtraBedsPolicies The policy of the hotel for having children stay at the hotel, as well as for including extra beds in the room. - */ +*/ data class HotelPolicies( // Beginning of the standard check-in window on the check in date, and in the local time of the hotel. @JsonProperty("CheckInStartTime") - @field:Valid val checkInStartTime: kotlin.String? = null, // End of the standard check-in window on the check in date, and in the local time of the hotel. @JsonProperty("CheckInEndTime") - @field:Valid val checkInEndTime: kotlin.String? = null, // Some special instructions needed care by customer when check in. @JsonProperty("SpecialCheckInInstructions") - @field:Valid val specialCheckInInstructions: kotlin.collections.List? = null, // Customers must check out before this time on the check out date, expressed in the local time of the hotel. @JsonProperty("CheckOutTime") - @field:Valid val checkOutTime: kotlin.String? = null, // The policy of the property toward having pets stay with guests. @JsonProperty("PetPolicies") - @field:Valid val petPolicies: kotlin.collections.List? = null, // The policy of the hotel for having children stay at the hotel, as well as for including extra beds in the room. @JsonProperty("ChildrenAndExtraBedsPolicies") - @field:Valid - val childrenAndExtraBedsPolicies: kotlin.collections.List? = null + val childrenAndExtraBedsPolicies: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -82,7 +60,7 @@ data class HotelPolicies( private var specialCheckInInstructions: kotlin.collections.List? = null, private var checkOutTime: kotlin.String? = null, private var petPolicies: kotlin.collections.List? = null, - private var childrenAndExtraBedsPolicies: kotlin.collections.List? = null + private var childrenAndExtraBedsPolicies: kotlin.collections.List? = null, ) { fun checkInStartTime(checkInStartTime: kotlin.String?) = apply { this.checkInStartTime = checkInStartTime } @@ -104,31 +82,11 @@ data class HotelPolicies( specialCheckInInstructions = specialCheckInInstructions, checkOutTime = checkOutTime, petPolicies = petPolicies, - childrenAndExtraBedsPolicies = childrenAndExtraBedsPolicies + childrenAndExtraBedsPolicies = childrenAndExtraBedsPolicies, ) - validate(instance) - return instance } - - private fun validate(instance: HotelPolicies) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -138,6 +96,6 @@ data class HotelPolicies( specialCheckInInstructions = specialCheckInInstructions, checkOutTime = checkOutTime, petPolicies = petPolicies, - childrenAndExtraBedsPolicies = childrenAndExtraBedsPolicies + childrenAndExtraBedsPolicies = childrenAndExtraBedsPolicies, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPropertyType.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPropertyType.kt index f12b4691f..b50a94128 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPropertyType.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPropertyType.kt @@ -13,43 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for information on hotel property type. You can find a complete list of Lodging Property Types in [Lodging Property Types](https://developers.expediagroup.com/xap/products/xap/lodging/references/property-types). +* Container for information on hotel property type. You can find a complete list of Lodging Property Types in [Lodging Property Types](https://developers.expediagroup.com/xap/products/xap/lodging/references/property-types). * @param id The id of hotel property type. * @param name The name of hotel property type. - */ +*/ data class HotelPropertyType( // The id of hotel property type. @JsonProperty("Id") val id: kotlin.Int? = null, // The name of hotel property type. @JsonProperty("Name") - @field:Valid - val name: kotlin.String? = null + val name: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -57,7 +40,7 @@ data class HotelPropertyType( class Builder( private var id: kotlin.Int? = null, - private var name: kotlin.String? = null + private var name: kotlin.String? = null, ) { fun id(id: kotlin.Int?) = apply { this.id = id } @@ -67,36 +50,16 @@ data class HotelPropertyType( val instance = HotelPropertyType( id = id, - name = name + name = name, ) - validate(instance) - return instance } - - private fun validate(instance: HotelPropertyType) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id, - name = name + name = name, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRateCalendar.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRateCalendar.kt index bc634ac91..ed7689f8c 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRateCalendar.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRateCalendar.kt @@ -13,50 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.RateCalendar import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for all hotel rate calendar data. +* Container for all hotel rate calendar data. * @param ecomHotelId The unique, Expedia-specific hotel property identifier used to designate a single hotel. * @param hcomHotelId The unique, Hotels.com-specific hotel property identifier used to designate a single hotel. This will be returned if searching via `hcomHotelId` in request or the request is coming from Hcom partner. * @param rateCalendar Container for all rate calendar data. - */ +*/ data class HotelRateCalendar( // The unique, Expedia-specific hotel property identifier used to designate a single hotel. @JsonProperty("EcomHotelId") - @field:Valid val ecomHotelId: kotlin.String? = null, // The unique, Hotels.com-specific hotel property identifier used to designate a single hotel. This will be returned if searching via `hcomHotelId` in request or the request is coming from Hcom partner. @JsonProperty("HcomHotelId") - @field:Valid val hcomHotelId: kotlin.String? = null, // Container for all rate calendar data. @JsonProperty("RateCalendar") - @field:Valid - val rateCalendar: kotlin.collections.List? = null + val rateCalendar: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -65,7 +46,7 @@ data class HotelRateCalendar( class Builder( private var ecomHotelId: kotlin.String? = null, private var hcomHotelId: kotlin.String? = null, - private var rateCalendar: kotlin.collections.List? = null + private var rateCalendar: kotlin.collections.List? = null, ) { fun ecomHotelId(ecomHotelId: kotlin.String?) = apply { this.ecomHotelId = ecomHotelId } @@ -78,37 +59,17 @@ data class HotelRateCalendar( HotelRateCalendar( ecomHotelId = ecomHotelId, hcomHotelId = hcomHotelId, - rateCalendar = rateCalendar + rateCalendar = rateCalendar, ) - validate(instance) - return instance } - - private fun validate(instance: HotelRateCalendar) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( ecomHotelId = ecomHotelId, hcomHotelId = hcomHotelId, - rateCalendar = rateCalendar + rateCalendar = rateCalendar, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInner.kt index 632f3b125..71007d0b5 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInner.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param id The identification number for a room amenity. * @param name The description of a room amenity. - */ +*/ data class HotelRoomAmenitiesInner( // The identification number for a room amenity. @JsonProperty("Id") - @field:Valid val id: kotlin.Any? = null, // The description of a room amenity. @JsonProperty("Name") - @field:Valid - val name: kotlin.Any? = null + val name: kotlin.Any? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class HotelRoomAmenitiesInner( class Builder( private var id: kotlin.Any? = null, - private var name: kotlin.Any? = null + private var name: kotlin.Any? = null, ) { fun id(id: kotlin.Any?) = apply { this.id = id } @@ -68,36 +50,16 @@ data class HotelRoomAmenitiesInner( val instance = HotelRoomAmenitiesInner( id = id, - name = name + name = name, ) - validate(instance) - return instance } - - private fun validate(instance: HotelRoomAmenitiesInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id, - name = name + name = name, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInnerAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInnerAllOf.kt deleted file mode 100644 index 692b6c972..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInnerAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param id The identification number for a room amenity. - * @param name The description of a room amenity. - */ -data class HotelRoomAmenitiesInnerAllOf( - // The identification number for a room amenity. - @JsonProperty("Id") - @field:Valid - val id: kotlin.Any? = null, - // The description of a room amenity. - @JsonProperty("Name") - @field:Valid - val name: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var id: kotlin.Any? = null, - private var name: kotlin.Any? = null - ) { - fun id(id: kotlin.Any?) = apply { this.id = id } - - fun name(name: kotlin.Any?) = apply { this.name = name } - - fun build(): HotelRoomAmenitiesInnerAllOf { - val instance = - HotelRoomAmenitiesInnerAllOf( - id = id, - name = name - ) - - validate(instance) - - return instance - } - - private fun validate(instance: HotelRoomAmenitiesInnerAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - id = id, - name = name - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Image.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Image.kt index 6d3a24ba2..1495b0553 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Image.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Image.kt @@ -13,53 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List of image resources of the car product. +* List of image resources of the car product. * @param type Resource typeSupported values :Thumbnail - (70 pixels wide)Image - (165 pixels wide) * @param propertySize Size of imageSupported values :s - (165 pixels wide)t - (70 pixels wide) * @param href URL for the image. - */ +*/ data class Image( // Resource typeSupported values :Thumbnail - (70 pixels wide)Image - (165 pixels wide) @JsonProperty("Type") - @field:NotNull - @field:Valid val type: kotlin.String, // Size of imageSupported values :s - (165 pixels wide)t - (70 pixels wide) @JsonProperty("Size") - @field:NotNull - @field:Valid val propertySize: kotlin.String, // URL for the image. @JsonProperty("Href") - @field:NotNull - @field:Valid - val href: kotlin.String + val href: kotlin.String, ) { + init { + require(type != null) { "type must not be null" } + + require(propertySize != null) { "propertySize must not be null" } + + require(href != null) { "href must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -68,7 +50,7 @@ data class Image( class Builder( private var type: kotlin.String? = null, private var propertySize: kotlin.String? = null, - private var href: kotlin.String? = null + private var href: kotlin.String? = null, ) { fun type(type: kotlin.String) = apply { this.type = type } @@ -81,37 +63,17 @@ data class Image( Image( type = type!!, propertySize = propertySize!!, - href = href!! + href = href!!, ) - validate(instance) - return instance } - - private fun validate(instance: Image) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( type = type!!, propertySize = propertySize!!, - href = href!! + href = href!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Link.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Link.kt index 0d1a271ca..d29d12742 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Link.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Link.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param accept The Accept request header (for API queries only - not included for page URLs). * @param method Method of request. * @param href The URL of the destination web page or API query. - */ +*/ data class Link( // The Accept request header (for API queries only - not included for page URLs). @JsonProperty("Accept") - @field:Valid val accept: kotlin.String? = null, // Method of request. @JsonProperty("Method") - @field:Valid val method: kotlin.String? = null, // The URL of the destination web page or API query. @JsonProperty("Href") - @field:Valid - val href: kotlin.String? = null + val href: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class Link( class Builder( private var accept: kotlin.String? = null, private var method: kotlin.String? = null, - private var href: kotlin.String? = null + private var href: kotlin.String? = null, ) { fun accept(accept: kotlin.String?) = apply { this.accept = accept } @@ -77,37 +58,17 @@ data class Link( Link( accept = accept, method = method, - href = href + href = href, ) - validate(instance) - return instance } - - private fun validate(instance: Link) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( accept = accept, method = method, - href = href + href = href, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Location.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Location.kt index b10b28b93..bb55e5ec1 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Location.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Location.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Address import com.expediagroup.sdk.xap.models.LocationGeoLocation import com.expediagroup.sdk.xap.models.Neighborhood import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for list of possible locations that could be used to disambiguate the query. +* Container for list of possible locations that could be used to disambiguate the query. * @param address * @param geoLocation * @param neighborhood - */ +*/ data class Location( @JsonProperty("Address") - @field:Valid val address: Address? = null, @JsonProperty("GeoLocation") - @field:Valid val geoLocation: LocationGeoLocation? = null, @JsonProperty("Neighborhood") - @field:Valid - val neighborhood: Neighborhood? = null + val neighborhood: Neighborhood? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class Location( class Builder( private var address: Address? = null, private var geoLocation: LocationGeoLocation? = null, - private var neighborhood: Neighborhood? = null + private var neighborhood: Neighborhood? = null, ) { fun address(address: Address?) = apply { this.address = address } @@ -77,37 +58,17 @@ data class Location( Location( address = address, geoLocation = geoLocation, - neighborhood = neighborhood + neighborhood = neighborhood, ) - validate(instance) - return instance } - - private fun validate(instance: Location) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( address = address, geoLocation = geoLocation, - neighborhood = neighborhood + neighborhood = neighborhood, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocation.kt index 2f75e9973..c0f9b0d36 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocation.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param latitude The geographic coordinates of the hotel property, based on a horizontal angular measurement relative to The Equator. North latitude will be represented by a positive value. South latitude will be represented by a negative value. * @param longitude The geographic coordinates of the hotel property, based on a vertical angular measurement relative to the universal Prime Meridian (Royal Observatory, Greenwich). East longitude will be represented by a positive value. West longitude will be represented by a negative value. * @param obfuscated Indicates whether the displayed Latitude/Longitude information is obfuscated. Note: Exact Lat/Long values for Vacation Rental properties will not be shown in either XAPv3 Search or Details responses to respect the security of the homeowner. Instead an 'obfuscated' Lat/Long value will be returned that will indicate the general area within which the property is located, but not the exact location of the property itself. - */ +*/ data class LocationGeoLocation( // The geographic coordinates of the hotel property, based on a horizontal angular measurement relative to The Equator. North latitude will be represented by a positive value. South latitude will be represented by a negative value. @JsonProperty("Latitude") - @field:Valid val latitude: kotlin.String? = null, // The geographic coordinates of the hotel property, based on a vertical angular measurement relative to the universal Prime Meridian (Royal Observatory, Greenwich). East longitude will be represented by a positive value. West longitude will be represented by a negative value. @JsonProperty("Longitude") - @field:Valid val longitude: kotlin.String? = null, // Indicates whether the displayed Latitude/Longitude information is obfuscated. Note: Exact Lat/Long values for Vacation Rental properties will not be shown in either XAPv3 Search or Details responses to respect the security of the homeowner. Instead an 'obfuscated' Lat/Long value will be returned that will indicate the general area within which the property is located, but not the exact location of the property itself. @JsonProperty("Obfuscated") - @field:Valid - val obfuscated: kotlin.Boolean? = null + val obfuscated: kotlin.Boolean? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class LocationGeoLocation( class Builder( private var latitude: kotlin.String? = null, private var longitude: kotlin.String? = null, - private var obfuscated: kotlin.Boolean? = null + private var obfuscated: kotlin.Boolean? = null, ) { fun latitude(latitude: kotlin.String?) = apply { this.latitude = latitude } @@ -77,37 +58,17 @@ data class LocationGeoLocation( LocationGeoLocation( latitude = latitude, longitude = longitude, - obfuscated = obfuscated + obfuscated = obfuscated, ) - validate(instance) - return instance } - - private fun validate(instance: LocationGeoLocation) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( latitude = latitude, longitude = longitude, - obfuscated = obfuscated + obfuscated = obfuscated, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocationAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocationAllOf.kt deleted file mode 100644 index 08d0f20bb..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocationAllOf.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param latitude The geographic coordinates of the hotel property, based on a horizontal angular measurement relative to The Equator. North latitude will be represented by a positive value. South latitude will be represented by a negative value. - * @param longitude The geographic coordinates of the hotel property, based on a vertical angular measurement relative to the universal Prime Meridian (Royal Observatory, Greenwich). East longitude will be represented by a positive value. West longitude will be represented by a negative value. - * @param obfuscated Indicates whether the displayed Latitude/Longitude information is obfuscated. Note: Exact Lat/Long values for Vacation Rental properties will not be shown in either XAPv3 Search or Details responses to respect the security of the homeowner. Instead an 'obfuscated' Lat/Long value will be returned that will indicate the general area within which the property is located, but not the exact location of the property itself. - */ -data class LocationGeoLocationAllOf( - // The geographic coordinates of the hotel property, based on a horizontal angular measurement relative to The Equator. North latitude will be represented by a positive value. South latitude will be represented by a negative value. - @JsonProperty("Latitude") - @field:Valid - val latitude: kotlin.String? = null, - // The geographic coordinates of the hotel property, based on a vertical angular measurement relative to the universal Prime Meridian (Royal Observatory, Greenwich). East longitude will be represented by a positive value. West longitude will be represented by a negative value. - @JsonProperty("Longitude") - @field:Valid - val longitude: kotlin.String? = null, - // Indicates whether the displayed Latitude/Longitude information is obfuscated. Note: Exact Lat/Long values for Vacation Rental properties will not be shown in either XAPv3 Search or Details responses to respect the security of the homeowner. Instead an 'obfuscated' Lat/Long value will be returned that will indicate the general area within which the property is located, but not the exact location of the property itself. - @JsonProperty("Obfuscated") - @field:Valid - val obfuscated: kotlin.Boolean? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var latitude: kotlin.String? = null, - private var longitude: kotlin.String? = null, - private var obfuscated: kotlin.Boolean? = null - ) { - fun latitude(latitude: kotlin.String?) = apply { this.latitude = latitude } - - fun longitude(longitude: kotlin.String?) = apply { this.longitude = longitude } - - fun obfuscated(obfuscated: kotlin.Boolean?) = apply { this.obfuscated = obfuscated } - - fun build(): LocationGeoLocationAllOf { - val instance = - LocationGeoLocationAllOf( - latitude = latitude, - longitude = longitude, - obfuscated = obfuscated - ) - - validate(instance) - - return instance - } - - private fun validate(instance: LocationGeoLocationAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - latitude = latitude, - longitude = longitude, - obfuscated = obfuscated - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationOption.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationOption.kt index fe3af0eab..24c4d3e37 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationOption.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationOption.kt @@ -13,33 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Country import com.expediagroup.sdk.xap.models.GeoLocation import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for possible matches to your ambiguous `locationKeyword` query. +* Container for possible matches to your ambiguous `locationKeyword` query. * @param type Type of the location. * @param regionId RegionId the location resides in. * @param shortName The name of the location which matches the location keyword. @@ -47,35 +28,31 @@ import javax.validation.Validation * @param address The address of the location. * @param country * @param geoLocation - */ +*/ data class LocationOption( // Type of the location. @JsonProperty("Type") - @field:Valid val type: kotlin.String? = null, // RegionId the location resides in. @JsonProperty("RegionId") - @field:Valid val regionId: kotlin.String? = null, // The name of the location which matches the location keyword. @JsonProperty("ShortName") - @field:Valid val shortName: kotlin.String? = null, // Indicates the nearest major airport to the location. @JsonProperty("AirportCode") - @field:Valid val airportCode: kotlin.String? = null, // The address of the location. @JsonProperty("Address") - @field:Valid val address: kotlin.String? = null, @JsonProperty("Country") - @field:Valid val country: Country? = null, @JsonProperty("GeoLocation") - @field:Valid - val geoLocation: GeoLocation? = null + val geoLocation: GeoLocation? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -88,7 +65,7 @@ data class LocationOption( private var airportCode: kotlin.String? = null, private var address: kotlin.String? = null, private var country: Country? = null, - private var geoLocation: GeoLocation? = null + private var geoLocation: GeoLocation? = null, ) { fun type(type: kotlin.String?) = apply { this.type = type } @@ -113,31 +90,11 @@ data class LocationOption( airportCode = airportCode, address = address, country = country, - geoLocation = geoLocation + geoLocation = geoLocation, ) - validate(instance) - return instance } - - private fun validate(instance: LocationOption) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -148,6 +105,6 @@ data class LocationOption( airportCode = airportCode, address = address, country = country, - geoLocation = geoLocation + geoLocation = geoLocation, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingAmenity.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingAmenity.kt index 7c31b4b32..6f896ce0b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingAmenity.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingAmenity.kt @@ -13,42 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param id * @param name - */ +*/ data class LodgingAmenity( @JsonProperty("Id") - @field:Valid val id: kotlin.String? = null, @JsonProperty("Name") - @field:Valid - val name: kotlin.String? = null + val name: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -56,7 +38,7 @@ data class LodgingAmenity( class Builder( private var id: kotlin.String? = null, - private var name: kotlin.String? = null + private var name: kotlin.String? = null, ) { fun id(id: kotlin.String?) = apply { this.id = id } @@ -66,36 +48,16 @@ data class LodgingAmenity( val instance = LodgingAmenity( id = id, - name = name + name = name, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingAmenity) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id, - name = name + name = name, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPenaltyRule.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPenaltyRule.kt index 687fe84c2..fb124cd4a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPenaltyRule.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPenaltyRule.kt @@ -13,47 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for cancellation penalty details. +* Container for cancellation penalty details. * @param penaltyPercentOfStay Specifies the per-stay cancellation fee charged as a percentage of the total rate, in addition to any other penalties listed. * @param penaltyStartDateTime The beginning of the window of time when the `CancellationPenaltyRule` is in effect. The date and time are expressed in ISO 8601 International Date format, and local to the property. * @param penaltyEndDateTime The end of the window of time when the `CancellationPenaltyRule` is in effect. The date and time are expressed in ISO 8601 International Date format, and local to the property. - */ +*/ data class LodgingCancellationPenaltyRule( // Specifies the per-stay cancellation fee charged as a percentage of the total rate, in addition to any other penalties listed. @JsonProperty("PenaltyPercentOfStay") - @field:Valid val penaltyPercentOfStay: kotlin.String? = null, // The beginning of the window of time when the `CancellationPenaltyRule` is in effect. The date and time are expressed in ISO 8601 International Date format, and local to the property. @JsonProperty("PenaltyStartDateTime") val penaltyStartDateTime: java.time.OffsetDateTime? = null, // The end of the window of time when the `CancellationPenaltyRule` is in effect. The date and time are expressed in ISO 8601 International Date format, and local to the property. @JsonProperty("PenaltyEndDateTime") - val penaltyEndDateTime: java.time.OffsetDateTime? = null + val penaltyEndDateTime: java.time.OffsetDateTime? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -62,7 +45,7 @@ data class LodgingCancellationPenaltyRule( class Builder( private var penaltyPercentOfStay: kotlin.String? = null, private var penaltyStartDateTime: java.time.OffsetDateTime? = null, - private var penaltyEndDateTime: java.time.OffsetDateTime? = null + private var penaltyEndDateTime: java.time.OffsetDateTime? = null, ) { fun penaltyPercentOfStay(penaltyPercentOfStay: kotlin.String?) = apply { this.penaltyPercentOfStay = penaltyPercentOfStay } @@ -75,37 +58,17 @@ data class LodgingCancellationPenaltyRule( LodgingCancellationPenaltyRule( penaltyPercentOfStay = penaltyPercentOfStay, penaltyStartDateTime = penaltyStartDateTime, - penaltyEndDateTime = penaltyEndDateTime + penaltyEndDateTime = penaltyEndDateTime, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingCancellationPenaltyRule) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( penaltyPercentOfStay = penaltyPercentOfStay, penaltyStartDateTime = penaltyStartDateTime, - penaltyEndDateTime = penaltyEndDateTime + penaltyEndDateTime = penaltyEndDateTime, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPolicy.kt index 6ca1f264d..d044642a5 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPolicy.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPolicy.kt @@ -13,54 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.LodgingCancellationPenaltyRule import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for Cancellation Policy information. +* Container for Cancellation Policy information. * @param refundable Indicate whether the rate is refundable or not. * @param freeCancellation Indicate whether the room can be cancelled free of charge. * @param freeCancellationEndDateTime The date and time until which the room can be cancelled free of charge. * @param cancellationPenaltyRules Container for Cancellation Penalty Rules information. - */ +*/ data class LodgingCancellationPolicy( // Indicate whether the rate is refundable or not. @JsonProperty("Refundable") - @field:Valid val refundable: kotlin.Boolean? = null, // Indicate whether the room can be cancelled free of charge. @JsonProperty("FreeCancellation") - @field:Valid val freeCancellation: kotlin.Boolean? = null, // The date and time until which the room can be cancelled free of charge. @JsonProperty("FreeCancellationEndDateTime") val freeCancellationEndDateTime: java.time.OffsetDateTime? = null, // Container for Cancellation Penalty Rules information. @JsonProperty("CancellationPenaltyRules") - @field:Valid - val cancellationPenaltyRules: kotlin.collections.List? = null + val cancellationPenaltyRules: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -70,7 +51,7 @@ data class LodgingCancellationPolicy( private var refundable: kotlin.Boolean? = null, private var freeCancellation: kotlin.Boolean? = null, private var freeCancellationEndDateTime: java.time.OffsetDateTime? = null, - private var cancellationPenaltyRules: kotlin.collections.List? = null + private var cancellationPenaltyRules: kotlin.collections.List? = null, ) { fun refundable(refundable: kotlin.Boolean?) = apply { this.refundable = refundable } @@ -86,31 +67,11 @@ data class LodgingCancellationPolicy( refundable = refundable, freeCancellation = freeCancellation, freeCancellationEndDateTime = freeCancellationEndDateTime, - cancellationPenaltyRules = cancellationPenaltyRules + cancellationPenaltyRules = cancellationPenaltyRules, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingCancellationPolicy) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -118,6 +79,6 @@ data class LodgingCancellationPolicy( refundable = refundable, freeCancellation = freeCancellation, freeCancellationEndDateTime = freeCancellationEndDateTime, - cancellationPenaltyRules = cancellationPenaltyRules + cancellationPenaltyRules = cancellationPenaltyRules, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingError.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingError.kt index 09cb9a147..4e504f76f 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingError.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingError.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for error list. +* Container for error list. * @param code Error code describing the issue * @param description A simple description of what the error is. - */ +*/ data class LodgingError( // Error code describing the issue @JsonProperty("Code") - @field:Valid val code: kotlin.String? = null, // A simple description of what the error is. @JsonProperty("Description") - @field:Valid - val description: kotlin.String? = null + val description: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class LodgingError( class Builder( private var code: kotlin.String? = null, - private var description: kotlin.String? = null + private var description: kotlin.String? = null, ) { fun code(code: kotlin.String?) = apply { this.code = code } @@ -68,36 +50,16 @@ data class LodgingError( val instance = LodgingError( code = code, - description = description + description = description, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingError) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( code = code, - description = description + description = description, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingErrors.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingErrors.kt index a9eba2d8e..01831a0a2 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingErrors.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingErrors.kt @@ -13,45 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.LodgingError import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param errors Container for error list. * @param transactionId A unique identifier for the transaction. - */ +*/ data class LodgingErrors( // Container for error list. @JsonProperty("Errors") - @field:Valid val errors: kotlin.collections.List? = null, // A unique identifier for the transaction. @JsonProperty("TransactionId") - @field:Valid - val transactionId: kotlin.String? = null + val transactionId: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -59,7 +41,7 @@ data class LodgingErrors( class Builder( private var errors: kotlin.collections.List? = null, - private var transactionId: kotlin.String? = null + private var transactionId: kotlin.String? = null, ) { fun errors(errors: kotlin.collections.List?) = apply { this.errors = errors } @@ -69,36 +51,16 @@ data class LodgingErrors( val instance = LodgingErrors( errors = errors, - transactionId = transactionId + transactionId = transactionId, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingErrors) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( errors = errors, - transactionId = transactionId + transactionId = transactionId, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingLink.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingLink.kt index 88b173658..dd905910f 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingLink.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingLink.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param accept The Accept request header for API queries only. Note: this value will only be returned if the link is an API query, as website URLs do not require an `Accept` header. * @param method Method of request. * @param href The URL of the destination web page or API query. - */ +*/ data class LodgingLink( // The Accept request header for API queries only. Note: this value will only be returned if the link is an API query, as website URLs do not require an `Accept` header. @JsonProperty("Accept") - @field:Valid val accept: kotlin.String? = null, // Method of request. @JsonProperty("Method") - @field:Valid val method: kotlin.String? = null, // The URL of the destination web page or API query. @JsonProperty("Href") - @field:Valid - val href: kotlin.String? = null + val href: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class LodgingLink( class Builder( private var accept: kotlin.String? = null, private var method: kotlin.String? = null, - private var href: kotlin.String? = null + private var href: kotlin.String? = null, ) { fun accept(accept: kotlin.String?) = apply { this.accept = accept } @@ -77,37 +58,17 @@ data class LodgingLink( LodgingLink( accept = accept, method = method, - href = href + href = href, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingLink) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( accept = accept, method = method, - href = href + href = href, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingMoney.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingMoney.kt index 890f2c1f2..bd7b009d9 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingMoney.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingMoney.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Pricing information of the stat date +* Pricing information of the stat date * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. - */ +*/ data class LodgingMoney( // The value of the element being defined. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null + val currency: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class LodgingMoney( class Builder( private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null + private var currency: kotlin.String? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -68,36 +50,16 @@ data class LodgingMoney( val instance = LodgingMoney( `value` = `value`, - currency = currency + currency = currency, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingMoney) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, - currency = currency + currency = currency, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingOccupant.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingOccupant.kt index d0bd6ce52..7d2c2df73 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingOccupant.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingOccupant.kt @@ -13,43 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param adults The number of adults in a room. * @param childAges The ages of children in a room. - */ +*/ data class LodgingOccupant( // The number of adults in a room. @JsonProperty("Adults") val adults: kotlin.Int? = null, // The ages of children in a room. @JsonProperty("ChildAges") - @field:Valid - val childAges: kotlin.collections.List? = null + val childAges: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -57,7 +40,7 @@ data class LodgingOccupant( class Builder( private var adults: kotlin.Int? = null, - private var childAges: kotlin.collections.List? = null + private var childAges: kotlin.collections.List? = null, ) { fun adults(adults: kotlin.Int?) = apply { this.adults = adults } @@ -67,36 +50,16 @@ data class LodgingOccupant( val instance = LodgingOccupant( adults = adults, - childAges = childAges + childAges = childAges, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingOccupant) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( adults = adults, - childAges = childAges + childAges = childAges, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingPromotion.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingPromotion.kt index e5bd5b15f..f865e660b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingPromotion.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingPromotion.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.LodgingMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param description The description of the promotion. * @param amount - */ +*/ data class LodgingPromotion( // The description of the promotion. @JsonProperty("Description") - @field:Valid val description: kotlin.String? = null, @JsonProperty("Amount") - @field:Valid - val amount: LodgingMoney? = null + val amount: LodgingMoney? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class LodgingPromotion( class Builder( private var description: kotlin.String? = null, - private var amount: LodgingMoney? = null + private var amount: LodgingMoney? = null, ) { fun description(description: kotlin.String?) = apply { this.description = description } @@ -68,36 +50,16 @@ data class LodgingPromotion( val instance = LodgingPromotion( description = description, - amount = amount + amount = amount, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingPromotion) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( description = description, - amount = amount + amount = amount, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingQuotesResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingQuotesResponse.kt index 4d59f99a7..d5b900015 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingQuotesResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingQuotesResponse.kt @@ -13,35 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.LodgingOccupant import com.expediagroup.sdk.xap.models.LodgingStayDates import com.expediagroup.sdk.xap.models.LodgingWarning import com.expediagroup.sdk.xap.models.Property import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param warnings There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. * @param count The number of properties actually returned in the response. * @param totalPropertyCount The number of properties requested. @@ -50,11 +31,10 @@ import javax.validation.Validation * @param lengthOfStay The number of stay nights. * @param occupants Container for the list of room occupants. * @param properties Container for all properties. - */ +*/ data class LodgingQuotesResponse( // There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. @JsonProperty("Warnings") - @field:Valid val warnings: kotlin.collections.List? = null, // The number of properties actually returned in the response. @JsonProperty("Count") @@ -64,23 +44,22 @@ data class LodgingQuotesResponse( val totalPropertyCount: kotlin.Int? = null, // Unique identifier for the API transaction. @JsonProperty("TransactionId") - @field:Valid val transactionId: kotlin.String? = null, @JsonProperty("StayDates") - @field:Valid val stayDates: LodgingStayDates? = null, // The number of stay nights. @JsonProperty("LengthOfStay") val lengthOfStay: kotlin.Int? = null, // Container for the list of room occupants. @JsonProperty("Occupants") - @field:Valid val occupants: kotlin.collections.List? = null, // Container for all properties. @JsonProperty("Properties") - @field:Valid - val properties: kotlin.collections.List? = null + val properties: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -94,7 +73,7 @@ data class LodgingQuotesResponse( private var stayDates: LodgingStayDates? = null, private var lengthOfStay: kotlin.Int? = null, private var occupants: kotlin.collections.List? = null, - private var properties: kotlin.collections.List? = null + private var properties: kotlin.collections.List? = null, ) { fun warnings(warnings: kotlin.collections.List?) = apply { this.warnings = warnings } @@ -122,31 +101,11 @@ data class LodgingQuotesResponse( stayDates = stayDates, lengthOfStay = lengthOfStay, occupants = occupants, - properties = properties + properties = properties, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingQuotesResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -158,6 +117,6 @@ data class LodgingQuotesResponse( stayDates = stayDates, lengthOfStay = lengthOfStay, occupants = occupants, - properties = properties + properties = properties, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRatePlan.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRatePlan.kt index e06c7748b..5dd8312d0 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRatePlan.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRatePlan.kt @@ -13,45 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.LodgingCancellationPolicy import com.expediagroup.sdk.xap.models.LodgingPromotion import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for rate plan information. +* Container for rate plan information. * @param cancellationPolicy * @param promotions All promotion information of the ratePlan. - */ +*/ data class LodgingRatePlan( @JsonProperty("CancellationPolicy") - @field:Valid val cancellationPolicy: LodgingCancellationPolicy? = null, // All promotion information of the ratePlan. @JsonProperty("Promotions") - @field:Valid - val promotions: kotlin.collections.List? = null + val promotions: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -59,7 +41,7 @@ data class LodgingRatePlan( class Builder( private var cancellationPolicy: LodgingCancellationPolicy? = null, - private var promotions: kotlin.collections.List? = null + private var promotions: kotlin.collections.List? = null, ) { fun cancellationPolicy(cancellationPolicy: LodgingCancellationPolicy?) = apply { this.cancellationPolicy = cancellationPolicy } @@ -69,36 +51,16 @@ data class LodgingRatePlan( val instance = LodgingRatePlan( cancellationPolicy = cancellationPolicy, - promotions = promotions + promotions = promotions, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingRatePlan) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( cancellationPolicy = cancellationPolicy, - promotions = promotions + promotions = promotions, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomType.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomType.kt index 8e46f1a6d..5dbbebbc0 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomType.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomType.kt @@ -13,50 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.LodgingRatePlan import com.expediagroup.sdk.xap.models.LodgingRoomTypeLinks import com.expediagroup.sdk.xap.models.LodgingRoomTypePrice import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param ratePlans Container for rate plan information. * @param price * @param links - */ +*/ data class LodgingRoomType( // Container for rate plan information. @JsonProperty("RatePlans") - @field:Valid val ratePlans: kotlin.collections.List? = null, @JsonProperty("Price") - @field:Valid val price: LodgingRoomTypePrice? = null, @JsonProperty("Links") - @field:Valid - val links: LodgingRoomTypeLinks? = null + val links: LodgingRoomTypeLinks? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -65,7 +46,7 @@ data class LodgingRoomType( class Builder( private var ratePlans: kotlin.collections.List? = null, private var price: LodgingRoomTypePrice? = null, - private var links: LodgingRoomTypeLinks? = null + private var links: LodgingRoomTypeLinks? = null, ) { fun ratePlans(ratePlans: kotlin.collections.List?) = apply { this.ratePlans = ratePlans } @@ -78,37 +59,17 @@ data class LodgingRoomType( LodgingRoomType( ratePlans = ratePlans, price = price, - links = links + links = links, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingRoomType) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( ratePlans = ratePlans, price = price, - links = links + links = links, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinks.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinks.kt index e1f92ed21..78f017bd3 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinks.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinks.kt @@ -13,45 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.LodgingLink import com.expediagroup.sdk.xap.models.LodgingRoomTypeLinksWebDetails import com.expediagroup.sdk.xap.models.LodgingRoomTypeLinksWebSearchResult import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for list of HATEOAS links to either Expedia website or additional Expedia APIs to complete booking of the selected offer. Which links are returned in this section are defined by the links parameter in the Search API query. Available links are: - WebDetails (link to web infosite) - WebSearchResult (link to web search result page) +* Container for list of HATEOAS links to either Expedia website or additional Expedia APIs to complete booking of the selected offer. Which links are returned in this section are defined by the links parameter in the Search API query. Available links are: - WebDetails (link to web infosite) - WebSearchResult (link to web search result page) * @param webSearchResult * @param webDetails - */ +*/ data class LodgingRoomTypeLinks( @JsonProperty("WebSearchResult") - @field:Valid val webSearchResult: LodgingRoomTypeLinksWebSearchResult? = null, @JsonProperty("WebDetails") - @field:Valid - val webDetails: LodgingRoomTypeLinksWebDetails? = null + val webDetails: LodgingRoomTypeLinksWebDetails? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -59,7 +41,7 @@ data class LodgingRoomTypeLinks( class Builder( private var webSearchResult: LodgingRoomTypeLinksWebSearchResult? = null, - private var webDetails: LodgingRoomTypeLinksWebDetails? = null + private var webDetails: LodgingRoomTypeLinksWebDetails? = null, ) { fun webSearchResult(webSearchResult: LodgingRoomTypeLinksWebSearchResult?) = apply { this.webSearchResult = webSearchResult } @@ -69,36 +51,16 @@ data class LodgingRoomTypeLinks( val instance = LodgingRoomTypeLinks( webSearchResult = webSearchResult, - webDetails = webDetails + webDetails = webDetails, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingRoomTypeLinks) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( webSearchResult = webSearchResult, - webDetails = webDetails + webDetails = webDetails, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebDetails.kt index 0c86902f4..8794eda6a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebDetails.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebDetails.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param accept The Accept request header for API queries only. Note: this value will only be returned if the link is an API query, as website URLs do not require an `Accept` header. * @param method Method of request. * @param href The URL of the destination web page or API query. - */ +*/ data class LodgingRoomTypeLinksWebDetails( // The Accept request header for API queries only. Note: this value will only be returned if the link is an API query, as website URLs do not require an `Accept` header. @JsonProperty("Accept") - @field:Valid val accept: kotlin.String? = null, // Method of request. @JsonProperty("Method") - @field:Valid val method: kotlin.String? = null, // The URL of the destination web page or API query. @JsonProperty("Href") - @field:Valid - val href: kotlin.String? = null + val href: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class LodgingRoomTypeLinksWebDetails( class Builder( private var accept: kotlin.String? = null, private var method: kotlin.String? = null, - private var href: kotlin.String? = null + private var href: kotlin.String? = null, ) { fun accept(accept: kotlin.String?) = apply { this.accept = accept } @@ -77,37 +58,17 @@ data class LodgingRoomTypeLinksWebDetails( LodgingRoomTypeLinksWebDetails( accept = accept, method = method, - href = href + href = href, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingRoomTypeLinksWebDetails) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( accept = accept, method = method, - href = href + href = href, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebSearchResult.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebSearchResult.kt index 95df79e67..1cbb75cd4 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebSearchResult.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebSearchResult.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param accept The Accept request header for API queries only. Note: this value will only be returned if the link is an API query, as website URLs do not require an `Accept` header. * @param method Method of request. * @param href The URL of the destination web page or API query. - */ +*/ data class LodgingRoomTypeLinksWebSearchResult( // The Accept request header for API queries only. Note: this value will only be returned if the link is an API query, as website URLs do not require an `Accept` header. @JsonProperty("Accept") - @field:Valid val accept: kotlin.String? = null, // Method of request. @JsonProperty("Method") - @field:Valid val method: kotlin.String? = null, // The URL of the destination web page or API query. @JsonProperty("Href") - @field:Valid - val href: kotlin.String? = null + val href: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class LodgingRoomTypeLinksWebSearchResult( class Builder( private var accept: kotlin.String? = null, private var method: kotlin.String? = null, - private var href: kotlin.String? = null + private var href: kotlin.String? = null, ) { fun accept(accept: kotlin.String?) = apply { this.accept = accept } @@ -77,37 +58,17 @@ data class LodgingRoomTypeLinksWebSearchResult( LodgingRoomTypeLinksWebSearchResult( accept = accept, method = method, - href = href + href = href, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingRoomTypeLinksWebSearchResult) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( accept = accept, method = method, - href = href + href = href, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePrice.kt index 091372351..8fe3f8eaa 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePrice.kt @@ -13,104 +13,81 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.LodgingRoomTypePriceAvgNightlyRate -import com.expediagroup.sdk.xap.models.LodgingRoomTypePriceAvgNightlyRateWithFees -import com.expediagroup.sdk.xap.models.LodgingRoomTypePriceBaseRate -import com.expediagroup.sdk.xap.models.LodgingRoomTypePricePropertyMandatoryFees -import com.expediagroup.sdk.xap.models.LodgingRoomTypePriceRefundableDamageDeposit -import com.expediagroup.sdk.xap.models.LodgingRoomTypePriceTaxesAndFees -import com.expediagroup.sdk.xap.models.LodgingRoomTypePriceTotalPrice -import com.expediagroup.sdk.xap.models.LodgingRoomTypePriceTotalPriceWithPropertyFees +import com.expediagroup.sdk.xap.models.LodgingMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for Price information. - * @param baseRate - * @param taxesAndFees - * @param totalPrice - * @param avgNightlyRate - * @param avgNightlyRateWithFees - * @param propertyMandatoryFees - * @param totalPriceWithPropertyFees - * @param refundableDamageDeposit - */ +* Container for Price information. + * @param baseRate The price of the rate plan for all occupants, excluding taxes and fees. + * @param taxesAndFees The total amount of taxes and fees of the rate plan for all occupants. + * @param totalPrice The total price of the rate plan, which is equal to the sum of `BaseRate` + `TaxesAndFees`. Property mandatory fees are not included in this value as these are paid at the property at checkout. + * @param avgNightlyRate The average nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. + * @param avgNightlyRateWithFees The average nightly rate per night per room of the room type, including all fees except those imposed by the government. + * @param propertyMandatoryFees The total mandatory fees which will be charged at the property for the rate plan. + * @param totalPriceWithPropertyFees The total price of the rate plan include property mandatory fees, which is equal to the sum of `BaseRate` + `TaxesAndFees` + `PropertyMandatoryFees`. **NOTE**: Since UK regulations require that `PropertyMandatoryFees` be included in this price, the quoted price will only be accurate for the day of quote. This is due to the fact that currency exchange fluctuations will change the exact amount of any `PropertyMandatoryFees` that are to be collected at the hotel during the guest's stay if the cost is converted into any other currency. **CMA Compliance Note (UK)**: Websites doing business in the UK should be displaying this value to be compliant with CMA requirements. + * @param refundableDamageDeposit The refundable damage deposit. +*/ data class LodgingRoomTypePrice( + // The price of the rate plan for all occupants, excluding taxes and fees. @JsonProperty("BaseRate") - @field:Valid - val baseRate: LodgingRoomTypePriceBaseRate? = null, + val baseRate: LodgingMoney? = null, + // The total amount of taxes and fees of the rate plan for all occupants. @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: LodgingRoomTypePriceTaxesAndFees? = null, + val taxesAndFees: LodgingMoney? = null, + // The total price of the rate plan, which is equal to the sum of `BaseRate` + `TaxesAndFees`. Property mandatory fees are not included in this value as these are paid at the property at checkout. @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: LodgingRoomTypePriceTotalPrice? = null, + val totalPrice: LodgingMoney? = null, + // The average nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. @JsonProperty("AvgNightlyRate") - @field:Valid - val avgNightlyRate: LodgingRoomTypePriceAvgNightlyRate? = null, + val avgNightlyRate: LodgingMoney? = null, + // The average nightly rate per night per room of the room type, including all fees except those imposed by the government. @JsonProperty("AvgNightlyRateWithFees") - @field:Valid - val avgNightlyRateWithFees: LodgingRoomTypePriceAvgNightlyRateWithFees? = null, + val avgNightlyRateWithFees: LodgingMoney? = null, + // The total mandatory fees which will be charged at the property for the rate plan. @JsonProperty("PropertyMandatoryFees") - @field:Valid - val propertyMandatoryFees: LodgingRoomTypePricePropertyMandatoryFees? = null, + val propertyMandatoryFees: LodgingMoney? = null, + // The total price of the rate plan include property mandatory fees, which is equal to the sum of `BaseRate` + `TaxesAndFees` + `PropertyMandatoryFees`. **NOTE**: Since UK regulations require that `PropertyMandatoryFees` be included in this price, the quoted price will only be accurate for the day of quote. This is due to the fact that currency exchange fluctuations will change the exact amount of any `PropertyMandatoryFees` that are to be collected at the hotel during the guest's stay if the cost is converted into any other currency. **CMA Compliance Note (UK)**: Websites doing business in the UK should be displaying this value to be compliant with CMA requirements. @JsonProperty("TotalPriceWithPropertyFees") - @field:Valid - val totalPriceWithPropertyFees: LodgingRoomTypePriceTotalPriceWithPropertyFees? = null, + val totalPriceWithPropertyFees: LodgingMoney? = null, + // The refundable damage deposit. @JsonProperty("RefundableDamageDeposit") - @field:Valid - val refundableDamageDeposit: LodgingRoomTypePriceRefundableDamageDeposit? = null + val refundableDamageDeposit: LodgingMoney? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() } class Builder( - private var baseRate: LodgingRoomTypePriceBaseRate? = null, - private var taxesAndFees: LodgingRoomTypePriceTaxesAndFees? = null, - private var totalPrice: LodgingRoomTypePriceTotalPrice? = null, - private var avgNightlyRate: LodgingRoomTypePriceAvgNightlyRate? = null, - private var avgNightlyRateWithFees: LodgingRoomTypePriceAvgNightlyRateWithFees? = null, - private var propertyMandatoryFees: LodgingRoomTypePricePropertyMandatoryFees? = null, - private var totalPriceWithPropertyFees: LodgingRoomTypePriceTotalPriceWithPropertyFees? = null, - private var refundableDamageDeposit: LodgingRoomTypePriceRefundableDamageDeposit? = null + private var baseRate: LodgingMoney? = null, + private var taxesAndFees: LodgingMoney? = null, + private var totalPrice: LodgingMoney? = null, + private var avgNightlyRate: LodgingMoney? = null, + private var avgNightlyRateWithFees: LodgingMoney? = null, + private var propertyMandatoryFees: LodgingMoney? = null, + private var totalPriceWithPropertyFees: LodgingMoney? = null, + private var refundableDamageDeposit: LodgingMoney? = null, ) { - fun baseRate(baseRate: LodgingRoomTypePriceBaseRate?) = apply { this.baseRate = baseRate } + fun baseRate(baseRate: LodgingMoney?) = apply { this.baseRate = baseRate } - fun taxesAndFees(taxesAndFees: LodgingRoomTypePriceTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } + fun taxesAndFees(taxesAndFees: LodgingMoney?) = apply { this.taxesAndFees = taxesAndFees } - fun totalPrice(totalPrice: LodgingRoomTypePriceTotalPrice?) = apply { this.totalPrice = totalPrice } + fun totalPrice(totalPrice: LodgingMoney?) = apply { this.totalPrice = totalPrice } - fun avgNightlyRate(avgNightlyRate: LodgingRoomTypePriceAvgNightlyRate?) = apply { this.avgNightlyRate = avgNightlyRate } + fun avgNightlyRate(avgNightlyRate: LodgingMoney?) = apply { this.avgNightlyRate = avgNightlyRate } - fun avgNightlyRateWithFees(avgNightlyRateWithFees: LodgingRoomTypePriceAvgNightlyRateWithFees?) = apply { this.avgNightlyRateWithFees = avgNightlyRateWithFees } + fun avgNightlyRateWithFees(avgNightlyRateWithFees: LodgingMoney?) = apply { this.avgNightlyRateWithFees = avgNightlyRateWithFees } - fun propertyMandatoryFees(propertyMandatoryFees: LodgingRoomTypePricePropertyMandatoryFees?) = apply { this.propertyMandatoryFees = propertyMandatoryFees } + fun propertyMandatoryFees(propertyMandatoryFees: LodgingMoney?) = apply { this.propertyMandatoryFees = propertyMandatoryFees } - fun totalPriceWithPropertyFees(totalPriceWithPropertyFees: LodgingRoomTypePriceTotalPriceWithPropertyFees?) = apply { this.totalPriceWithPropertyFees = totalPriceWithPropertyFees } + fun totalPriceWithPropertyFees(totalPriceWithPropertyFees: LodgingMoney?) = apply { this.totalPriceWithPropertyFees = totalPriceWithPropertyFees } - fun refundableDamageDeposit(refundableDamageDeposit: LodgingRoomTypePriceRefundableDamageDeposit?) = apply { this.refundableDamageDeposit = refundableDamageDeposit } + fun refundableDamageDeposit(refundableDamageDeposit: LodgingMoney?) = apply { this.refundableDamageDeposit = refundableDamageDeposit } fun build(): LodgingRoomTypePrice { val instance = @@ -122,31 +99,11 @@ data class LodgingRoomTypePrice( avgNightlyRateWithFees = avgNightlyRateWithFees, propertyMandatoryFees = propertyMandatoryFees, totalPriceWithPropertyFees = totalPriceWithPropertyFees, - refundableDamageDeposit = refundableDamageDeposit + refundableDamageDeposit = refundableDamageDeposit, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingRoomTypePrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -158,6 +115,6 @@ data class LodgingRoomTypePrice( avgNightlyRateWithFees = avgNightlyRateWithFees, propertyMandatoryFees = propertyMandatoryFees, totalPriceWithPropertyFees = totalPriceWithPropertyFees, - refundableDamageDeposit = refundableDamageDeposit + refundableDamageDeposit = refundableDamageDeposit, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceAvgNightlyRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceAvgNightlyRate.kt deleted file mode 100644 index 30334c5f6..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceAvgNightlyRate.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The average nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - */ -data class LodgingRoomTypePriceAvgNightlyRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun build(): LodgingRoomTypePriceAvgNightlyRate { - val instance = - LodgingRoomTypePriceAvgNightlyRate( - `value` = `value`, - currency = currency - ) - - validate(instance) - - return instance - } - - private fun validate(instance: LodgingRoomTypePriceAvgNightlyRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceAvgNightlyRateWithFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceAvgNightlyRateWithFees.kt deleted file mode 100644 index 0300b78dc..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceAvgNightlyRateWithFees.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The average nightly rate per night per room of the room type, including all fees except those imposed by the government. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - */ -data class LodgingRoomTypePriceAvgNightlyRateWithFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun build(): LodgingRoomTypePriceAvgNightlyRateWithFees { - val instance = - LodgingRoomTypePriceAvgNightlyRateWithFees( - `value` = `value`, - currency = currency - ) - - validate(instance) - - return instance - } - - private fun validate(instance: LodgingRoomTypePriceAvgNightlyRateWithFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceBaseRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceBaseRate.kt deleted file mode 100644 index f89218067..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceBaseRate.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The price of the rate plan for all occupants, excluding taxes and fees. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - */ -data class LodgingRoomTypePriceBaseRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun build(): LodgingRoomTypePriceBaseRate { - val instance = - LodgingRoomTypePriceBaseRate( - `value` = `value`, - currency = currency - ) - - validate(instance) - - return instance - } - - private fun validate(instance: LodgingRoomTypePriceBaseRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePricePropertyMandatoryFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePricePropertyMandatoryFees.kt deleted file mode 100644 index df2af69c1..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePricePropertyMandatoryFees.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total mandatory fees which will be charged at the property for the rate plan. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - */ -data class LodgingRoomTypePricePropertyMandatoryFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun build(): LodgingRoomTypePricePropertyMandatoryFees { - val instance = - LodgingRoomTypePricePropertyMandatoryFees( - `value` = `value`, - currency = currency - ) - - validate(instance) - - return instance - } - - private fun validate(instance: LodgingRoomTypePricePropertyMandatoryFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceRefundableDamageDeposit.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceRefundableDamageDeposit.kt deleted file mode 100644 index 807018ac4..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceRefundableDamageDeposit.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The refundable damage deposit. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - */ -data class LodgingRoomTypePriceRefundableDamageDeposit( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun build(): LodgingRoomTypePriceRefundableDamageDeposit { - val instance = - LodgingRoomTypePriceRefundableDamageDeposit( - `value` = `value`, - currency = currency - ) - - validate(instance) - - return instance - } - - private fun validate(instance: LodgingRoomTypePriceRefundableDamageDeposit) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTaxesAndFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTaxesAndFees.kt deleted file mode 100644 index 33e0db2f6..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTaxesAndFees.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total amount of taxes and fees of the rate plan for all occupants. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - */ -data class LodgingRoomTypePriceTaxesAndFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun build(): LodgingRoomTypePriceTaxesAndFees { - val instance = - LodgingRoomTypePriceTaxesAndFees( - `value` = `value`, - currency = currency - ) - - validate(instance) - - return instance - } - - private fun validate(instance: LodgingRoomTypePriceTaxesAndFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTotalPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTotalPrice.kt deleted file mode 100644 index 63812c3e4..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTotalPrice.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total price of the rate plan, which is equal to the sum of `BaseRate` + `TaxesAndFees`. Property mandatory fees are not included in this value as these are paid at the property at checkout. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - */ -data class LodgingRoomTypePriceTotalPrice( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun build(): LodgingRoomTypePriceTotalPrice { - val instance = - LodgingRoomTypePriceTotalPrice( - `value` = `value`, - currency = currency - ) - - validate(instance) - - return instance - } - - private fun validate(instance: LodgingRoomTypePriceTotalPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTotalPriceWithPropertyFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTotalPriceWithPropertyFees.kt deleted file mode 100644 index 456c5aefb..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTotalPriceWithPropertyFees.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total price of the rate plan include property mandatory fees, which is equal to the sum of `BaseRate` + `TaxesAndFees` + `PropertyMandatoryFees`. **NOTE**: Since UK regulations require that `PropertyMandatoryFees` be included in this price, the quoted price will only be accurate for the day of quote. This is due to the fact that currency exchange fluctuations will change the exact amount of any `PropertyMandatoryFees` that are to be collected at the hotel during the guest's stay if the cost is converted into any other currency. **CMA Compliance Note (UK)**: Websites doing business in the UK should be displaying this value to be compliant with CMA requirements. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - */ -data class LodgingRoomTypePriceTotalPriceWithPropertyFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun build(): LodgingRoomTypePriceTotalPriceWithPropertyFees { - val instance = - LodgingRoomTypePriceTotalPriceWithPropertyFees( - `value` = `value`, - currency = currency - ) - - validate(instance) - - return instance - } - - private fun validate(instance: LodgingRoomTypePriceTotalPriceWithPropertyFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingStayDates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingStayDates.kt index 87bea51dd..2546348cc 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingStayDates.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingStayDates.kt @@ -13,41 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Validation /** - * Container for requested dates of stay. +* Container for requested dates of stay. * @param checkInDate The initial day of the property stay in an ISO 8601 Date format [YYYY-MM-DD]. * @param checkOutDate The final day of the property stay in an ISO 8601 Date format [YYYY-MM-DD]. - */ +*/ data class LodgingStayDates( // The initial day of the property stay in an ISO 8601 Date format [YYYY-MM-DD]. @JsonProperty("CheckInDate") val checkInDate: java.time.LocalDate? = null, // The final day of the property stay in an ISO 8601 Date format [YYYY-MM-DD]. @JsonProperty("CheckOutDate") - val checkOutDate: java.time.LocalDate? = null + val checkOutDate: java.time.LocalDate? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -55,7 +40,7 @@ data class LodgingStayDates( class Builder( private var checkInDate: java.time.LocalDate? = null, - private var checkOutDate: java.time.LocalDate? = null + private var checkOutDate: java.time.LocalDate? = null, ) { fun checkInDate(checkInDate: java.time.LocalDate?) = apply { this.checkInDate = checkInDate } @@ -65,36 +50,16 @@ data class LodgingStayDates( val instance = LodgingStayDates( checkInDate = checkInDate, - checkOutDate = checkOutDate + checkOutDate = checkOutDate, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingStayDates) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( checkInDate = checkInDate, - checkOutDate = checkOutDate + checkOutDate = checkOutDate, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingWarning.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingWarning.kt index 9a7b84983..439606e28 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingWarning.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingWarning.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param code The code of a warning. * @param description A description of what caused the issues. - */ +*/ data class LodgingWarning( // The code of a warning. @JsonProperty("Code") - @field:Valid val code: kotlin.String? = null, // A description of what caused the issues. @JsonProperty("Description") - @field:Valid - val description: kotlin.String? = null + val description: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class LodgingWarning( class Builder( private var code: kotlin.String? = null, - private var description: kotlin.String? = null + private var description: kotlin.String? = null, ) { fun code(code: kotlin.String?) = apply { this.code = code } @@ -68,36 +50,16 @@ data class LodgingWarning( val instance = LodgingWarning( code = code, - description = description + description = description, ) - validate(instance) - return instance } - - private fun validate(instance: LodgingWarning) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( code = code, - description = description + description = description, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetail.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetail.kt index b33bcc200..272200072 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetail.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetail.kt @@ -13,43 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.MandatoryFeesDetailAmount import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * The breakdown for the taxes and fees that must be paid at the property. +* The breakdown for the taxes and fees that must be paid at the property. * @param type Type of mandatory fee. * @param amount - */ +*/ data class MandatoryFeesDetail( // Type of mandatory fee. @JsonProperty("Type") val type: MandatoryFeesDetail.Type? = null, @JsonProperty("Amount") - @field:Valid - val amount: MandatoryFeesDetailAmount? = null + val amount: MandatoryFeesDetailAmount? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -57,7 +40,7 @@ data class MandatoryFeesDetail( class Builder( private var type: MandatoryFeesDetail.Type? = null, - private var amount: MandatoryFeesDetailAmount? = null + private var amount: MandatoryFeesDetailAmount? = null, ) { fun type(type: MandatoryFeesDetail.Type?) = apply { this.type = type } @@ -67,44 +50,26 @@ data class MandatoryFeesDetail( val instance = MandatoryFeesDetail( type = type, - amount = amount + amount = amount, ) - validate(instance) - return instance } - - private fun validate(instance: MandatoryFeesDetail) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( type = type, - amount = amount + amount = amount, ) /** * Type of mandatory fee. * Values: CITY_LOCAL_TAX_AMT,CITY_LOCAL_TAX_PCNT,CLEANING_FEE_AMT,CLEANING_FEE_PCNT,CLUB_CARD_ADULT,CLUB_CARD_CHILD,DESTINATION_FEE_AMT,DESTINATION_FEE_PCNT,GALA_DINNER_ADULT,GALA_DINNER_CHILD,GALA_DINNER_CHINESE_NY_ADULT,GALA_DINNER_CHINESE_NY_CHILD,GALA_DINNER_NY_DAY_ADULT,GALA_DINNER_NY_DAY_CHILD,GALA_DINNER_NY_EVE_ADULT,GALA_DINNER_NY_EVE_CHILD,GALA_DINNER_VALENTINES_DAY_ADULT,GALA_DINNER_VALENTINES_DAY_CHILD,GALA_DINNER_XMAS_DAY_ADULT,GALA_DINNER_XMAS_DAY_CHILD,GALA_DINNER_XMAS_EVE_ADULT,GALA_DINNER_XMAS_EVE_CHILD,RESORT_FEE_AMT,RESORT_FEE_PCNT,SANITATION_FEE,SEASONAL_HEATING_FEE,TOURISM_FEE_AMT,TOURISM_FEE_PCNT,TOWEL_SHEETS_FEE_AMT,TRANSFER_FEE_AMT_ADULT,TRANSFER_FEE_AMT_CHILD,UTILITY_SURCHARGE */ - enum class Type(val value: kotlin.String) { + enum class Type( + val value: kotlin.String, + ) { @JsonProperty("City_LocalTax_Amt") CITY_LOCAL_TAX_AMT("City_LocalTax_Amt"), @@ -199,6 +164,6 @@ data class MandatoryFeesDetail( TRANSFER_FEE_AMT_CHILD("TransferFee_Amt_Child"), @JsonProperty("UtilitySurcharge") - UTILITY_SURCHARGE("UtilitySurcharge") + UTILITY_SURCHARGE("UtilitySurcharge"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetailAmount.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetailAmount.kt index 4263b0be2..5c5401c08 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetailAmount.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetailAmount.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class MandatoryFeesDetailAmount( // The value of the element being defined. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:Valid val currency: kotlin.String? = null, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null + val localCurrencyPrice: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class MandatoryFeesDetailAmount( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null + private var localCurrencyPrice: Money? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -77,37 +58,17 @@ data class MandatoryFeesDetailAmount( MandatoryFeesDetailAmount( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: MandatoryFeesDetailAmount) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Media.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Media.kt index f04faf656..92073f54d 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Media.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Media.kt @@ -13,53 +13,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for hotel images +* Container for hotel images * @param type Supported type of media. 1=Image. Only 1 is supported now. * @param title Image title * @param propertySize Image size. You can find a link to the complete list of Supported Images Sizes in [Lodging Image Captions, IDs, and Sizes](https://developers.expediagroup.com/xap/products/xap/lodging/references/image-captions-ids-and-sizes). * @param url Image URL - */ +*/ data class Media( // Supported type of media. 1=Image. Only 1 is supported now. @JsonProperty("Type") val type: Media.Type? = null, // Image title @JsonProperty("Title") - @field:Valid val title: kotlin.String? = null, // Image size. You can find a link to the complete list of Supported Images Sizes in [Lodging Image Captions, IDs, and Sizes](https://developers.expediagroup.com/xap/products/xap/lodging/references/image-captions-ids-and-sizes). @JsonProperty("Size") - @field:Valid val propertySize: kotlin.String? = null, // Image URL @JsonProperty("Url") - @field:Valid - val url: kotlin.String? = null + val url: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -69,7 +50,7 @@ data class Media( private var type: Media.Type? = null, private var title: kotlin.String? = null, private var propertySize: kotlin.String? = null, - private var url: kotlin.String? = null + private var url: kotlin.String? = null, ) { fun type(type: Media.Type?) = apply { this.type = type } @@ -85,31 +66,11 @@ data class Media( type = type, title = title, propertySize = propertySize, - url = url + url = url, ) - validate(instance) - return instance } - - private fun validate(instance: Media) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -117,15 +78,17 @@ data class Media( type = type, title = title, propertySize = propertySize, - url = url + url = url, ) /** * Supported type of media. 1=Image. Only 1 is supported now. * Values: _1 */ - enum class Type(val value: kotlin.String) { + enum class Type( + val value: kotlin.String, + ) { @JsonProperty("1") - _1("1") + _1("1"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Mileage.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Mileage.kt index dcd643dec..5625b0429 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Mileage.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Mileage.kt @@ -13,52 +13,33 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsDistance import com.expediagroup.sdk.xap.models.ExtraCostPerDistance import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * A list of charges to be levied based on the mileage driven. +* A list of charges to be levied based on the mileage driven. * @param freeDistance * @param freeDistanceRatePeriod Rate period for free distance. * @param extraCostPerDistance - */ +*/ data class Mileage( @JsonProperty("FreeDistance") - @field:NotNull - @field:Valid val freeDistance: CarsDistance, // Rate period for free distance. @JsonProperty("FreeDistanceRatePeriod") - @field:NotNull - @field:Valid val freeDistanceRatePeriod: kotlin.String, @JsonProperty("ExtraCostPerDistance") - @field:Valid - val extraCostPerDistance: ExtraCostPerDistance? = null + val extraCostPerDistance: ExtraCostPerDistance? = null, ) { + init { + require(freeDistance != null) { "freeDistance must not be null" } + + require(freeDistanceRatePeriod != null) { "freeDistanceRatePeriod must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -67,7 +48,7 @@ data class Mileage( class Builder( private var freeDistance: CarsDistance? = null, private var freeDistanceRatePeriod: kotlin.String? = null, - private var extraCostPerDistance: ExtraCostPerDistance? = null + private var extraCostPerDistance: ExtraCostPerDistance? = null, ) { fun freeDistance(freeDistance: CarsDistance) = apply { this.freeDistance = freeDistance } @@ -80,37 +61,17 @@ data class Mileage( Mileage( freeDistance = freeDistance!!, freeDistanceRatePeriod = freeDistanceRatePeriod!!, - extraCostPerDistance = extraCostPerDistance + extraCostPerDistance = extraCostPerDistance, ) - validate(instance) - return instance } - - private fun validate(instance: Mileage) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( freeDistance = freeDistance!!, freeDistanceRatePeriod = freeDistanceRatePeriod!!, - extraCostPerDistance = extraCostPerDistance + extraCostPerDistance = extraCostPerDistance, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Money.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Money.kt index ca5a04bd5..63ffdf3ee 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Money.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Money.kt @@ -13,48 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Pricing information of the stat date +* Pricing information of the stat date * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class Money( // The value of the element being defined. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:Valid val currency: kotlin.String? = null, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null + val localCurrencyPrice: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -63,7 +44,7 @@ data class Money( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null + private var localCurrencyPrice: Money? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -76,37 +57,17 @@ data class Money( Money( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: Money) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Neighborhood.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Neighborhood.kt index 38f7ad11c..8ff27eca1 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Neighborhood.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Neighborhood.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Geography entities which are typically contained within a city. This includes the categories neighborhood and point of interest. Low level regions are not a formally defined concept in the geography model. +* Geography entities which are typically contained within a city. This includes the categories neighborhood and point of interest. Low level regions are not a formally defined concept in the geography model. * @param id Neighborhood id. * @param name Neighborhood name. - */ +*/ data class Neighborhood( // Neighborhood id. @JsonProperty("Id") - @field:Valid val id: kotlin.String? = null, // Neighborhood name. @JsonProperty("Name") - @field:Valid - val name: kotlin.String? = null + val name: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class Neighborhood( class Builder( private var id: kotlin.String? = null, - private var name: kotlin.String? = null + private var name: kotlin.String? = null, ) { fun id(id: kotlin.String?) = apply { this.id = id } @@ -68,36 +50,16 @@ data class Neighborhood( val instance = Neighborhood( id = id, - name = name + name = name, ) - validate(instance) - return instance } - - private fun validate(instance: Neighborhood) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id, - name = name + name = name, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NightlyRates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NightlyRates.kt index 3d9cdfe50..199b02791 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NightlyRates.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NightlyRates.kt @@ -13,42 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param stayDate * @param baseRate - */ +*/ data class NightlyRates( @JsonProperty("StayDate") val stayDate: java.time.LocalDate? = null, @JsonProperty("BaseRate") - @field:Valid - val baseRate: Money? = null + val baseRate: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -56,7 +39,7 @@ data class NightlyRates( class Builder( private var stayDate: java.time.LocalDate? = null, - private var baseRate: Money? = null + private var baseRate: Money? = null, ) { fun stayDate(stayDate: java.time.LocalDate?) = apply { this.stayDate = stayDate } @@ -66,36 +49,16 @@ data class NightlyRates( val instance = NightlyRates( stayDate = stayDate, - baseRate = baseRate + baseRate = baseRate, ) - validate(instance) - return instance } - - private fun validate(instance: NightlyRates) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( stayDate = stayDate, - baseRate = baseRate + baseRate = baseRate, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonCancellableDateTimeRange.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonCancellableDateTimeRange.kt index 40acb6691..605c5401a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonCancellableDateTimeRange.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonCancellableDateTimeRange.kt @@ -13,41 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Validation /** - * Container for non-cancellable date and time range element +* Container for non-cancellable date and time range element * @param startDateTime The time of this non-cancellable window starts * @param endDateTime The time of this non-cancellable window ends - */ +*/ data class NonCancellableDateTimeRange( // The time of this non-cancellable window starts @JsonProperty("StartDateTime") val startDateTime: java.time.LocalDateTime, // The time of this non-cancellable window ends @JsonProperty("EndDateTime") - val endDateTime: java.time.LocalDateTime + val endDateTime: java.time.LocalDateTime, ) { + init { + require(startDateTime != null) { "startDateTime must not be null" } + + require(endDateTime != null) { "endDateTime must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -55,7 +43,7 @@ data class NonCancellableDateTimeRange( class Builder( private var startDateTime: java.time.LocalDateTime? = null, - private var endDateTime: java.time.LocalDateTime? = null + private var endDateTime: java.time.LocalDateTime? = null, ) { fun startDateTime(startDateTime: java.time.LocalDateTime) = apply { this.startDateTime = startDateTime } @@ -65,36 +53,16 @@ data class NonCancellableDateTimeRange( val instance = NonCancellableDateTimeRange( startDateTime = startDateTime!!, - endDateTime = endDateTime!! + endDateTime = endDateTime!!, ) - validate(instance) - return instance } - - private fun validate(instance: NonCancellableDateTimeRange) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( startDateTime = startDateTime!!, - endDateTime = endDateTime!! + endDateTime = endDateTime!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonRefundableDateRange.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonRefundableDateRange.kt index 80f7c2bd6..5f6bb2812 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonRefundableDateRange.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonRefundableDateRange.kt @@ -13,41 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Validation /** - * +* * @param startDate Start date of a non-refundable date range. * @param endDate End date of a non-refundable date range. - */ +*/ data class NonRefundableDateRange( // Start date of a non-refundable date range. @JsonProperty("StartDate") val startDate: java.time.LocalDate? = null, // End date of a non-refundable date range. @JsonProperty("EndDate") - val endDate: java.time.LocalDate? = null + val endDate: java.time.LocalDate? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -55,7 +40,7 @@ data class NonRefundableDateRange( class Builder( private var startDate: java.time.LocalDate? = null, - private var endDate: java.time.LocalDate? = null + private var endDate: java.time.LocalDate? = null, ) { fun startDate(startDate: java.time.LocalDate?) = apply { this.startDate = startDate } @@ -65,36 +50,16 @@ data class NonRefundableDateRange( val instance = NonRefundableDateRange( startDate = startDate, - endDate = endDate + endDate = endDate, ) - validate(instance) - return instance } - - private fun validate(instance: NonRefundableDateRange) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( startDate = startDate, - endDate = endDate + endDate = endDate, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Occupant.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Occupant.kt index 37b9ba019..0e89710c7 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Occupant.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Occupant.kt @@ -13,43 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for the list of room occupants. +* Container for the list of room occupants. * @param adults The number of adults in a room. * @param childAges The ages of children in a room. - */ +*/ data class Occupant( // The number of adults in a room. @JsonProperty("Adults") val adults: kotlin.Int? = null, // The ages of children in a room. @JsonProperty("ChildAges") - @field:Valid - val childAges: kotlin.collections.List? = null + val childAges: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -57,7 +40,7 @@ data class Occupant( class Builder( private var adults: kotlin.Int? = null, - private var childAges: kotlin.collections.List? = null + private var childAges: kotlin.collections.List? = null, ) { fun adults(adults: kotlin.Int?) = apply { this.adults = adults } @@ -67,36 +50,16 @@ data class Occupant( val instance = Occupant( adults = adults, - childAges = childAges + childAges = childAges, ) - validate(instance) - return instance } - - private fun validate(instance: Occupant) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( adults = adults, - childAges = childAges + childAges = childAges, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt index eb1e00553..ff749c878 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt @@ -13,35 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesLink import com.expediagroup.sdk.xap.models.ActivitiesPrice import com.expediagroup.sdk.xap.models.AvailableTimeSlot import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Offers for the activity. +* Offers for the activity. * @param id The numerical identifier for the offer. * @param title A descriptive title for this offer. * @param duration The anticipated time duration for the activity, e xpressed using Java JDK duration format. @@ -49,42 +29,44 @@ import javax.validation.constraints.NotNull * @param offerPrice * @param description Description of this offer. * @param links Container of HATEOAS URL's - */ +*/ data class Offer( // The numerical identifier for the offer. @JsonProperty("Id") val id: kotlin.Int, // A descriptive title for this offer. @JsonProperty("Title") - @field:NotNull - @field:Valid val title: kotlin.String, // The anticipated time duration for the activity, e xpressed using Java JDK duration format. @JsonProperty("Duration") - @field:NotNull - @field:Valid val duration: kotlin.String, // The list of available Time Slots for the activity. @JsonProperty("AvailableTimeSlots") - @field:NotNull - @field:Valid val availableTimeSlots: kotlin.collections .List< - AvailableTimeSlot + AvailableTimeSlot, >, @JsonProperty("OfferPrice") - @field:NotNull - @field:Valid val offerPrice: ActivitiesPrice, // Description of this offer. @JsonProperty("Description") - @field:Valid val description: kotlin.String? = null, // Container of HATEOAS URL's @JsonProperty("Links") - @field:Valid - val links: kotlin.collections.Map? = null + val links: kotlin.collections.Map? = null, ) { + init { + require(id != null) { "id must not be null" } + + require(title != null) { "title must not be null" } + + require(duration != null) { "duration must not be null" } + + require(availableTimeSlots != null) { "availableTimeSlots must not be null" } + + require(offerPrice != null) { "offerPrice must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -97,7 +79,7 @@ data class Offer( private var availableTimeSlots: kotlin.collections.List? = null, private var offerPrice: ActivitiesPrice? = null, private var description: kotlin.String? = null, - private var links: kotlin.collections.Map? = null + private var links: kotlin.collections.Map? = null, ) { fun id(id: kotlin.Int) = apply { this.id = id } @@ -122,31 +104,11 @@ data class Offer( availableTimeSlots = availableTimeSlots!!, offerPrice = offerPrice!!, description = description, - links = links + links = links, ) - validate(instance) - return instance } - - private fun validate(instance: Offer) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -157,6 +119,6 @@ data class Offer( availableTimeSlots = availableTimeSlots!!, offerPrice = offerPrice!!, description = description, - links = links + links = links, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedule.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedule.kt index 025044cdd..dc9f523c9 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedule.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedule.kt @@ -13,43 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.PaymentSchedulePrice import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Contains information on the payment schedule. +* Contains information on the payment schedule. * @param due Date/Time stamp when this installment/deposit should be paid by. * @param price - */ +*/ data class PaymentSchedule( // Date/Time stamp when this installment/deposit should be paid by. @JsonProperty("Due") val due: java.time.LocalDate? = null, @JsonProperty("Price") - @field:Valid - val price: PaymentSchedulePrice? = null + val price: PaymentSchedulePrice? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -57,7 +40,7 @@ data class PaymentSchedule( class Builder( private var due: java.time.LocalDate? = null, - private var price: PaymentSchedulePrice? = null + private var price: PaymentSchedulePrice? = null, ) { fun due(due: java.time.LocalDate?) = apply { this.due = due } @@ -67,36 +50,16 @@ data class PaymentSchedule( val instance = PaymentSchedule( due = due, - price = price + price = price, ) - validate(instance) - return instance } - - private fun validate(instance: PaymentSchedule) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( due = due, - price = price + price = price, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedulePrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedulePrice.kt index 84106a19e..6f591291b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedulePrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedulePrice.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class PaymentSchedulePrice( // The value of the element being defined. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:Valid val currency: kotlin.String? = null, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null + val localCurrencyPrice: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class PaymentSchedulePrice( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null + private var localCurrencyPrice: Money? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -77,37 +58,17 @@ data class PaymentSchedulePrice( PaymentSchedulePrice( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: PaymentSchedulePrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyRule.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyRule.kt index 19c7a22ce..8323846fb 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyRule.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyRule.kt @@ -13,49 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.PenaltyType import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for penalty rules +* Container for penalty rules * @param penalty * @param startDateTime The time when this penalty window starts * @param endDateTime The time when this penalty window ends - */ +*/ data class PenaltyRule( @JsonProperty("Penalty") - @field:NotNull - @field:Valid val penalty: PenaltyType, // The time when this penalty window starts @JsonProperty("StartDateTime") val startDateTime: java.time.LocalDateTime, // The time when this penalty window ends @JsonProperty("EndDateTime") - val endDateTime: java.time.LocalDateTime + val endDateTime: java.time.LocalDateTime, ) { + init { + require(penalty != null) { "penalty must not be null" } + + require(startDateTime != null) { "startDateTime must not be null" } + + require(endDateTime != null) { "endDateTime must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +50,7 @@ data class PenaltyRule( class Builder( private var penalty: PenaltyType? = null, private var startDateTime: java.time.LocalDateTime? = null, - private var endDateTime: java.time.LocalDateTime? = null + private var endDateTime: java.time.LocalDateTime? = null, ) { fun penalty(penalty: PenaltyType) = apply { this.penalty = penalty } @@ -77,37 +63,17 @@ data class PenaltyRule( PenaltyRule( penalty = penalty!!, startDateTime = startDateTime!!, - endDateTime = endDateTime!! + endDateTime = endDateTime!!, ) - validate(instance) - return instance } - - private fun validate(instance: PenaltyRule) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( penalty = penalty!!, startDateTime = startDateTime!!, - endDateTime = endDateTime!! + endDateTime = endDateTime!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyType.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyType.kt index 5896c61fc..e5736c58c 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyType.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyType.kt @@ -13,53 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for no show penalty element +* Container for no show penalty element * @param type What the penalty amount is based on. should be one of the following values:AMOUNT : it means the user is charged a fixed amount specified in the value node. Say 50$ for example.PERCENT : it means the user is charged a percentage of the base rate/total rate.PERDAY : it means the user is charged Per Day Price. For eg.., if the value is 2, it means the penalty amount will the Per day price of 2 days. * @param `value` Value to indicate how many/much of the type listed above is going to be charged as a penalty. * @param currency The currency of the amount, only valid when Type=AMOUNT - */ +*/ data class PenaltyType( // What the penalty amount is based on. should be one of the following values:AMOUNT : it means the user is charged a fixed amount specified in the value node. Say 50$ for example.PERCENT : it means the user is charged a percentage of the base rate/total rate.PERDAY : it means the user is charged Per Day Price. For eg.., if the value is 2, it means the penalty amount will the Per day price of 2 days. @JsonProperty("Type") - @field:NotNull - @field:Valid val type: kotlin.String, // Value to indicate how many/much of the type listed above is going to be charged as a penalty. @JsonProperty("Value") - @field:NotNull - @field:Valid val `value`: kotlin.String, // The currency of the amount, only valid when Type=AMOUNT @JsonProperty("Currency") - @field:NotNull - @field:Valid - val currency: kotlin.String + val currency: kotlin.String, ) { + init { + require(type != null) { "type must not be null" } + + require(`value` != null) { "`value` must not be null" } + + require(currency != null) { "currency must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -68,7 +50,7 @@ data class PenaltyType( class Builder( private var type: kotlin.String? = null, private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null + private var currency: kotlin.String? = null, ) { fun type(type: kotlin.String) = apply { this.type = type } @@ -81,37 +63,17 @@ data class PenaltyType( PenaltyType( type = type!!, `value` = `value`!!, - currency = currency!! + currency = currency!!, ) - validate(instance) - return instance } - - private fun validate(instance: PenaltyType) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( type = type!!, `value` = `value`!!, - currency = currency!! + currency = currency!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Phone.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Phone.kt index 34966455d..5001877b0 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Phone.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Phone.kt @@ -13,54 +13,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param countryCode The designated country calling code. * @param areaCode The phone's area code. * @param number The phone's local number. * @param extensionNumber Optional extension number, if required to reach the hotel. - */ +*/ data class Phone( // The designated country calling code. @JsonProperty("CountryCode") - @field:Valid val countryCode: kotlin.String? = null, // The phone's area code. @JsonProperty("AreaCode") - @field:Valid val areaCode: kotlin.String? = null, // The phone's local number. @JsonProperty("Number") - @field:Valid val number: kotlin.String? = null, // Optional extension number, if required to reach the hotel. @JsonProperty("ExtensionNumber") - @field:Valid - val extensionNumber: kotlin.String? = null + val extensionNumber: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -70,7 +50,7 @@ data class Phone( private var countryCode: kotlin.String? = null, private var areaCode: kotlin.String? = null, private var number: kotlin.String? = null, - private var extensionNumber: kotlin.String? = null + private var extensionNumber: kotlin.String? = null, ) { fun countryCode(countryCode: kotlin.String?) = apply { this.countryCode = countryCode } @@ -86,31 +66,11 @@ data class Phone( countryCode = countryCode, areaCode = areaCode, number = number, - extensionNumber = extensionNumber + extensionNumber = extensionNumber, ) - validate(instance) - return instance } - - private fun validate(instance: Phone) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -118,6 +78,6 @@ data class Phone( countryCode = countryCode, areaCode = areaCode, number = number, - extensionNumber = extensionNumber + extensionNumber = extensionNumber, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PresignedUrlResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PresignedUrlResponse.kt index 7b09f4df8..258c51c8e 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PresignedUrlResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PresignedUrlResponse.kt @@ -13,58 +13,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Fault import com.expediagroup.sdk.xap.models.FileInfo import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param transactionId Unique identifier for each API response. * @param error * @param warning * @param bestMatchedFile * @param otherFileOptions Container for file Pre-signed download URL and informations. - */ +*/ data class PresignedUrlResponse( // Unique identifier for each API response. @JsonProperty("transactionId") - @field:Valid val transactionId: kotlin.String? = null, @JsonProperty("error") - @field:Valid val error: Fault? = null, @JsonProperty("warning") - @field:Valid val warning: Fault? = null, @JsonProperty("bestMatchedFile") - @field:Valid val bestMatchedFile: FileInfo? = null, // Container for file Pre-signed download URL and informations. @JsonProperty("otherFileOptions") - @field:Valid - val otherFileOptions: kotlin.collections.List? = null + val otherFileOptions: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -75,7 +54,7 @@ data class PresignedUrlResponse( private var error: Fault? = null, private var warning: Fault? = null, private var bestMatchedFile: FileInfo? = null, - private var otherFileOptions: kotlin.collections.List? = null + private var otherFileOptions: kotlin.collections.List? = null, ) { fun transactionId(transactionId: kotlin.String?) = apply { this.transactionId = transactionId } @@ -94,31 +73,11 @@ data class PresignedUrlResponse( error = error, warning = warning, bestMatchedFile = bestMatchedFile, - otherFileOptions = otherFileOptions + otherFileOptions = otherFileOptions, ) - validate(instance) - return instance } - - private fun validate(instance: PresignedUrlResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -127,6 +86,6 @@ data class PresignedUrlResponse( error = error, warning = warning, bestMatchedFile = bestMatchedFile, - otherFileOptions = otherFileOptions + otherFileOptions = otherFileOptions, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Price.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Price.kt index a756e2b3a..8fc5ca7eb 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Price.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Price.kt @@ -13,57 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Pricing information for the rental. +* Pricing information for the rental. * @param totalPrice * @param ratePeriodUnitPrice * @param basePrice * @param taxesAndFees * @param totalPriceDueAtBooking - */ +*/ data class Price( @JsonProperty("TotalPrice") - @field:NotNull - @field:Valid val totalPrice: CarsMoney, @JsonProperty("RatePeriodUnitPrice") - @field:Valid val ratePeriodUnitPrice: CarsMoney? = null, @JsonProperty("BasePrice") - @field:Valid val basePrice: CarsMoney? = null, @JsonProperty("TaxesAndFees") - @field:Valid val taxesAndFees: CarsMoney? = null, @JsonProperty("TotalPriceDueAtBooking") - @field:Valid - val totalPriceDueAtBooking: CarsMoney? = null + val totalPriceDueAtBooking: CarsMoney? = null, ) { + init { + require(totalPrice != null) { "totalPrice must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -74,7 +52,7 @@ data class Price( private var ratePeriodUnitPrice: CarsMoney? = null, private var basePrice: CarsMoney? = null, private var taxesAndFees: CarsMoney? = null, - private var totalPriceDueAtBooking: CarsMoney? = null + private var totalPriceDueAtBooking: CarsMoney? = null, ) { fun totalPrice(totalPrice: CarsMoney) = apply { this.totalPrice = totalPrice } @@ -93,31 +71,11 @@ data class Price( ratePeriodUnitPrice = ratePeriodUnitPrice, basePrice = basePrice, taxesAndFees = taxesAndFees, - totalPriceDueAtBooking = totalPriceDueAtBooking + totalPriceDueAtBooking = totalPriceDueAtBooking, ) - validate(instance) - return instance } - - private fun validate(instance: Price) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -126,6 +84,6 @@ data class Price( ratePeriodUnitPrice = ratePeriodUnitPrice, basePrice = basePrice, taxesAndFees = taxesAndFees, - totalPriceDueAtBooking = totalPriceDueAtBooking + totalPriceDueAtBooking = totalPriceDueAtBooking, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Promotion.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Promotion.kt index 0939d422c..367851e3c 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Promotion.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Promotion.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.PromotionAmount import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param description The description of the promotion. * @param amount - */ +*/ data class Promotion( // The description of the promotion. @JsonProperty("Description") - @field:Valid val description: kotlin.String? = null, @JsonProperty("Amount") - @field:Valid - val amount: PromotionAmount? = null + val amount: PromotionAmount? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class Promotion( class Builder( private var description: kotlin.String? = null, - private var amount: PromotionAmount? = null + private var amount: PromotionAmount? = null, ) { fun description(description: kotlin.String?) = apply { this.description = description } @@ -68,36 +50,16 @@ data class Promotion( val instance = Promotion( description = description, - amount = amount + amount = amount, ) - validate(instance) - return instance } - - private fun validate(instance: Promotion) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( description = description, - amount = amount + amount = amount, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PromotionAmount.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PromotionAmount.kt index 58152aba5..a05e7bcd8 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PromotionAmount.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PromotionAmount.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class PromotionAmount( // The value of the element being defined. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:Valid val currency: kotlin.String? = null, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null + val localCurrencyPrice: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class PromotionAmount( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null + private var localCurrencyPrice: Money? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -77,37 +58,17 @@ data class PromotionAmount( PromotionAmount( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: PromotionAmount) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Property.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Property.kt index b5f444a48..98734baca 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Property.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Property.kt @@ -13,49 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.LodgingRoomType import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for information on each offered hotel. +* Container for information on each offered hotel. * @param id The unique property identifier used to designate a single property. * @param status Represents whether the offer is currently available. * @param roomTypes Container for all of available room types. - */ +*/ data class Property( // The unique property identifier used to designate a single property. @JsonProperty("Id") - @field:Valid val id: kotlin.String? = null, // Represents whether the offer is currently available. @JsonProperty("Status") val status: Property.Status? = null, // Container for all of available room types. @JsonProperty("RoomTypes") - @field:Valid - val roomTypes: kotlin.collections.List? = null + val roomTypes: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +46,7 @@ data class Property( class Builder( private var id: kotlin.String? = null, private var status: Property.Status? = null, - private var roomTypes: kotlin.collections.List? = null + private var roomTypes: kotlin.collections.List? = null, ) { fun id(id: kotlin.String?) = apply { this.id = id } @@ -77,45 +59,27 @@ data class Property( Property( id = id, status = status, - roomTypes = roomTypes + roomTypes = roomTypes, ) - validate(instance) - return instance } - - private fun validate(instance: Property) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id, status = status, - roomTypes = roomTypes + roomTypes = roomTypes, ) /** * Represents whether the offer is currently available. * Values: AVAILABLE,NOT_AVAILABLE,ERROR,NUMBER_OF_ADULTS_NOT_ACCEPTED,NUMBER_OF_CHILDREN_NOT_ACCEPTED,NUMBER_OF_INFANTS_NOT_ACCEPTED,NUMBER_OF_PERSONS_NOT_ACCEPTED,CHECK_IN_AGE_NOT_ACCEPTED */ - enum class Status(val value: kotlin.String) { + enum class Status( + val value: kotlin.String, + ) { @JsonProperty("AVAILABLE") AVAILABLE("AVAILABLE"), @@ -138,6 +102,6 @@ data class Property( NUMBER_OF_PERSONS_NOT_ACCEPTED("NUMBER_OF_PERSONS_NOT_ACCEPTED"), @JsonProperty("CHECK_IN_AGE_NOT_ACCEPTED") - CHECK_IN_AGE_NOT_ACCEPTED("CHECK_IN_AGE_NOT_ACCEPTED") + CHECK_IN_AGE_NOT_ACCEPTED("CHECK_IN_AGE_NOT_ACCEPTED"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyDetails.kt index 9d3c6b357..fd8c2b682 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyDetails.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyDetails.kt @@ -13,32 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.PropertyManager import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for information about the hotel property detail. It will be shown for Vacation Rental hotel only. +* Container for information about the hotel property detail. It will be shown for Vacation Rental hotel only. * @param propertyRegistryNumber The registry number of property. * @param hostLanguages The languages the host of property will speak. * @param maxOccupancy The maximum number of guests allowed to stay in the property. @@ -46,15 +27,13 @@ import javax.validation.Validation * @param numberOfBathrooms The number of bathrooms in the property. * @param squareFeet Property area in square feet. * @param propertyManager - */ +*/ data class PropertyDetails( // The registry number of property. @JsonProperty("PropertyRegistryNumber") - @field:Valid val propertyRegistryNumber: kotlin.String? = null, // The languages the host of property will speak. @JsonProperty("HostLanguages") - @field:Valid val hostLanguages: kotlin.collections.List? = null, // The maximum number of guests allowed to stay in the property. @JsonProperty("MaxOccupancy") @@ -67,12 +46,13 @@ data class PropertyDetails( val numberOfBathrooms: kotlin.Int? = null, // Property area in square feet. @JsonProperty("SquareFeet") - @field:Valid val squareFeet: kotlin.String? = null, @JsonProperty("PropertyManager") - @field:Valid - val propertyManager: PropertyManager? = null + val propertyManager: PropertyManager? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -85,7 +65,7 @@ data class PropertyDetails( private var numberOfBedrooms: kotlin.Int? = null, private var numberOfBathrooms: kotlin.Int? = null, private var squareFeet: kotlin.String? = null, - private var propertyManager: PropertyManager? = null + private var propertyManager: PropertyManager? = null, ) { fun propertyRegistryNumber(propertyRegistryNumber: kotlin.String?) = apply { this.propertyRegistryNumber = propertyRegistryNumber } @@ -110,31 +90,11 @@ data class PropertyDetails( numberOfBedrooms = numberOfBedrooms, numberOfBathrooms = numberOfBathrooms, squareFeet = squareFeet, - propertyManager = propertyManager + propertyManager = propertyManager, ) - validate(instance) - return instance } - - private fun validate(instance: PropertyDetails) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -145,6 +105,6 @@ data class PropertyDetails( numberOfBedrooms = numberOfBedrooms, numberOfBathrooms = numberOfBathrooms, squareFeet = squareFeet, - propertyManager = propertyManager + propertyManager = propertyManager, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyManager.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyManager.kt index 7ea7695e4..edbddd768 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyManager.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyManager.kt @@ -13,48 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for information about the property manager. It will be shown for Vacation Rental hotel only. +* Container for information about the property manager. It will be shown for Vacation Rental hotel only. * @param name The name of the property manager. * @param calendarLastUpdated The latest updated date. * @param photoUrl The URL for property manager's photo. - */ +*/ data class PropertyManager( // The name of the property manager. @JsonProperty("Name") - @field:Valid val name: kotlin.String? = null, // The latest updated date. @JsonProperty("CalendarLastUpdated") val calendarLastUpdated: java.time.LocalDate? = null, // The URL for property manager's photo. @JsonProperty("PhotoUrl") - @field:Valid - val photoUrl: kotlin.String? = null + val photoUrl: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -63,7 +45,7 @@ data class PropertyManager( class Builder( private var name: kotlin.String? = null, private var calendarLastUpdated: java.time.LocalDate? = null, - private var photoUrl: kotlin.String? = null + private var photoUrl: kotlin.String? = null, ) { fun name(name: kotlin.String?) = apply { this.name = name } @@ -76,37 +58,17 @@ data class PropertyManager( PropertyManager( name = name, calendarLastUpdated = calendarLastUpdated, - photoUrl = photoUrl + photoUrl = photoUrl, ) - validate(instance) - return instance } - - private fun validate(instance: PropertyManager) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( name = name, calendarLastUpdated = calendarLastUpdated, - photoUrl = photoUrl + photoUrl = photoUrl, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendar.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendar.kt index 6d569d02b..f4f6ba807 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendar.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendar.kt @@ -13,51 +13,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.RateCalendarPrice import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * The lowest rate information of requested days +* The lowest rate information of requested days * @param stayDate Stay date for which the price is returned. * @param price * @param priceLevel Indicates how that day's price compares to the other lowest price for that hotel over the searched date range. Prices will be bucketed into LOW/MEDIUM/HIGH. Here are the details for each `PriceLevel`: - HIGH: 65th percentile+ - MEDIUM: 30th Percentile+ - LOW: Anything lower than 30th percentile * @param status Represents whether the offer is currently available. - */ +*/ data class RateCalendar( // Stay date for which the price is returned. @JsonProperty("StayDate") val stayDate: java.time.LocalDate? = null, @JsonProperty("Price") - @field:Valid val price: RateCalendarPrice? = null, // Indicates how that day's price compares to the other lowest price for that hotel over the searched date range. Prices will be bucketed into LOW/MEDIUM/HIGH. Here are the details for each `PriceLevel`: - HIGH: 65th percentile+ - MEDIUM: 30th Percentile+ - LOW: Anything lower than 30th percentile @JsonProperty("PriceLevel") val priceLevel: RateCalendar.PriceLevel? = null, // Represents whether the offer is currently available. @JsonProperty("Status") - val status: RateCalendar.Status? = null + val status: RateCalendar.Status? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -67,7 +50,7 @@ data class RateCalendar( private var stayDate: java.time.LocalDate? = null, private var price: RateCalendarPrice? = null, private var priceLevel: RateCalendar.PriceLevel? = null, - private var status: RateCalendar.Status? = null + private var status: RateCalendar.Status? = null, ) { fun stayDate(stayDate: java.time.LocalDate?) = apply { this.stayDate = stayDate } @@ -83,31 +66,11 @@ data class RateCalendar( stayDate = stayDate, price = price, priceLevel = priceLevel, - status = status + status = status, ) - validate(instance) - return instance } - - private fun validate(instance: RateCalendar) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -115,14 +78,16 @@ data class RateCalendar( stayDate = stayDate, price = price, priceLevel = priceLevel, - status = status + status = status, ) /** * Indicates how that day's price compares to the other lowest price for that hotel over the searched date range. Prices will be bucketed into LOW/MEDIUM/HIGH. Here are the details for each `PriceLevel`: - HIGH: 65th percentile+ - MEDIUM: 30th Percentile+ - LOW: Anything lower than 30th percentile * Values: HIGH,MEDIUM,LOW */ - enum class PriceLevel(val value: kotlin.String) { + enum class PriceLevel( + val value: kotlin.String, + ) { @JsonProperty("HIGH") HIGH("HIGH"), @@ -130,18 +95,20 @@ data class RateCalendar( MEDIUM("MEDIUM"), @JsonProperty("LOW") - LOW("LOW") + LOW("LOW"), } /** * Represents whether the offer is currently available. * Values: AVAILABLE,NOT_AVAILABLE */ - enum class Status(val value: kotlin.String) { + enum class Status( + val value: kotlin.String, + ) { @JsonProperty("AVAILABLE") AVAILABLE("AVAILABLE"), @JsonProperty("NOT_AVAILABLE") - NOT_AVAILABLE("NOT_AVAILABLE") + NOT_AVAILABLE("NOT_AVAILABLE"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPrice.kt index 6b55c8a57..6a009c1d3 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPrice.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param `value` The total price of the corresponding date. * @param currency The ISO 4217 Currency Code that the Value is expressed in. See [Global Currency Codes](https://developers.expediagroup.com/xap/products/xap/lodging/references/global-currency-codes) for a full list of supported currencies. * @param localCurrencyPrice - */ +*/ data class RateCalendarPrice( // The total price of the corresponding date. @JsonProperty("Value") - @field:Valid val `value`: kotlin.Any? = null, // The ISO 4217 Currency Code that the Value is expressed in. See [Global Currency Codes](https://developers.expediagroup.com/xap/products/xap/lodging/references/global-currency-codes) for a full list of supported currencies. @JsonProperty("Currency") - @field:Valid val currency: kotlin.Any? = null, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null + val localCurrencyPrice: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class RateCalendarPrice( class Builder( private var `value`: kotlin.Any? = null, private var currency: kotlin.Any? = null, - private var localCurrencyPrice: Money? = null + private var localCurrencyPrice: Money? = null, ) { fun `value`(`value`: kotlin.Any?) = apply { this.`value` = `value` } @@ -77,37 +58,17 @@ data class RateCalendarPrice( RateCalendarPrice( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: RateCalendarPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPriceAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPriceAllOf.kt deleted file mode 100644 index 4dbbf2fb6..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPriceAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param `value` The total price of the corresponding date. - * @param currency The ISO 4217 Currency Code that the Value is expressed in. See [Global Currency Codes](https://developers.expediagroup.com/xap/products/xap/lodging/references/global-currency-codes) for a full list of supported currencies. - */ -data class RateCalendarPriceAllOf( - // The total price of the corresponding date. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.Any? = null, - // The ISO 4217 Currency Code that the Value is expressed in. See [Global Currency Codes](https://developers.expediagroup.com/xap/products/xap/lodging/references/global-currency-codes) for a full list of supported currencies. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.Any? = null, - private var currency: kotlin.Any? = null - ) { - fun `value`(`value`: kotlin.Any?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.Any?) = apply { this.currency = currency } - - fun build(): RateCalendarPriceAllOf { - val instance = - RateCalendarPriceAllOf( - `value` = `value`, - currency = currency - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RateCalendarPriceAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarResponse.kt index 978111dab..41222ce07 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarResponse.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarResponse.kt @@ -13,51 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.HotelRateCalendar import com.expediagroup.sdk.xap.models.Warning import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param warnings There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. * @param transactionId Unique identifier for the transaction. * @param rateCalendars Container for all hotel rate calendar data. - */ +*/ data class RateCalendarResponse( // There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. @JsonProperty("Warnings") - @field:Valid val warnings: kotlin.collections.List? = null, // Unique identifier for the transaction. @JsonProperty("TransactionId") - @field:Valid val transactionId: kotlin.String? = null, // Container for all hotel rate calendar data. @JsonProperty("RateCalendars") - @field:Valid - val rateCalendars: kotlin.collections.List? = null + val rateCalendars: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -66,7 +47,7 @@ data class RateCalendarResponse( class Builder( private var warnings: kotlin.collections.List? = null, private var transactionId: kotlin.String? = null, - private var rateCalendars: kotlin.collections.List? = null + private var rateCalendars: kotlin.collections.List? = null, ) { fun warnings(warnings: kotlin.collections.List?) = apply { this.warnings = warnings } @@ -79,37 +60,17 @@ data class RateCalendarResponse( RateCalendarResponse( warnings = warnings, transactionId = transactionId, - rateCalendars = rateCalendars + rateCalendars = rateCalendars, ) - validate(instance) - return instance } - - private fun validate(instance: RateCalendarResponse) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( warnings = warnings, transactionId = transactionId, - rateCalendars = rateCalendars + rateCalendars = rateCalendars, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateDetails.kt index efca8821d..b75ebb0e7 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateDetails.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateDetails.kt @@ -13,34 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Discount import com.expediagroup.sdk.xap.models.Mileage import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The rate detail information for a car offer. +* The rate detail information for a car offer. * @param ratePeriod Rate period. Supported values: Daily,Weekly,Monthly,Trip,Weekend * @param prePay Indicates whether this reservation should be paid at the time of booking (true) or at time of rental return (false). * @param rateCode Rate plan identifier. @@ -48,39 +28,36 @@ import javax.validation.constraints.NotNull * @param discounts List of discount information. * @param mileages A list of charges to be levied based on the mileage driven. * @param mobileRate Indicates whether car offer is mobile rate. - */ +*/ data class RateDetails( // Rate period. Supported values: Daily,Weekly,Monthly,Trip,Weekend @JsonProperty("RatePeriod") - @field:NotNull - @field:Valid val ratePeriod: kotlin.String, // Indicates whether this reservation should be paid at the time of booking (true) or at time of rental return (false). @JsonProperty("PrePay") - @field:NotNull - @field:Valid val prePay: kotlin.Boolean, // Rate plan identifier. @JsonProperty("RateCode") - @field:Valid val rateCode: kotlin.String? = null, // Indicates whether credit card is required for booking. @JsonProperty("CreditCardRequired") - @field:Valid val creditCardRequired: kotlin.Boolean? = null, // List of discount information. @JsonProperty("Discounts") - @field:Valid val discounts: kotlin.collections.List? = null, // A list of charges to be levied based on the mileage driven. @JsonProperty("Mileages") - @field:Valid val mileages: kotlin.collections.List? = null, // Indicates whether car offer is mobile rate. @JsonProperty("MobileRate") - @field:Valid - val mobileRate: kotlin.Boolean? = null + val mobileRate: kotlin.Boolean? = null, ) { + init { + require(ratePeriod != null) { "ratePeriod must not be null" } + + require(prePay != null) { "prePay must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -93,7 +70,7 @@ data class RateDetails( private var creditCardRequired: kotlin.Boolean? = null, private var discounts: kotlin.collections.List? = null, private var mileages: kotlin.collections.List? = null, - private var mobileRate: kotlin.Boolean? = null + private var mobileRate: kotlin.Boolean? = null, ) { fun ratePeriod(ratePeriod: kotlin.String) = apply { this.ratePeriod = ratePeriod } @@ -118,31 +95,11 @@ data class RateDetails( creditCardRequired = creditCardRequired, discounts = discounts, mileages = mileages, - mobileRate = mobileRate + mobileRate = mobileRate, ) - validate(instance) - return instance } - - private fun validate(instance: RateDetails) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -153,6 +110,6 @@ data class RateDetails( creditCardRequired = creditCardRequired, discounts = discounts, mileages = mileages, - mobileRate = mobileRate + mobileRate = mobileRate, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlan.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlan.kt index f644328f8..95999640a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlan.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlan.kt @@ -13,24 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CancellationPolicy import com.expediagroup.sdk.xap.models.PaymentSchedule import com.expediagroup.sdk.xap.models.Promotion @@ -39,12 +23,9 @@ import com.expediagroup.sdk.xap.models.RatePlanPrice import com.expediagroup.sdk.xap.models.RatePlanStandalonePrice import com.expediagroup.sdk.xap.models.StayDates import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for information on each rate plan. +* Container for information on each rate plan. * @param roomTypeId The room type identifier. * @param ratePlanId The rate plan identifier. * @param rateRuleId The identifier of rate rule. @@ -73,55 +54,43 @@ import javax.validation.Validation * @param hcomRewardsBurn Indicate whether the room qualifies for Hcom Rewards Burn. (Hotels.com partners only) * @param cancellationPolicy * @param amenities The amenities of the `rateplan`. - */ +*/ data class RatePlan( // The room type identifier. @JsonProperty("RoomTypeId") - @field:Valid val roomTypeId: kotlin.String? = null, // The rate plan identifier. @JsonProperty("RatePlanId") - @field:Valid val ratePlanId: kotlin.String? = null, // The identifier of rate rule. @JsonProperty("RateRuleId") - @field:Valid val rateRuleId: kotlin.String? = null, // The identification number of the source that provides the rate plan. @JsonProperty("InventorySourceId") - @field:Valid val inventorySourceId: kotlin.String? = null, // The source name that provided the rate plan. @JsonProperty("InventorySourceCode") - @field:Valid val inventorySourceCode: kotlin.String? = null, @JsonProperty("StayDates") - @field:Valid val stayDates: StayDates? = null, // The number of rooms remaining through Expedia for this room type. **NOTE**: This value does NOT represent the total number of rooms remaining at the hotel property, only the number of rooms allocated to Expedia for sale by the property that currently remain in Expedia's inventory. When a hotel is listed as 'sold out' by Expedia there may still be rooms available for sale by the hotel through other channels. Also note that the `RemainingCount` response element has a maximum returned value of 100, even if there are more than 100 rooms available within bookable Expedia inventory. **CMA Compliance Note (UK)**: websites in the UK that display `remainingCount` should make it clear to consumers that this count refers to the number of rooms remaining within Expedia inventory - NOT the number remaining at the property. @JsonProperty("RemainingCount") val remainingCount: kotlin.Int? = null, @JsonProperty("Price") - @field:Valid val price: RatePlanPrice? = null, // Indicates whether the rate is for member only. Only visible by configuration. Please contact your Expedia Account Manager if you need this node. @JsonProperty("MemberOnlyDeal") - @field:Valid val memberOnlyDeal: kotlin.Boolean? = null, // All promotion information of the `ratePlan`. @JsonProperty("Promotions") - @field:Valid val promotions: kotlin.collections.List? = null, @JsonProperty("StandalonePrice") - @field:Valid val standalonePrice: RatePlanStandalonePrice? = null, // Indicates whether taxes and fees are included in base rate. @JsonProperty("TaxesAndFeesInclusive") - @field:Valid val taxesAndFeesInclusive: kotlin.Boolean? = null, // Text description for any deposit information provide by the property (if applicable). @JsonProperty("GuaranteeText") - @field:Valid val guaranteeText: kotlin.String? = null, // Room payment information. The available options are: - Online: Pay at the time of booking - Hotel: Could either be paid at the hotel during the time of stay or paid at the time indicated by `PaymentTime` and `PaymentSchedule` @JsonProperty("PaymentMethod") @@ -131,56 +100,46 @@ data class RatePlan( val paymentTime: RatePlan.PaymentTime? = null, // It will be true if PaymentSchedule has one installment and the value of \"Due\" is booking date, otherwise, it will be false. @JsonProperty("FullDepositUponBooking") - @field:Valid val fullDepositUponBooking: kotlin.Boolean? = null, // Contains information on the payment schedule. @JsonProperty("PaymentSchedule") - @field:Valid val paymentSchedule: kotlin.collections.List? = null, // Indicates whether this rate plan need deposit to reserve. @JsonProperty("ReserveWithDeposit") - @field:Valid val reserveWithDeposit: kotlin.Boolean? = null, // Indicates whether the price of the room includes free Internet. (either wireless or wired) @JsonProperty("FreeInternet") - @field:Valid val freeInternet: kotlin.Boolean? = null, // Indicates whether the price of the room includes free wireless Internet access. @JsonProperty("FreeWiFi") - @field:Valid val freeWiFi: kotlin.Boolean? = null, // The localized details for the free internet amenity (only shown when FreeInternet = true). You can find a link to the complete list of Free Internet Details in [Lodging Free Breakfast and Internet Details](https://developers.expediagroup.com/xap/products/xap/lodging/references/free-breakfast-and-internet-details). @JsonProperty("FreeInternetDetails") - @field:Valid val freeInternetDetails: kotlin.collections.List? = null, // Indicates whether the price of the room includes free parking. @JsonProperty("FreeParking") - @field:Valid val freeParking: kotlin.Boolean? = null, // Indicates whether the price of the room includes free breakfast. @JsonProperty("FreeBreakfast") - @field:Valid val freeBreakfast: kotlin.Boolean? = null, // The localized details for the free breakfast amenity (only shown when FreeBreakfast = true). You can find a link to the complete list of Free Breakfast Details in [Lodging Free Breakfast and Internet Details](https://developers.expediagroup.com/xap/products/xap/lodging/references/free-breakfast-and-internet-details). @JsonProperty("FreeBreakfastDetails") - @field:Valid val freeBreakfastDetails: kotlin.collections.List? = null, // Indicate whether the room qualifies for Hcom Rewards Earn. (Hotels.com partners only) @JsonProperty("HcomRewardsEarn") - @field:Valid val hcomRewardsEarn: kotlin.Boolean? = null, // Indicate whether the room qualifies for Hcom Rewards Burn. (Hotels.com partners only) @JsonProperty("HcomRewardsBurn") - @field:Valid val hcomRewardsBurn: kotlin.Boolean? = null, @JsonProperty("CancellationPolicy") - @field:Valid val cancellationPolicy: CancellationPolicy? = null, // The amenities of the `rateplan`. @JsonProperty("Amenities") - @field:Valid - val amenities: kotlin.collections.List? = null + val amenities: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -214,7 +173,7 @@ data class RatePlan( private var hcomRewardsEarn: kotlin.Boolean? = null, private var hcomRewardsBurn: kotlin.Boolean? = null, private var cancellationPolicy: CancellationPolicy? = null, - private var amenities: kotlin.collections.List? = null + private var amenities: kotlin.collections.List? = null, ) { fun roomTypeId(roomTypeId: kotlin.String?) = apply { this.roomTypeId = roomTypeId } @@ -302,31 +261,11 @@ data class RatePlan( hcomRewardsEarn = hcomRewardsEarn, hcomRewardsBurn = hcomRewardsBurn, cancellationPolicy = cancellationPolicy, - amenities = amenities + amenities = amenities, ) - validate(instance) - return instance } - - private fun validate(instance: RatePlan) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -358,26 +297,30 @@ data class RatePlan( hcomRewardsEarn = hcomRewardsEarn, hcomRewardsBurn = hcomRewardsBurn, cancellationPolicy = cancellationPolicy, - amenities = amenities + amenities = amenities, ) /** * Room payment information. The available options are: - Online: Pay at the time of booking - Hotel: Could either be paid at the hotel during the time of stay or paid at the time indicated by `PaymentTime` and `PaymentSchedule` * Values: ONLINE,HOTEL */ - enum class PaymentMethod(val value: kotlin.String) { + enum class PaymentMethod( + val value: kotlin.String, + ) { @JsonProperty("Online") ONLINE("Online"), @JsonProperty("Hotel") - HOTEL("Hotel") + HOTEL("Hotel"), } /** * The time when the booking amount will be charged on the traveler’s credit card. Valid values are as follows: - UponBooking - PayLater - SupplierDiscretion * Values: UPON_BOOKING,PAY_LATER,SUPPLIER_DISCRETION */ - enum class PaymentTime(val value: kotlin.String) { + enum class PaymentTime( + val value: kotlin.String, + ) { @JsonProperty("UponBooking") UPON_BOOKING("UponBooking"), @@ -385,6 +328,6 @@ data class RatePlan( PAY_LATER("PayLater"), @JsonProperty("SupplierDiscretion") - SUPPLIER_DISCRETION("SupplierDiscretion") + SUPPLIER_DISCRETION("SupplierDiscretion"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInner.kt index e573e018d..ddad85122 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInner.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param id Amenity ID. * @param name Amenity Name. - */ +*/ data class RatePlanAmenitiesInner( // Amenity ID. @JsonProperty("Id") - @field:Valid val id: kotlin.Any? = null, // Amenity Name. @JsonProperty("Name") - @field:Valid - val name: kotlin.Any? = null + val name: kotlin.Any? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class RatePlanAmenitiesInner( class Builder( private var id: kotlin.Any? = null, - private var name: kotlin.Any? = null + private var name: kotlin.Any? = null, ) { fun id(id: kotlin.Any?) = apply { this.id = id } @@ -68,36 +50,16 @@ data class RatePlanAmenitiesInner( val instance = RatePlanAmenitiesInner( id = id, - name = name + name = name, ) - validate(instance) - return instance } - - private fun validate(instance: RatePlanAmenitiesInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id, - name = name + name = name, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInnerAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInnerAllOf.kt deleted file mode 100644 index eb8caff62..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInnerAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param id Amenity ID. - * @param name Amenity Name. - */ -data class RatePlanAmenitiesInnerAllOf( - // Amenity ID. - @JsonProperty("Id") - @field:Valid - val id: kotlin.Any? = null, - // Amenity Name. - @JsonProperty("Name") - @field:Valid - val name: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var id: kotlin.Any? = null, - private var name: kotlin.Any? = null - ) { - fun id(id: kotlin.Any?) = apply { this.id = id } - - fun name(name: kotlin.Any?) = apply { this.name = name } - - fun build(): RatePlanAmenitiesInnerAllOf { - val instance = - RatePlanAmenitiesInnerAllOf( - id = id, - name = name - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanAmenitiesInnerAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - id = id, - name = name - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPrice.kt index e50b26b92..75b8d7207 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPrice.kt @@ -13,131 +13,105 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.RatePlanPriceAvgNightlyRate -import com.expediagroup.sdk.xap.models.RatePlanPriceAvgNightlyStrikeOutRate -import com.expediagroup.sdk.xap.models.RatePlanPriceBaseRate -import com.expediagroup.sdk.xap.models.RatePlanPriceHotelMandatoryFees +import com.expediagroup.sdk.xap.models.Money import com.expediagroup.sdk.xap.models.RatePlanPriceNightlyRatesInner -import com.expediagroup.sdk.xap.models.RatePlanPriceRefundableDamageDeposit -import com.expediagroup.sdk.xap.models.RatePlanPriceRoomRatesInner -import com.expediagroup.sdk.xap.models.RatePlanPriceTaxesAndFees import com.expediagroup.sdk.xap.models.RatePlanPriceTaxesAndFeesDetailsInner -import com.expediagroup.sdk.xap.models.RatePlanPriceTotalPrice -import com.expediagroup.sdk.xap.models.RatePlanPriceTotalStrikeOutPrice +import com.expediagroup.sdk.xap.models.RoomRates import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for all price components of the rate plan. - * @param baseRate - * @param taxesAndFees - * @param totalPrice - * @param totalStrikeOutPrice - * @param avgNightlyRate - * @param avgNightlyStrikeOutRate - * @param hotelMandatoryFees - * @param refundableDamageDeposit +* Container for all price components of the rate plan. + * @param baseRate The price of the rate plan for all occupants, excluding taxes and fees. + * @param taxesAndFees The total rate of taxes and fees of the rate plan for all occupants. + * @param totalPrice The total price of the rate plan, which is equal to the sum of `BaseRate` + `TaxesAndFees`. Hotel mandatory fees are not included in this value as these are paid at the hotel at checkout. Promotion amount have been deducted from the `TotalPrice` value. + * @param totalStrikeOutPrice The total amount to strikeout price. This value is the sum of the pre-discount `BaseRate` + the pre-discount `TaxesAndFees`. + * @param avgNightlyRate The average nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. + * @param avgNightlyStrikeOutRate The average nightly strike out price per night per room of the rate plan, which is equal to the strike out of `BaseRate` divided by `StayDates` and by `room number`. + * @param hotelMandatoryFees The total mandatory fees which will be charged at the hotel for the rate plan. + * @param refundableDamageDeposit The refundable damage deposit. * @param nightlyRates Nightly base rate of the rate plan. * @param taxesAndFeesDetails Container for taxes and fees detail information. Only visible by configuration. Please contact your Expedia Account Manager if you need this node. * @param roomRates Container for the rate information of all rooms. This is only returned in Lodging Details API. - */ +*/ data class RatePlanPrice( + // The price of the rate plan for all occupants, excluding taxes and fees. @JsonProperty("BaseRate") - @field:Valid - val baseRate: RatePlanPriceBaseRate? = null, + val baseRate: Money? = null, + // The total rate of taxes and fees of the rate plan for all occupants. @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: RatePlanPriceTaxesAndFees? = null, + val taxesAndFees: Money? = null, + // The total price of the rate plan, which is equal to the sum of `BaseRate` + `TaxesAndFees`. Hotel mandatory fees are not included in this value as these are paid at the hotel at checkout. Promotion amount have been deducted from the `TotalPrice` value. @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: RatePlanPriceTotalPrice? = null, + val totalPrice: Money? = null, + // The total amount to strikeout price. This value is the sum of the pre-discount `BaseRate` + the pre-discount `TaxesAndFees`. @JsonProperty("TotalStrikeOutPrice") - @field:Valid - val totalStrikeOutPrice: RatePlanPriceTotalStrikeOutPrice? = null, + val totalStrikeOutPrice: Money? = null, + // The average nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. @JsonProperty("AvgNightlyRate") - @field:Valid - val avgNightlyRate: RatePlanPriceAvgNightlyRate? = null, + val avgNightlyRate: Money? = null, + // The average nightly strike out price per night per room of the rate plan, which is equal to the strike out of `BaseRate` divided by `StayDates` and by `room number`. @JsonProperty("AvgNightlyStrikeOutRate") - @field:Valid - val avgNightlyStrikeOutRate: RatePlanPriceAvgNightlyStrikeOutRate? = null, + val avgNightlyStrikeOutRate: Money? = null, + // The total mandatory fees which will be charged at the hotel for the rate plan. @JsonProperty("HotelMandatoryFees") - @field:Valid - val hotelMandatoryFees: RatePlanPriceHotelMandatoryFees? = null, + val hotelMandatoryFees: Money? = null, + // The refundable damage deposit. @JsonProperty("RefundableDamageDeposit") - @field:Valid - val refundableDamageDeposit: RatePlanPriceRefundableDamageDeposit? = null, + val refundableDamageDeposit: Money? = null, // Nightly base rate of the rate plan. @JsonProperty("NightlyRates") - @field:Valid val nightlyRates: kotlin.collections.List? = null, // Container for taxes and fees detail information. Only visible by configuration. Please contact your Expedia Account Manager if you need this node. @JsonProperty("TaxesAndFeesDetails") - @field:Valid val taxesAndFeesDetails: kotlin.collections.List? = null, // Container for the rate information of all rooms. This is only returned in Lodging Details API. @JsonProperty("RoomRates") - @field:Valid - val roomRates: kotlin.collections.List? = null + val roomRates: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() } class Builder( - private var baseRate: RatePlanPriceBaseRate? = null, - private var taxesAndFees: RatePlanPriceTaxesAndFees? = null, - private var totalPrice: RatePlanPriceTotalPrice? = null, - private var totalStrikeOutPrice: RatePlanPriceTotalStrikeOutPrice? = null, - private var avgNightlyRate: RatePlanPriceAvgNightlyRate? = null, - private var avgNightlyStrikeOutRate: RatePlanPriceAvgNightlyStrikeOutRate? = null, - private var hotelMandatoryFees: RatePlanPriceHotelMandatoryFees? = null, - private var refundableDamageDeposit: RatePlanPriceRefundableDamageDeposit? = null, + private var baseRate: Money? = null, + private var taxesAndFees: Money? = null, + private var totalPrice: Money? = null, + private var totalStrikeOutPrice: Money? = null, + private var avgNightlyRate: Money? = null, + private var avgNightlyStrikeOutRate: Money? = null, + private var hotelMandatoryFees: Money? = null, + private var refundableDamageDeposit: Money? = null, private var nightlyRates: kotlin.collections.List? = null, private var taxesAndFeesDetails: kotlin.collections.List? = null, - private var roomRates: kotlin.collections.List? = null + private var roomRates: kotlin.collections.List? = null, ) { - fun baseRate(baseRate: RatePlanPriceBaseRate?) = apply { this.baseRate = baseRate } + fun baseRate(baseRate: Money?) = apply { this.baseRate = baseRate } - fun taxesAndFees(taxesAndFees: RatePlanPriceTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } + fun taxesAndFees(taxesAndFees: Money?) = apply { this.taxesAndFees = taxesAndFees } - fun totalPrice(totalPrice: RatePlanPriceTotalPrice?) = apply { this.totalPrice = totalPrice } + fun totalPrice(totalPrice: Money?) = apply { this.totalPrice = totalPrice } - fun totalStrikeOutPrice(totalStrikeOutPrice: RatePlanPriceTotalStrikeOutPrice?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } + fun totalStrikeOutPrice(totalStrikeOutPrice: Money?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } - fun avgNightlyRate(avgNightlyRate: RatePlanPriceAvgNightlyRate?) = apply { this.avgNightlyRate = avgNightlyRate } + fun avgNightlyRate(avgNightlyRate: Money?) = apply { this.avgNightlyRate = avgNightlyRate } - fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: RatePlanPriceAvgNightlyStrikeOutRate?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } + fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: Money?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } - fun hotelMandatoryFees(hotelMandatoryFees: RatePlanPriceHotelMandatoryFees?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } + fun hotelMandatoryFees(hotelMandatoryFees: Money?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } - fun refundableDamageDeposit(refundableDamageDeposit: RatePlanPriceRefundableDamageDeposit?) = apply { this.refundableDamageDeposit = refundableDamageDeposit } + fun refundableDamageDeposit(refundableDamageDeposit: Money?) = apply { this.refundableDamageDeposit = refundableDamageDeposit } fun nightlyRates(nightlyRates: kotlin.collections.List?) = apply { this.nightlyRates = nightlyRates } fun taxesAndFeesDetails(taxesAndFeesDetails: kotlin.collections.List?) = apply { this.taxesAndFeesDetails = taxesAndFeesDetails } - fun roomRates(roomRates: kotlin.collections.List?) = apply { this.roomRates = roomRates } + fun roomRates(roomRates: kotlin.collections.List?) = apply { this.roomRates = roomRates } fun build(): RatePlanPrice { val instance = @@ -152,31 +126,11 @@ data class RatePlanPrice( refundableDamageDeposit = refundableDamageDeposit, nightlyRates = nightlyRates, taxesAndFeesDetails = taxesAndFeesDetails, - roomRates = roomRates + roomRates = roomRates, ) - validate(instance) - return instance } - - private fun validate(instance: RatePlanPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -191,6 +145,6 @@ data class RatePlanPrice( refundableDamageDeposit = refundableDamageDeposit, nightlyRates = nightlyRates, taxesAndFeesDetails = taxesAndFeesDetails, - roomRates = roomRates + roomRates = roomRates, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceAvgNightlyRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceAvgNightlyRate.kt deleted file mode 100644 index 0b1c4f127..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceAvgNightlyRate.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The average nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanPriceAvgNightlyRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanPriceAvgNightlyRate { - val instance = - RatePlanPriceAvgNightlyRate( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceAvgNightlyRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceAvgNightlyStrikeOutRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceAvgNightlyStrikeOutRate.kt deleted file mode 100644 index 6b948ad35..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceAvgNightlyStrikeOutRate.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The average nightly strike out price per night per room of the rate plan, which is equal to the strike out of `BaseRate` divided by `StayDates` and by `room number`. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanPriceAvgNightlyStrikeOutRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanPriceAvgNightlyStrikeOutRate { - val instance = - RatePlanPriceAvgNightlyStrikeOutRate( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceAvgNightlyStrikeOutRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceBaseRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceBaseRate.kt deleted file mode 100644 index 845f676bf..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceBaseRate.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The price of the rate plan for all occupants, excluding taxes and fees. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanPriceBaseRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanPriceBaseRate { - val instance = - RatePlanPriceBaseRate( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceBaseRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceHotelMandatoryFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceHotelMandatoryFees.kt deleted file mode 100644 index be55341fb..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceHotelMandatoryFees.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total mandatory fees which will be charged at the hotel for the rate plan. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanPriceHotelMandatoryFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanPriceHotelMandatoryFees { - val instance = - RatePlanPriceHotelMandatoryFees( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceHotelMandatoryFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInner.kt index 2149da0c4..fba98dd70 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInner.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param stayDate A single night during the requested stay. * @param baseRate Container for nightly base rate. - */ +*/ data class RatePlanPriceNightlyRatesInner( // A single night during the requested stay. @JsonProperty("StayDate") - @field:Valid val stayDate: kotlin.Any? = null, // Container for nightly base rate. @JsonProperty("BaseRate") - @field:Valid - val baseRate: kotlin.Any? = null + val baseRate: kotlin.Any? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class RatePlanPriceNightlyRatesInner( class Builder( private var stayDate: kotlin.Any? = null, - private var baseRate: kotlin.Any? = null + private var baseRate: kotlin.Any? = null, ) { fun stayDate(stayDate: kotlin.Any?) = apply { this.stayDate = stayDate } @@ -68,36 +50,16 @@ data class RatePlanPriceNightlyRatesInner( val instance = RatePlanPriceNightlyRatesInner( stayDate = stayDate, - baseRate = baseRate + baseRate = baseRate, ) - validate(instance) - return instance } - - private fun validate(instance: RatePlanPriceNightlyRatesInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( stayDate = stayDate, - baseRate = baseRate + baseRate = baseRate, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInnerAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInnerAllOf.kt deleted file mode 100644 index a20247e9a..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInnerAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param stayDate A single night during the requested stay. - * @param baseRate Container for nightly base rate. - */ -data class RatePlanPriceNightlyRatesInnerAllOf( - // A single night during the requested stay. - @JsonProperty("StayDate") - @field:Valid - val stayDate: kotlin.Any? = null, - // Container for nightly base rate. - @JsonProperty("BaseRate") - @field:Valid - val baseRate: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var stayDate: kotlin.Any? = null, - private var baseRate: kotlin.Any? = null - ) { - fun stayDate(stayDate: kotlin.Any?) = apply { this.stayDate = stayDate } - - fun baseRate(baseRate: kotlin.Any?) = apply { this.baseRate = baseRate } - - fun build(): RatePlanPriceNightlyRatesInnerAllOf { - val instance = - RatePlanPriceNightlyRatesInnerAllOf( - stayDate = stayDate, - baseRate = baseRate - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceNightlyRatesInnerAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - stayDate = stayDate, - baseRate = baseRate - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceRefundableDamageDeposit.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceRefundableDamageDeposit.kt deleted file mode 100644 index c64b17ba3..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceRefundableDamageDeposit.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The refundable damage deposit. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanPriceRefundableDamageDeposit( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanPriceRefundableDamageDeposit { - val instance = - RatePlanPriceRefundableDamageDeposit( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceRefundableDamageDeposit) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceRoomRatesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceRoomRatesInner.kt deleted file mode 100644 index 58f63dc10..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceRoomRatesInner.kt +++ /dev/null @@ -1,165 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.MandatoryFeesDetail -import com.expediagroup.sdk.xap.models.RoomRatesBaseRate -import com.expediagroup.sdk.xap.models.RoomRatesNightlyRatesInner -import com.expediagroup.sdk.xap.models.RoomRatesTaxesAndFees -import com.expediagroup.sdk.xap.models.RoomRatesTaxesAndFeesDetailsInner -import com.expediagroup.sdk.xap.models.RoomRatesTotalPrice -import com.expediagroup.sdk.xap.models.RoomRatesTotalStrikeOutPrice -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param roomIndex Index of which of the requested rooms this entry refers to. - * @param baseRate - * @param taxesAndFees - * @param totalPrice - * @param totalStrikeOutPrice - * @param taxesAndFeesDetails The breakdown for taxes and fees for this room for the entire stay. Only visible by configuration. Please contact your Expedia Account Manager if you need this node. - * @param mandatoryFeesDetails The breakdown for the taxes and fees that must be paid at the property. - * @param nightlyRates Container for the nightly rate of current room. - */ -data class RatePlanPriceRoomRatesInner( - // Index of which of the requested rooms this entry refers to. - @JsonProperty("RoomIndex") - val roomIndex: kotlin.Int? = null, - @JsonProperty("BaseRate") - @field:Valid - val baseRate: RoomRatesBaseRate? = null, - @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: RoomRatesTaxesAndFees? = null, - @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: RoomRatesTotalPrice? = null, - @JsonProperty("TotalStrikeOutPrice") - @field:Valid - val totalStrikeOutPrice: RoomRatesTotalStrikeOutPrice? = null, - // The breakdown for taxes and fees for this room for the entire stay. Only visible by configuration. Please contact your Expedia Account Manager if you need this node. - @JsonProperty("TaxesAndFeesDetails") - @field:Valid - val taxesAndFeesDetails: kotlin.collections.List? = null, - // The breakdown for the taxes and fees that must be paid at the property. - @JsonProperty("MandatoryFeesDetails") - @field:Valid - val mandatoryFeesDetails: kotlin.collections.List? = null, - // Container for the nightly rate of current room. - @JsonProperty("NightlyRates") - @field:Valid - val nightlyRates: kotlin.collections.List? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var roomIndex: kotlin.Int? = null, - private var baseRate: RoomRatesBaseRate? = null, - private var taxesAndFees: RoomRatesTaxesAndFees? = null, - private var totalPrice: RoomRatesTotalPrice? = null, - private var totalStrikeOutPrice: RoomRatesTotalStrikeOutPrice? = null, - private var taxesAndFeesDetails: kotlin.collections.List? = null, - private var mandatoryFeesDetails: kotlin.collections.List? = null, - private var nightlyRates: kotlin.collections.List? = null - ) { - fun roomIndex(roomIndex: kotlin.Int?) = apply { this.roomIndex = roomIndex } - - fun baseRate(baseRate: RoomRatesBaseRate?) = apply { this.baseRate = baseRate } - - fun taxesAndFees(taxesAndFees: RoomRatesTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } - - fun totalPrice(totalPrice: RoomRatesTotalPrice?) = apply { this.totalPrice = totalPrice } - - fun totalStrikeOutPrice(totalStrikeOutPrice: RoomRatesTotalStrikeOutPrice?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } - - fun taxesAndFeesDetails(taxesAndFeesDetails: kotlin.collections.List?) = apply { this.taxesAndFeesDetails = taxesAndFeesDetails } - - fun mandatoryFeesDetails(mandatoryFeesDetails: kotlin.collections.List?) = apply { this.mandatoryFeesDetails = mandatoryFeesDetails } - - fun nightlyRates(nightlyRates: kotlin.collections.List?) = apply { this.nightlyRates = nightlyRates } - - fun build(): RatePlanPriceRoomRatesInner { - val instance = - RatePlanPriceRoomRatesInner( - roomIndex = roomIndex, - baseRate = baseRate, - taxesAndFees = taxesAndFees, - totalPrice = totalPrice, - totalStrikeOutPrice = totalStrikeOutPrice, - taxesAndFeesDetails = taxesAndFeesDetails, - mandatoryFeesDetails = mandatoryFeesDetails, - nightlyRates = nightlyRates - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceRoomRatesInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - roomIndex = roomIndex, - baseRate = baseRate, - taxesAndFees = taxesAndFees, - totalPrice = totalPrice, - totalStrikeOutPrice = totalStrikeOutPrice, - taxesAndFeesDetails = taxesAndFeesDetails, - mandatoryFeesDetails = mandatoryFeesDetails, - nightlyRates = nightlyRates - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFees.kt deleted file mode 100644 index abe8bca24..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFees.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total rate of taxes and fees of the rate plan for all occupants. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanPriceTaxesAndFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanPriceTaxesAndFees { - val instance = - RatePlanPriceTaxesAndFees( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceTaxesAndFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInner.kt index 39cdae6df..755f8c5a7 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInner.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param categoryCode Category ID of this specific tax or fee. * @param amount The value of this specific tax or fee. - */ +*/ data class RatePlanPriceTaxesAndFeesDetailsInner( // Category ID of this specific tax or fee. @JsonProperty("CategoryCode") - @field:Valid val categoryCode: kotlin.Any? = null, // The value of this specific tax or fee. @JsonProperty("Amount") - @field:Valid - val amount: kotlin.Any? = null + val amount: kotlin.Any? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class RatePlanPriceTaxesAndFeesDetailsInner( class Builder( private var categoryCode: kotlin.Any? = null, - private var amount: kotlin.Any? = null + private var amount: kotlin.Any? = null, ) { fun categoryCode(categoryCode: kotlin.Any?) = apply { this.categoryCode = categoryCode } @@ -68,36 +50,16 @@ data class RatePlanPriceTaxesAndFeesDetailsInner( val instance = RatePlanPriceTaxesAndFeesDetailsInner( categoryCode = categoryCode, - amount = amount + amount = amount, ) - validate(instance) - return instance } - - private fun validate(instance: RatePlanPriceTaxesAndFeesDetailsInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( categoryCode = categoryCode, - amount = amount + amount = amount, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInnerAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInnerAllOf.kt deleted file mode 100644 index e64d779c9..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInnerAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param categoryCode Category ID of this specific tax or fee. - * @param amount The value of this specific tax or fee. - */ -data class RatePlanPriceTaxesAndFeesDetailsInnerAllOf( - // Category ID of this specific tax or fee. - @JsonProperty("CategoryCode") - @field:Valid - val categoryCode: kotlin.Any? = null, - // The value of this specific tax or fee. - @JsonProperty("Amount") - @field:Valid - val amount: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var categoryCode: kotlin.Any? = null, - private var amount: kotlin.Any? = null - ) { - fun categoryCode(categoryCode: kotlin.Any?) = apply { this.categoryCode = categoryCode } - - fun amount(amount: kotlin.Any?) = apply { this.amount = amount } - - fun build(): RatePlanPriceTaxesAndFeesDetailsInnerAllOf { - val instance = - RatePlanPriceTaxesAndFeesDetailsInnerAllOf( - categoryCode = categoryCode, - amount = amount - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceTaxesAndFeesDetailsInnerAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - categoryCode = categoryCode, - amount = amount - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTotalPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTotalPrice.kt deleted file mode 100644 index f9a09b8e9..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTotalPrice.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total price of the rate plan, which is equal to the sum of `BaseRate` + `TaxesAndFees`. Hotel mandatory fees are not included in this value as these are paid at the hotel at checkout. Promotion amount have been deducted from the `TotalPrice` value. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanPriceTotalPrice( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanPriceTotalPrice { - val instance = - RatePlanPriceTotalPrice( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceTotalPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTotalStrikeOutPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTotalStrikeOutPrice.kt deleted file mode 100644 index 6ca234123..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTotalStrikeOutPrice.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total amount to strikeout price. This value is the sum of the pre-discount `BaseRate` + the pre-discount `TaxesAndFees`. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanPriceTotalStrikeOutPrice( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanPriceTotalStrikeOutPrice { - val instance = - RatePlanPriceTotalStrikeOutPrice( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanPriceTotalStrikeOutPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePrice.kt index f4a1ec8d7..eee768f83 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePrice.kt @@ -13,124 +13,95 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceAvgNightlyRate -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceAvgNightlyStrikeOutRate -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceBaseRate -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceHotelMandatoryFees -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceStrikeOutBaseRate -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceStrikeOutHotelMandatoryFees -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceStrikeOutTaxesAndFees -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceTaxesAndFees -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceTotalPrice -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceTotalStrikeOutPrice +import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * The corresponded standalone price to the package rate plan (to show the `strikethrough`). Only returned when the returned `rateplan` is being used as part of a package. - * @param baseRate - * @param strikeOutBaseRate - * @param taxesAndFees - * @param strikeOutTaxesAndFees - * @param totalPrice - * @param totalStrikeOutPrice - * @param avgNightlyRate - * @param avgNightlyStrikeOutRate - * @param hotelMandatoryFees - * @param strikeOutHotelMandatoryFees - */ +* The corresponded standalone price to the package rate plan (to show the `strikethrough`). Only returned when the returned `rateplan` is being used as part of a package. + * @param baseRate The standalone price of the rate plan for all occupants, excluding taxes and fees. + * @param strikeOutBaseRate The base rate strikeout in the standalone shopping path. + * @param taxesAndFees The total standalone rate of taxes and fees of the rate plan for all occupants. + * @param strikeOutTaxesAndFees The taxes and fees strikeout in the standalone shopping path. + * @param totalPrice The total standalone price of the rate plan, which is equal to the sum of `BaseRate` and `TaxesAndFees`. Hotel mandatory fees are not included as these are paid at the hotel at checkout. + * @param totalStrikeOutPrice The total strikeout in the standalone shopping path, which is equal to the sum of `StrikeOutBaseRate` and `StrikeOutTaxesAndFees`. + * @param avgNightlyRate The average standalone nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. + * @param avgNightlyStrikeOutRate The average strikeout of the base rate in the standalone shopping path, which is per night per room and is equal to `StrikeOutBaseRate` divided by `StayDates` and by `room number`. + * @param hotelMandatoryFees The total standalone mandatory fees. + * @param strikeOutHotelMandatoryFees The strikeout of the mandatory fees in the standalone shopping path. +*/ data class RatePlanStandalonePrice( + // The standalone price of the rate plan for all occupants, excluding taxes and fees. @JsonProperty("BaseRate") - @field:Valid - val baseRate: RatePlanStandalonePriceBaseRate? = null, + val baseRate: Money? = null, + // The base rate strikeout in the standalone shopping path. @JsonProperty("StrikeOutBaseRate") - @field:Valid - val strikeOutBaseRate: RatePlanStandalonePriceStrikeOutBaseRate? = null, + val strikeOutBaseRate: Money? = null, + // The total standalone rate of taxes and fees of the rate plan for all occupants. @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: RatePlanStandalonePriceTaxesAndFees? = null, + val taxesAndFees: Money? = null, + // The taxes and fees strikeout in the standalone shopping path. @JsonProperty("StrikeOutTaxesAndFees") - @field:Valid - val strikeOutTaxesAndFees: RatePlanStandalonePriceStrikeOutTaxesAndFees? = null, + val strikeOutTaxesAndFees: Money? = null, + // The total standalone price of the rate plan, which is equal to the sum of `BaseRate` and `TaxesAndFees`. Hotel mandatory fees are not included as these are paid at the hotel at checkout. @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: RatePlanStandalonePriceTotalPrice? = null, + val totalPrice: Money? = null, + // The total strikeout in the standalone shopping path, which is equal to the sum of `StrikeOutBaseRate` and `StrikeOutTaxesAndFees`. @JsonProperty("TotalStrikeOutPrice") - @field:Valid - val totalStrikeOutPrice: RatePlanStandalonePriceTotalStrikeOutPrice? = null, + val totalStrikeOutPrice: Money? = null, + // The average standalone nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. @JsonProperty("AvgNightlyRate") - @field:Valid - val avgNightlyRate: RatePlanStandalonePriceAvgNightlyRate? = null, + val avgNightlyRate: Money? = null, + // The average strikeout of the base rate in the standalone shopping path, which is per night per room and is equal to `StrikeOutBaseRate` divided by `StayDates` and by `room number`. @JsonProperty("AvgNightlyStrikeOutRate") - @field:Valid - val avgNightlyStrikeOutRate: RatePlanStandalonePriceAvgNightlyStrikeOutRate? = null, + val avgNightlyStrikeOutRate: Money? = null, + // The total standalone mandatory fees. @JsonProperty("HotelMandatoryFees") - @field:Valid - val hotelMandatoryFees: RatePlanStandalonePriceHotelMandatoryFees? = null, + val hotelMandatoryFees: Money? = null, + // The strikeout of the mandatory fees in the standalone shopping path. @JsonProperty("StrikeOutHotelMandatoryFees") - @field:Valid - val strikeOutHotelMandatoryFees: RatePlanStandalonePriceStrikeOutHotelMandatoryFees? = null + val strikeOutHotelMandatoryFees: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() } class Builder( - private var baseRate: RatePlanStandalonePriceBaseRate? = null, - private var strikeOutBaseRate: RatePlanStandalonePriceStrikeOutBaseRate? = null, - private var taxesAndFees: RatePlanStandalonePriceTaxesAndFees? = null, - private var strikeOutTaxesAndFees: RatePlanStandalonePriceStrikeOutTaxesAndFees? = null, - private var totalPrice: RatePlanStandalonePriceTotalPrice? = null, - private var totalStrikeOutPrice: RatePlanStandalonePriceTotalStrikeOutPrice? = null, - private var avgNightlyRate: RatePlanStandalonePriceAvgNightlyRate? = null, - private var avgNightlyStrikeOutRate: RatePlanStandalonePriceAvgNightlyStrikeOutRate? = null, - private var hotelMandatoryFees: RatePlanStandalonePriceHotelMandatoryFees? = null, - private var strikeOutHotelMandatoryFees: RatePlanStandalonePriceStrikeOutHotelMandatoryFees? = null + private var baseRate: Money? = null, + private var strikeOutBaseRate: Money? = null, + private var taxesAndFees: Money? = null, + private var strikeOutTaxesAndFees: Money? = null, + private var totalPrice: Money? = null, + private var totalStrikeOutPrice: Money? = null, + private var avgNightlyRate: Money? = null, + private var avgNightlyStrikeOutRate: Money? = null, + private var hotelMandatoryFees: Money? = null, + private var strikeOutHotelMandatoryFees: Money? = null, ) { - fun baseRate(baseRate: RatePlanStandalonePriceBaseRate?) = apply { this.baseRate = baseRate } + fun baseRate(baseRate: Money?) = apply { this.baseRate = baseRate } - fun strikeOutBaseRate(strikeOutBaseRate: RatePlanStandalonePriceStrikeOutBaseRate?) = apply { this.strikeOutBaseRate = strikeOutBaseRate } + fun strikeOutBaseRate(strikeOutBaseRate: Money?) = apply { this.strikeOutBaseRate = strikeOutBaseRate } - fun taxesAndFees(taxesAndFees: RatePlanStandalonePriceTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } + fun taxesAndFees(taxesAndFees: Money?) = apply { this.taxesAndFees = taxesAndFees } - fun strikeOutTaxesAndFees(strikeOutTaxesAndFees: RatePlanStandalonePriceStrikeOutTaxesAndFees?) = apply { this.strikeOutTaxesAndFees = strikeOutTaxesAndFees } + fun strikeOutTaxesAndFees(strikeOutTaxesAndFees: Money?) = apply { this.strikeOutTaxesAndFees = strikeOutTaxesAndFees } - fun totalPrice(totalPrice: RatePlanStandalonePriceTotalPrice?) = apply { this.totalPrice = totalPrice } + fun totalPrice(totalPrice: Money?) = apply { this.totalPrice = totalPrice } - fun totalStrikeOutPrice(totalStrikeOutPrice: RatePlanStandalonePriceTotalStrikeOutPrice?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } + fun totalStrikeOutPrice(totalStrikeOutPrice: Money?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } - fun avgNightlyRate(avgNightlyRate: RatePlanStandalonePriceAvgNightlyRate?) = apply { this.avgNightlyRate = avgNightlyRate } + fun avgNightlyRate(avgNightlyRate: Money?) = apply { this.avgNightlyRate = avgNightlyRate } - fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: RatePlanStandalonePriceAvgNightlyStrikeOutRate?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } + fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: Money?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } - fun hotelMandatoryFees(hotelMandatoryFees: RatePlanStandalonePriceHotelMandatoryFees?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } + fun hotelMandatoryFees(hotelMandatoryFees: Money?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } - fun strikeOutHotelMandatoryFees(strikeOutHotelMandatoryFees: RatePlanStandalonePriceStrikeOutHotelMandatoryFees?) = - apply { - this.strikeOutHotelMandatoryFees = - strikeOutHotelMandatoryFees - } + fun strikeOutHotelMandatoryFees(strikeOutHotelMandatoryFees: Money?) = apply { this.strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees } fun build(): RatePlanStandalonePrice { val instance = @@ -144,31 +115,11 @@ data class RatePlanStandalonePrice( avgNightlyRate = avgNightlyRate, avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, hotelMandatoryFees = hotelMandatoryFees, - strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees + strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees, ) - validate(instance) - return instance } - - private fun validate(instance: RatePlanStandalonePrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -182,6 +133,6 @@ data class RatePlanStandalonePrice( avgNightlyRate = avgNightlyRate, avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, hotelMandatoryFees = hotelMandatoryFees, - strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees + strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceAvgNightlyRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceAvgNightlyRate.kt deleted file mode 100644 index f420ce0d1..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceAvgNightlyRate.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The average standalone nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanStandalonePriceAvgNightlyRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanStandalonePriceAvgNightlyRate { - val instance = - RatePlanStandalonePriceAvgNightlyRate( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanStandalonePriceAvgNightlyRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceAvgNightlyStrikeOutRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceAvgNightlyStrikeOutRate.kt deleted file mode 100644 index 61d776320..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceAvgNightlyStrikeOutRate.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The average strikeout of the base rate in the standalone shopping path, which is per night per room and is equal to `StrikeOutBaseRate` divided by `StayDates` and by `room number`. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanStandalonePriceAvgNightlyStrikeOutRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanStandalonePriceAvgNightlyStrikeOutRate { - val instance = - RatePlanStandalonePriceAvgNightlyStrikeOutRate( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanStandalonePriceAvgNightlyStrikeOutRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceBaseRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceBaseRate.kt deleted file mode 100644 index 731322a14..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceBaseRate.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The standalone price of the rate plan for all occupants, excluding taxes and fees. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanStandalonePriceBaseRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanStandalonePriceBaseRate { - val instance = - RatePlanStandalonePriceBaseRate( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanStandalonePriceBaseRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceHotelMandatoryFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceHotelMandatoryFees.kt deleted file mode 100644 index fca3776fc..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceHotelMandatoryFees.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total standalone mandatory fees. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanStandalonePriceHotelMandatoryFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanStandalonePriceHotelMandatoryFees { - val instance = - RatePlanStandalonePriceHotelMandatoryFees( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanStandalonePriceHotelMandatoryFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutBaseRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutBaseRate.kt deleted file mode 100644 index 074cbd2e0..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutBaseRate.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The base rate strikeout in the standalone shopping path. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanStandalonePriceStrikeOutBaseRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanStandalonePriceStrikeOutBaseRate { - val instance = - RatePlanStandalonePriceStrikeOutBaseRate( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanStandalonePriceStrikeOutBaseRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutHotelMandatoryFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutHotelMandatoryFees.kt deleted file mode 100644 index a2d729701..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutHotelMandatoryFees.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The strikeout of the mandatory fees in the standalone shopping path. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanStandalonePriceStrikeOutHotelMandatoryFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanStandalonePriceStrikeOutHotelMandatoryFees { - val instance = - RatePlanStandalonePriceStrikeOutHotelMandatoryFees( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanStandalonePriceStrikeOutHotelMandatoryFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutTaxesAndFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutTaxesAndFees.kt deleted file mode 100644 index 51fee932a..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutTaxesAndFees.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The taxes and fees strikeout in the standalone shopping path. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanStandalonePriceStrikeOutTaxesAndFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanStandalonePriceStrikeOutTaxesAndFees { - val instance = - RatePlanStandalonePriceStrikeOutTaxesAndFees( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanStandalonePriceStrikeOutTaxesAndFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTaxesAndFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTaxesAndFees.kt deleted file mode 100644 index 61764d1e2..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTaxesAndFees.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total standalone rate of taxes and fees of the rate plan for all occupants. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanStandalonePriceTaxesAndFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanStandalonePriceTaxesAndFees { - val instance = - RatePlanStandalonePriceTaxesAndFees( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanStandalonePriceTaxesAndFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTotalPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTotalPrice.kt deleted file mode 100644 index da20178e9..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTotalPrice.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total standalone price of the rate plan, which is equal to the sum of `BaseRate` and `TaxesAndFees`. Hotel mandatory fees are not included as these are paid at the hotel at checkout. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanStandalonePriceTotalPrice( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanStandalonePriceTotalPrice { - val instance = - RatePlanStandalonePriceTotalPrice( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanStandalonePriceTotalPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTotalStrikeOutPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTotalStrikeOutPrice.kt deleted file mode 100644 index 953de54d9..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTotalStrikeOutPrice.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total strikeout in the standalone shopping path, which is equal to the sum of `StrikeOutBaseRate` and `StrikeOutTaxesAndFees`. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RatePlanStandalonePriceTotalStrikeOutPrice( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RatePlanStandalonePriceTotalStrikeOutPrice { - val instance = - RatePlanStandalonePriceTotalStrikeOutPrice( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RatePlanStandalonePriceTotalStrikeOutPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Rating.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Rating.kt index 561c4766b..29636cd34 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Rating.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Rating.kt @@ -13,53 +13,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.RatingDetails import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The rating of the car being offered. +* The rating of the car being offered. * @param ratingPercentage The percentage of rating. * @param ratingCount The total count of rating. * @param ratingDetails List of all the details of rating. - */ +*/ data class Rating( // The percentage of rating. @JsonProperty("RatingPercentage") - @field:NotNull - @field:Valid val ratingPercentage: kotlin.String, // The total count of rating. @JsonProperty("RatingCount") - @field:NotNull - @field:Valid val ratingCount: kotlin.String, // List of all the details of rating. @JsonProperty("RatingDetails") - @field:Valid - val ratingDetails: kotlin.collections.List? = null + val ratingDetails: kotlin.collections.List? = null, ) { + init { + require(ratingPercentage != null) { "ratingPercentage must not be null" } + + require(ratingCount != null) { "ratingCount must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -68,7 +49,7 @@ data class Rating( class Builder( private var ratingPercentage: kotlin.String? = null, private var ratingCount: kotlin.String? = null, - private var ratingDetails: kotlin.collections.List? = null + private var ratingDetails: kotlin.collections.List? = null, ) { fun ratingPercentage(ratingPercentage: kotlin.String) = apply { this.ratingPercentage = ratingPercentage } @@ -81,37 +62,17 @@ data class Rating( Rating( ratingPercentage = ratingPercentage!!, ratingCount = ratingCount!!, - ratingDetails = ratingDetails + ratingDetails = ratingDetails, ) - validate(instance) - return instance } - - private fun validate(instance: Rating) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( ratingPercentage = ratingPercentage!!, ratingCount = ratingCount!!, - ratingDetails = ratingDetails + ratingDetails = ratingDetails, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingDetails.kt index 28e075cb8..c1f7c3dd6 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingDetails.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingDetails.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List of all the details of rating. +* List of all the details of rating. * @param category The category of rating detail. * @param percentage The percentage of rating detail category. - */ +*/ data class RatingDetails( // The category of rating detail. @JsonProperty("Category") - @field:NotNull - @field:Valid val category: kotlin.String, // The percentage of rating detail category. @JsonProperty("Percentage") - @field:NotNull - @field:Valid - val percentage: kotlin.String + val percentage: kotlin.String, ) { + init { + require(category != null) { "category must not be null" } + + require(percentage != null) { "percentage must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class RatingDetails( class Builder( private var category: kotlin.String? = null, - private var percentage: kotlin.String? = null + private var percentage: kotlin.String? = null, ) { fun category(category: kotlin.String) = apply { this.category = category } @@ -71,36 +53,16 @@ data class RatingDetails( val instance = RatingDetails( category = category!!, - percentage = percentage!! + percentage = percentage!!, ) - validate(instance) - return instance } - - private fun validate(instance: RatingDetails) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( category = category!!, - percentage = percentage!! + percentage = percentage!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingWithoutDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingWithoutDetails.kt index 184f6d22a..e1ced55ef 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingWithoutDetails.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingWithoutDetails.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The rating of the car being offered. +* The rating of the car being offered. * @param ratingPercentage The percentage of rating. * @param ratingCount The total count of rating. - */ +*/ data class RatingWithoutDetails( // The percentage of rating. @JsonProperty("RatingPercentage") - @field:NotNull - @field:Valid val ratingPercentage: kotlin.String, // The total count of rating. @JsonProperty("RatingCount") - @field:NotNull - @field:Valid - val ratingCount: kotlin.String + val ratingCount: kotlin.String, ) { + init { + require(ratingPercentage != null) { "ratingPercentage must not be null" } + + require(ratingCount != null) { "ratingCount must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class RatingWithoutDetails( class Builder( private var ratingPercentage: kotlin.String? = null, - private var ratingCount: kotlin.String? = null + private var ratingCount: kotlin.String? = null, ) { fun ratingPercentage(ratingPercentage: kotlin.String) = apply { this.ratingPercentage = ratingPercentage } @@ -71,36 +53,16 @@ data class RatingWithoutDetails( val instance = RatingWithoutDetails( ratingPercentage = ratingPercentage!!, - ratingCount = ratingCount!! + ratingCount = ratingCount!!, ) - validate(instance) - return instance } - - private fun validate(instance: RatingWithoutDetails) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( ratingPercentage = ratingPercentage!!, - ratingCount = ratingCount!! + ratingCount = ratingCount!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt index 32a02d013..b6d3a9fda 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt @@ -13,45 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesLocation import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container of redemption information. +* Container of redemption information. * @param type The type of redemption process associated to the activity. * @param redemptionLocations List of redemption locations where the activity will take place, please refer to Location Section below. - */ +*/ data class Redemption( // The type of redemption process associated to the activity. @JsonProperty("Type") - @field:Valid val type: kotlin.String? = null, // List of redemption locations where the activity will take place, please refer to Location Section below. @JsonProperty("RedemptionLocations") - @field:Valid - val redemptionLocations: kotlin.collections.List? = null + val redemptionLocations: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -59,7 +41,7 @@ data class Redemption( class Builder( private var type: kotlin.String? = null, - private var redemptionLocations: kotlin.collections.List? = null + private var redemptionLocations: kotlin.collections.List? = null, ) { fun type(type: kotlin.String?) = apply { this.type = type } @@ -69,36 +51,16 @@ data class Redemption( val instance = Redemption( type = type, - redemptionLocations = redemptionLocations + redemptionLocations = redemptionLocations, ) - validate(instance) - return instance } - - private fun validate(instance: Redemption) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( type = type, - redemptionLocations = redemptionLocations + redemptionLocations = redemptionLocations, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt index 8657fc46b..1979f7f5b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt @@ -13,49 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container for the reference price used for strike out display. +* Container for the reference price used for strike out display. * @param totalRate * @param totalFees * @param totalTaxesAndFees - */ +*/ data class ReferencePrice( @JsonProperty("TotalRate") - @field:NotNull - @field:Valid val totalRate: ActivitiesMoney, @JsonProperty("TotalFees") - @field:Valid val totalFees: ActivitiesMoney? = null, @JsonProperty("TotalTaxesAndFees") - @field:Valid - val totalTaxesAndFees: ActivitiesMoney? = null + val totalTaxesAndFees: ActivitiesMoney? = null, ) { + init { + require(totalRate != null) { "totalRate must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +44,7 @@ data class ReferencePrice( class Builder( private var totalRate: ActivitiesMoney? = null, private var totalFees: ActivitiesMoney? = null, - private var totalTaxesAndFees: ActivitiesMoney? = null + private var totalTaxesAndFees: ActivitiesMoney? = null, ) { fun totalRate(totalRate: ActivitiesMoney) = apply { this.totalRate = totalRate } @@ -77,37 +57,17 @@ data class ReferencePrice( ReferencePrice( totalRate = totalRate!!, totalFees = totalFees, - totalTaxesAndFees = totalTaxesAndFees + totalTaxesAndFees = totalTaxesAndFees, ) - validate(instance) - return instance } - - private fun validate(instance: ReferencePrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( totalRate = totalRate!!, totalFees = totalFees, - totalTaxesAndFees = totalTaxesAndFees + totalTaxesAndFees = totalTaxesAndFees, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RentalLimits.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RentalLimits.kt index 2764c1589..f3218e201 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RentalLimits.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RentalLimits.kt @@ -13,46 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Duration import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Limitations that are part of this rental agreement. +* Limitations that are part of this rental agreement. * @param minDuration * @param maxDuration - */ +*/ data class RentalLimits( @JsonProperty("MinDuration") - @field:NotNull - @field:Valid val minDuration: Duration, @JsonProperty("MaxDuration") - @field:NotNull - @field:Valid - val maxDuration: Duration + val maxDuration: Duration, ) { + init { + require(minDuration != null) { "minDuration must not be null" } + + require(maxDuration != null) { "maxDuration must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -60,7 +42,7 @@ data class RentalLimits( class Builder( private var minDuration: Duration? = null, - private var maxDuration: Duration? = null + private var maxDuration: Duration? = null, ) { fun minDuration(minDuration: Duration) = apply { this.minDuration = minDuration } @@ -70,36 +52,16 @@ data class RentalLimits( val instance = RentalLimits( minDuration = minDuration!!, - maxDuration = maxDuration!! + maxDuration = maxDuration!!, ) - validate(instance) - return instance } - - private fun validate(instance: RentalLimits) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( minDuration = minDuration!!, - maxDuration = maxDuration!! + maxDuration = maxDuration!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt index e442400b4..53e338b91 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt @@ -13,58 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container of the Restrictions associated to this ticket. +* Container of the Restrictions associated to this ticket. * @param type Type of the Restriction. * @param max Maximum value allowed for the restriction type. * @param min Minimum value allowed for the restriction type. * @param description The text to describe the restriction. - */ +*/ data class Restrictions( // Type of the Restriction. @JsonProperty("Type") - @field:NotNull - @field:Valid val type: kotlin.String, // Maximum value allowed for the restriction type. @JsonProperty("Max") - @field:NotNull - @field:Valid val max: kotlin.String, // Minimum value allowed for the restriction type. @JsonProperty("Min") - @field:NotNull - @field:Valid val min: kotlin.String, // The text to describe the restriction. @JsonProperty("Description") - @field:Valid - val description: kotlin.String? = null + val description: kotlin.String? = null, ) { + init { + require(type != null) { "type must not be null" } + + require(max != null) { "max must not be null" } + + require(min != null) { "min must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -74,7 +55,7 @@ data class Restrictions( private var type: kotlin.String? = null, private var max: kotlin.String? = null, private var min: kotlin.String? = null, - private var description: kotlin.String? = null + private var description: kotlin.String? = null, ) { fun type(type: kotlin.String) = apply { this.type = type } @@ -90,31 +71,11 @@ data class Restrictions( type = type!!, max = max!!, min = min!!, - description = description + description = description, ) - validate(instance) - return instance } - - private fun validate(instance: Restrictions) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -122,6 +83,6 @@ data class Restrictions( type = type!!, max = max!!, min = min!!, - description = description + description = description, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Room.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Room.kt index 3b86043e9..276c4bb81 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Room.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Room.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package com.expediagroup.sdk.xap.models data class Room( val adults: Long?, - val childAges: List? + val childAges: List?, ) { companion object { @JvmStatic @@ -26,7 +26,7 @@ data class Room( class Builder( private var adults: Long? = null, - private var childAges: List? = null + private var childAges: List? = null, ) { fun adults(adults: Long?) = apply { this.adults = adults } @@ -35,7 +35,7 @@ data class Room( fun build(): Room = Room( adults = this.adults, - childAges = this.childAges + childAges = this.childAges, ) } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomOccupancyPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomOccupancyPolicy.kt index 784bbeea1..86a4e7ac8 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomOccupancyPolicy.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomOccupancyPolicy.kt @@ -13,38 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.AgeClassRestriction import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Room occupancy policy. +* Room occupancy policy. * @param maxGuestCount The maximum number of guests allowed to stay in a room. * @param minCheckInAge The minimum age required for check-in. * @param includedGuestCount The number of guests included in base rate. * @param minGuestAge The minimum age required for any guest staying in the room. * @param ageClassRestrictions Container for room occupancy rules based on the age of the guests. - */ +*/ data class RoomOccupancyPolicy( // The maximum number of guests allowed to stay in a room. @JsonProperty("MaxGuestCount") @@ -60,9 +41,11 @@ data class RoomOccupancyPolicy( val minGuestAge: kotlin.Int? = null, // Container for room occupancy rules based on the age of the guests. @JsonProperty("AgeClassRestrictions") - @field:Valid - val ageClassRestrictions: kotlin.collections.List? = null + val ageClassRestrictions: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -73,7 +56,7 @@ data class RoomOccupancyPolicy( private var minCheckInAge: kotlin.Int? = null, private var includedGuestCount: kotlin.Int? = null, private var minGuestAge: kotlin.Int? = null, - private var ageClassRestrictions: kotlin.collections.List? = null + private var ageClassRestrictions: kotlin.collections.List? = null, ) { fun maxGuestCount(maxGuestCount: kotlin.Int?) = apply { this.maxGuestCount = maxGuestCount } @@ -92,31 +75,11 @@ data class RoomOccupancyPolicy( minCheckInAge = minCheckInAge, includedGuestCount = includedGuestCount, minGuestAge = minGuestAge, - ageClassRestrictions = ageClassRestrictions + ageClassRestrictions = ageClassRestrictions, ) - validate(instance) - return instance } - - private fun validate(instance: RoomOccupancyPolicy) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -125,6 +88,6 @@ data class RoomOccupancyPolicy( minCheckInAge = minCheckInAge, includedGuestCount = includedGuestCount, minGuestAge = minGuestAge, - ageClassRestrictions = ageClassRestrictions + ageClassRestrictions = ageClassRestrictions, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomPreference.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomPreference.kt index 1ff685628..a06d74961 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomPreference.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomPreference.kt @@ -13,43 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for room preferences. +* Container for room preferences. * @param type The type of preference. Options are: SmokingPreference Bed * @param `value` The value of the room preference. For SmokingPreference, options are SmokingOrNonSmoking Smoking NonSmoking For supported Bed Types, please refer to the Related Links section at the bottom of the page. - */ +*/ data class RoomPreference( // The type of preference. Options are: SmokingPreference Bed @JsonProperty("Type") val type: RoomPreference.Type? = null, // The value of the room preference. For SmokingPreference, options are SmokingOrNonSmoking Smoking NonSmoking For supported Bed Types, please refer to the Related Links section at the bottom of the page. @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null + val `value`: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -57,7 +40,7 @@ data class RoomPreference( class Builder( private var type: RoomPreference.Type? = null, - private var `value`: kotlin.String? = null + private var `value`: kotlin.String? = null, ) { fun type(type: RoomPreference.Type?) = apply { this.type = type } @@ -67,48 +50,30 @@ data class RoomPreference( val instance = RoomPreference( type = type, - `value` = `value` + `value` = `value`, ) - validate(instance) - return instance } - - private fun validate(instance: RoomPreference) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( type = type, - `value` = `value` + `value` = `value`, ) /** * The type of preference. Options are: SmokingPreference Bed * Values: SMOKING_PREFERENCE,BED */ - enum class Type(val value: kotlin.String) { + enum class Type( + val value: kotlin.String, + ) { @JsonProperty("SmokingPreference") SMOKING_PREFERENCE("SmokingPreference"), @JsonProperty("Bed") - BED("Bed") + BED("Bed"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRates.kt index 4c7b21ab3..7b6e4af4b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRates.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRates.kt @@ -13,24 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.MandatoryFeesDetail import com.expediagroup.sdk.xap.models.RoomRatesBaseRate import com.expediagroup.sdk.xap.models.RoomRatesNightlyRatesInner @@ -39,12 +23,9 @@ import com.expediagroup.sdk.xap.models.RoomRatesTaxesAndFeesDetailsInner import com.expediagroup.sdk.xap.models.RoomRatesTotalPrice import com.expediagroup.sdk.xap.models.RoomRatesTotalStrikeOutPrice import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param roomIndex Index of which of the requested rooms this entry refers to. * @param baseRate * @param taxesAndFees @@ -53,36 +34,32 @@ import javax.validation.Validation * @param taxesAndFeesDetails The breakdown for taxes and fees for this room for the entire stay. Only visible by configuration. Please contact your Expedia Account Manager if you need this node. * @param mandatoryFeesDetails The breakdown for the taxes and fees that must be paid at the property. * @param nightlyRates Container for the nightly rate of current room. - */ +*/ data class RoomRates( // Index of which of the requested rooms this entry refers to. @JsonProperty("RoomIndex") val roomIndex: kotlin.Int? = null, @JsonProperty("BaseRate") - @field:Valid val baseRate: RoomRatesBaseRate? = null, @JsonProperty("TaxesAndFees") - @field:Valid val taxesAndFees: RoomRatesTaxesAndFees? = null, @JsonProperty("TotalPrice") - @field:Valid val totalPrice: RoomRatesTotalPrice? = null, @JsonProperty("TotalStrikeOutPrice") - @field:Valid val totalStrikeOutPrice: RoomRatesTotalStrikeOutPrice? = null, // The breakdown for taxes and fees for this room for the entire stay. Only visible by configuration. Please contact your Expedia Account Manager if you need this node. @JsonProperty("TaxesAndFeesDetails") - @field:Valid val taxesAndFeesDetails: kotlin.collections.List? = null, // The breakdown for the taxes and fees that must be paid at the property. @JsonProperty("MandatoryFeesDetails") - @field:Valid val mandatoryFeesDetails: kotlin.collections.List? = null, // Container for the nightly rate of current room. @JsonProperty("NightlyRates") - @field:Valid - val nightlyRates: kotlin.collections.List? = null + val nightlyRates: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -96,7 +73,7 @@ data class RoomRates( private var totalStrikeOutPrice: RoomRatesTotalStrikeOutPrice? = null, private var taxesAndFeesDetails: kotlin.collections.List? = null, private var mandatoryFeesDetails: kotlin.collections.List? = null, - private var nightlyRates: kotlin.collections.List? = null + private var nightlyRates: kotlin.collections.List? = null, ) { fun roomIndex(roomIndex: kotlin.Int?) = apply { this.roomIndex = roomIndex } @@ -124,31 +101,11 @@ data class RoomRates( totalStrikeOutPrice = totalStrikeOutPrice, taxesAndFeesDetails = taxesAndFeesDetails, mandatoryFeesDetails = mandatoryFeesDetails, - nightlyRates = nightlyRates + nightlyRates = nightlyRates, ) - validate(instance) - return instance } - - private fun validate(instance: RoomRates) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -160,6 +117,6 @@ data class RoomRates( totalStrikeOutPrice = totalStrikeOutPrice, taxesAndFeesDetails = taxesAndFeesDetails, mandatoryFeesDetails = mandatoryFeesDetails, - nightlyRates = nightlyRates + nightlyRates = nightlyRates, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesBaseRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesBaseRate.kt index d394ff996..37edb9215 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesBaseRate.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesBaseRate.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class RoomRatesBaseRate( // The value of the element being defined. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:Valid val currency: kotlin.String? = null, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null + val localCurrencyPrice: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class RoomRatesBaseRate( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null + private var localCurrencyPrice: Money? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -77,37 +58,17 @@ data class RoomRatesBaseRate( RoomRatesBaseRate( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: RoomRatesBaseRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInner.kt index 343dd3abc..992c412b4 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInner.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param stayDate One date of the property stay * @param baseRate Nightly Base Rate for the selected date of stay. - */ +*/ data class RoomRatesNightlyRatesInner( // One date of the property stay @JsonProperty("StayDate") - @field:Valid val stayDate: kotlin.Any? = null, // Nightly Base Rate for the selected date of stay. @JsonProperty("BaseRate") - @field:Valid - val baseRate: kotlin.Any? = null + val baseRate: kotlin.Any? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class RoomRatesNightlyRatesInner( class Builder( private var stayDate: kotlin.Any? = null, - private var baseRate: kotlin.Any? = null + private var baseRate: kotlin.Any? = null, ) { fun stayDate(stayDate: kotlin.Any?) = apply { this.stayDate = stayDate } @@ -68,36 +50,16 @@ data class RoomRatesNightlyRatesInner( val instance = RoomRatesNightlyRatesInner( stayDate = stayDate, - baseRate = baseRate + baseRate = baseRate, ) - validate(instance) - return instance } - - private fun validate(instance: RoomRatesNightlyRatesInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( stayDate = stayDate, - baseRate = baseRate + baseRate = baseRate, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInnerAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInnerAllOf.kt deleted file mode 100644 index 2120e407b..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInnerAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param stayDate One date of the property stay - * @param baseRate Nightly Base Rate for the selected date of stay. - */ -data class RoomRatesNightlyRatesInnerAllOf( - // One date of the property stay - @JsonProperty("StayDate") - @field:Valid - val stayDate: kotlin.Any? = null, - // Nightly Base Rate for the selected date of stay. - @JsonProperty("BaseRate") - @field:Valid - val baseRate: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var stayDate: kotlin.Any? = null, - private var baseRate: kotlin.Any? = null - ) { - fun stayDate(stayDate: kotlin.Any?) = apply { this.stayDate = stayDate } - - fun baseRate(baseRate: kotlin.Any?) = apply { this.baseRate = baseRate } - - fun build(): RoomRatesNightlyRatesInnerAllOf { - val instance = - RoomRatesNightlyRatesInnerAllOf( - stayDate = stayDate, - baseRate = baseRate - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomRatesNightlyRatesInnerAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - stayDate = stayDate, - baseRate = baseRate - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFees.kt index c954065d2..cdef69c74 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFees.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFees.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class RoomRatesTaxesAndFees( // The value of the element being defined. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:Valid val currency: kotlin.String? = null, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null + val localCurrencyPrice: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class RoomRatesTaxesAndFees( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null + private var localCurrencyPrice: Money? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -77,37 +58,17 @@ data class RoomRatesTaxesAndFees( RoomRatesTaxesAndFees( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: RoomRatesTaxesAndFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInner.kt index e7f4b0ae5..a777bca7b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInner.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param categoryCode Tax or fee category code. * @param amount Tax or fee value. - */ +*/ data class RoomRatesTaxesAndFeesDetailsInner( // Tax or fee category code. @JsonProperty("CategoryCode") - @field:Valid val categoryCode: kotlin.Any? = null, // Tax or fee value. @JsonProperty("Amount") - @field:Valid - val amount: kotlin.Any? = null + val amount: kotlin.Any? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class RoomRatesTaxesAndFeesDetailsInner( class Builder( private var categoryCode: kotlin.Any? = null, - private var amount: kotlin.Any? = null + private var amount: kotlin.Any? = null, ) { fun categoryCode(categoryCode: kotlin.Any?) = apply { this.categoryCode = categoryCode } @@ -68,36 +50,16 @@ data class RoomRatesTaxesAndFeesDetailsInner( val instance = RoomRatesTaxesAndFeesDetailsInner( categoryCode = categoryCode, - amount = amount + amount = amount, ) - validate(instance) - return instance } - - private fun validate(instance: RoomRatesTaxesAndFeesDetailsInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( categoryCode = categoryCode, - amount = amount + amount = amount, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInnerAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInnerAllOf.kt deleted file mode 100644 index ad1bc49e8..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInnerAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param categoryCode Tax or fee category code. - * @param amount Tax or fee value. - */ -data class RoomRatesTaxesAndFeesDetailsInnerAllOf( - // Tax or fee category code. - @JsonProperty("CategoryCode") - @field:Valid - val categoryCode: kotlin.Any? = null, - // Tax or fee value. - @JsonProperty("Amount") - @field:Valid - val amount: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var categoryCode: kotlin.Any? = null, - private var amount: kotlin.Any? = null - ) { - fun categoryCode(categoryCode: kotlin.Any?) = apply { this.categoryCode = categoryCode } - - fun amount(amount: kotlin.Any?) = apply { this.amount = amount } - - fun build(): RoomRatesTaxesAndFeesDetailsInnerAllOf { - val instance = - RoomRatesTaxesAndFeesDetailsInnerAllOf( - categoryCode = categoryCode, - amount = amount - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomRatesTaxesAndFeesDetailsInnerAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - categoryCode = categoryCode, - amount = amount - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalPrice.kt index 1505b956c..5433314b6 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalPrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalPrice.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class RoomRatesTotalPrice( // The value of the element being defined. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:Valid val currency: kotlin.String? = null, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null + val localCurrencyPrice: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class RoomRatesTotalPrice( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null + private var localCurrencyPrice: Money? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -77,37 +58,17 @@ data class RoomRatesTotalPrice( RoomRatesTotalPrice( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: RoomRatesTotalPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalStrikeOutPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalStrikeOutPrice.kt index 536d30cbd..3b4abb91b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalStrikeOutPrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalStrikeOutPrice.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param `value` The value of the element being defined. * @param currency The ISO 4217 Currency Code that the value is expressed in. * @param localCurrencyPrice - */ +*/ data class RoomRatesTotalStrikeOutPrice( // The value of the element being defined. @JsonProperty("Value") - @field:Valid val `value`: kotlin.String? = null, // The ISO 4217 Currency Code that the value is expressed in. @JsonProperty("Currency") - @field:Valid val currency: kotlin.String? = null, @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null + val localCurrencyPrice: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class RoomRatesTotalStrikeOutPrice( class Builder( private var `value`: kotlin.String? = null, private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null + private var localCurrencyPrice: Money? = null, ) { fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } @@ -77,37 +58,17 @@ data class RoomRatesTotalStrikeOutPrice( RoomRatesTotalStrikeOutPrice( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) - validate(instance) - return instance } - - private fun validate(instance: RoomRatesTotalStrikeOutPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( `value` = `value`, currency = currency, - localCurrencyPrice = localCurrencyPrice + localCurrencyPrice = localCurrencyPrice, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomType.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomType.kt index 5b42f0176..9becbe6a6 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomType.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomType.kt @@ -13,24 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.BedType import com.expediagroup.sdk.xap.models.Promotion import com.expediagroup.sdk.xap.models.RatePlan @@ -41,12 +25,9 @@ import com.expediagroup.sdk.xap.models.RoomTypeMediaInner import com.expediagroup.sdk.xap.models.RoomTypePrice import com.expediagroup.sdk.xap.models.RoomTypeStandalonePrice import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param description Text description of the room type. * @param roomKey An encrypted string which includes the information that could be used to address the current room type. `RoomKey` has been renamed as `OfferId`. * @param offerId An encrypted string which includes the information that could be used to address the current room type. @@ -63,69 +44,58 @@ import javax.validation.Validation * @param amenities Container for all room amenities. * @param descriptiveAmenities Container for all room amenities in group. The key is amenity category, the values are the amenity information. The category for grouped amenities in room level will be: - ACCESSIBILITY - BATHROOM - BEDROOM - CLUB_EXEC - FAMILY_FRIENDLY - ENTERTAINMENT - FOOD_AND_DRINK - INTERNET - MORE - OUTDOOR_SPACE - SAFETY * @param media Container for Media elements. - */ +*/ data class RoomType( // Text description of the room type. @JsonProperty("Description") - @field:Valid val description: kotlin.String? = null, // An encrypted string which includes the information that could be used to address the current room type. `RoomKey` has been renamed as `OfferId`. @Deprecated(message = "This property is deprecated.") @JsonProperty("RoomKey") - @field:Valid val roomKey: kotlin.String? = null, // An encrypted string which includes the information that could be used to address the current room type. @JsonProperty("OfferId") - @field:Valid val offerId: kotlin.String? = null, // Name of Merchant that did the initial Authentication. @JsonProperty("MerchantName") - @field:Valid val merchantName: kotlin.String? = null, // Indicate the room type is sold as package or standalone. @JsonProperty("RatePlanType") val ratePlanType: RoomType.RatePlanType? = null, // Container for rate plan information. @JsonProperty("RatePlans") - @field:Valid val ratePlans: kotlin.collections.List? = null, @JsonProperty("Price") - @field:Valid val price: RoomTypePrice? = null, @JsonProperty("StandalonePrice") - @field:Valid val standalonePrice: RoomTypeStandalonePrice? = null, // All promotion information of the room. **Note**: The node has been moved to `RatePlan` node, and will be deprecated soon. @Deprecated(message = "This property is deprecated.") @JsonProperty("Promotions [deprecated]") - @field:Valid val promotionsDeprecated: kotlin.collections.List? = null, @JsonProperty("Links") - @field:Valid val links: RoomTypeLinks? = null, // The smoking options available for the room type. @JsonProperty("SmokingOption") val smokingOption: RoomType.SmokingOption? = null, // Statement of bed types available for this offer. A room may have several bed type options available. **NOTE**: due to the large number of bed type options available, we no longer publish a list of available bed types. More information is available in [Lodging Bed Types](https://developers.expediagroup.com/xap/products/xap/lodging/references/bed-types). @JsonProperty("BedTypeOptions") - @field:Valid val bedTypeOptions: kotlin.collections.List? = null, @JsonProperty("RoomOccupancyPolicy") - @field:Valid val roomOccupancyPolicy: RoomOccupancyPolicy? = null, // Container for all room amenities. @JsonProperty("Amenities") - @field:Valid val amenities: kotlin.collections.List? = null, // Container for all room amenities in group. The key is amenity category, the values are the amenity information. The category for grouped amenities in room level will be: - ACCESSIBILITY - BATHROOM - BEDROOM - CLUB_EXEC - FAMILY_FRIENDLY - ENTERTAINMENT - FOOD_AND_DRINK - INTERNET - MORE - OUTDOOR_SPACE - SAFETY @JsonProperty("DescriptiveAmenities") - @field:Valid val descriptiveAmenities: kotlin.collections.Map>? = null, // Container for Media elements. @JsonProperty("Media") - @field:Valid - val media: kotlin.collections.List? = null + val media: kotlin.collections.List? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -147,7 +117,7 @@ data class RoomType( private var roomOccupancyPolicy: RoomOccupancyPolicy? = null, private var amenities: kotlin.collections.List? = null, private var descriptiveAmenities: kotlin.collections.Map>? = null, - private var media: kotlin.collections.List? = null + private var media: kotlin.collections.List? = null, ) { fun description(description: kotlin.String?) = apply { this.description = description } @@ -203,31 +173,11 @@ data class RoomType( roomOccupancyPolicy = roomOccupancyPolicy, amenities = amenities, descriptiveAmenities = descriptiveAmenities, - media = media + media = media, ) - validate(instance) - return instance } - - private fun validate(instance: RoomType) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -247,14 +197,16 @@ data class RoomType( roomOccupancyPolicy = roomOccupancyPolicy, amenities = amenities, descriptiveAmenities = descriptiveAmenities, - media = media + media = media, ) /** * Indicate the room type is sold as package or standalone. * Values: STANDALONE,PACKAGE,WHOLESALE */ - enum class RatePlanType(val value: kotlin.String) { + enum class RatePlanType( + val value: kotlin.String, + ) { @JsonProperty("standalone") STANDALONE("standalone"), @@ -262,14 +214,16 @@ data class RoomType( PACKAGE("package"), @JsonProperty("wholesale") - WHOLESALE("wholesale") + WHOLESALE("wholesale"), } /** * The smoking options available for the room type. * Values: SMOKING_OR_NON_SMOKING,SMOKING,NON_SMOKING */ - enum class SmokingOption(val value: kotlin.String) { + enum class SmokingOption( + val value: kotlin.String, + ) { @JsonProperty("SmokingOrNonSmoking") SMOKING_OR_NON_SMOKING("SmokingOrNonSmoking"), @@ -277,6 +231,6 @@ data class RoomType( SMOKING("Smoking"), @JsonProperty("NonSmoking") - NON_SMOKING("NonSmoking") + NON_SMOKING("NonSmoking"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInner.kt index 7e419fa50..33dfe06d4 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInner.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param id Amenity id * @param name Amenity name - */ +*/ data class RoomTypeAmenitiesInner( // Amenity id @JsonProperty("Id") - @field:Valid val id: kotlin.Any? = null, // Amenity name @JsonProperty("Name") - @field:Valid - val name: kotlin.Any? = null + val name: kotlin.Any? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class RoomTypeAmenitiesInner( class Builder( private var id: kotlin.Any? = null, - private var name: kotlin.Any? = null + private var name: kotlin.Any? = null, ) { fun id(id: kotlin.Any?) = apply { this.id = id } @@ -68,36 +50,16 @@ data class RoomTypeAmenitiesInner( val instance = RoomTypeAmenitiesInner( id = id, - name = name + name = name, ) - validate(instance) - return instance } - - private fun validate(instance: RoomTypeAmenitiesInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( id = id, - name = name + name = name, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInnerAllOf.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInnerAllOf.kt deleted file mode 100644 index fefe33cec..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInnerAllOf.kt +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * - * @param id Amenity id - * @param name Amenity name - */ -data class RoomTypeAmenitiesInnerAllOf( - // Amenity id - @JsonProperty("Id") - @field:Valid - val id: kotlin.Any? = null, - // Amenity name - @JsonProperty("Name") - @field:Valid - val name: kotlin.Any? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var id: kotlin.Any? = null, - private var name: kotlin.Any? = null - ) { - fun id(id: kotlin.Any?) = apply { this.id = id } - - fun name(name: kotlin.Any?) = apply { this.name = name } - - fun build(): RoomTypeAmenitiesInnerAllOf { - val instance = - RoomTypeAmenitiesInnerAllOf( - id = id, - name = name - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomTypeAmenitiesInnerAllOf) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - id = id, - name = name - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinks.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinks.kt index 20e424b4b..a88c91238 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinks.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinks.kt @@ -13,50 +13,31 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.HotelLinksWebSearchResult import com.expediagroup.sdk.xap.models.Link import com.expediagroup.sdk.xap.models.RoomTypeLinksApiDetails import com.expediagroup.sdk.xap.models.RoomTypeLinksWebDetails import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for list of HATEOAS links to either Expedia website or additional Expedia APIs to complete booking of the selected offer. Which links are returned in this section are defined by the `links` parameter in the Search API query. Available links are: - WebSearchResult (link to web search result page) - WebDetails (link to web infosite) - ApiDetails (link for details API) +* Container for list of HATEOAS links to either Expedia website or additional Expedia APIs to complete booking of the selected offer. Which links are returned in this section are defined by the `links` parameter in the Search API query. Available links are: - WebSearchResult (link to web search result page) - WebDetails (link to web infosite) - ApiDetails (link for details API) * @param webSearchResult * @param webDetails * @param apiDetails - */ +*/ data class RoomTypeLinks( @JsonProperty("WebSearchResult") - @field:Valid val webSearchResult: HotelLinksWebSearchResult? = null, @JsonProperty("WebDetails") - @field:Valid val webDetails: RoomTypeLinksWebDetails? = null, @JsonProperty("ApiDetails") - @field:Valid - val apiDetails: RoomTypeLinksApiDetails? = null + val apiDetails: RoomTypeLinksApiDetails? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -65,7 +46,7 @@ data class RoomTypeLinks( class Builder( private var webSearchResult: HotelLinksWebSearchResult? = null, private var webDetails: RoomTypeLinksWebDetails? = null, - private var apiDetails: RoomTypeLinksApiDetails? = null + private var apiDetails: RoomTypeLinksApiDetails? = null, ) { fun webSearchResult(webSearchResult: HotelLinksWebSearchResult?) = apply { this.webSearchResult = webSearchResult } @@ -78,37 +59,17 @@ data class RoomTypeLinks( RoomTypeLinks( webSearchResult = webSearchResult, webDetails = webDetails, - apiDetails = apiDetails + apiDetails = apiDetails, ) - validate(instance) - return instance } - - private fun validate(instance: RoomTypeLinks) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( webSearchResult = webSearchResult, webDetails = webDetails, - apiDetails = apiDetails + apiDetails = apiDetails, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksApiDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksApiDetails.kt index 510b729bc..5f9f1397a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksApiDetails.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksApiDetails.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param accept The Accept request header (for API queries only - not included for page URLs). * @param method Method of request. * @param href The URL of the destination web page or API query. - */ +*/ data class RoomTypeLinksApiDetails( // The Accept request header (for API queries only - not included for page URLs). @JsonProperty("Accept") - @field:Valid val accept: kotlin.String? = null, // Method of request. @JsonProperty("Method") - @field:Valid val method: kotlin.String? = null, // The URL of the destination web page or API query. @JsonProperty("Href") - @field:Valid - val href: kotlin.String? = null + val href: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class RoomTypeLinksApiDetails( class Builder( private var accept: kotlin.String? = null, private var method: kotlin.String? = null, - private var href: kotlin.String? = null + private var href: kotlin.String? = null, ) { fun accept(accept: kotlin.String?) = apply { this.accept = accept } @@ -77,37 +58,17 @@ data class RoomTypeLinksApiDetails( RoomTypeLinksApiDetails( accept = accept, method = method, - href = href + href = href, ) - validate(instance) - return instance } - - private fun validate(instance: RoomTypeLinksApiDetails) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( accept = accept, method = method, - href = href + href = href, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksWebDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksWebDetails.kt index 90367647f..279b7426b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksWebDetails.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksWebDetails.kt @@ -13,49 +13,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param accept The Accept request header (for API queries only - not included for page URLs). * @param method Method of request. * @param href The URL of the destination web page or API query. - */ +*/ data class RoomTypeLinksWebDetails( // The Accept request header (for API queries only - not included for page URLs). @JsonProperty("Accept") - @field:Valid val accept: kotlin.String? = null, // Method of request. @JsonProperty("Method") - @field:Valid val method: kotlin.String? = null, // The URL of the destination web page or API query. @JsonProperty("Href") - @field:Valid - val href: kotlin.String? = null + val href: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -64,7 +45,7 @@ data class RoomTypeLinksWebDetails( class Builder( private var accept: kotlin.String? = null, private var method: kotlin.String? = null, - private var href: kotlin.String? = null + private var href: kotlin.String? = null, ) { fun accept(accept: kotlin.String?) = apply { this.accept = accept } @@ -77,37 +58,17 @@ data class RoomTypeLinksWebDetails( RoomTypeLinksWebDetails( accept = accept, method = method, - href = href + href = href, ) - validate(instance) - return instance } - - private fun validate(instance: RoomTypeLinksWebDetails) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( accept = accept, method = method, - href = href + href = href, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeMediaInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeMediaInner.kt index c70093121..ed41738d6 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeMediaInner.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeMediaInner.kt @@ -13,53 +13,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param type Supported type of media. 1=Image. Only 1 is supported now. * @param title Image title * @param propertySize Image size. You can find a link to the complete list of Supported Images Sizes in [Lodging Image Captions, IDs, and Sizes](https://developers.expediagroup.com/xap/products/xap/lodging/references/image-captions-ids-and-sizes). * @param url Image URL - */ +*/ data class RoomTypeMediaInner( // Supported type of media. 1=Image. Only 1 is supported now. @JsonProperty("Type") val type: RoomTypeMediaInner.Type? = null, // Image title @JsonProperty("Title") - @field:Valid val title: kotlin.String? = null, // Image size. You can find a link to the complete list of Supported Images Sizes in [Lodging Image Captions, IDs, and Sizes](https://developers.expediagroup.com/xap/products/xap/lodging/references/image-captions-ids-and-sizes). @JsonProperty("Size") - @field:Valid val propertySize: kotlin.String? = null, // Image URL @JsonProperty("Url") - @field:Valid - val url: kotlin.String? = null + val url: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -69,7 +50,7 @@ data class RoomTypeMediaInner( private var type: RoomTypeMediaInner.Type? = null, private var title: kotlin.String? = null, private var propertySize: kotlin.String? = null, - private var url: kotlin.String? = null + private var url: kotlin.String? = null, ) { fun type(type: RoomTypeMediaInner.Type?) = apply { this.type = type } @@ -85,31 +66,11 @@ data class RoomTypeMediaInner( type = type, title = title, propertySize = propertySize, - url = url + url = url, ) - validate(instance) - return instance } - - private fun validate(instance: RoomTypeMediaInner) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -117,15 +78,17 @@ data class RoomTypeMediaInner( type = type, title = title, propertySize = propertySize, - url = url + url = url, ) /** * Supported type of media. 1=Image. Only 1 is supported now. * Values: _1 */ - enum class Type(val value: kotlin.String) { + enum class Type( + val value: kotlin.String, + ) { @JsonProperty("1") - _1("1") + _1("1"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePrice.kt index d2fbf24c9..112356417 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePrice.kt @@ -13,132 +13,102 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.RatePlanPriceBaseRate -import com.expediagroup.sdk.xap.models.RatePlanPriceHotelMandatoryFees -import com.expediagroup.sdk.xap.models.RatePlanPriceTaxesAndFees -import com.expediagroup.sdk.xap.models.RoomTypePriceAvgNightlyRate -import com.expediagroup.sdk.xap.models.RoomTypePriceAvgNightlyRateWithFees -import com.expediagroup.sdk.xap.models.RoomTypePriceAvgNightlyStrikeOutRate -import com.expediagroup.sdk.xap.models.RoomTypePriceAvgNightlyStrikeoutRateWithFees -import com.expediagroup.sdk.xap.models.RoomTypePriceRefundableDamageDeposit -import com.expediagroup.sdk.xap.models.RoomTypePriceTotalPrice -import com.expediagroup.sdk.xap.models.RoomTypePriceTotalPriceWithHotelFees -import com.expediagroup.sdk.xap.models.RoomTypePriceTotalStrikeOutPrice +import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container of all price components of the room. - * @param baseRate - * @param taxesAndFees - * @param totalPrice - * @param totalStrikeOutPrice - * @param avgNightlyRate - * @param avgNightlyStrikeOutRate - * @param avgNightlyRateWithFees - * @param avgNightlyStrikeoutRateWithFees - * @param hotelMandatoryFees - * @param totalPriceWithHotelFees - * @param refundableDamageDeposit - */ +* Container of all price components of the room. + * @param baseRate The price of the rate plan for all occupants, excluding taxes and fees. + * @param taxesAndFees The total rate of taxes and fees of the rate plan for all occupants. + * @param totalPrice The total price of the rate plan, which is equal to the sum of `BaseRate` and `TaxesAndFees`. Hotel mandatory fees are not included as these are paid at the hotel at checkout. + * @param totalStrikeOutPrice The total strike out price of the rate plan, which is equal to the sum of `BaseRate`'s `totalStrikeOut` and `TaxesAndFees`'s `totalStrikeOut`. + * @param avgNightlyRate The average nightly base rate per night per room of the room type, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. + * @param avgNightlyStrikeOutRate The average nightly strike out rate per night per room of the room type, which is equal to the strike out of `BaseRate` divided by `StayDates` and by `room number`. + * @param avgNightlyRateWithFees The average nightly rate per night per room of the room type, including all fees except those imposed by the government. + * @param avgNightlyStrikeoutRateWithFees The average nightly strike out rate per night per room of the room type, including all fees except those imposed by the government. + * @param hotelMandatoryFees The total mandatory fees which will be charged at the hotel for the rate plan. + * @param totalPriceWithHotelFees The total combined price that includes `TotalPrice` that will be charged by Expedia (`BaseRate` + `TaxesAndFees`) combined with any `HotelMandatoryFees` that will be charged at hotel. **NOTE**: Since UK regulations require that `HotelMandatoryFees` be included in this price, the quoted price will only be accurate for the day of quote. This is due to the fact that currency exchange fluctuations will change the exact amount of any `HotelMandatoryFees` that are to be collected at the hotel during the guest's stay if the cost is converted into any other currency. **CMA Compliance Note (UK)**: Websites doing business in the UK should be displaying this value to be compliant with CMA requirements. + * @param refundableDamageDeposit The refundable damage deposit for the rate plan. +*/ data class RoomTypePrice( + // The price of the rate plan for all occupants, excluding taxes and fees. @JsonProperty("BaseRate") - @field:Valid - val baseRate: RatePlanPriceBaseRate? = null, + val baseRate: Money? = null, + // The total rate of taxes and fees of the rate plan for all occupants. @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: RatePlanPriceTaxesAndFees? = null, + val taxesAndFees: Money? = null, + // The total price of the rate plan, which is equal to the sum of `BaseRate` and `TaxesAndFees`. Hotel mandatory fees are not included as these are paid at the hotel at checkout. @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: RoomTypePriceTotalPrice? = null, + val totalPrice: Money? = null, + // The total strike out price of the rate plan, which is equal to the sum of `BaseRate`'s `totalStrikeOut` and `TaxesAndFees`'s `totalStrikeOut`. @JsonProperty("TotalStrikeOutPrice") - @field:Valid - val totalStrikeOutPrice: RoomTypePriceTotalStrikeOutPrice? = null, + val totalStrikeOutPrice: Money? = null, + // The average nightly base rate per night per room of the room type, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. @JsonProperty("AvgNightlyRate") - @field:Valid - val avgNightlyRate: RoomTypePriceAvgNightlyRate? = null, + val avgNightlyRate: Money? = null, + // The average nightly strike out rate per night per room of the room type, which is equal to the strike out of `BaseRate` divided by `StayDates` and by `room number`. @JsonProperty("AvgNightlyStrikeOutRate") - @field:Valid - val avgNightlyStrikeOutRate: RoomTypePriceAvgNightlyStrikeOutRate? = null, + val avgNightlyStrikeOutRate: Money? = null, + // The average nightly rate per night per room of the room type, including all fees except those imposed by the government. @JsonProperty("AvgNightlyRateWithFees") - @field:Valid - val avgNightlyRateWithFees: RoomTypePriceAvgNightlyRateWithFees? = null, + val avgNightlyRateWithFees: Money? = null, + // The average nightly strike out rate per night per room of the room type, including all fees except those imposed by the government. @JsonProperty("AvgNightlyStrikeoutRateWithFees") - @field:Valid - val avgNightlyStrikeoutRateWithFees: RoomTypePriceAvgNightlyStrikeoutRateWithFees? = null, + val avgNightlyStrikeoutRateWithFees: Money? = null, + // The total mandatory fees which will be charged at the hotel for the rate plan. @JsonProperty("HotelMandatoryFees") - @field:Valid - val hotelMandatoryFees: RatePlanPriceHotelMandatoryFees? = null, + val hotelMandatoryFees: Money? = null, + // The total combined price that includes `TotalPrice` that will be charged by Expedia (`BaseRate` + `TaxesAndFees`) combined with any `HotelMandatoryFees` that will be charged at hotel. **NOTE**: Since UK regulations require that `HotelMandatoryFees` be included in this price, the quoted price will only be accurate for the day of quote. This is due to the fact that currency exchange fluctuations will change the exact amount of any `HotelMandatoryFees` that are to be collected at the hotel during the guest's stay if the cost is converted into any other currency. **CMA Compliance Note (UK)**: Websites doing business in the UK should be displaying this value to be compliant with CMA requirements. @JsonProperty("TotalPriceWithHotelFees") - @field:Valid - val totalPriceWithHotelFees: RoomTypePriceTotalPriceWithHotelFees? = null, + val totalPriceWithHotelFees: Money? = null, + // The refundable damage deposit for the rate plan. @JsonProperty("RefundableDamageDeposit") - @field:Valid - val refundableDamageDeposit: RoomTypePriceRefundableDamageDeposit? = null + val refundableDamageDeposit: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() } class Builder( - private var baseRate: RatePlanPriceBaseRate? = null, - private var taxesAndFees: RatePlanPriceTaxesAndFees? = null, - private var totalPrice: RoomTypePriceTotalPrice? = null, - private var totalStrikeOutPrice: RoomTypePriceTotalStrikeOutPrice? = null, - private var avgNightlyRate: RoomTypePriceAvgNightlyRate? = null, - private var avgNightlyStrikeOutRate: RoomTypePriceAvgNightlyStrikeOutRate? = null, - private var avgNightlyRateWithFees: RoomTypePriceAvgNightlyRateWithFees? = null, - private var avgNightlyStrikeoutRateWithFees: RoomTypePriceAvgNightlyStrikeoutRateWithFees? = null, - private var hotelMandatoryFees: RatePlanPriceHotelMandatoryFees? = null, - private var totalPriceWithHotelFees: RoomTypePriceTotalPriceWithHotelFees? = null, - private var refundableDamageDeposit: RoomTypePriceRefundableDamageDeposit? = null + private var baseRate: Money? = null, + private var taxesAndFees: Money? = null, + private var totalPrice: Money? = null, + private var totalStrikeOutPrice: Money? = null, + private var avgNightlyRate: Money? = null, + private var avgNightlyStrikeOutRate: Money? = null, + private var avgNightlyRateWithFees: Money? = null, + private var avgNightlyStrikeoutRateWithFees: Money? = null, + private var hotelMandatoryFees: Money? = null, + private var totalPriceWithHotelFees: Money? = null, + private var refundableDamageDeposit: Money? = null, ) { - fun baseRate(baseRate: RatePlanPriceBaseRate?) = apply { this.baseRate = baseRate } + fun baseRate(baseRate: Money?) = apply { this.baseRate = baseRate } - fun taxesAndFees(taxesAndFees: RatePlanPriceTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } + fun taxesAndFees(taxesAndFees: Money?) = apply { this.taxesAndFees = taxesAndFees } - fun totalPrice(totalPrice: RoomTypePriceTotalPrice?) = apply { this.totalPrice = totalPrice } + fun totalPrice(totalPrice: Money?) = apply { this.totalPrice = totalPrice } - fun totalStrikeOutPrice(totalStrikeOutPrice: RoomTypePriceTotalStrikeOutPrice?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } + fun totalStrikeOutPrice(totalStrikeOutPrice: Money?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } - fun avgNightlyRate(avgNightlyRate: RoomTypePriceAvgNightlyRate?) = apply { this.avgNightlyRate = avgNightlyRate } + fun avgNightlyRate(avgNightlyRate: Money?) = apply { this.avgNightlyRate = avgNightlyRate } - fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: RoomTypePriceAvgNightlyStrikeOutRate?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } + fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: Money?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } - fun avgNightlyRateWithFees(avgNightlyRateWithFees: RoomTypePriceAvgNightlyRateWithFees?) = apply { this.avgNightlyRateWithFees = avgNightlyRateWithFees } + fun avgNightlyRateWithFees(avgNightlyRateWithFees: Money?) = apply { this.avgNightlyRateWithFees = avgNightlyRateWithFees } - fun avgNightlyStrikeoutRateWithFees(avgNightlyStrikeoutRateWithFees: RoomTypePriceAvgNightlyStrikeoutRateWithFees?) = - apply { - this.avgNightlyStrikeoutRateWithFees = - avgNightlyStrikeoutRateWithFees - } + fun avgNightlyStrikeoutRateWithFees(avgNightlyStrikeoutRateWithFees: Money?) = apply { this.avgNightlyStrikeoutRateWithFees = avgNightlyStrikeoutRateWithFees } - fun hotelMandatoryFees(hotelMandatoryFees: RatePlanPriceHotelMandatoryFees?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } + fun hotelMandatoryFees(hotelMandatoryFees: Money?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } - fun totalPriceWithHotelFees(totalPriceWithHotelFees: RoomTypePriceTotalPriceWithHotelFees?) = apply { this.totalPriceWithHotelFees = totalPriceWithHotelFees } + fun totalPriceWithHotelFees(totalPriceWithHotelFees: Money?) = apply { this.totalPriceWithHotelFees = totalPriceWithHotelFees } - fun refundableDamageDeposit(refundableDamageDeposit: RoomTypePriceRefundableDamageDeposit?) = apply { this.refundableDamageDeposit = refundableDamageDeposit } + fun refundableDamageDeposit(refundableDamageDeposit: Money?) = apply { this.refundableDamageDeposit = refundableDamageDeposit } fun build(): RoomTypePrice { val instance = @@ -153,31 +123,11 @@ data class RoomTypePrice( avgNightlyStrikeoutRateWithFees = avgNightlyStrikeoutRateWithFees, hotelMandatoryFees = hotelMandatoryFees, totalPriceWithHotelFees = totalPriceWithHotelFees, - refundableDamageDeposit = refundableDamageDeposit + refundableDamageDeposit = refundableDamageDeposit, ) - validate(instance) - return instance } - - private fun validate(instance: RoomTypePrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -192,6 +142,6 @@ data class RoomTypePrice( avgNightlyStrikeoutRateWithFees = avgNightlyStrikeoutRateWithFees, hotelMandatoryFees = hotelMandatoryFees, totalPriceWithHotelFees = totalPriceWithHotelFees, - refundableDamageDeposit = refundableDamageDeposit + refundableDamageDeposit = refundableDamageDeposit, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyRate.kt deleted file mode 100644 index 88210c328..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyRate.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The average nightly base rate per night per room of the room type, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RoomTypePriceAvgNightlyRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RoomTypePriceAvgNightlyRate { - val instance = - RoomTypePriceAvgNightlyRate( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomTypePriceAvgNightlyRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyRateWithFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyRateWithFees.kt deleted file mode 100644 index 837173151..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyRateWithFees.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The average nightly rate per night per room of the room type, including all fees except those imposed by the government. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RoomTypePriceAvgNightlyRateWithFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RoomTypePriceAvgNightlyRateWithFees { - val instance = - RoomTypePriceAvgNightlyRateWithFees( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomTypePriceAvgNightlyRateWithFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyStrikeOutRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyStrikeOutRate.kt deleted file mode 100644 index c1137a3b7..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyStrikeOutRate.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The average nightly strike out rate per night per room of the room type, which is equal to the strike out of `BaseRate` divided by `StayDates` and by `room number`. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RoomTypePriceAvgNightlyStrikeOutRate( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RoomTypePriceAvgNightlyStrikeOutRate { - val instance = - RoomTypePriceAvgNightlyStrikeOutRate( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomTypePriceAvgNightlyStrikeOutRate) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyStrikeoutRateWithFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyStrikeoutRateWithFees.kt deleted file mode 100644 index 05a62a690..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyStrikeoutRateWithFees.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The average nightly strike out rate per night per room of the room type, including all fees except those imposed by the government. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RoomTypePriceAvgNightlyStrikeoutRateWithFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RoomTypePriceAvgNightlyStrikeoutRateWithFees { - val instance = - RoomTypePriceAvgNightlyStrikeoutRateWithFees( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomTypePriceAvgNightlyStrikeoutRateWithFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceRefundableDamageDeposit.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceRefundableDamageDeposit.kt deleted file mode 100644 index b579bee8b..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceRefundableDamageDeposit.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The refundable damage deposit for the rate plan. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RoomTypePriceRefundableDamageDeposit( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RoomTypePriceRefundableDamageDeposit { - val instance = - RoomTypePriceRefundableDamageDeposit( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomTypePriceRefundableDamageDeposit) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalPrice.kt deleted file mode 100644 index b77edc08d..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalPrice.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total price of the rate plan, which is equal to the sum of `BaseRate` and `TaxesAndFees`. Hotel mandatory fees are not included as these are paid at the hotel at checkout. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RoomTypePriceTotalPrice( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RoomTypePriceTotalPrice { - val instance = - RoomTypePriceTotalPrice( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomTypePriceTotalPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalPriceWithHotelFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalPriceWithHotelFees.kt deleted file mode 100644 index ff1db94d0..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalPriceWithHotelFees.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total combined price that includes `TotalPrice` that will be charged by Expedia (`BaseRate` + `TaxesAndFees`) combined with any `HotelMandatoryFees` that will be charged at hotel. **NOTE**: Since UK regulations require that `HotelMandatoryFees` be included in this price, the quoted price will only be accurate for the day of quote. This is due to the fact that currency exchange fluctuations will change the exact amount of any `HotelMandatoryFees` that are to be collected at the hotel during the guest's stay if the cost is converted into any other currency. **CMA Compliance Note (UK)**: Websites doing business in the UK should be displaying this value to be compliant with CMA requirements. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RoomTypePriceTotalPriceWithHotelFees( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RoomTypePriceTotalPriceWithHotelFees { - val instance = - RoomTypePriceTotalPriceWithHotelFees( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomTypePriceTotalPriceWithHotelFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalStrikeOutPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalStrikeOutPrice.kt deleted file mode 100644 index 5e044604d..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalStrikeOutPrice.kt +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models - -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.Money -import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation - -/** - * The total strike out price of the rate plan, which is equal to the sum of `BaseRate`'s `totalStrikeOut` and `TaxesAndFees`'s `totalStrikeOut`. - * @param `value` The value of the element being defined. - * @param currency The ISO 4217 Currency Code that the value is expressed in. - * @param localCurrencyPrice - */ -data class RoomTypePriceTotalStrikeOutPrice( - // The value of the element being defined. - @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null, - // The ISO 4217 Currency Code that the value is expressed in. - @JsonProperty("Currency") - @field:Valid - val currency: kotlin.String? = null, - @JsonProperty("LocalCurrencyPrice") - @field:Valid - val localCurrencyPrice: Money? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var `value`: kotlin.String? = null, - private var currency: kotlin.String? = null, - private var localCurrencyPrice: Money? = null - ) { - fun `value`(`value`: kotlin.String?) = apply { this.`value` = `value` } - - fun currency(currency: kotlin.String?) = apply { this.currency = currency } - - fun localCurrencyPrice(localCurrencyPrice: Money?) = apply { this.localCurrencyPrice = localCurrencyPrice } - - fun build(): RoomTypePriceTotalStrikeOutPrice { - val instance = - RoomTypePriceTotalStrikeOutPrice( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) - - validate(instance) - - return instance - } - - private fun validate(instance: RoomTypePriceTotalStrikeOutPrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } - } - - fun toBuilder() = - Builder( - `value` = `value`, - currency = currency, - localCurrencyPrice = localCurrencyPrice - ) -} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeStandalonePrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeStandalonePrice.kt index 2d55a3109..7bf77f6da 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeStandalonePrice.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeStandalonePrice.kt @@ -13,124 +13,95 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceAvgNightlyRate -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceAvgNightlyStrikeOutRate -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceBaseRate -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceHotelMandatoryFees -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceStrikeOutBaseRate -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceStrikeOutHotelMandatoryFees -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceStrikeOutTaxesAndFees -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceTaxesAndFees -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceTotalPrice -import com.expediagroup.sdk.xap.models.RatePlanStandalonePriceTotalStrikeOutPrice +import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * The corresponded standalone price to the package rate plan (to show the `strikethrough`). Only returned when this is a package rate plan. - * @param baseRate - * @param strikeOutBaseRate - * @param taxesAndFees - * @param strikeOutTaxesAndFees - * @param totalPrice - * @param totalStrikeOutPrice - * @param avgNightlyRate - * @param avgNightlyStrikeOutRate - * @param hotelMandatoryFees - * @param strikeOutHotelMandatoryFees - */ +* The corresponded standalone price to the package rate plan (to show the `strikethrough`). Only returned when this is a package rate plan. + * @param baseRate The standalone price of the rate plan for all occupants, excluding taxes and fees. + * @param strikeOutBaseRate The base rate strikeout in the standalone shopping path. + * @param taxesAndFees The total standalone rate of taxes and fees of the rate plan for all occupants. + * @param strikeOutTaxesAndFees The taxes and fees strikeout in the standalone shopping path. + * @param totalPrice The total standalone price of the rate plan, which is equal to the sum of `BaseRate` and `TaxesAndFees`. Hotel mandatory fees are not included as these are paid at the hotel at checkout. + * @param totalStrikeOutPrice The total strikeout in the standalone shopping path, which is equal to the sum of `StrikeOutBaseRate` and `StrikeOutTaxesAndFees`. + * @param avgNightlyRate The average standalone nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. + * @param avgNightlyStrikeOutRate The average strikeout of the base rate in the standalone shopping path, which is per night per room and is equal to `StrikeOutBaseRate` divided by `StayDates` and by `room number`. + * @param hotelMandatoryFees The total standalone mandatory fees. + * @param strikeOutHotelMandatoryFees The strikeout of the mandatory fees in the standalone shopping path. +*/ data class RoomTypeStandalonePrice( + // The standalone price of the rate plan for all occupants, excluding taxes and fees. @JsonProperty("BaseRate") - @field:Valid - val baseRate: RatePlanStandalonePriceBaseRate? = null, + val baseRate: Money? = null, + // The base rate strikeout in the standalone shopping path. @JsonProperty("StrikeOutBaseRate") - @field:Valid - val strikeOutBaseRate: RatePlanStandalonePriceStrikeOutBaseRate? = null, + val strikeOutBaseRate: Money? = null, + // The total standalone rate of taxes and fees of the rate plan for all occupants. @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: RatePlanStandalonePriceTaxesAndFees? = null, + val taxesAndFees: Money? = null, + // The taxes and fees strikeout in the standalone shopping path. @JsonProperty("StrikeOutTaxesAndFees") - @field:Valid - val strikeOutTaxesAndFees: RatePlanStandalonePriceStrikeOutTaxesAndFees? = null, + val strikeOutTaxesAndFees: Money? = null, + // The total standalone price of the rate plan, which is equal to the sum of `BaseRate` and `TaxesAndFees`. Hotel mandatory fees are not included as these are paid at the hotel at checkout. @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: RatePlanStandalonePriceTotalPrice? = null, + val totalPrice: Money? = null, + // The total strikeout in the standalone shopping path, which is equal to the sum of `StrikeOutBaseRate` and `StrikeOutTaxesAndFees`. @JsonProperty("TotalStrikeOutPrice") - @field:Valid - val totalStrikeOutPrice: RatePlanStandalonePriceTotalStrikeOutPrice? = null, + val totalStrikeOutPrice: Money? = null, + // The average standalone nightly base rate per night per room of the rate plan, which is equal to the `BaseRate` divided by `StayDates` and by `room number`. @JsonProperty("AvgNightlyRate") - @field:Valid - val avgNightlyRate: RatePlanStandalonePriceAvgNightlyRate? = null, + val avgNightlyRate: Money? = null, + // The average strikeout of the base rate in the standalone shopping path, which is per night per room and is equal to `StrikeOutBaseRate` divided by `StayDates` and by `room number`. @JsonProperty("AvgNightlyStrikeOutRate") - @field:Valid - val avgNightlyStrikeOutRate: RatePlanStandalonePriceAvgNightlyStrikeOutRate? = null, + val avgNightlyStrikeOutRate: Money? = null, + // The total standalone mandatory fees. @JsonProperty("HotelMandatoryFees") - @field:Valid - val hotelMandatoryFees: RatePlanStandalonePriceHotelMandatoryFees? = null, + val hotelMandatoryFees: Money? = null, + // The strikeout of the mandatory fees in the standalone shopping path. @JsonProperty("StrikeOutHotelMandatoryFees") - @field:Valid - val strikeOutHotelMandatoryFees: RatePlanStandalonePriceStrikeOutHotelMandatoryFees? = null + val strikeOutHotelMandatoryFees: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() } class Builder( - private var baseRate: RatePlanStandalonePriceBaseRate? = null, - private var strikeOutBaseRate: RatePlanStandalonePriceStrikeOutBaseRate? = null, - private var taxesAndFees: RatePlanStandalonePriceTaxesAndFees? = null, - private var strikeOutTaxesAndFees: RatePlanStandalonePriceStrikeOutTaxesAndFees? = null, - private var totalPrice: RatePlanStandalonePriceTotalPrice? = null, - private var totalStrikeOutPrice: RatePlanStandalonePriceTotalStrikeOutPrice? = null, - private var avgNightlyRate: RatePlanStandalonePriceAvgNightlyRate? = null, - private var avgNightlyStrikeOutRate: RatePlanStandalonePriceAvgNightlyStrikeOutRate? = null, - private var hotelMandatoryFees: RatePlanStandalonePriceHotelMandatoryFees? = null, - private var strikeOutHotelMandatoryFees: RatePlanStandalonePriceStrikeOutHotelMandatoryFees? = null + private var baseRate: Money? = null, + private var strikeOutBaseRate: Money? = null, + private var taxesAndFees: Money? = null, + private var strikeOutTaxesAndFees: Money? = null, + private var totalPrice: Money? = null, + private var totalStrikeOutPrice: Money? = null, + private var avgNightlyRate: Money? = null, + private var avgNightlyStrikeOutRate: Money? = null, + private var hotelMandatoryFees: Money? = null, + private var strikeOutHotelMandatoryFees: Money? = null, ) { - fun baseRate(baseRate: RatePlanStandalonePriceBaseRate?) = apply { this.baseRate = baseRate } + fun baseRate(baseRate: Money?) = apply { this.baseRate = baseRate } - fun strikeOutBaseRate(strikeOutBaseRate: RatePlanStandalonePriceStrikeOutBaseRate?) = apply { this.strikeOutBaseRate = strikeOutBaseRate } + fun strikeOutBaseRate(strikeOutBaseRate: Money?) = apply { this.strikeOutBaseRate = strikeOutBaseRate } - fun taxesAndFees(taxesAndFees: RatePlanStandalonePriceTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } + fun taxesAndFees(taxesAndFees: Money?) = apply { this.taxesAndFees = taxesAndFees } - fun strikeOutTaxesAndFees(strikeOutTaxesAndFees: RatePlanStandalonePriceStrikeOutTaxesAndFees?) = apply { this.strikeOutTaxesAndFees = strikeOutTaxesAndFees } + fun strikeOutTaxesAndFees(strikeOutTaxesAndFees: Money?) = apply { this.strikeOutTaxesAndFees = strikeOutTaxesAndFees } - fun totalPrice(totalPrice: RatePlanStandalonePriceTotalPrice?) = apply { this.totalPrice = totalPrice } + fun totalPrice(totalPrice: Money?) = apply { this.totalPrice = totalPrice } - fun totalStrikeOutPrice(totalStrikeOutPrice: RatePlanStandalonePriceTotalStrikeOutPrice?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } + fun totalStrikeOutPrice(totalStrikeOutPrice: Money?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } - fun avgNightlyRate(avgNightlyRate: RatePlanStandalonePriceAvgNightlyRate?) = apply { this.avgNightlyRate = avgNightlyRate } + fun avgNightlyRate(avgNightlyRate: Money?) = apply { this.avgNightlyRate = avgNightlyRate } - fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: RatePlanStandalonePriceAvgNightlyStrikeOutRate?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } + fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: Money?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } - fun hotelMandatoryFees(hotelMandatoryFees: RatePlanStandalonePriceHotelMandatoryFees?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } + fun hotelMandatoryFees(hotelMandatoryFees: Money?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } - fun strikeOutHotelMandatoryFees(strikeOutHotelMandatoryFees: RatePlanStandalonePriceStrikeOutHotelMandatoryFees?) = - apply { - this.strikeOutHotelMandatoryFees = - strikeOutHotelMandatoryFees - } + fun strikeOutHotelMandatoryFees(strikeOutHotelMandatoryFees: Money?) = apply { this.strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees } fun build(): RoomTypeStandalonePrice { val instance = @@ -144,31 +115,11 @@ data class RoomTypeStandalonePrice( avgNightlyRate = avgNightlyRate, avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, hotelMandatoryFees = hotelMandatoryFees, - strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees + strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees, ) - validate(instance) - return instance } - - private fun validate(instance: RoomTypeStandalonePrice) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -182,6 +133,6 @@ data class RoomTypeStandalonePrice( avgNightlyRate = avgNightlyRate, avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, hotelMandatoryFees = hotelMandatoryFees, - strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees + strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt index 9282cb674..bee2be476 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt @@ -13,45 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Container of savings information. +* Container of savings information. * @param percentage The percentage of the price that has been discounted off the regular price for the current activity. * @param amount - */ +*/ data class Savings( // The percentage of the price that has been discounted off the regular price for the current activity. @JsonProperty("Percentage") val percentage: kotlin.Int, @JsonProperty("Amount") - @field:NotNull - @field:Valid - val amount: ActivitiesMoney + val amount: ActivitiesMoney, ) { + init { + require(percentage != null) { "percentage must not be null" } + + require(amount != null) { "amount must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -59,7 +43,7 @@ data class Savings( class Builder( private var percentage: kotlin.Int? = null, - private var amount: ActivitiesMoney? = null + private var amount: ActivitiesMoney? = null, ) { fun percentage(percentage: kotlin.Int) = apply { this.percentage = percentage } @@ -69,36 +53,16 @@ data class Savings( val instance = Savings( percentage = percentage!!, - amount = amount!! + amount = amount!!, ) - validate(instance) - return instance } - - private fun validate(instance: Savings) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( percentage = percentage!!, - amount = amount!! + amount = amount!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpAPIMError.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpAPIMError.kt index f38340930..74d7b4d98 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpAPIMError.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpAPIMError.kt @@ -13,81 +13,44 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Error from the APIM. +* Error from the APIM. * @param message Error from the APIM. - */ +*/ data class SdpAPIMError( // Error from the APIM. @JsonProperty("message") - @field:Valid - val message: kotlin.String? = null + val message: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() } class Builder( - private var message: kotlin.String? = null + private var message: kotlin.String? = null, ) { fun message(message: kotlin.String?) = apply { this.message = message } fun build(): SdpAPIMError { val instance = SdpAPIMError( - message = message + message = message, ) - validate(instance) - return instance } - - private fun validate(instance: SdpAPIMError) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( - message = message + message = message, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpLink.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpLink.kt index ff2c3747a..a8e106893 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpLink.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpLink.kt @@ -13,44 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Contains link information, including link address, request method. Only provided if FileInfo is in OtherFileOptions. +* Contains link information, including link address, request method. Only provided if FileInfo is in OtherFileOptions. * @param href a link address. * @param method Request method, it will support `GET`, `POST`, `DELETE` and `PUT` etc... - */ +*/ data class SdpLink( // a link address. @JsonProperty("href") - @field:Valid val href: kotlin.String? = null, // Request method, it will support `GET`, `POST`, `DELETE` and `PUT` etc... @JsonProperty("method") - @field:Valid - val method: kotlin.String? = null + val method: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -58,7 +40,7 @@ data class SdpLink( class Builder( private var href: kotlin.String? = null, - private var method: kotlin.String? = null + private var method: kotlin.String? = null, ) { fun href(href: kotlin.String?) = apply { this.href = href } @@ -68,36 +50,16 @@ data class SdpLink( val instance = SdpLink( href = href, - method = method + method = method, ) - validate(instance) - return instance } - - private fun validate(instance: SdpLink) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( href = href, - method = method + method = method, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/StayDates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/StayDates.kt index c999f33de..a223495f2 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/StayDates.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/StayDates.kt @@ -13,41 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Validation /** - * Container for information for the stay dates of the rate plan. +* Container for information for the stay dates of the rate plan. * @param checkInDate The initial day of the hotel stay in an ISO 8601 Date format [YYYY-MM-DD]. * @param checkOutDate The final day of the hotel stay in an ISO 8601 Date format [YYYY-MM-DD]. - */ +*/ data class StayDates( // The initial day of the hotel stay in an ISO 8601 Date format [YYYY-MM-DD]. @JsonProperty("CheckInDate") val checkInDate: java.time.LocalDate? = null, // The final day of the hotel stay in an ISO 8601 Date format [YYYY-MM-DD]. @JsonProperty("CheckOutDate") - val checkOutDate: java.time.LocalDate? = null + val checkOutDate: java.time.LocalDate? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -55,7 +40,7 @@ data class StayDates( class Builder( private var checkInDate: java.time.LocalDate? = null, - private var checkOutDate: java.time.LocalDate? = null + private var checkOutDate: java.time.LocalDate? = null, ) { fun checkInDate(checkInDate: java.time.LocalDate?) = apply { this.checkInDate = checkInDate } @@ -65,36 +50,16 @@ data class StayDates( val instance = StayDates( checkInDate = checkInDate, - checkOutDate = checkOutDate + checkOutDate = checkOutDate, ) - validate(instance) - return instance } - - private fun validate(instance: StayDates) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( checkInDate = checkInDate, - checkOutDate = checkOutDate + checkOutDate = checkOutDate, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Supplier.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Supplier.kt index 74f9bba8e..28a082b57 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Supplier.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Supplier.kt @@ -13,58 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The supplier of the car being offered. +* The supplier of the car being offered. * @param id Supplier ID. * @param name Supplier Name. * @param code Supplier Code. * @param logoImageUrl Supplier Logo Image Url. - */ +*/ data class Supplier( // Supplier ID. @JsonProperty("Id") - @field:NotNull - @field:Valid val id: kotlin.String, // Supplier Name. @JsonProperty("Name") - @field:NotNull - @field:Valid val name: kotlin.String, // Supplier Code. @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // Supplier Logo Image Url. @JsonProperty("LogoImageUrl") - @field:Valid - val logoImageUrl: kotlin.String? = null + val logoImageUrl: kotlin.String? = null, ) { + init { + require(id != null) { "id must not be null" } + + require(name != null) { "name must not be null" } + + require(code != null) { "code must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -74,7 +55,7 @@ data class Supplier( private var id: kotlin.String? = null, private var name: kotlin.String? = null, private var code: kotlin.String? = null, - private var logoImageUrl: kotlin.String? = null + private var logoImageUrl: kotlin.String? = null, ) { fun id(id: kotlin.String) = apply { this.id = id } @@ -90,31 +71,11 @@ data class Supplier( id = id!!, name = name!!, code = code!!, - logoImageUrl = logoImageUrl + logoImageUrl = logoImageUrl, ) - validate(instance) - return instance } - - private fun validate(instance: Supplier) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -122,6 +83,6 @@ data class Supplier( id = id!!, name = name!!, code = code!!, - logoImageUrl = logoImageUrl + logoImageUrl = logoImageUrl, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFees.kt index 37d1118a7..57a3f03d6 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFees.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFees.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsMoney import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * List of TaxesAndFees Details +* List of TaxesAndFees Details * @param description TaxesAndFees description * @param amount - */ +*/ data class TaxesAndFees( // TaxesAndFees description @JsonProperty("Description") - @field:NotNull - @field:Valid val description: kotlin.String, @JsonProperty("Amount") - @field:NotNull - @field:Valid - val amount: CarsMoney + val amount: CarsMoney, ) { + init { + require(description != null) { "description must not be null" } + + require(amount != null) { "amount must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class TaxesAndFees( class Builder( private var description: kotlin.String? = null, - private var amount: CarsMoney? = null + private var amount: CarsMoney? = null, ) { fun description(description: kotlin.String) = apply { this.description = description } @@ -71,36 +53,16 @@ data class TaxesAndFees( val instance = TaxesAndFees( description = description!!, - amount = amount!! + amount = amount!!, ) - validate(instance) - return instance } - - private fun validate(instance: TaxesAndFees) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( description = description!!, - amount = amount!! + amount = amount!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFeesDetail.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFeesDetail.kt index e1b99baf7..526b786b5 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFeesDetail.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFeesDetail.kt @@ -13,43 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param categoryCode * @param amount - */ +*/ data class TaxesAndFeesDetail( @JsonProperty("CategoryCode") - @field:Valid val categoryCode: kotlin.String? = null, @JsonProperty("Amount") - @field:Valid - val amount: Money? = null + val amount: Money? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -57,7 +39,7 @@ data class TaxesAndFeesDetail( class Builder( private var categoryCode: kotlin.String? = null, - private var amount: Money? = null + private var amount: Money? = null, ) { fun categoryCode(categoryCode: kotlin.String?) = apply { this.categoryCode = categoryCode } @@ -67,36 +49,16 @@ data class TaxesAndFeesDetail( val instance = TaxesAndFeesDetail( categoryCode = categoryCode, - amount = amount + amount = amount, ) - validate(instance) - return instance } - - private fun validate(instance: TaxesAndFeesDetail) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( categoryCode = categoryCode, - amount = amount + amount = amount, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt index 741c82f28..87ffad3fa 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt @@ -13,60 +13,45 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.ActivitiesPrice import com.expediagroup.sdk.xap.models.Restrictions import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * The list of Ticket information. +* The list of Ticket information. * @param id The numerical identifier for the ticket. * @param code The code for the ticket. Values supported are: Adult Traveler Child Group Senior Infant Student * @param count The number of each ticket type to be booked. * @param ticketPrice * @param restrictions - */ +*/ data class Ticket( // The numerical identifier for the ticket. @JsonProperty("Id") val id: kotlin.Int, // The code for the ticket. Values supported are: Adult Traveler Child Group Senior Infant Student @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // The number of each ticket type to be booked. @JsonProperty("Count") val count: kotlin.Int, @JsonProperty("TicketPrice") - @field:NotNull - @field:Valid val ticketPrice: ActivitiesPrice, @JsonProperty("Restrictions") - @field:Valid - val restrictions: Restrictions? = null + val restrictions: Restrictions? = null, ) { + init { + require(id != null) { "id must not be null" } + + require(code != null) { "code must not be null" } + + require(count != null) { "count must not be null" } + + require(ticketPrice != null) { "ticketPrice must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -77,7 +62,7 @@ data class Ticket( private var code: kotlin.String? = null, private var count: kotlin.Int? = null, private var ticketPrice: ActivitiesPrice? = null, - private var restrictions: Restrictions? = null + private var restrictions: Restrictions? = null, ) { fun id(id: kotlin.Int) = apply { this.id = id } @@ -96,31 +81,11 @@ data class Ticket( code = code!!, count = count!!, ticketPrice = ticketPrice!!, - restrictions = restrictions + restrictions = restrictions, ) - validate(instance) - return instance } - - private fun validate(instance: Ticket) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -129,6 +94,6 @@ data class Ticket( code = code!!, count = count!!, ticketPrice = ticketPrice!!, - restrictions = restrictions + restrictions = restrictions, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TimeRange.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TimeRange.kt index 9366c8573..0cedf5189 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TimeRange.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TimeRange.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * A list of time range to indicate the operation hours of the date range. +* A list of time range to indicate the operation hours of the date range. * @param startTime Start time at pickup location of the date range. * @param endTime End time at pickup location of the date range. - */ +*/ data class TimeRange( // Start time at pickup location of the date range. @JsonProperty("StartTime") - @field:NotNull - @field:Valid val startTime: kotlin.String, // End time at pickup location of the date range. @JsonProperty("EndTime") - @field:NotNull - @field:Valid - val endTime: kotlin.String + val endTime: kotlin.String, ) { + init { + require(startTime != null) { "startTime must not be null" } + + require(endTime != null) { "endTime must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class TimeRange( class Builder( private var startTime: kotlin.String? = null, - private var endTime: kotlin.String? = null + private var endTime: kotlin.String? = null, ) { fun startTime(startTime: kotlin.String) = apply { this.startTime = startTime } @@ -71,36 +53,16 @@ data class TimeRange( val instance = TimeRange( startTime = startTime!!, - endTime = endTime!! + endTime = endTime!!, ) - validate(instance) - return instance } - - private fun validate(instance: TimeRange) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( startTime = startTime!!, - endTime = endTime!! + endTime = endTime!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TransmissionDrive.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TransmissionDrive.kt index 1fc2fa112..be384206a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TransmissionDrive.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TransmissionDrive.kt @@ -13,47 +13,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Car transmission and drive. Please find list of Car Transmission Drive Codes in https://expediaintegration.zendesk.com/hc/en-us/articles/115005380028 +* Car transmission and drive. Please find list of Car Transmission Drive Codes in https://expediaintegration.zendesk.com/hc/en-us/articles/115005380028 * @param code Car transmission and drive code. * @param `value` Car transmission and drive value. - */ +*/ data class TransmissionDrive( // Car transmission and drive code. @JsonProperty("Code") - @field:NotNull - @field:Valid val code: kotlin.String, // Car transmission and drive value. @JsonProperty("Value") - @field:NotNull - @field:Valid - val `value`: kotlin.String + val `value`: kotlin.String, ) { + init { + require(code != null) { "code must not be null" } + + require(`value` != null) { "`value` must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -61,7 +43,7 @@ data class TransmissionDrive( class Builder( private var code: kotlin.String? = null, - private var `value`: kotlin.String? = null + private var `value`: kotlin.String? = null, ) { fun code(code: kotlin.String) = apply { this.code = code } @@ -71,36 +53,16 @@ data class TransmissionDrive( val instance = TransmissionDrive( code = code!!, - `value` = `value`!! + `value` = `value`!!, ) - validate(instance) - return instance } - - private fun validate(instance: TransmissionDrive) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( code = code!!, - `value` = `value`!! + `value` = `value`!!, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ValidFormsOfPayment.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ValidFormsOfPayment.kt index 6310bb6fb..804c8b015 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ValidFormsOfPayment.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ValidFormsOfPayment.kt @@ -13,56 +13,36 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Container for hotel supported payment information. +* Container for hotel supported payment information. * @param paymentMethod The payment method. * @param name The brand name of the payment sub-method to be displayed to the customer. * @param paymentSubMethod The payment sub-method. * @param brandName The brand name of the payment sub-method to be displayed to the customer. In many cases it will be the same as the payment sub-method, but \"Visa/Carte Blanche\" and \"Visa/Delta\" are some of the exceptions. - */ +*/ data class ValidFormsOfPayment( // The payment method. @JsonProperty("PaymentMethod") - @field:Valid val paymentMethod: kotlin.String? = null, // The brand name of the payment sub-method to be displayed to the customer. @JsonProperty("Name") - @field:Valid val name: kotlin.String? = null, // The payment sub-method. @Deprecated(message = "This property is deprecated.") @JsonProperty("PaymentSubMethod") - @field:Valid val paymentSubMethod: kotlin.String? = null, // The brand name of the payment sub-method to be displayed to the customer. In many cases it will be the same as the payment sub-method, but \"Visa/Carte Blanche\" and \"Visa/Delta\" are some of the exceptions. @Deprecated(message = "This property is deprecated.") @JsonProperty("BrandName") - @field:Valid - val brandName: kotlin.String? = null + val brandName: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -72,7 +52,7 @@ data class ValidFormsOfPayment( private var paymentMethod: kotlin.String? = null, private var name: kotlin.String? = null, private var paymentSubMethod: kotlin.String? = null, - private var brandName: kotlin.String? = null + private var brandName: kotlin.String? = null, ) { fun paymentMethod(paymentMethod: kotlin.String?) = apply { this.paymentMethod = paymentMethod } @@ -88,31 +68,11 @@ data class ValidFormsOfPayment( paymentMethod = paymentMethod, name = name, paymentSubMethod = paymentSubMethod, - brandName = brandName + brandName = brandName, ) - validate(instance) - return instance } - - private fun validate(instance: ValidFormsOfPayment) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -120,6 +80,6 @@ data class ValidFormsOfPayment( paymentMethod = paymentMethod, name = name, paymentSubMethod = paymentSubMethod, - brandName = brandName + brandName = brandName, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VehicleDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VehicleDetails.kt index 8c3675c28..c3908291e 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VehicleDetails.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VehicleDetails.kt @@ -13,37 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Capacity import com.expediagroup.sdk.xap.models.CarCategory import com.expediagroup.sdk.xap.models.CarType import com.expediagroup.sdk.xap.models.FuelAC import com.expediagroup.sdk.xap.models.TransmissionDrive import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Specific information for a car. +* Specific information for a car. * @param carClass Car category and type. * @param carCategory * @param carType @@ -54,32 +34,21 @@ import javax.validation.constraints.NotNull * @param maxDoors Maximal car door count. * @param fuelLevel Car fuel information. * @param capacity - */ +*/ data class VehicleDetails( // Car category and type. @JsonProperty("CarClass") - @field:NotNull - @field:Valid val carClass: kotlin.String, @JsonProperty("CarCategory") - @field:NotNull - @field:Valid val carCategory: CarCategory, @JsonProperty("CarType") - @field:NotNull - @field:Valid val carType: CarType, @JsonProperty("TransmissionDrive") - @field:NotNull - @field:Valid val transmissionDrive: TransmissionDrive, @JsonProperty("FuelAC") - @field:NotNull - @field:Valid val fuelAC: FuelAC, // Car manufacturer and model. @JsonProperty("Make") - @field:Valid val make: kotlin.String? = null, // Minimal car door count. @JsonProperty("MinDoors") @@ -89,12 +58,22 @@ data class VehicleDetails( val maxDoors: kotlin.Int? = null, // Car fuel information. @JsonProperty("FuelLevel") - @field:Valid val fuelLevel: kotlin.String? = null, @JsonProperty("Capacity") - @field:Valid - val capacity: Capacity? = null + val capacity: Capacity? = null, ) { + init { + require(carClass != null) { "carClass must not be null" } + + require(carCategory != null) { "carCategory must not be null" } + + require(carType != null) { "carType must not be null" } + + require(transmissionDrive != null) { "transmissionDrive must not be null" } + + require(fuelAC != null) { "fuelAC must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -110,7 +89,7 @@ data class VehicleDetails( private var minDoors: kotlin.Int? = null, private var maxDoors: kotlin.Int? = null, private var fuelLevel: kotlin.String? = null, - private var capacity: Capacity? = null + private var capacity: Capacity? = null, ) { fun carClass(carClass: kotlin.String) = apply { this.carClass = carClass } @@ -144,31 +123,11 @@ data class VehicleDetails( minDoors = minDoors, maxDoors = maxDoors, fuelLevel = fuelLevel, - capacity = capacity + capacity = capacity, ) - validate(instance) - return instance } - - private fun validate(instance: VehicleDetails) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -182,6 +141,6 @@ data class VehicleDetails( minDoors = minDoors, maxDoors = maxDoors, fuelLevel = fuelLevel, - capacity = capacity + capacity = capacity, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VendorLocationDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VendorLocationDetails.kt index 2a05c1f50..98a6da5ee 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VendorLocationDetails.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VendorLocationDetails.kt @@ -13,61 +13,42 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.CarsDistance import com.expediagroup.sdk.xap.models.CarsLocation import com.expediagroup.sdk.xap.models.DateTimePeriod import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** - * Drop off information +* Drop off information * @param dateTime Pickup date and time. * @param location * @param shuttleCategory The category of shuttle from the terminal to the rental car counter. Please find list of Shuttle Categories in the Related Links Section below. * @param distance * @param openSchedule A List of date time periods to indicate the vendor business hours for the pickup time. - */ +*/ data class VendorLocationDetails( // Pickup date and time. @JsonProperty("DateTime") val dateTime: java.time.LocalDateTime, @JsonProperty("Location") - @field:NotNull - @field:Valid val location: CarsLocation, // The category of shuttle from the terminal to the rental car counter. Please find list of Shuttle Categories in the Related Links Section below. @JsonProperty("ShuttleCategory") - @field:Valid val shuttleCategory: kotlin.String? = null, @JsonProperty("Distance") - @field:Valid val distance: CarsDistance? = null, // A List of date time periods to indicate the vendor business hours for the pickup time. @JsonProperty("OpenSchedule") - @field:Valid - val openSchedule: kotlin.collections.List? = null + val openSchedule: kotlin.collections.List? = null, ) { + init { + require(dateTime != null) { "dateTime must not be null" } + + require(location != null) { "location must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -78,7 +59,7 @@ data class VendorLocationDetails( private var location: CarsLocation? = null, private var shuttleCategory: kotlin.String? = null, private var distance: CarsDistance? = null, - private var openSchedule: kotlin.collections.List? = null + private var openSchedule: kotlin.collections.List? = null, ) { fun dateTime(dateTime: java.time.LocalDateTime) = apply { this.dateTime = dateTime } @@ -97,31 +78,11 @@ data class VendorLocationDetails( location = location!!, shuttleCategory = shuttleCategory, distance = distance, - openSchedule = openSchedule + openSchedule = openSchedule, ) - validate(instance) - return instance } - - private fun validate(instance: VendorLocationDetails) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -130,6 +91,6 @@ data class VendorLocationDetails( location = location!!, shuttleCategory = shuttleCategory, distance = distance, - openSchedule = openSchedule + openSchedule = openSchedule, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/WaiverPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/WaiverPolicy.kt index 4d0bb5d15..3b230b249 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/WaiverPolicy.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/WaiverPolicy.kt @@ -13,81 +13,44 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * +* * @param waiverPolicyDescription The localized waiver policy description, which could be put in front of cancellation policy description. - */ +*/ data class WaiverPolicy( // The localized waiver policy description, which could be put in front of cancellation policy description. @JsonProperty("WaiverPolicyDescription") - @field:Valid - val waiverPolicyDescription: kotlin.String? = null + val waiverPolicyDescription: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() } class Builder( - private var waiverPolicyDescription: kotlin.String? = null + private var waiverPolicyDescription: kotlin.String? = null, ) { fun waiverPolicyDescription(waiverPolicyDescription: kotlin.String?) = apply { this.waiverPolicyDescription = waiverPolicyDescription } fun build(): WaiverPolicy { val instance = WaiverPolicy( - waiverPolicyDescription = waiverPolicyDescription + waiverPolicyDescription = waiverPolicyDescription, ) - validate(instance) - return instance } - - private fun validate(instance: WaiverPolicy) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( - waiverPolicyDescription = waiverPolicyDescription + waiverPolicyDescription = waiverPolicyDescription, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Warning.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Warning.kt index 86b7d77b1..7df4ee20f 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Warning.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Warning.kt @@ -13,62 +13,40 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.expediagroup.sdk.xap.models.Money import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. +* There were some errors or events during the transaction, but the API has still returned a response. Container for all warnings. * @param code The code of a warning. * @param description A detail information of what happened. * @param originalPrice * @param newPrice * @param changedAmount * @param changedPercentage The changed percentage. In the sample 2.97 means the changed percentage is 2.97%. - */ +*/ data class Warning( // The code of a warning. @JsonProperty("Code") - @field:Valid val code: kotlin.String? = null, // A detail information of what happened. @JsonProperty("Description") - @field:Valid val description: kotlin.String? = null, @JsonProperty("OriginalPrice") - @field:Valid val originalPrice: Money? = null, @JsonProperty("NewPrice") - @field:Valid val newPrice: Money? = null, @JsonProperty("ChangedAmount") - @field:Valid val changedAmount: Money? = null, // The changed percentage. In the sample 2.97 means the changed percentage is 2.97%. @JsonProperty("ChangedPercentage") - @field:Valid - val changedPercentage: kotlin.String? = null + val changedPercentage: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -80,7 +58,7 @@ data class Warning( private var originalPrice: Money? = null, private var newPrice: Money? = null, private var changedAmount: Money? = null, - private var changedPercentage: kotlin.String? = null + private var changedPercentage: kotlin.String? = null, ) { fun code(code: kotlin.String?) = apply { this.code = code } @@ -102,31 +80,11 @@ data class Warning( originalPrice = originalPrice, newPrice = newPrice, changedAmount = changedAmount, - changedPercentage = changedPercentage + changedPercentage = changedPercentage, ) - validate(instance) - return instance } - - private fun validate(instance: Warning) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -136,6 +94,6 @@ data class Warning( originalPrice = originalPrice, newPrice = newPrice, changedAmount = changedAmount, - changedPercentage = changedPercentage + changedPercentage = changedPercentage, ) } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/When.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/When.kt index f1a5224c1..01d2fad9c 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/When.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/When.kt @@ -13,43 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - package com.expediagroup.sdk.xap.models -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException import com.fasterxml.jackson.annotation.JsonProperty -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation /** - * Indicate when to pay. +* Indicate when to pay. * @param type Indicates the time of the deposit collection. Options are: UPON_BOOKING The customer must pay the deposit when booking the property. DAYS_PRIOR The customer must pay the deposit a number of days before arriving at the property. UPON_ARRIVAL The customer must pay the deposit upon arriving at the property. * @param `value` This value will only be shown when Deposit Type is DAYS_PRIOR to indicate the number of days prior to check in when the deposit will be collected. - */ +*/ data class When( // Indicates the time of the deposit collection. Options are: UPON_BOOKING The customer must pay the deposit when booking the property. DAYS_PRIOR The customer must pay the deposit a number of days before arriving at the property. UPON_ARRIVAL The customer must pay the deposit upon arriving at the property. @JsonProperty("Type") val type: When.Type? = null, // This value will only be shown when Deposit Type is DAYS_PRIOR to indicate the number of days prior to check in when the deposit will be collected. @JsonProperty("Value") - @field:Valid - val `value`: kotlin.String? = null + val `value`: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() @@ -57,7 +40,7 @@ data class When( class Builder( private var type: When.Type? = null, - private var `value`: kotlin.String? = null + private var `value`: kotlin.String? = null, ) { fun type(type: When.Type?) = apply { this.type = type } @@ -67,44 +50,26 @@ data class When( val instance = When( type = type, - `value` = `value` + `value` = `value`, ) - validate(instance) - return instance } - - private fun validate(instance: When) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(instance) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( type = type, - `value` = `value` + `value` = `value`, ) /** * Indicates the time of the deposit collection. Options are: UPON_BOOKING The customer must pay the deposit when booking the property. DAYS_PRIOR The customer must pay the deposit a number of days before arriving at the property. UPON_ARRIVAL The customer must pay the deposit upon arriving at the property. * Values: UPON_BOOKING,DAYS_PRIOR,UPON_ARRIVAL */ - enum class Type(val value: kotlin.String) { + enum class Type( + val value: kotlin.String, + ) { @JsonProperty("UPON_BOOKING") UPON_BOOKING("UPON_BOOKING"), @@ -112,6 +77,6 @@ data class When( DAYS_PRIOR("DAYS_PRIOR"), @JsonProperty("UPON_ARRIVAL") - UPON_ARRIVAL("UPON_ARRIVAL") + UPON_ARRIVAL("UPON_ARRIVAL"), } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/exception/ApiException.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/exception/ApiException.kt deleted file mode 100644 index 56dc289dc..000000000 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/exception/ApiException.kt +++ /dev/null @@ -1,293 +0,0 @@ -/* - * 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. - */ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package com.expediagroup.sdk.xap.models.exception - -import com.expediagroup.sdk.core.model.exception.service.ExpediaGroupApiException -import com.expediagroup.sdk.core.model.exception.service.ExpediaGroupServiceDefaultErrorException -import com.expediagroup.sdk.core.model.getTransactionId -import com.expediagroup.sdk.xap.models.* -import io.ktor.client.call.body -import io.ktor.client.statement.HttpResponse -import io.ktor.client.statement.bodyAsText -import io.ktor.client.statement.request -import kotlinx.coroutines.runBlocking - -internal open class HttpStatusCodeRange( - private val statusCode: String, - val getException: (HttpResponse) -> ExpediaGroupApiException -) : Comparable { - open fun matches(statusCode: String): Boolean = if (isRangeDefinition()) this.statusCode.first() == statusCode.first() else this.statusCode == statusCode - - open fun isRangeDefinition(): Boolean = statusCode.matches(Regex("^[1-5]XX$")) - - override fun compareTo(other: HttpStatusCodeRange): Int = (if (this.isRangeDefinition()) 1 else 0).compareTo(if (other.isRangeDefinition()) 1 else 0) -} - -internal object DefaultHttpStatusCodeRange : HttpStatusCodeRange( - "DefaultHttpStatusCodeRange", - { ExpediaGroupServiceDefaultErrorException(it.status.value, runBlocking { it.bodyAsText() }, it.request.headers.getTransactionId()) } -) { - override fun matches(statusCode: String): Boolean = true - - override fun isRangeDefinition(): Boolean = true -} - -internal object ErrorObjectMapper { - private val defaultHttpStatusCodeRanges = listOf(DefaultHttpStatusCodeRange) - private val httpStatusCodeRanges: Map> = - mapOf( - Pair( - "getActivityDetails", - listOf( - HttpStatusCodeRange("400") { - ExpediaGroupApiActivitiesErrorsException(it.status.value, fetchErrorObject(it) as ActivitiesErrors, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("401") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("403") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("404") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("429") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("500") { - ExpediaGroupApiActivitiesErrorsException(it.status.value, fetchErrorObject(it) as ActivitiesErrors, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("503") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - DefaultHttpStatusCodeRange - ) - ), - Pair( - "getActivityListings", - listOf( - HttpStatusCodeRange("400") { - ExpediaGroupApiActivitiesErrorsException(it.status.value, fetchErrorObject(it) as ActivitiesErrors, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("401") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("403") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("404") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("429") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("500") { - ExpediaGroupApiActivitiesErrorsException(it.status.value, fetchErrorObject(it) as ActivitiesErrors, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("503") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - DefaultHttpStatusCodeRange - ) - ), - Pair( - "getCarDetails", - listOf( - HttpStatusCodeRange("400") { ExpediaGroupApiCarsErrorsException(it.status.value, fetchErrorObject(it) as CarsErrors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("401") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("403") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("404") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("429") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("500") { ExpediaGroupApiCarsErrorsException(it.status.value, fetchErrorObject(it) as CarsErrors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("503") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - DefaultHttpStatusCodeRange - ) - ), - Pair( - "getCarsListings", - listOf( - HttpStatusCodeRange("400") { ExpediaGroupApiCarsErrorsException(it.status.value, fetchErrorObject(it) as CarsErrors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("401") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("403") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("404") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("429") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("503") { ExpediaGroupApiAPIMErrorException(it.status.value, fetchErrorObject(it) as APIMError, it.headers.getTransactionId()) }, - DefaultHttpStatusCodeRange - ) - ), - Pair( - "getFeedDownloadUrl", - listOf( - HttpStatusCodeRange("400") { - ExpediaGroupApiPresignedUrlResponseException(it.status.value, fetchErrorObject(it) as PresignedUrlResponse, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("401") { ExpediaGroupApiSdpAPIMErrorException(it.status.value, fetchErrorObject(it) as SdpAPIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("403") { ExpediaGroupApiSdpAPIMErrorException(it.status.value, fetchErrorObject(it) as SdpAPIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("404") { ExpediaGroupApiSdpAPIMErrorException(it.status.value, fetchErrorObject(it) as SdpAPIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("429") { ExpediaGroupApiSdpAPIMErrorException(it.status.value, fetchErrorObject(it) as SdpAPIMError, it.headers.getTransactionId()) }, - HttpStatusCodeRange("500") { - ExpediaGroupApiPresignedUrlResponseException(it.status.value, fetchErrorObject(it) as PresignedUrlResponse, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("503") { ExpediaGroupApiSdpAPIMErrorException(it.status.value, fetchErrorObject(it) as SdpAPIMError, it.headers.getTransactionId()) }, - DefaultHttpStatusCodeRange - ) - ), - Pair( - "getLodgingAvailabilityCalendars", - listOf( - HttpStatusCodeRange("400") { ExpediaGroupApiLodgingErrorsException(it.status.value, fetchErrorObject(it) as LodgingErrors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("401") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("403") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("429") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("500") { ExpediaGroupApiLodgingErrorsException(it.status.value, fetchErrorObject(it) as LodgingErrors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("503") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("504") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - DefaultHttpStatusCodeRange - ) - ), - Pair( - "getLodgingDetails", - listOf( - HttpStatusCodeRange("400") { ExpediaGroupApiErrorsException(it.status.value, fetchErrorObject(it) as Errors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("401") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("403") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("429") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("500") { ExpediaGroupApiErrorsException(it.status.value, fetchErrorObject(it) as Errors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("503") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("504") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - DefaultHttpStatusCodeRange - ) - ), - Pair( - "getLodgingListings", - listOf( - HttpStatusCodeRange("400") { ExpediaGroupApiErrorsException(it.status.value, fetchErrorObject(it) as Errors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("401") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("403") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("429") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("500") { ExpediaGroupApiErrorsException(it.status.value, fetchErrorObject(it) as Errors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("503") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("504") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - DefaultHttpStatusCodeRange - ) - ), - Pair( - "getLodgingQuotes", - listOf( - HttpStatusCodeRange("400") { ExpediaGroupApiLodgingErrorsException(it.status.value, fetchErrorObject(it) as LodgingErrors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("401") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("403") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("429") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("500") { ExpediaGroupApiLodgingErrorsException(it.status.value, fetchErrorObject(it) as LodgingErrors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("503") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("504") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - DefaultHttpStatusCodeRange - ) - ), - Pair( - "getLodgingRateCalendar", - listOf( - HttpStatusCodeRange("400") { ExpediaGroupApiErrorsException(it.status.value, fetchErrorObject(it) as Errors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("401") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("403") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("409") { ExpediaGroupApiErrorsException(it.status.value, fetchErrorObject(it) as Errors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("429") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("500") { ExpediaGroupApiErrorsException(it.status.value, fetchErrorObject(it) as Errors, it.headers.getTransactionId()) }, - HttpStatusCodeRange("503") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - HttpStatusCodeRange("504") { - ExpediaGroupApiAPIGatewayErrorException(it.status.value, fetchErrorObject(it) as APIGatewayError, it.headers.getTransactionId()) - }, - DefaultHttpStatusCodeRange - ) - ) - ) - - fun process( - httpResponse: HttpResponse, - operationId: String - ): ExpediaGroupApiException = - httpStatusCodeRanges.getOrDefault(operationId, defaultHttpStatusCodeRanges).filter { it.matches(httpResponse.status.value.toString()) }.min().getException(httpResponse) - - private inline fun fetchErrorObject(httpResponse: HttpResponse): T = - runBlocking { - runCatching { - httpResponse.body() - }.getOrElse { throw ExpediaGroupServiceDefaultErrorException(httpResponse.status.value, httpResponse.bodyAsText(), httpResponse.request.headers.getTransactionId()) } - } -} - -class ExpediaGroupApiActivitiesErrorsException(code: Int, override val errorObject: ActivitiesErrors, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) - -class ExpediaGroupApiAPIMErrorException(code: Int, override val errorObject: APIMError, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) - -class ExpediaGroupApiCarsErrorsException(code: Int, override val errorObject: CarsErrors, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) - -class ExpediaGroupApiPresignedUrlResponseException(code: Int, override val errorObject: PresignedUrlResponse, transactionId: String?) : ExpediaGroupApiException( - code, - errorObject, - transactionId -) - -class ExpediaGroupApiSdpAPIMErrorException(code: Int, override val errorObject: SdpAPIMError, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) - -class ExpediaGroupApiLodgingErrorsException(code: Int, override val errorObject: LodgingErrors, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) - -class ExpediaGroupApiAPIGatewayErrorException(code: Int, override val errorObject: APIGatewayError, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) - -class ExpediaGroupApiErrorsException(code: Int, override val errorObject: Errors, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt index ce5455483..f38721780 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,30 +15,47 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation -import org.apache.commons.text.StringSubstitutor +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.trait.operation.HeadersTrait +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationRequestTrait +import com.expediagroup.sdk.rest.trait.operation.UrlPathTrait +import com.expediagroup.sdk.rest.trait.operation.UrlQueryParamsTrait +import com.expediagroup.sdk.xap.models.ActivityDetailsResponse +import com.fasterxml.jackson.core.type.TypeReference +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef /** * * @property params [GetActivityDetailsOperationParams] */ class GetActivityDetailsOperation( - params: GetActivityDetailsOperationParams -) : Operation< - Nothing - >( - url(params), - "GET", - "getActivityDetails", - null, - params - ) { - companion object { - fun url(params: GetActivityDetailsOperationParams): String { - val url = "/activities/details/{offerToken}" - val substitutor = StringSubstitutor(params.getPathParams(), "{", "}") - return substitutor.replace(url) - } + private val params: GetActivityDetailsOperationParams, +) : OperationRequestTrait, + UrlPathTrait, + JacksonModelOperationResponseBodyTrait, + UrlQueryParamsTrait, + HeadersTrait { + override fun getHttpMethod(): String = "GET" + + override fun getRequestInfo(): OperationRequestTrait = this + + override fun getUrlPath(): String { + var url = "/activities/details/{offerToken}" + + url = + url.replace( + oldValue = "{" + "offerToken" + "}", + newValue = this.params.offerToken, + ignoreCase = true, + ) + + return url } + + override fun getTypeIdentifier(): TypeReference = jacksonTypeRef() + + override fun getHeaders(): Headers = this.params.getHeaders() + + override fun getUrlQueryParams() = this.params.getQueryParams() } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt index 03f1b89b1..ced8ba43c 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,12 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.OperationParams -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.infrastructure.* +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.model.UrlQueryParam +import com.expediagroup.sdk.rest.util.stringifyExplode +import com.expediagroup.sdk.rest.util.swaggerCollectionFormatStringifier import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import io.ktor.http.Headers -import io.ktor.http.Parameters -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** * @property offerToken the offerToken of a activity @@ -34,16 +29,17 @@ import javax.validation.constraints.NotNull */ @JsonDeserialize(builder = GetActivityDetailsOperationParams.Builder::class) data class GetActivityDetailsOperationParams( - @field:NotNull - @field:Valid val offerToken: kotlin.String, - @field:NotNull - @field:Valid val partnerTransactionId: kotlin.String, - @field:Valid val locale: kotlin.String? = - null -) : OperationParams { + null, +) { + init { + require(offerToken != null) { "offerToken must not be null" } + + require(partnerTransactionId != null) { "partnerTransactionId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -52,7 +48,7 @@ data class GetActivityDetailsOperationParams( class Builder( @JsonProperty("offerToken") private var offerToken: kotlin.String? = null, @JsonProperty("Partner-Transaction-Id") private var partnerTransactionId: kotlin.String? = null, - @JsonProperty("locale") private var locale: kotlin.String? = null + @JsonProperty("locale") private var locale: kotlin.String? = null, ) { /** * @param offerToken the offerToken of a activity @@ -74,56 +70,50 @@ data class GetActivityDetailsOperationParams( GetActivityDetailsOperationParams( offerToken = offerToken!!, partnerTransactionId = partnerTransactionId!!, - locale = locale + locale = locale, ) - validate(params) - return params } - - private fun validate(params: GetActivityDetailsOperationParams) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(params) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( offerToken = offerToken, partnerTransactionId = partnerTransactionId, - locale = locale + locale = locale, ) - override fun getHeaders(): Headers = - Headers.build { - partnerTransactionId?.let { - append("Partner-Transaction-Id", it) - } - append("Accept", "application/vnd.exp-activity.v3+json") - } + fun getHeaders(): Headers = + Headers + .builder() + .apply { + partnerTransactionId?.let { + add("Partner-Transaction-Id", it) + } + add("Accept", "application/vnd.exp-activity.v3+json") + }.build() - override fun getQueryParams(): Parameters = - Parameters.build { + fun getQueryParams(): List = + buildList { locale?.let { - append("locale", it) + val key = "locale" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } } - override fun getPathParams(): Map = + fun getPathParams(): Map = buildMap { offerToken?.also { put("offerToken", offerToken) diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt index 795784611..f02c3771e 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,21 +15,40 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.trait.operation.HeadersTrait +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationRequestTrait +import com.expediagroup.sdk.rest.trait.operation.UrlPathTrait +import com.expediagroup.sdk.rest.trait.operation.UrlQueryParamsTrait +import com.expediagroup.sdk.xap.models.ActivityListingsResponse +import com.fasterxml.jackson.core.type.TypeReference +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef /** * * @property params [GetActivityListingsOperationParams] */ class GetActivityListingsOperation( - params: GetActivityListingsOperationParams -) : Operation< - Nothing - >( - "/activities/listings", - "GET", - "getActivityListings", - null, - params - ) + private val params: GetActivityListingsOperationParams, +) : OperationRequestTrait, + UrlPathTrait, + JacksonModelOperationResponseBodyTrait, + UrlQueryParamsTrait, + HeadersTrait { + override fun getHttpMethod(): String = "GET" + + override fun getRequestInfo(): OperationRequestTrait = this + + override fun getUrlPath(): String { + var url = "/activities/listings" + + return url + } + + override fun getTypeIdentifier(): TypeReference = jacksonTypeRef() + + override fun getHeaders(): Headers = this.params.getHeaders() + + override fun getUrlQueryParams() = this.params.getQueryParams() +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt index 55bf59454..bd0d1bd41 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,12 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.OperationParams -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.infrastructure.* +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.model.UrlQueryParam +import com.expediagroup.sdk.rest.util.stringifyExplode +import com.expediagroup.sdk.rest.util.swaggerCollectionFormatStringifier import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import io.ktor.http.Headers -import io.ktor.http.Parameters -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** * @property partnerTransactionId Partner-generated identifier. @@ -38,39 +33,36 @@ import javax.validation.constraints.NotNull */ @JsonDeserialize(builder = GetActivityListingsOperationParams.Builder::class) data class GetActivityListingsOperationParams( - @field:NotNull - @field:Valid val partnerTransactionId: kotlin.String, - @field:Valid val location: kotlin.String? = null, - @field:Valid val geoLocation: kotlin.String? = null, - @field:Valid val startDate: java.time.LocalDate? = null, - @field:Valid val endDate: java.time.LocalDate? = null, - @field:Valid val locale: kotlin.String? = null, val links: kotlin.collections.List< - GetActivityListingsOperationParams.Links + GetActivityListingsOperationParams.Links, >? = - null -) : OperationParams { + null, +) { + init { + require(partnerTransactionId != null) { "partnerTransactionId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() } enum class Links( - val value: kotlin.String + val value: kotlin.String, ) { WD("WD"), - AD("AD") + AD("AD"), } class Builder( @@ -81,8 +73,8 @@ data class GetActivityListingsOperationParams( @JsonProperty("endDate") private var endDate: java.time.LocalDate? = null, @JsonProperty("locale") private var locale: kotlin.String? = null, @JsonProperty("links") private var links: kotlin.collections.List< - GetActivityListingsOperationParams.Links - >? = null + GetActivityListingsOperationParams.Links, + >? = null, ) { /** * @param partnerTransactionId Partner-generated identifier. @@ -119,8 +111,8 @@ data class GetActivityListingsOperationParams( */ fun links( links: kotlin.collections.List< - GetActivityListingsOperationParams.Links - > + GetActivityListingsOperationParams.Links, + >, ) = apply { this.links = links } fun build(): GetActivityListingsOperationParams { @@ -132,31 +124,11 @@ data class GetActivityListingsOperationParams( startDate = startDate, endDate = endDate, locale = locale, - links = links + links = links, ) - validate(params) - return params } - - private fun validate(params: GetActivityListingsOperationParams) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(params) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -167,40 +139,110 @@ data class GetActivityListingsOperationParams( startDate = startDate, endDate = endDate, locale = locale, - links = links + links = links, ) - override fun getHeaders(): Headers = - Headers.build { - partnerTransactionId?.let { - append("Partner-Transaction-Id", it) - } - append("Accept", "application/vnd.exp-activity.v3+json") - } - - override fun getQueryParams(): Parameters = - Parameters.build { + fun getHeaders(): Headers = + Headers + .builder() + .apply { + partnerTransactionId?.let { + add("Partner-Transaction-Id", it) + } + add("Accept", "application/vnd.exp-activity.v3+json") + }.build() + + fun getQueryParams(): List = + buildList { location?.let { - append("location", it) + val key = "location" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } geoLocation?.let { - append("geoLocation", it) + val key = "geoLocation" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } startDate?.let { - append("startDate", it.toString()) + val key = "startDate" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } endDate?.let { - append("endDate", it.toString()) + val key = "endDate" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } locale?.let { - append("locale", it) + val key = "locale" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } links?.let { - appendAll("links", toMultiValue(it.map { item -> item.value }, "csv")) + val key = "links" + val value = + buildList { + addAll(it.map { it.value }) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } } - - override fun getPathParams(): Map = - buildMap { - } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperation.kt index 69021e83d..7f5e8aeae 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperation.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,30 +15,47 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation -import org.apache.commons.text.StringSubstitutor +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.trait.operation.HeadersTrait +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationRequestTrait +import com.expediagroup.sdk.rest.trait.operation.UrlPathTrait +import com.expediagroup.sdk.rest.trait.operation.UrlQueryParamsTrait +import com.expediagroup.sdk.xap.models.CarDetailsResponse +import com.fasterxml.jackson.core.type.TypeReference +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef /** * Get Extended information with a single car offer * @property params [GetCarDetailsOperationParams] */ class GetCarDetailsOperation( - params: GetCarDetailsOperationParams -) : Operation< - Nothing - >( - url(params), - "GET", - "getCarDetails", - null, - params - ) { - companion object { - fun url(params: GetCarDetailsOperationParams): String { - val url = "/cars/details/{offerToken}" - val substitutor = StringSubstitutor(params.getPathParams(), "{", "}") - return substitutor.replace(url) - } + private val params: GetCarDetailsOperationParams, +) : OperationRequestTrait, + UrlPathTrait, + JacksonModelOperationResponseBodyTrait, + UrlQueryParamsTrait, + HeadersTrait { + override fun getHttpMethod(): String = "GET" + + override fun getRequestInfo(): OperationRequestTrait = this + + override fun getUrlPath(): String { + var url = "/cars/details/{offerToken}" + + url = + url.replace( + oldValue = "{" + "offerToken" + "}", + newValue = this.params.offerToken, + ignoreCase = true, + ) + + return url } + + override fun getTypeIdentifier(): TypeReference = jacksonTypeRef() + + override fun getHeaders(): Headers = this.params.getHeaders() + + override fun getUrlQueryParams() = this.params.getQueryParams() } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt index e7d897da3..b6dd9cfca 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,12 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.OperationParams -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.infrastructure.* +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.model.UrlQueryParam +import com.expediagroup.sdk.rest.util.stringifyExplode +import com.expediagroup.sdk.rest.util.swaggerCollectionFormatStringifier import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import io.ktor.http.Headers -import io.ktor.http.Parameters -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** * @property offerToken car offer token @@ -36,22 +31,23 @@ import javax.validation.constraints.NotNull */ @JsonDeserialize(builder = GetCarDetailsOperationParams.Builder::class) data class GetCarDetailsOperationParams( - @field:NotNull - @field:Valid val offerToken: kotlin.String, - @field:NotNull - @field:Valid val partnerTransactionId: kotlin.String, - @field:NotNull - @field:Valid val price: kotlin.String, - @field:NotNull - @field:Valid val currency: kotlin.String, - @field:Valid val source: kotlin.String? = - null -) : OperationParams { + null, +) { + init { + require(offerToken != null) { "offerToken must not be null" } + + require(partnerTransactionId != null) { "partnerTransactionId must not be null" } + + require(price != null) { "price must not be null" } + + require(currency != null) { "currency must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -62,7 +58,7 @@ data class GetCarDetailsOperationParams( @JsonProperty("Partner-Transaction-Id") private var partnerTransactionId: kotlin.String? = null, @JsonProperty("price") private var price: kotlin.String? = null, @JsonProperty("currency") private var currency: kotlin.String? = null, - @JsonProperty("source") private var source: kotlin.String? = null + @JsonProperty("source") private var source: kotlin.String? = null, ) { /** * @param offerToken car offer token @@ -96,31 +92,11 @@ data class GetCarDetailsOperationParams( partnerTransactionId = partnerTransactionId!!, price = price!!, currency = currency!!, - source = source + source = source, ) - validate(params) - return params } - - private fun validate(params: GetCarDetailsOperationParams) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(params) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -129,31 +105,69 @@ data class GetCarDetailsOperationParams( partnerTransactionId = partnerTransactionId, price = price, currency = currency, - source = source + source = source, ) - override fun getHeaders(): Headers = - Headers.build { - partnerTransactionId?.let { - append("Partner-Transaction-Id", it) - } - append("Accept", "application/vnd.exp-car.v3+json,application/vnd.exp-car.v3+xml") - } - - override fun getQueryParams(): Parameters = - Parameters.build { + fun getHeaders(): Headers = + Headers + .builder() + .apply { + partnerTransactionId?.let { + add("Partner-Transaction-Id", it) + } + add("Accept", "application/vnd.exp-car.v3+json") + }.build() + + fun getQueryParams(): List = + buildList { price?.let { - append("price", it) + val key = "price" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } currency?.let { - append("currency", it) + val key = "currency" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } source?.let { - append("source", it) + val key = "source" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } } - override fun getPathParams(): Map = + fun getPathParams(): Map = buildMap { offerToken?.also { put("offerToken", offerToken) diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperation.kt index 8e61afc6b..9e43a1ee8 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperation.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,21 +15,40 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.trait.operation.HeadersTrait +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationRequestTrait +import com.expediagroup.sdk.rest.trait.operation.UrlPathTrait +import com.expediagroup.sdk.rest.trait.operation.UrlQueryParamsTrait +import com.expediagroup.sdk.xap.models.CarListingsResponse +import com.fasterxml.jackson.core.type.TypeReference +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef /** * Search Expedia car inventory * @property params [GetCarsListingsOperationParams] */ class GetCarsListingsOperation( - params: GetCarsListingsOperationParams -) : Operation< - Nothing - >( - "/cars/listings", - "GET", - "getCarsListings", - null, - params - ) + private val params: GetCarsListingsOperationParams, +) : OperationRequestTrait, + UrlPathTrait, + JacksonModelOperationResponseBodyTrait, + UrlQueryParamsTrait, + HeadersTrait { + override fun getHttpMethod(): String = "GET" + + override fun getRequestInfo(): OperationRequestTrait = this + + override fun getUrlPath(): String { + var url = "/cars/listings" + + return url + } + + override fun getTypeIdentifier(): TypeReference = jacksonTypeRef() + + override fun getHeaders(): Headers = this.params.getHeaders() + + override fun getUrlQueryParams() = this.params.getQueryParams() +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt index e2d314963..2333e3dd4 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +15,12 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.OperationParams -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.infrastructure.* +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.model.UrlQueryParam +import com.expediagroup.sdk.rest.util.stringifyExplode +import com.expediagroup.sdk.rest.util.swaggerCollectionFormatStringifier import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import io.ktor.http.Headers -import io.ktor.http.Parameters -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import java.time.temporal.ChronoUnit -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** * @property partnerTransactionId [Not consumed by Expedia] Partner-generated identifier. @@ -60,141 +54,124 @@ import javax.validation.constraints.NotNull */ @JsonDeserialize(builder = GetCarsListingsOperationParams.Builder::class) data class GetCarsListingsOperationParams( - @field:NotNull - @field:Valid val partnerTransactionId: kotlin.String, - @field:Valid val pickupAirport: kotlin.String? = null, - @field:Valid val pickupCity: kotlin.String? = null, - @field:Valid val pickupAddress: kotlin.String? = null, - @field:Valid val pickupGeoLocation: kotlin.String? = null, - @field:Valid val pickupRadius: kotlin.Int? = null, - @field:Valid val dropOffAirport: kotlin.String? = null, - @field:Valid val dropOffCity: kotlin.String? = null, - @field:Valid val dropOffAddress: kotlin.String? = null, - @field:Valid val dropOffGeoLocation: kotlin.String? = null, - @field:Valid val dropOffRadius: kotlin.Int? = null, - @field:NotNull - @field:Valid val pickupTime: java.time.LocalDateTime, - @field:NotNull - @field:Valid val dropOffTime: java.time.LocalDateTime, val sortType: GetCarsListingsOperationParams.SortType? = null, val sortOrder: GetCarsListingsOperationParams.SortOrder? = null, - @field:Valid val limit: kotlin.Int? = null, - @field:Valid val suppliers: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, - @field:Valid val carClasses: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, - @field:Valid val discount1Supplier: kotlin.String? = null, val discount1Type: GetCarsListingsOperationParams.Discount1Type? = null, - @field:Valid val discount1Code: kotlin.String? = null, - @field:Valid val transmissions: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, - @field:Valid val airConditioning: kotlin.Boolean? = null, - @field:Valid val carTypes: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, val unit: GetCarsListingsOperationParams.Unit? = null, - @field:Valid val driverAge: kotlin.Int? = null, val links: kotlin.collections.List< - GetCarsListingsOperationParams.Links + GetCarsListingsOperationParams.Links, >? = null, val source: GetCarsListingsOperationParams.Source? = - null -) : OperationParams { + null, +) { + init { + require(partnerTransactionId != null) { "partnerTransactionId must not be null" } + + require(pickupTime != null) { "pickupTime must not be null" } + + require(dropOffTime != null) { "dropOffTime must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() } enum class SortType( - val value: kotlin.String + val value: kotlin.String, ) { - PRICE("Price") + PRICE("Price"), } enum class SortOrder( - val value: kotlin.String + val value: kotlin.String, ) { ASC("ASC"), - DESC("DESC") + DESC("DESC"), } enum class Discount1Type( - val value: kotlin.String + val value: kotlin.String, ) { CORP_DISCOUNT("CorpDiscount"), - COUPON("Coupon") + COUPON("Coupon"), } enum class Unit( - val value: kotlin.String + val value: kotlin.String, ) { KM("KM"), - MI("MI") + MI("MI"), } enum class Links( - val value: kotlin.String + val value: kotlin.String, ) { WS("WS"), AD("AD"), - WD("WD") + WD("WD"), } enum class Source( - val value: kotlin.String + val value: kotlin.String, ) { BROWSER("browser"), MOBILE("mobile"), - ALL("all") + ALL("all"), } class Builder( @@ -215,27 +192,27 @@ data class GetCarsListingsOperationParams( @JsonProperty("sortOrder") private var sortOrder: GetCarsListingsOperationParams.SortOrder? = null, @JsonProperty("limit") private var limit: kotlin.Int? = null, @JsonProperty("suppliers") private var suppliers: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("carClasses") private var carClasses: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("discount1.supplier") private var discount1Supplier: kotlin.String? = null, @JsonProperty("discount1.type") private var discount1Type: GetCarsListingsOperationParams.Discount1Type? = null, @JsonProperty("discount1.code") private var discount1Code: kotlin.String? = null, @JsonProperty("transmissions") private var transmissions: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("airConditioning") private var airConditioning: kotlin.Boolean? = null, @JsonProperty("carTypes") private var carTypes: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("unit") private var unit: GetCarsListingsOperationParams.Unit? = null, @JsonProperty("driverAge") private var driverAge: kotlin.Int? = null, @JsonProperty("links") private var links: kotlin.collections.List< - GetCarsListingsOperationParams.Links + GetCarsListingsOperationParams.Links, >? = null, - @JsonProperty("source") private var source: GetCarsListingsOperationParams.Source? = null + @JsonProperty("source") private var source: GetCarsListingsOperationParams.Source? = null, ) { /** * @param partnerTransactionId [Not consumed by Expedia] Partner-generated identifier. @@ -322,8 +299,8 @@ data class GetCarsListingsOperationParams( */ fun suppliers( suppliers: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.suppliers = suppliers } /** @@ -331,8 +308,8 @@ data class GetCarsListingsOperationParams( */ fun carClasses( carClasses: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.carClasses = carClasses } /** @@ -355,8 +332,8 @@ data class GetCarsListingsOperationParams( */ fun transmissions( transmissions: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.transmissions = transmissions } /** @@ -369,8 +346,8 @@ data class GetCarsListingsOperationParams( */ fun carTypes( carTypes: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.carTypes = carTypes } /** @@ -388,8 +365,8 @@ data class GetCarsListingsOperationParams( */ fun links( links: kotlin.collections.List< - GetCarsListingsOperationParams.Links - > + GetCarsListingsOperationParams.Links, + >, ) = apply { this.links = links } /** @@ -427,31 +404,11 @@ data class GetCarsListingsOperationParams( unit = unit, driverAge = driverAge, links = links, - source = source + source = source, ) - validate(params) - return params } - - private fun validate(params: GetCarsListingsOperationParams) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(params) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -483,103 +440,425 @@ data class GetCarsListingsOperationParams( unit = unit, driverAge = driverAge, links = links, - source = source + source = source, ) - override fun getHeaders(): Headers = - Headers.build { - partnerTransactionId?.let { - append("Partner-Transaction-Id", it) - } - append("Accept", "application/vnd.exp-car.v3+json,application/vnd.exp-car.v3+xml") - } - - override fun getQueryParams(): Parameters = - Parameters.build { + fun getHeaders(): Headers = + Headers + .builder() + .apply { + partnerTransactionId?.let { + add("Partner-Transaction-Id", it) + } + add("Accept", "application/vnd.exp-car.v3+json") + }.build() + + fun getQueryParams(): List = + buildList { pickupAirport?.let { - append("pickup.airport", it) + val key = "pickup.airport" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } pickupCity?.let { - append("pickup.city", it) + val key = "pickup.city" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } pickupAddress?.let { - append("pickup.address", it) + val key = "pickup.address" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } pickupGeoLocation?.let { - append("pickup.geoLocation", it) + val key = "pickup.geoLocation" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } pickupRadius?.let { - append("pickup.radius", it.toString()) + val key = "pickup.radius" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } dropOffAirport?.let { - append("dropOff.airport", it) + val key = "dropOff.airport" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } dropOffCity?.let { - append("dropOff.city", it) + val key = "dropOff.city" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } dropOffAddress?.let { - append("dropOff.address", it) + val key = "dropOff.address" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } dropOffGeoLocation?.let { - append("dropOff.geoLocation", it) + val key = "dropOff.geoLocation" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } dropOffRadius?.let { - append("dropOff.radius", it.toString()) + val key = "dropOff.radius" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } pickupTime?.let { - append("pickupTime", it.truncatedTo(ChronoUnit.MINUTES).toString()) + val key = "pickupTime" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } dropOffTime?.let { - append("dropOffTime", it.truncatedTo(ChronoUnit.MINUTES).toString()) + val key = "dropOffTime" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } sortType?.let { - append("sortType", it.value) + val key = "sortType" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } sortOrder?.let { - append("sortOrder", it.value) + val key = "sortOrder" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } limit?.let { - append("limit", it.toString()) + val key = "limit" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } suppliers?.let { - appendAll("suppliers", toMultiValue(it, "csv")) + val key = "suppliers" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } carClasses?.let { - appendAll("carClasses", toMultiValue(it, "csv")) + val key = "carClasses" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } discount1Supplier?.let { - append("discount1.supplier", it) + val key = "discount1.supplier" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } discount1Type?.let { - append("discount1.type", it.value) + val key = "discount1.type" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } discount1Code?.let { - append("discount1.code", it) + val key = "discount1.code" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } transmissions?.let { - appendAll("transmissions", toMultiValue(it, "csv")) + val key = "transmissions" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } airConditioning?.let { - append("airConditioning", it.toString()) + val key = "airConditioning" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } carTypes?.let { - appendAll("carTypes", toMultiValue(it, "csv")) + val key = "carTypes" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } unit?.let { - append("unit", it.value) + val key = "unit" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } driverAge?.let { - append("driverAge", it.toString()) + val key = "driverAge" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } links?.let { - appendAll("links", toMultiValue(it.map { item -> item.value }, "csv")) + val key = "links" + val value = + buildList { + addAll(it.map { it.value }) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } source?.let { - append("source", it.value) + val key = "source" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } } - - override fun getPathParams(): Map = - buildMap { - } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperation.kt index 87d5a5ab7..c4ddc0439 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperation.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,21 +15,35 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationRequestTrait +import com.expediagroup.sdk.rest.trait.operation.UrlPathTrait +import com.expediagroup.sdk.rest.trait.operation.UrlQueryParamsTrait +import com.expediagroup.sdk.xap.models.PresignedUrlResponse +import com.fasterxml.jackson.core.type.TypeReference +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef /** * * @property params [GetFeedDownloadUrlOperationParams] */ class GetFeedDownloadUrlOperation( - params: GetFeedDownloadUrlOperationParams -) : Operation< - Nothing - >( - "/feed/v1/download-url", - "GET", - "getFeedDownloadUrl", - null, - params - ) + private val params: GetFeedDownloadUrlOperationParams, +) : OperationRequestTrait, + UrlPathTrait, + JacksonModelOperationResponseBodyTrait, + UrlQueryParamsTrait { + override fun getHttpMethod(): String = "GET" + + override fun getRequestInfo(): OperationRequestTrait = this + + override fun getUrlPath(): String { + var url = "/feed/v1/download-url" + + return url + } + + override fun getTypeIdentifier(): TypeReference = jacksonTypeRef() + + override fun getUrlQueryParams() = this.params.getQueryParams() +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt index 6d9b971a2..563c0f355 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,11 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.OperationParams -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.infrastructure.* +import com.expediagroup.sdk.rest.model.UrlQueryParam +import com.expediagroup.sdk.rest.util.stringifyExplode +import com.expediagroup.sdk.rest.util.swaggerCollectionFormatStringifier import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import io.ktor.http.Headers -import io.ktor.http.Parameters -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** * @property type The type of file, used to get files by type. @@ -36,9 +30,7 @@ import javax.validation.constraints.NotNull */ @JsonDeserialize(builder = GetFeedDownloadUrlOperationParams.Builder::class) data class GetFeedDownloadUrlOperationParams( - @field:NotNull val type: GetFeedDownloadUrlOperationParams.Type, - @field:Valid val locale: kotlin.String? = null, val pointOfSupply: GetFeedDownloadUrlOperationParams.PointOfSupply? = @@ -46,15 +38,19 @@ data class GetFeedDownloadUrlOperationParams( val lodgingType: GetFeedDownloadUrlOperationParams.LodgingType? = null, val brand: GetFeedDownloadUrlOperationParams.Brand? = - null -) : OperationParams { + null, +) { + init { + require(type != null) { "type must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() } enum class Type( - val value: kotlin.String + val value: kotlin.String, ) { DESTINATION("DESTINATION"), VENDORLOGO("VENDORLOGO"), @@ -70,11 +66,11 @@ data class GetFeedDownloadUrlOperationParams( ALL_REGIONS("ALL_REGIONS"), BOUNDING_POLYGON("BOUNDING_POLYGON"), HOTEL_TO_REGION_HIERARCHY("HOTEL_TO_REGION_HIERARCHY"), - ROOM_DETAILS("ROOM_DETAILS") + ROOM_DETAILS("ROOM_DETAILS"), } enum class PointOfSupply( - val value: kotlin.String + val value: kotlin.String, ) { US("US"), AT("AT"), @@ -91,20 +87,20 @@ data class GetFeedDownloadUrlOperationParams( ES("ES"), TR("TR"), AE("AE"), - GB("GB") + GB("GB"), } enum class LodgingType( - val value: kotlin.String + val value: kotlin.String, ) { CL("CL"), - VR("VR") + VR("VR"), } enum class Brand( - val value: kotlin.String + val value: kotlin.String, ) { - VRBO("VRBO") + VRBO("VRBO"), } class Builder( @@ -112,7 +108,7 @@ data class GetFeedDownloadUrlOperationParams( @JsonProperty("locale") private var locale: kotlin.String? = null, @JsonProperty("pointOfSupply") private var pointOfSupply: GetFeedDownloadUrlOperationParams.PointOfSupply? = null, @JsonProperty("lodgingType") private var lodgingType: GetFeedDownloadUrlOperationParams.LodgingType? = null, - @JsonProperty("brand") private var brand: GetFeedDownloadUrlOperationParams.Brand? = null + @JsonProperty("brand") private var brand: GetFeedDownloadUrlOperationParams.Brand? = null, ) { /** * @param type The type of file, used to get files by type. @@ -146,31 +142,11 @@ data class GetFeedDownloadUrlOperationParams( locale = locale, pointOfSupply = pointOfSupply, lodgingType = lodgingType, - brand = brand + brand = brand, ) - validate(params) - return params } - - private fun validate(params: GetFeedDownloadUrlOperationParams) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(params) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -179,34 +155,85 @@ data class GetFeedDownloadUrlOperationParams( locale = locale, pointOfSupply = pointOfSupply, lodgingType = lodgingType, - brand = brand + brand = brand, ) - override fun getHeaders(): Headers = - Headers.build { - append("Accept", "application/vnd.exp-lodging.v1+json") - } - - override fun getQueryParams(): Parameters = - Parameters.build { + fun getQueryParams(): List = + buildList { type?.let { - append("type", it.value) + val key = "type" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } locale?.let { - append("locale", it) + val key = "locale" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } pointOfSupply?.let { - append("pointOfSupply", it.value) + val key = "pointOfSupply" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } lodgingType?.let { - append("lodgingType", it.value) + val key = "lodgingType" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } brand?.let { - append("brand", it.value) + val key = "brand" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } } - - override fun getPathParams(): Map = - buildMap { - } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperation.kt index 4878aee01..fc50a71a9 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperation.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,21 +15,40 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.trait.operation.HeadersTrait +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationRequestTrait +import com.expediagroup.sdk.rest.trait.operation.UrlPathTrait +import com.expediagroup.sdk.rest.trait.operation.UrlQueryParamsTrait +import com.expediagroup.sdk.xap.models.AvailabilityCalendarResponse +import com.fasterxml.jackson.core.type.TypeReference +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef /** * Get availability calendars of properties * @property params [GetLodgingAvailabilityCalendarsOperationParams] */ class GetLodgingAvailabilityCalendarsOperation( - params: GetLodgingAvailabilityCalendarsOperationParams -) : Operation< - Nothing - >( - "/lodging/availabilityCalendars", - "GET", - "getLodgingAvailabilityCalendars", - null, - params - ) + private val params: GetLodgingAvailabilityCalendarsOperationParams, +) : OperationRequestTrait, + UrlPathTrait, + JacksonModelOperationResponseBodyTrait, + UrlQueryParamsTrait, + HeadersTrait { + override fun getHttpMethod(): String = "GET" + + override fun getRequestInfo(): OperationRequestTrait = this + + override fun getUrlPath(): String { + var url = "/lodging/availabilityCalendars" + + return url + } + + override fun getTypeIdentifier(): TypeReference = jacksonTypeRef() + + override fun getHeaders(): Headers = this.params.getHeaders() + + override fun getUrlQueryParams() = this.params.getQueryParams() +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt index 08363b387..d5b72ca9b 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,12 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.OperationParams -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.infrastructure.* +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.model.UrlQueryParam +import com.expediagroup.sdk.rest.util.stringifyExplode +import com.expediagroup.sdk.rest.util.swaggerCollectionFormatStringifier import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import io.ktor.http.Headers -import io.ktor.http.Parameters -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** * @property partnerTransactionId The `Partner-Transaction-ID` is a required API request header element that is not consumed by Expedia. It will be required in all XAP v3 API request headers and will be mirrored back to the partner in the corresponding API response header. The `Partner-Transaction-ID` may be any alphanumeric string of the partner's choosing. @@ -33,15 +28,16 @@ import javax.validation.constraints.NotNull */ @JsonDeserialize(builder = GetLodgingAvailabilityCalendarsOperationParams.Builder::class) data class GetLodgingAvailabilityCalendarsOperationParams( - @field:NotNull - @field:Valid val partnerTransactionId: kotlin.String, - @field:Valid val propertyIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = - null -) : OperationParams { + null, +) { + init { + require(partnerTransactionId != null) { "partnerTransactionId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -50,8 +46,8 @@ data class GetLodgingAvailabilityCalendarsOperationParams( class Builder( @JsonProperty("Partner-Transaction-Id") private var partnerTransactionId: kotlin.String? = null, @JsonProperty("propertyIds") private var propertyIds: kotlin.collections.Set< - kotlin.String - >? = null + kotlin.String, + >? = null, ) { /** * @param partnerTransactionId The `Partner-Transaction-ID` is a required API request header element that is not consumed by Expedia. It will be required in all XAP v3 API request headers and will be mirrored back to the partner in the corresponding API response header. The `Partner-Transaction-ID` may be any alphanumeric string of the partner's choosing. @@ -63,63 +59,53 @@ data class GetLodgingAvailabilityCalendarsOperationParams( */ fun propertyIds( propertyIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.propertyIds = propertyIds } fun build(): GetLodgingAvailabilityCalendarsOperationParams { val params = GetLodgingAvailabilityCalendarsOperationParams( partnerTransactionId = partnerTransactionId!!, - propertyIds = propertyIds + propertyIds = propertyIds, ) - validate(params) - return params } - - private fun validate(params: GetLodgingAvailabilityCalendarsOperationParams) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(params) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = Builder( partnerTransactionId = partnerTransactionId, - propertyIds = propertyIds + propertyIds = propertyIds, ) - override fun getHeaders(): Headers = - Headers.build { - partnerTransactionId?.let { - append("Partner-Transaction-Id", it) - } - append("Accept", "application/vnd.exp-lodging.v3+json") - } + fun getHeaders(): Headers = + Headers + .builder() + .apply { + partnerTransactionId?.let { + add("Partner-Transaction-Id", it) + } + add("Accept", "application/vnd.exp-lodging.v3+json") + }.build() - override fun getQueryParams(): Parameters = - Parameters.build { + fun getQueryParams(): List = + buildList { propertyIds?.let { - appendAll("propertyIds", toMultiValue(it, "csv")) - } - } + val key = "propertyIds" + val value = + buildList { + addAll(it) + } - override fun getPathParams(): Map = - buildMap { + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) + } } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperation.kt index 3c8b9b0a4..2cf110591 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperation.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,30 +15,47 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation -import org.apache.commons.text.StringSubstitutor +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.trait.operation.HeadersTrait +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationRequestTrait +import com.expediagroup.sdk.rest.trait.operation.UrlPathTrait +import com.expediagroup.sdk.rest.trait.operation.UrlQueryParamsTrait +import com.expediagroup.sdk.xap.models.HotelDetailsResponse +import com.fasterxml.jackson.core.type.TypeReference +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef /** * Get Extended information with a single property offer * @property params [GetLodgingDetailsOperationParams] */ class GetLodgingDetailsOperation( - params: GetLodgingDetailsOperationParams -) : Operation< - Nothing - >( - url(params), - "GET", - "getLodgingDetails", - null, - params - ) { - companion object { - fun url(params: GetLodgingDetailsOperationParams): String { - val url = "/hotels/details/{offerToken}" - val substitutor = StringSubstitutor(params.getPathParams(), "{", "}") - return substitutor.replace(url) - } + private val params: GetLodgingDetailsOperationParams, +) : OperationRequestTrait, + UrlPathTrait, + JacksonModelOperationResponseBodyTrait, + UrlQueryParamsTrait, + HeadersTrait { + override fun getHttpMethod(): String = "GET" + + override fun getRequestInfo(): OperationRequestTrait = this + + override fun getUrlPath(): String { + var url = "/hotels/details/{offerToken}" + + url = + url.replace( + oldValue = "{" + "offerToken" + "}", + newValue = this.params.offerToken, + ignoreCase = true, + ) + + return url } + + override fun getTypeIdentifier(): TypeReference = jacksonTypeRef() + + override fun getHeaders(): Headers = this.params.getHeaders() + + override fun getUrlQueryParams() = this.params.getQueryParams() } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt index 44403bb61..7e851db4a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,12 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.OperationParams -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.infrastructure.* +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.model.UrlQueryParam +import com.expediagroup.sdk.rest.util.stringifyExplode +import com.expediagroup.sdk.rest.util.swaggerCollectionFormatStringifier import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import io.ktor.http.Headers -import io.ktor.http.Parameters -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** * @property offerToken A Hotel Natural Key from the Lodging Search API -> Hotels -> RoomTypes -> OfferId. It is a concatenated string of multiple values that defines a hotel offer. @@ -38,40 +33,38 @@ import javax.validation.constraints.NotNull */ @JsonDeserialize(builder = GetLodgingDetailsOperationParams.Builder::class) data class GetLodgingDetailsOperationParams( - @field:NotNull - @field:Valid val offerToken: kotlin.String, - @field:NotNull - @field:Valid val partnerTransactionId: kotlin.String, - @field:Valid val price: kotlin.String? = null, - @field:Valid val currency: kotlin.String? = null, - @field:Valid val locale: kotlin.String? = null, val imageSizes: GetLodgingDetailsOperationParams.ImageSizes? = ImageSizes.T, - @field:Valid val groupedAmenities: kotlin.Boolean? = - null -) : OperationParams { + null, +) { + init { + require(offerToken != null) { "offerToken must not be null" } + + require(partnerTransactionId != null) { "partnerTransactionId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() } enum class ImageSizes( - val value: kotlin.String + val value: kotlin.String, ) { T("t"), S("s"), B("b"), Y("y"), - Z("z") + Z("z"), } class Builder( @@ -81,7 +74,7 @@ data class GetLodgingDetailsOperationParams( @JsonProperty("currency") private var currency: kotlin.String? = null, @JsonProperty("locale") private var locale: kotlin.String? = null, @JsonProperty("imageSizes") private var imageSizes: GetLodgingDetailsOperationParams.ImageSizes? = null, - @JsonProperty("groupedAmenities") private var groupedAmenities: kotlin.Boolean? = null + @JsonProperty("groupedAmenities") private var groupedAmenities: kotlin.Boolean? = null, ) { /** * @param offerToken A Hotel Natural Key from the Lodging Search API -> Hotels -> RoomTypes -> OfferId. It is a concatenated string of multiple values that defines a hotel offer. @@ -127,31 +120,11 @@ data class GetLodgingDetailsOperationParams( currency = currency, locale = locale, imageSizes = imageSizes, - groupedAmenities = groupedAmenities + groupedAmenities = groupedAmenities, ) - validate(params) - return params } - - private fun validate(params: GetLodgingDetailsOperationParams) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(params) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -162,37 +135,99 @@ data class GetLodgingDetailsOperationParams( currency = currency, locale = locale, imageSizes = imageSizes, - groupedAmenities = groupedAmenities + groupedAmenities = groupedAmenities, ) - override fun getHeaders(): Headers = - Headers.build { - partnerTransactionId?.let { - append("Partner-Transaction-Id", it) - } - append("Accept", "application/vnd.exp-hotel.v3+json") - } - - override fun getQueryParams(): Parameters = - Parameters.build { + fun getHeaders(): Headers = + Headers + .builder() + .apply { + partnerTransactionId?.let { + add("Partner-Transaction-Id", it) + } + add("Accept", "application/vnd.exp-hotel.v3+json") + }.build() + + fun getQueryParams(): List = + buildList { price?.let { - append("price", it) + val key = "price" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } currency?.let { - append("currency", it) + val key = "currency" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } locale?.let { - append("locale", it) + val key = "locale" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } imageSizes?.let { - append("imageSizes", it.value) + val key = "imageSizes" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } groupedAmenities?.let { - append("groupedAmenities", it.toString()) + val key = "groupedAmenities" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } } - override fun getPathParams(): Map = + fun getPathParams(): Map = buildMap { offerToken?.also { put("offerToken", offerToken) diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperation.kt index 8c1263988..1663d366a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperation.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,21 +15,40 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.trait.operation.HeadersTrait +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationRequestTrait +import com.expediagroup.sdk.rest.trait.operation.UrlPathTrait +import com.expediagroup.sdk.rest.trait.operation.UrlQueryParamsTrait +import com.expediagroup.sdk.xap.models.HotelListingsResponse +import com.fasterxml.jackson.core.type.TypeReference +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef /** * Search lodging inventory * @property params [GetLodgingListingsOperationParams] */ class GetLodgingListingsOperation( - params: GetLodgingListingsOperationParams -) : Operation< - Nothing - >( - "/hotels/listings", - "GET", - "getLodgingListings", - null, - params - ) + private val params: GetLodgingListingsOperationParams, +) : OperationRequestTrait, + UrlPathTrait, + JacksonModelOperationResponseBodyTrait, + UrlQueryParamsTrait, + HeadersTrait { + override fun getHttpMethod(): String = "GET" + + override fun getRequestInfo(): OperationRequestTrait = this + + override fun getUrlPath(): String { + var url = "/hotels/listings" + + return url + } + + override fun getTypeIdentifier(): TypeReference = jacksonTypeRef() + + override fun getHeaders(): Headers = this.params.getHeaders() + + override fun getUrlQueryParams() = this.params.getQueryParams() +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt index e8661f32f..ad4c1105f 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +15,12 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.OperationParams -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.infrastructure.* -import com.expediagroup.sdk.xap.models.Room +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.model.UrlQueryParam +import com.expediagroup.sdk.rest.util.stringifyExplode +import com.expediagroup.sdk.rest.util.swaggerCollectionFormatStringifier import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import io.ktor.http.Headers -import io.ktor.http.Parameters -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** * @property partnerTransactionId The `Partner-Transaction-ID` is a required API request header element that is not consumed by Expedia. It will be required in all XAP v3 API request headers and will be mirrored back to the partner in the corresponding API response header. The `Partner-Transaction-ID` may be any alphanumeric string of the partner's choosing. @@ -83,72 +77,55 @@ import javax.validation.constraints.NotNull */ @JsonDeserialize(builder = GetLodgingListingsOperationParams.Builder::class) data class GetLodgingListingsOperationParams( - @field:NotNull - @field:Valid val partnerTransactionId: kotlin.String, - @field:Valid val ecomHotelIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, - @field:Valid val hcomHotelIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, - @field:Valid val geoLocation: kotlin.String? = null, - @field:Valid val radius: kotlin.Long? = 25L, val unit: GetLodgingListingsOperationParams.Unit? = Unit.KM, - @field:Valid val locationKeyword: kotlin.String? = null, - @field:Valid val regionIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, - @field:Valid val checkIn: java.time.LocalDate? = null, - @field:Valid val checkOut: java.time.LocalDate? = null, - @field:Valid val locale: kotlin.String? = null, - @field:Valid val currency: kotlin.String? = null, val source: GetLodgingListingsOperationParams.Source? = Source.BROWSER, - @field:Valid val travelWithPets: kotlin.Boolean? = false, val contentDetails: GetLodgingListingsOperationParams.ContentDetails? = ContentDetails.LOW, - @field:Valid val allRoomTypes: kotlin.Boolean? = false, val links: kotlin.collections.List< - GetLodgingListingsOperationParams.Links + GetLodgingListingsOperationParams.Links, >? = null, val minStarRating: GetLodgingListingsOperationParams.MinStarRating? = null, val maxStarRating: GetLodgingListingsOperationParams.MaxStarRating? = null, - @field:Valid val limit: kotlin.Long? = null, - @field:Valid val queryText: kotlin.String? = null, - @field:Valid val availOnly: kotlin.Boolean? = null, val smokingPreference: GetLodgingListingsOperationParams.SmokingPreference? = @@ -159,28 +136,22 @@ data class GetLodgingListingsOperationParams( null, val thumbnailImageSize: GetLodgingListingsOperationParams.ThumbnailImageSize? = null, - @field:Valid val includedPropertyTypeIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, - @field:Valid val excludedPropertyTypeIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, - @field:Valid val includedInventorySourceIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, - @field:Valid val freeCancellation: kotlin.Boolean? = null, - @field:Valid val groupedAmenities: kotlin.Boolean? = null, - @field:Valid val blockFullDepositRateplan: kotlin.Boolean? = false, val ratePlanType: GetLodgingListingsOperationParams.RatePlanType? = @@ -189,112 +160,100 @@ data class GetLodgingListingsOperationParams( null, val sortOrder: GetLodgingListingsOperationParams.SortOrder? = SortOrder.ASC, - @field:Valid val room1Adults: kotlin.Long? = null, - @field:Valid val room1ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room2Adults: kotlin.Long? = null, - @field:Valid val room2ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room3Adults: kotlin.Long? = null, - @field:Valid val room3ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room4Adults: kotlin.Long? = null, - @field:Valid val room4ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room5Adults: kotlin.Long? = null, - @field:Valid val room5ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room6Adults: kotlin.Long? = null, - @field:Valid val room6ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room7Adults: kotlin.Long? = null, - @field:Valid val room7ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room8Adults: kotlin.Long? = null, - @field:Valid val room8ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = - null -) : OperationParams { + null, +) { + init { + require(partnerTransactionId != null) { "partnerTransactionId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() } enum class Unit( - val value: kotlin.String + val value: kotlin.String, ) { KM("km"), - MI("mi") + MI("mi"), } enum class Source( - val value: kotlin.String + val value: kotlin.String, ) { BROWSER("browser"), - MOBILEAPP("mobileapp") + MOBILEAPP("mobileapp"), } enum class ContentDetails( - val value: kotlin.String + val value: kotlin.String, ) { LOWEST("lowest"), LOW("low"), MEDIUM("medium"), - HIGH("high") + HIGH("high"), } enum class Links( - val value: kotlin.String + val value: kotlin.String, ) { WD("WD"), WS("WS"), AD("AD"), RC("RC"), WEB("WEB"), - API("API") + API("API"), } enum class MinStarRating( - val value: kotlin.String + val value: kotlin.String, ) { _1_PERIOD0("1.0"), _1_PERIOD5("1.5"), @@ -304,11 +263,11 @@ data class GetLodgingListingsOperationParams( _3_PERIOD5("3.5"), _4_PERIOD0("4.0"), _4_PERIOD5("4.5"), - _5_PERIOD0("5.0") + _5_PERIOD0("5.0"), } enum class MaxStarRating( - val value: kotlin.String + val value: kotlin.String, ) { _1_PERIOD0("1.0"), _1_PERIOD5("1.5"), @@ -318,54 +277,54 @@ data class GetLodgingListingsOperationParams( _3_PERIOD5("3.5"), _4_PERIOD0("4.0"), _4_PERIOD5("4.5"), - _5_PERIOD0("5.0") + _5_PERIOD0("5.0"), } enum class SmokingPreference( - val value: kotlin.String + val value: kotlin.String, ) { SMOKING("smoking"), NONSMOKING("nonsmoking"), - BOTH("both") + BOTH("both"), } enum class RateType( - val value: kotlin.String + val value: kotlin.String, ) { PAYONLINE("payonline"), PAYHOTEL("payhotel"), - ALL("all") + ALL("all"), } enum class ImageSizes( - val value: kotlin.String + val value: kotlin.String, ) { T("t"), S("s"), B("b"), Y("y"), - Z("z") + Z("z"), } enum class ThumbnailImageSize( - val value: kotlin.String + val value: kotlin.String, ) { T("t"), S("s"), B("b"), Y("y"), - Z("z") + Z("z"), } enum class RatePlanType( - val value: kotlin.String + val value: kotlin.String, ) { STANDALONE("standalone"), - PACKAGE("package") + PACKAGE("package"), } enum class SortType( - val value: kotlin.String + val value: kotlin.String, ) { PRICE("price"), STARRATING("starrating"), @@ -374,30 +333,30 @@ data class GetLodgingListingsOperationParams( GUESTRATING("guestrating"), HOTELNAME("hotelname"), DISTANCE("distance"), - TOTALPRICEWITHFEES("totalpricewithfees") + TOTALPRICEWITHFEES("totalpricewithfees"), } enum class SortOrder( - val value: kotlin.String + val value: kotlin.String, ) { ASC("asc"), - DESC("desc") + DESC("desc"), } class Builder( @JsonProperty("Partner-Transaction-Id") private var partnerTransactionId: kotlin.String? = null, @JsonProperty("ecomHotelIds") private var ecomHotelIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("hcomHotelIds") private var hcomHotelIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("geoLocation") private var geoLocation: kotlin.String? = null, @JsonProperty("radius") private var radius: kotlin.Long? = null, @JsonProperty("unit") private var unit: GetLodgingListingsOperationParams.Unit? = null, @JsonProperty("locationKeyword") private var locationKeyword: kotlin.String? = null, @JsonProperty("regionIds") private var regionIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("checkIn") private var checkIn: java.time.LocalDate? = null, @JsonProperty("checkOut") private var checkOut: java.time.LocalDate? = null, @@ -408,7 +367,7 @@ data class GetLodgingListingsOperationParams( @JsonProperty("contentDetails") private var contentDetails: GetLodgingListingsOperationParams.ContentDetails? = null, @JsonProperty("allRoomTypes") private var allRoomTypes: kotlin.Boolean? = null, @JsonProperty("links") private var links: kotlin.collections.List< - GetLodgingListingsOperationParams.Links + GetLodgingListingsOperationParams.Links, >? = null, @JsonProperty("minStarRating") private var minStarRating: GetLodgingListingsOperationParams.MinStarRating? = null, @JsonProperty("maxStarRating") private var maxStarRating: GetLodgingListingsOperationParams.MaxStarRating? = null, @@ -420,13 +379,13 @@ data class GetLodgingListingsOperationParams( @JsonProperty("imageSizes") private var imageSizes: GetLodgingListingsOperationParams.ImageSizes? = null, @JsonProperty("thumbnailImageSize") private var thumbnailImageSize: GetLodgingListingsOperationParams.ThumbnailImageSize? = null, @JsonProperty("includedPropertyTypeIds") private var includedPropertyTypeIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("excludedPropertyTypeIds") private var excludedPropertyTypeIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("includedInventorySourceIds") private var includedInventorySourceIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("freeCancellation") private var freeCancellation: kotlin.Boolean? = null, @JsonProperty("groupedAmenities") private var groupedAmenities: kotlin.Boolean? = null, @@ -436,36 +395,36 @@ data class GetLodgingListingsOperationParams( @JsonProperty("sortOrder") private var sortOrder: GetLodgingListingsOperationParams.SortOrder? = null, @JsonProperty("room1.adults") private var room1Adults: kotlin.Long? = null, @JsonProperty("room1.childAges") private var room1ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room2.adults") private var room2Adults: kotlin.Long? = null, @JsonProperty("room2.childAges") private var room2ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room3.adults") private var room3Adults: kotlin.Long? = null, @JsonProperty("room3.childAges") private var room3ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room4.adults") private var room4Adults: kotlin.Long? = null, @JsonProperty("room4.childAges") private var room4ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room5.adults") private var room5Adults: kotlin.Long? = null, @JsonProperty("room5.childAges") private var room5ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room6.adults") private var room6Adults: kotlin.Long? = null, @JsonProperty("room6.childAges") private var room6ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room7.adults") private var room7Adults: kotlin.Long? = null, @JsonProperty("room7.childAges") private var room7ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room8.adults") private var room8Adults: kotlin.Long? = null, @JsonProperty("room8.childAges") private var room8ChildAges: kotlin.collections.List< - kotlin.String - >? = null + kotlin.String, + >? = null, ) { /** * @param partnerTransactionId The `Partner-Transaction-ID` is a required API request header element that is not consumed by Expedia. It will be required in all XAP v3 API request headers and will be mirrored back to the partner in the corresponding API response header. The `Partner-Transaction-ID` may be any alphanumeric string of the partner's choosing. @@ -477,8 +436,8 @@ data class GetLodgingListingsOperationParams( */ fun ecomHotelIds( ecomHotelIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.ecomHotelIds = ecomHotelIds } /** @@ -486,8 +445,8 @@ data class GetLodgingListingsOperationParams( */ fun hcomHotelIds( hcomHotelIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.hcomHotelIds = hcomHotelIds } /** @@ -515,8 +474,8 @@ data class GetLodgingListingsOperationParams( */ fun regionIds( regionIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.regionIds = regionIds } /** @@ -564,8 +523,8 @@ data class GetLodgingListingsOperationParams( */ fun links( links: kotlin.collections.List< - GetLodgingListingsOperationParams.Links - > + GetLodgingListingsOperationParams.Links, + >, ) = apply { this.links = links } /** @@ -618,8 +577,8 @@ data class GetLodgingListingsOperationParams( */ fun includedPropertyTypeIds( includedPropertyTypeIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.includedPropertyTypeIds = includedPropertyTypeIds } /** @@ -627,8 +586,8 @@ data class GetLodgingListingsOperationParams( */ fun excludedPropertyTypeIds( excludedPropertyTypeIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.excludedPropertyTypeIds = excludedPropertyTypeIds } /** @@ -636,8 +595,8 @@ data class GetLodgingListingsOperationParams( */ fun includedInventorySourceIds( includedInventorySourceIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.includedInventorySourceIds = includedInventorySourceIds } /** @@ -670,11 +629,11 @@ data class GetLodgingListingsOperationParams( */ fun sortOrder(sortOrder: GetLodgingListingsOperationParams.SortOrder) = apply { this.sortOrder = sortOrder } - fun rooms(rooms: List) = + fun rooms(rooms: List) = apply { if (rooms.size > 8) { - throw PropertyConstraintViolationException( - constraintViolations = listOf("rooms: size must be between 0 and 8") + throw com.expediagroup.sdk.rest.exception.client.PropertyConstraintViolationException( + constraintViolations = listOf("rooms: size must be between 0 and 8"), ) } @@ -772,31 +731,11 @@ data class GetLodgingListingsOperationParams( room7Adults = room7Adults, room7ChildAges = room7ChildAges, room8Adults = room8Adults, - room8ChildAges = room8ChildAges + room8ChildAges = room8ChildAges, ) - validate(params) - return params } - - private fun validate(params: GetLodgingListingsOperationParams) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(params) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -851,172 +790,770 @@ data class GetLodgingListingsOperationParams( room7Adults = room7Adults, room7ChildAges = room7ChildAges, room8Adults = room8Adults, - room8ChildAges = room8ChildAges + room8ChildAges = room8ChildAges, ) - override fun getHeaders(): Headers = - Headers.build { - partnerTransactionId?.let { - append("Partner-Transaction-Id", it) - } - append("Accept", "application/vnd.exp-hotel.v3+json") - } + fun getHeaders(): Headers = + Headers + .builder() + .apply { + partnerTransactionId?.let { + add("Partner-Transaction-Id", it) + } + add("Accept", "application/vnd.exp-hotel.v3+json") + }.build() - override fun getQueryParams(): Parameters = - Parameters.build { + fun getQueryParams(): List = + buildList { ecomHotelIds?.let { - appendAll("ecomHotelIds", toMultiValue(it, "csv")) + val key = "ecomHotelIds" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } hcomHotelIds?.let { - appendAll("hcomHotelIds", toMultiValue(it, "csv")) + val key = "hcomHotelIds" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } geoLocation?.let { - append("geoLocation", it) + val key = "geoLocation" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } radius?.let { - append("radius", it.toString()) + val key = "radius" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } unit?.let { - append("unit", it.value) + val key = "unit" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } locationKeyword?.let { - append("locationKeyword", it) + val key = "locationKeyword" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } regionIds?.let { - appendAll("regionIds", toMultiValue(it, "csv")) + val key = "regionIds" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } checkIn?.let { - append("checkIn", it.toString()) + val key = "checkIn" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } checkOut?.let { - append("checkOut", it.toString()) + val key = "checkOut" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } locale?.let { - append("locale", it) + val key = "locale" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } currency?.let { - append("currency", it) + val key = "currency" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } source?.let { - append("source", it.value) + val key = "source" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } travelWithPets?.let { - append("travelWithPets", it.toString()) + val key = "travelWithPets" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } contentDetails?.let { - append("contentDetails", it.value) + val key = "contentDetails" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } allRoomTypes?.let { - append("allRoomTypes", it.toString()) + val key = "allRoomTypes" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } links?.let { - appendAll("links", toMultiValue(it.map { item -> item.value }, "csv")) + val key = "links" + val value = + buildList { + addAll(it.map { it.value }) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } minStarRating?.let { - append("minStarRating", it.value) + val key = "minStarRating" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } maxStarRating?.let { - append("maxStarRating", it.value) + val key = "maxStarRating" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } limit?.let { - append("limit", it.toString()) + val key = "limit" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } queryText?.let { - append("queryText", it) + val key = "queryText" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } availOnly?.let { - append("availOnly", it.toString()) + val key = "availOnly" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } smokingPreference?.let { - append("smokingPreference", it.value) + val key = "smokingPreference" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } rateType?.let { - append("rateType", it.value) + val key = "rateType" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } imageSizes?.let { - append("imageSizes", it.value) + val key = "imageSizes" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } thumbnailImageSize?.let { - append("thumbnailImageSize", it.value) + val key = "thumbnailImageSize" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } includedPropertyTypeIds?.let { - appendAll("includedPropertyTypeIds", toMultiValue(it, "csv")) + val key = "includedPropertyTypeIds" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } excludedPropertyTypeIds?.let { - appendAll("excludedPropertyTypeIds", toMultiValue(it, "csv")) + val key = "excludedPropertyTypeIds" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } includedInventorySourceIds?.let { - appendAll("includedInventorySourceIds", toMultiValue(it, "csv")) + val key = "includedInventorySourceIds" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } freeCancellation?.let { - append("freeCancellation", it.toString()) + val key = "freeCancellation" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } groupedAmenities?.let { - append("groupedAmenities", it.toString()) + val key = "groupedAmenities" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } blockFullDepositRateplan?.let { - append("blockFullDepositRateplan", it.toString()) + val key = "blockFullDepositRateplan" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } ratePlanType?.let { - append("ratePlanType", it.value) + val key = "ratePlanType" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } sortType?.let { - append("sortType", it.value) + val key = "sortType" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } sortOrder?.let { - append("sortOrder", it.value) + val key = "sortOrder" + val value = + buildList { + add(it.value) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room1Adults?.let { - append("room1.adults", it.toString()) + val key = "room1.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room1ChildAges?.let { - appendAll("room1.childAges", toMultiValue(it, "csv")) + val key = "room1.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room2Adults?.let { - append("room2.adults", it.toString()) + val key = "room2.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room2ChildAges?.let { - appendAll("room2.childAges", toMultiValue(it, "csv")) + val key = "room2.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room3Adults?.let { - append("room3.adults", it.toString()) + val key = "room3.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room3ChildAges?.let { - appendAll("room3.childAges", toMultiValue(it, "csv")) + val key = "room3.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room4Adults?.let { - append("room4.adults", it.toString()) + val key = "room4.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room4ChildAges?.let { - appendAll("room4.childAges", toMultiValue(it, "csv")) + val key = "room4.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room5Adults?.let { - append("room5.adults", it.toString()) + val key = "room5.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room5ChildAges?.let { - appendAll("room5.childAges", toMultiValue(it, "csv")) + val key = "room5.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room6Adults?.let { - append("room6.adults", it.toString()) + val key = "room6.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room6ChildAges?.let { - appendAll("room6.childAges", toMultiValue(it, "csv")) + val key = "room6.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room7Adults?.let { - append("room7.adults", it.toString()) + val key = "room7.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room7ChildAges?.let { - appendAll("room7.childAges", toMultiValue(it, "csv")) + val key = "room7.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room8Adults?.let { - append("room8.adults", it.toString()) + val key = "room8.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room8ChildAges?.let { - appendAll("room8.childAges", toMultiValue(it, "csv")) + val key = "room8.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } } - - override fun getPathParams(): Map = - buildMap { - } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperation.kt index 88996be23..8a4a3acb4 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperation.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,21 +15,40 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.trait.operation.HeadersTrait +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationRequestTrait +import com.expediagroup.sdk.rest.trait.operation.UrlPathTrait +import com.expediagroup.sdk.rest.trait.operation.UrlQueryParamsTrait +import com.expediagroup.sdk.xap.models.LodgingQuotesResponse +import com.fasterxml.jackson.core.type.TypeReference +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef /** * Get properties price and availability information * @property params [GetLodgingQuotesOperationParams] */ class GetLodgingQuotesOperation( - params: GetLodgingQuotesOperationParams -) : Operation< - Nothing - >( - "/lodging/quotes", - "GET", - "getLodgingQuotes", - null, - params - ) + private val params: GetLodgingQuotesOperationParams, +) : OperationRequestTrait, + UrlPathTrait, + JacksonModelOperationResponseBodyTrait, + UrlQueryParamsTrait, + HeadersTrait { + override fun getHttpMethod(): String = "GET" + + override fun getRequestInfo(): OperationRequestTrait = this + + override fun getUrlPath(): String { + var url = "/lodging/quotes" + + return url + } + + override fun getTypeIdentifier(): TypeReference = jacksonTypeRef() + + override fun getHeaders(): Headers = this.params.getHeaders() + + override fun getUrlQueryParams() = this.params.getQueryParams() +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt index ecf9284fe..0ef246e5a 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,18 +15,12 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.OperationParams -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.infrastructure.* -import com.expediagroup.sdk.xap.models.Room +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.model.UrlQueryParam +import com.expediagroup.sdk.rest.util.stringifyExplode +import com.expediagroup.sdk.rest.util.swaggerCollectionFormatStringifier import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import io.ktor.http.Headers -import io.ktor.http.Parameters -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** * @property partnerTransactionId The `Partner-Transaction-ID` is a required API request header element that is not consumed by Expedia. It will be required in all XAP v3 API request headers and will be mirrored back to the partner in the corresponding API response header. The `Partner-Transaction-ID` may be any alphanumeric string of the partner's choosing. @@ -55,152 +49,133 @@ import javax.validation.constraints.NotNull */ @JsonDeserialize(builder = GetLodgingQuotesOperationParams.Builder::class) data class GetLodgingQuotesOperationParams( - @field:NotNull - @field:Valid val partnerTransactionId: kotlin.String, - @field:Valid val propertyIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, - @field:Valid val checkIn: java.time.LocalDate? = null, - @field:Valid val checkOut: java.time.LocalDate? = null, - @field:Valid val currency: kotlin.String? = null, val links: kotlin.collections.List< - GetLodgingQuotesOperationParams.Links + GetLodgingQuotesOperationParams.Links, >? = null, - @field:Valid val travelWithPets: kotlin.Boolean? = false, - @field:Valid val room1Adults: kotlin.Long? = null, - @field:Valid val room1ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room2Adults: kotlin.Long? = null, - @field:Valid val room2ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room3Adults: kotlin.Long? = null, - @field:Valid val room3ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room4Adults: kotlin.Long? = null, - @field:Valid val room4ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room5Adults: kotlin.Long? = null, - @field:Valid val room5ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room6Adults: kotlin.Long? = null, - @field:Valid val room6ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room7Adults: kotlin.Long? = null, - @field:Valid val room7ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, - @field:Valid val room8Adults: kotlin.Long? = null, - @field:Valid val room8ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = - null -) : OperationParams { + null, +) { + init { + require(partnerTransactionId != null) { "partnerTransactionId must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() } enum class Links( - val value: kotlin.String + val value: kotlin.String, ) { WD("WD"), WS("WS"), - WEB("WEB") + WEB("WEB"), } class Builder( @JsonProperty("Partner-Transaction-Id") private var partnerTransactionId: kotlin.String? = null, @JsonProperty("propertyIds") private var propertyIds: kotlin.collections.Set< - kotlin.String + kotlin.String, >? = null, @JsonProperty("checkIn") private var checkIn: java.time.LocalDate? = null, @JsonProperty("checkOut") private var checkOut: java.time.LocalDate? = null, @JsonProperty("currency") private var currency: kotlin.String? = null, @JsonProperty("links") private var links: kotlin.collections.List< - GetLodgingQuotesOperationParams.Links + GetLodgingQuotesOperationParams.Links, >? = null, @JsonProperty("travelWithPets") private var travelWithPets: kotlin.Boolean? = null, @JsonProperty("room1.adults") private var room1Adults: kotlin.Long? = null, @JsonProperty("room1.childAges") private var room1ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room2.adults") private var room2Adults: kotlin.Long? = null, @JsonProperty("room2.childAges") private var room2ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room3.adults") private var room3Adults: kotlin.Long? = null, @JsonProperty("room3.childAges") private var room3ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room4.adults") private var room4Adults: kotlin.Long? = null, @JsonProperty("room4.childAges") private var room4ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room5.adults") private var room5Adults: kotlin.Long? = null, @JsonProperty("room5.childAges") private var room5ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room6.adults") private var room6Adults: kotlin.Long? = null, @JsonProperty("room6.childAges") private var room6ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room7.adults") private var room7Adults: kotlin.Long? = null, @JsonProperty("room7.childAges") private var room7ChildAges: kotlin.collections.List< - kotlin.String + kotlin.String, >? = null, @JsonProperty("room8.adults") private var room8Adults: kotlin.Long? = null, @JsonProperty("room8.childAges") private var room8ChildAges: kotlin.collections.List< - kotlin.String - >? = null + kotlin.String, + >? = null, ) { /** * @param partnerTransactionId The `Partner-Transaction-ID` is a required API request header element that is not consumed by Expedia. It will be required in all XAP v3 API request headers and will be mirrored back to the partner in the corresponding API response header. The `Partner-Transaction-ID` may be any alphanumeric string of the partner's choosing. @@ -212,8 +187,8 @@ data class GetLodgingQuotesOperationParams( */ fun propertyIds( propertyIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.propertyIds = propertyIds } /** @@ -236,8 +211,8 @@ data class GetLodgingQuotesOperationParams( */ fun links( links: kotlin.collections.List< - GetLodgingQuotesOperationParams.Links - > + GetLodgingQuotesOperationParams.Links, + >, ) = apply { this.links = links } /** @@ -245,11 +220,11 @@ data class GetLodgingQuotesOperationParams( */ fun travelWithPets(travelWithPets: kotlin.Boolean) = apply { this.travelWithPets = travelWithPets } - fun rooms(rooms: List) = + fun rooms(rooms: List) = apply { if (rooms.size > 8) { - throw PropertyConstraintViolationException( - constraintViolations = listOf("rooms: size must be between 0 and 8") + throw com.expediagroup.sdk.rest.exception.client.PropertyConstraintViolationException( + constraintViolations = listOf("rooms: size must be between 0 and 8"), ) } @@ -319,31 +294,11 @@ data class GetLodgingQuotesOperationParams( room7Adults = room7Adults, room7ChildAges = room7ChildAges, room8Adults = room8Adults, - room8ChildAges = room8ChildAges + room8ChildAges = room8ChildAges, ) - validate(params) - return params } - - private fun validate(params: GetLodgingQuotesOperationParams) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(params) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -370,88 +325,350 @@ data class GetLodgingQuotesOperationParams( room7Adults = room7Adults, room7ChildAges = room7ChildAges, room8Adults = room8Adults, - room8ChildAges = room8ChildAges + room8ChildAges = room8ChildAges, ) - override fun getHeaders(): Headers = - Headers.build { - partnerTransactionId?.let { - append("Partner-Transaction-Id", it) - } - append("Accept", "application/vnd.exp-lodging.v3+json") - } + fun getHeaders(): Headers = + Headers + .builder() + .apply { + partnerTransactionId?.let { + add("Partner-Transaction-Id", it) + } + add("Accept", "application/vnd.exp-lodging.v3+json") + }.build() - override fun getQueryParams(): Parameters = - Parameters.build { + fun getQueryParams(): List = + buildList { propertyIds?.let { - appendAll("propertyIds", toMultiValue(it, "csv")) + val key = "propertyIds" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } checkIn?.let { - append("checkIn", it.toString()) + val key = "checkIn" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } checkOut?.let { - append("checkOut", it.toString()) + val key = "checkOut" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } currency?.let { - append("currency", it) + val key = "currency" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } links?.let { - appendAll("links", toMultiValue(it.map { item -> item.value }, "csv")) + val key = "links" + val value = + buildList { + addAll(it.map { it.value }) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } travelWithPets?.let { - append("travelWithPets", it.toString()) + val key = "travelWithPets" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room1Adults?.let { - append("room1.adults", it.toString()) + val key = "room1.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room1ChildAges?.let { - appendAll("room1.childAges", toMultiValue(it, "csv")) + val key = "room1.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room2Adults?.let { - append("room2.adults", it.toString()) + val key = "room2.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room2ChildAges?.let { - appendAll("room2.childAges", toMultiValue(it, "csv")) + val key = "room2.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room3Adults?.let { - append("room3.adults", it.toString()) + val key = "room3.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room3ChildAges?.let { - appendAll("room3.childAges", toMultiValue(it, "csv")) + val key = "room3.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room4Adults?.let { - append("room4.adults", it.toString()) + val key = "room4.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room4ChildAges?.let { - appendAll("room4.childAges", toMultiValue(it, "csv")) + val key = "room4.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room5Adults?.let { - append("room5.adults", it.toString()) + val key = "room5.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room5ChildAges?.let { - appendAll("room5.childAges", toMultiValue(it, "csv")) + val key = "room5.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room6Adults?.let { - append("room6.adults", it.toString()) + val key = "room6.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room6ChildAges?.let { - appendAll("room6.childAges", toMultiValue(it, "csv")) + val key = "room6.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room7Adults?.let { - append("room7.adults", it.toString()) + val key = "room7.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room7ChildAges?.let { - appendAll("room7.childAges", toMultiValue(it, "csv")) + val key = "room7.childAges" + val value = + buildList { + addAll(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) } room8Adults?.let { - append("room8.adults", it.toString()) + val key = "room8.adults" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } room8ChildAges?.let { - appendAll("room8.childAges", toMultiValue(it, "csv")) - } - } + val key = "room8.childAges" + val value = + buildList { + addAll(it) + } - override fun getPathParams(): Map = - buildMap { + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("csv", stringifyExplode), + ), + ) + } } } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperation.kt index a375d6b7d..6d81ebd74 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperation.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperation.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,21 +15,40 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.trait.operation.HeadersTrait +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationRequestTrait +import com.expediagroup.sdk.rest.trait.operation.UrlPathTrait +import com.expediagroup.sdk.rest.trait.operation.UrlQueryParamsTrait +import com.expediagroup.sdk.xap.models.RateCalendarResponse +import com.fasterxml.jackson.core.type.TypeReference +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef /** * Get rate calendar of a property * @property params [GetLodgingRateCalendarOperationParams] */ class GetLodgingRateCalendarOperation( - params: GetLodgingRateCalendarOperationParams -) : Operation< - Nothing - >( - "/hotels/rateCalendar", - "GET", - "getLodgingRateCalendar", - null, - params - ) + private val params: GetLodgingRateCalendarOperationParams, +) : OperationRequestTrait, + UrlPathTrait, + JacksonModelOperationResponseBodyTrait, + UrlQueryParamsTrait, + HeadersTrait { + override fun getHttpMethod(): String = "GET" + + override fun getRequestInfo(): OperationRequestTrait = this + + override fun getUrlPath(): String { + var url = "/hotels/rateCalendar" + + return url + } + + override fun getTypeIdentifier(): TypeReference = jacksonTypeRef() + + override fun getHeaders(): Headers = this.params.getHeaders() + + override fun getUrlQueryParams() = this.params.getQueryParams() +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt index c3f4b290a..db794eb6c 100644 --- a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt @@ -1,5 +1,5 @@ -/* - * Copyright (C) 2022 Expedia, Inc. +/** + * Copyright (C) 2025 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,12 @@ */ package com.expediagroup.sdk.xap.operations -import com.expediagroup.sdk.core.model.OperationParams -import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException -import com.expediagroup.sdk.xap.infrastructure.* +import com.expediagroup.sdk.core.http.Headers +import com.expediagroup.sdk.rest.model.UrlQueryParam +import com.expediagroup.sdk.rest.util.stringifyExplode +import com.expediagroup.sdk.rest.util.swaggerCollectionFormatStringifier import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.annotation.JsonDeserialize -import io.ktor.http.Headers -import io.ktor.http.Parameters -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator -import javax.validation.Valid -import javax.validation.Validation -import javax.validation.constraints.NotNull /** * @property partnerTransactionId The `Partner-Transaction-ID` is a required API request header element that is not consumed by Expedia. It will be required in all XAP v3 API request headers and will be mirrored back to the partner in the corresponding API response header. The `Partner-Transaction-ID` may be any alphanumeric string of the partner's choosing. @@ -38,28 +33,26 @@ import javax.validation.constraints.NotNull */ @JsonDeserialize(builder = GetLodgingRateCalendarOperationParams.Builder::class) data class GetLodgingRateCalendarOperationParams( - @field:NotNull - @field:Valid val partnerTransactionId: kotlin.String, - @field:Valid val ecomHotelId: kotlin.String? = null, - @field:Valid val hcomHotelId: kotlin.String? = null, - @field:NotNull - @field:Valid val startDate: java.time.LocalDate, - @field:NotNull - @field:Valid val endDate: java.time.LocalDate, - @field:Valid val lengthOfStay: kotlin.Int? = 1, - @field:Valid val currency: kotlin.String? = - null -) : OperationParams { + null, +) { + init { + require(partnerTransactionId != null) { "partnerTransactionId must not be null" } + + require(startDate != null) { "startDate must not be null" } + + require(endDate != null) { "endDate must not be null" } + } + companion object { @JvmStatic fun builder() = Builder() @@ -72,7 +65,7 @@ data class GetLodgingRateCalendarOperationParams( @JsonProperty("startDate") private var startDate: java.time.LocalDate? = null, @JsonProperty("endDate") private var endDate: java.time.LocalDate? = null, @JsonProperty("lengthOfStay") private var lengthOfStay: kotlin.Int? = null, - @JsonProperty("currency") private var currency: kotlin.String? = null + @JsonProperty("currency") private var currency: kotlin.String? = null, ) { /** * @param partnerTransactionId The `Partner-Transaction-ID` is a required API request header element that is not consumed by Expedia. It will be required in all XAP v3 API request headers and will be mirrored back to the partner in the corresponding API response header. The `Partner-Transaction-ID` may be any alphanumeric string of the partner's choosing. @@ -118,31 +111,11 @@ data class GetLodgingRateCalendarOperationParams( startDate = startDate!!, endDate = endDate!!, lengthOfStay = lengthOfStay, - currency = currency + currency = currency, ) - validate(params) - return params } - - private fun validate(params: GetLodgingRateCalendarOperationParams) { - val validator = - Validation - .byDefaultProvider() - .configure() - .messageInterpolator(ParameterMessageInterpolator()) - .buildValidatorFactory() - .validator - - val violations = validator.validate(params) - - if (violations.isNotEmpty()) { - throw PropertyConstraintViolationException( - constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } - ) - } - } } fun toBuilder() = @@ -153,40 +126,110 @@ data class GetLodgingRateCalendarOperationParams( startDate = startDate, endDate = endDate, lengthOfStay = lengthOfStay, - currency = currency + currency = currency, ) - override fun getHeaders(): Headers = - Headers.build { - partnerTransactionId?.let { - append("Partner-Transaction-Id", it) - } - append("Accept", "application/vnd.exp-hotel.v3+json") - } - - override fun getQueryParams(): Parameters = - Parameters.build { + fun getHeaders(): Headers = + Headers + .builder() + .apply { + partnerTransactionId?.let { + add("Partner-Transaction-Id", it) + } + add("Accept", "application/vnd.exp-hotel.v3+json") + }.build() + + fun getQueryParams(): List = + buildList { ecomHotelId?.let { - append("ecomHotelId", it) + val key = "ecomHotelId" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } hcomHotelId?.let { - append("hcomHotelId", it) + val key = "hcomHotelId" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } startDate?.let { - append("startDate", it.toString()) + val key = "startDate" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } endDate?.let { - append("endDate", it.toString()) + val key = "endDate" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } lengthOfStay?.let { - append("lengthOfStay", it.toString()) + val key = "lengthOfStay" + val value = + buildList { + add(it.toString()) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } currency?.let { - append("currency", it) + val key = "currency" + val value = + buildList { + add(it) + } + + add( + UrlQueryParam( + key = key, + value = value, + stringify = swaggerCollectionFormatStringifier.getOrDefault("", stringifyExplode), + ), + ) } } - - override fun getPathParams(): Map = - buildMap { - } }