Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Publish v5.4.0-SNAPSHOT #288

Open
wants to merge 1 commit into
base: mohnoor94/release20250204
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<dependency>
<groupId>com.expediagroup</groupId>
<artifactId>rapid-sdk</artifactId>
<version>5.3.2</version>
<version>5.4.0-SNAPSHOT</version>
</dependency>
```

Expand Down
6 changes: 3 additions & 3 deletions code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.expediagroup</groupId>
<artifactId>rapid-sdk</artifactId>
<version>5.3.2</version>
<version>5.4.0-SNAPSHOT</version>
<name>EG rapid-sdk for Java</name>
<description>EG rapid-sdk v5.3.2</description>
<description>EG rapid-sdk v5.4.0-SNAPSHOT</description>
<url>https://github.com/ExpediaGroup/test-sdk</url>
<inceptionYear>2022</inceptionYear>
<packaging>jar</packaging>
Expand Down Expand Up @@ -79,7 +79,7 @@
<properties.maven.plugin.version>1.2.1</properties.maven.plugin.version>
<maven.licence.plugin.version>4.6</maven.licence.plugin.version>
<flatten.maven.plugin.version>1.6.0</flatten.maven.plugin.version>
<kotlin.version>2.1.0</kotlin.version>
<kotlin.version>2.1.10</kotlin.version>
<kotlinx.coroutines.version>1.10.1</kotlinx.coroutines.version>
<ktor.version>3.0.3</ktor.version>
<kotlin-atomic.version>0.27.0</kotlin-atomic.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,38 @@
package com.expediagroup.sdk.core.constant.provider

internal object LogMaskingRegexProvider {
/**
* Generates a regex pattern to match specified fields in a JSON string.
*
* @param maskedBodyFields the set of fields to be masked
* @param valueToMatch regex pattern to match the value of the fields. Default: match any sequence of characters except double quotes.
* @return the regex pattern to match the specified fields and their values
*/
fun getMaskedFieldsRegex(
maskedBodyFields: Set<String>,
value: String = "[^\\\"]+"
valueToMatch: String = "[^\\\"]+"
): Regex {
val fields = maskedBodyFields.joinToString("|")
return "\"($fields)(\\\\*\"\\s*:\\s*\\\\*\")$value(?:\\\\?\"|)".toRegex()
// The pattern matches:
// - The field name (one of the specified fields) captured in group 1.
// - Optional backslash, closing double quotes, colon(:), optional whitespace, and opening double quotes.
// - The value of the field, matching the specified valueToMatch pattern.
// - Optional backslash, followed by a closing double quote
return "\"($fields)(\\\\?\"\\s*:\\s*\\\\*\")$valueToMatch(?:\\\\?\")".toRegex()
}

/**
* Generates a regex pattern to match a specified field in a JSON string.
*
* @param maskedBodyField the field to be masked
* @param valueToMatch regex pattern to match the value of the field. Default: match any sequence of characters except double quotes.
* @return the regex pattern to match the specified field and its value
*/
fun getMaskedFieldsRegex(
maskedBodyField: String,
value: String = "[^\\\"]+"
valueToMatch: String = "[^\\\"]+"
): Regex {
val fields = setOf(maskedBodyField)
return getMaskedFieldsRegex(fields, value)
return getMaskedFieldsRegex(fields, valueToMatch)
}
}
4,126 changes: 2,920 additions & 1,206 deletions code/src/main/kotlin/com/expediagroup/sdk/rapid/client/RapidClient.kt

Large diffs are not rendered by default.

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
)
}
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
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ data class ChangeRoomDetailsRequest(
@field:Valid
val specialRequest: kotlin.String? = null,
// Deprecated. Please use the loyalty id inside the loyalty object.
@Deprecated(message = "This property is deprecated.")
@JsonProperty("loyalty_id")
@field:Valid
val loyaltyId: kotlin.String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ data class CreateItineraryRequestRoom(
@field:Valid
val specialRequest: kotlin.String? = null,
// Deprecated. Please use the loyalty id inside the loyalty object.
@Deprecated(message = "This property is deprecated.")
@JsonProperty("loyalty_id")
@field:Valid
val loyaltyId: kotlin.String? = null,
Expand Down
Loading