-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
780bf11
commit f4f4ed8
Showing
56 changed files
with
10,880 additions
and
1,948 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4,126 changes: 2,920 additions & 1,206 deletions
4,126
code/src/main/kotlin/com/expediagroup/sdk/rapid/client/RapidClient.kt
Large diffs are not rendered by default.
Oops, something went wrong.
113 changes: 113 additions & 0 deletions
113
code/src/main/kotlin/com/expediagroup/sdk/rapid/models/AmenityReference.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* | ||
* 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.rapid.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 | ||
|
||
/** | ||
* An individual amenity reference. | ||
* @param id Amenity id. | ||
* @param name Amenity name. | ||
* @param hasValue Indicates whether an amenity will have an associated numeric value. | ||
*/ | ||
data class AmenityReference( | ||
// Amenity id. | ||
@JsonProperty("id") | ||
@field:Valid | ||
val id: kotlin.String? = null, | ||
// Amenity name. | ||
@JsonProperty("name") | ||
@field:Valid | ||
val name: kotlin.String? = null, | ||
// Indicates whether an amenity will have an associated numeric value. | ||
@JsonProperty("has_value") | ||
@field:Valid | ||
val hasValue: kotlin.Boolean? = null | ||
) { | ||
companion object { | ||
@JvmStatic | ||
fun builder() = Builder() | ||
} | ||
|
||
class Builder( | ||
private var id: kotlin.String? = null, | ||
private var name: kotlin.String? = null, | ||
private var hasValue: kotlin.Boolean? = null | ||
) { | ||
fun id(id: kotlin.String?) = apply { this.id = id } | ||
|
||
fun name(name: kotlin.String?) = apply { this.name = name } | ||
|
||
fun hasValue(hasValue: kotlin.Boolean?) = apply { this.hasValue = hasValue } | ||
|
||
fun build(): AmenityReference { | ||
val instance = | ||
AmenityReference( | ||
id = id, | ||
name = name, | ||
hasValue = hasValue | ||
) | ||
|
||
validate(instance) | ||
|
||
return instance | ||
} | ||
|
||
private fun validate(instance: AmenityReference) { | ||
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, | ||
hasValue = hasValue | ||
) | ||
} |
113 changes: 113 additions & 0 deletions
113
code/src/main/kotlin/com/expediagroup/sdk/rapid/models/AttributeReference.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* | ||
* 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.rapid.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 | ||
|
||
/** | ||
* An individual attribute reference. | ||
* @param id The attribute definition ID for this attribute. | ||
* @param name Attribute name. | ||
* @param hasValue Indicates whether an attribute will have an associated numeric value. | ||
*/ | ||
data class AttributeReference( | ||
// The attribute definition ID for this attribute. | ||
@JsonProperty("id") | ||
@field:Valid | ||
val id: kotlin.String? = null, | ||
// Attribute name. | ||
@JsonProperty("name") | ||
@field:Valid | ||
val name: kotlin.String? = null, | ||
// Indicates whether an attribute will have an associated numeric value. | ||
@JsonProperty("has_value") | ||
@field:Valid | ||
val hasValue: kotlin.Boolean? = null | ||
) { | ||
companion object { | ||
@JvmStatic | ||
fun builder() = Builder() | ||
} | ||
|
||
class Builder( | ||
private var id: kotlin.String? = null, | ||
private var name: kotlin.String? = null, | ||
private var hasValue: kotlin.Boolean? = null | ||
) { | ||
fun id(id: kotlin.String?) = apply { this.id = id } | ||
|
||
fun name(name: kotlin.String?) = apply { this.name = name } | ||
|
||
fun hasValue(hasValue: kotlin.Boolean?) = apply { this.hasValue = hasValue } | ||
|
||
fun build(): AttributeReference { | ||
val instance = | ||
AttributeReference( | ||
id = id, | ||
name = name, | ||
hasValue = hasValue | ||
) | ||
|
||
validate(instance) | ||
|
||
return instance | ||
} | ||
|
||
private fun validate(instance: AttributeReference) { | ||
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, | ||
hasValue = hasValue | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.