Skip to content
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.4.0</version>
<version>5.4.1-SNAPSHOT</version>
</dependency>
```

Expand Down
24 changes: 12 additions & 12 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.4.0</version>
<version>5.4.1-SNAPSHOT</version>
<name>EG rapid-sdk for Java</name>
<description>EG rapid-sdk v5.4.0</description>
<description>EG rapid-sdk v5.4.1-SNAPSHOT</description>
<url>https://github.com/ExpediaGroup/test-sdk</url>
<inceptionYear>2022</inceptionYear>
<packaging>jar</packaging>
Expand Down Expand Up @@ -71,17 +71,17 @@
<maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
<build-helper-maven-plugin.version>3.6.1</build-helper-maven-plugin.version>
<ktlint-plugin.version>3.5.0</ktlint-plugin.version>
<jacoco-plugin.version>0.8.13</jacoco-plugin.version>
<dokka-plugin.version>2.0.0</dokka-plugin.version>
<dokka-old-versions.location/> <!-- passed as a property when running dokka:dokka-->
<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.7.0</flatten.maven.plugin.version>
<kotlin.version>2.1.20</kotlin.version>
<kotlinx.coroutines.version>1.10.1</kotlinx.coroutines.version>
<ktor.version>3.1.2</ktor.version>
<maven.licence.plugin.version>5.0.0</maven.licence.plugin.version>
<flatten.maven.plugin.version>1.7.1</flatten.maven.plugin.version>
<kotlin.version>2.1.21</kotlin.version>
<kotlinx.coroutines.version>1.10.2</kotlinx.coroutines.version>
<ktor.version>3.1.3</ktor.version>
<kotlin-atomic.version>0.27.0</kotlin-atomic.version>
<slf4j.version>2.0.17</slf4j.version>
<maven.nexus-staging.plugin.version>1.7.0</maven.nexus-staging.plugin.version>
Expand Down Expand Up @@ -131,14 +131,14 @@
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.18.3</version>
<version>2.19.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio-jvm</artifactId>
<version>3.10.2</version>
<version>3.15.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
Expand All @@ -153,7 +153,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.18.3</version>
<version>2.19.1</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -733,7 +733,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.18.0</version>
<version>3.17.0</version>
</dependency>

<dependency>
Expand Down
1,149 changes: 1,131 additions & 18 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,231 @@
/*
* 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.expediagroup.sdk.rapid.models.AdditionalHandlingCardContact
import com.expediagroup.sdk.rapid.models.Amount
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

/**
* Parent object for additional VCC handling instructions, to be included as part of the payment object when virtual_card is the requested payment type for property collect inventory. If not included, existing behavior regarding handling of VCCs with property collect inventory is to be preserved. This object will be ignored for non-property collect/non-VCC transactions. total_charges_allowed represents the total ceiling of all charges allowed on the VCC, including the booking price and any allowed incidentals. The value of total_charges_allowed must be at least the booking value.
* @param authorizedExpenses Indicates which types of expenses are authorized to be charged to the VCC. * `prestay_expenses_only` - Indicates that the provided VCC is for pre-stay charges only (e.g., deposits, cancellation fees, no-show fees). A physical card must be presented at check-in for any remaining balance, as well as incidentals. * `total_booking_amount` - Indicates that both pre-stay charges and the total booking amount are authorized, but no incidentals are authorized. A physical card must be presented at check-in for any incidentals. * `total_plus_incidentals` - Indicates that pre-stay, total booking, and incidental expenses are authorized. See `specified_incidental_expenses`. A physical card may be required for additional incidental expenses. * `see_authorization_form` - Indicates that a property should refer to the authorization form that will be sent either by the card provider or the authorizing company.
* @param specifiedIncidentalExpenses Included list of enumerated categories to restrict the authorized incidentals. This is only utilized when `authorized_expenses` is supplied with `total_plus_incidentals` and restrictions on incidentals are desired.<br> Example: To allow any incidental expenses, specify `authorized_expenses` equal to `total_plus_incidentals` and omit `specified_incidental_expenses`.
* @param totalChargesAllowed
* @param isCvcRequired Indicates whether a CVC is required for the provided VCC. If this is marked required, the security_code field for the payment MUST be provided.
* @param authorizingCompany Company that will issue the authorization form for the virtual credit card payment.
* @param cardContact
* @param maxPaymentAttemptCount Requested limit to number of payment attempts.
* @param paymentAllowablePeriodStart Start date for valid range of the VCC payment instrument, in ISO 8601 format (YYYY-MM-DD).
* @param paymentAllowablePeriodEnd End date for valid range of the VCC payment instrument, in ISO 8601 format (YYYY-MM-DD).
*/
data class AdditionalHandling(
// Indicates which types of expenses are authorized to be charged to the VCC. * `prestay_expenses_only` - Indicates that the provided VCC is for pre-stay charges only (e.g., deposits, cancellation fees, no-show fees). A physical card must be presented at check-in for any remaining balance, as well as incidentals. * `total_booking_amount` - Indicates that both pre-stay charges and the total booking amount are authorized, but no incidentals are authorized. A physical card must be presented at check-in for any incidentals. * `total_plus_incidentals` - Indicates that pre-stay, total booking, and incidental expenses are authorized. See `specified_incidental_expenses`. A physical card may be required for additional incidental expenses. * `see_authorization_form` - Indicates that a property should refer to the authorization form that will be sent either by the card provider or the authorizing company.
@JsonProperty("authorized_expenses")
@field:NotNull
val authorizedExpenses: AdditionalHandling.AuthorizedExpenses,
// Included list of enumerated categories to restrict the authorized incidentals. This is only utilized when `authorized_expenses` is supplied with `total_plus_incidentals` and restrictions on incidentals are desired.<br> Example: To allow any incidental expenses, specify `authorized_expenses` equal to `total_plus_incidentals` and omit `specified_incidental_expenses`.
@JsonProperty("specified_incidental_expenses")
val specifiedIncidentalExpenses: kotlin.collections.List<AdditionalHandling.SpecifiedIncidentalExpenses>? = null,
@JsonProperty("total_charges_allowed")
@field:Valid
val totalChargesAllowed: Amount? = null,
// Indicates whether a CVC is required for the provided VCC. If this is marked required, the security_code field for the payment MUST be provided.
@JsonProperty("is_cvc_required")
@field:Valid
val isCvcRequired: kotlin.Boolean? = null,
// Company that will issue the authorization form for the virtual credit card payment.
@JsonProperty("authorizing_company")
@field:Valid
val authorizingCompany: kotlin.String? = null,
@JsonProperty("card_contact")
@field:Valid
val cardContact: AdditionalHandlingCardContact? = null,
// Requested limit to number of payment attempts.
@JsonProperty("max_payment_attempt_count")
@field:Valid
val maxPaymentAttemptCount: java.math.BigDecimal? = null,
// Start date for valid range of the VCC payment instrument, in ISO 8601 format (YYYY-MM-DD).
@JsonProperty("payment_allowable_period_start")
@field:Valid
val paymentAllowablePeriodStart: kotlin.String? = null,
// End date for valid range of the VCC payment instrument, in ISO 8601 format (YYYY-MM-DD).
@JsonProperty("payment_allowable_period_end")
@field:Valid
val paymentAllowablePeriodEnd: kotlin.String? = null
) {
companion object {
@JvmStatic
fun builder() = Builder()
}

class Builder(
private var authorizedExpenses: AdditionalHandling.AuthorizedExpenses? = null,
private var specifiedIncidentalExpenses: kotlin.collections.List<AdditionalHandling.SpecifiedIncidentalExpenses>? = null,
private var totalChargesAllowed: Amount? = null,
private var isCvcRequired: kotlin.Boolean? = null,
private var authorizingCompany: kotlin.String? = null,
private var cardContact: AdditionalHandlingCardContact? = null,
private var maxPaymentAttemptCount: java.math.BigDecimal? = null,
private var paymentAllowablePeriodStart: kotlin.String? = null,
private var paymentAllowablePeriodEnd: kotlin.String? = null
) {
fun authorizedExpenses(authorizedExpenses: AdditionalHandling.AuthorizedExpenses) = apply { this.authorizedExpenses = authorizedExpenses }

fun specifiedIncidentalExpenses(specifiedIncidentalExpenses: kotlin.collections.List<AdditionalHandling.SpecifiedIncidentalExpenses>?) =
apply {
this.specifiedIncidentalExpenses =
specifiedIncidentalExpenses
}

fun totalChargesAllowed(totalChargesAllowed: Amount?) = apply { this.totalChargesAllowed = totalChargesAllowed }

fun isCvcRequired(isCvcRequired: kotlin.Boolean?) = apply { this.isCvcRequired = isCvcRequired }

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

fun cardContact(cardContact: AdditionalHandlingCardContact?) = apply { this.cardContact = cardContact }

fun maxPaymentAttemptCount(maxPaymentAttemptCount: java.math.BigDecimal?) = apply { this.maxPaymentAttemptCount = maxPaymentAttemptCount }

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

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

fun build(): AdditionalHandling {
val instance =
AdditionalHandling(
authorizedExpenses = authorizedExpenses!!,
specifiedIncidentalExpenses = specifiedIncidentalExpenses,
totalChargesAllowed = totalChargesAllowed,
isCvcRequired = isCvcRequired,
authorizingCompany = authorizingCompany,
cardContact = cardContact,
maxPaymentAttemptCount = maxPaymentAttemptCount,
paymentAllowablePeriodStart = paymentAllowablePeriodStart,
paymentAllowablePeriodEnd = paymentAllowablePeriodEnd
)

validate(instance)

return instance
}

private fun validate(instance: AdditionalHandling) {
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(
authorizedExpenses = authorizedExpenses!!,
specifiedIncidentalExpenses = specifiedIncidentalExpenses,
totalChargesAllowed = totalChargesAllowed,
isCvcRequired = isCvcRequired,
authorizingCompany = authorizingCompany,
cardContact = cardContact,
maxPaymentAttemptCount = maxPaymentAttemptCount,
paymentAllowablePeriodStart = paymentAllowablePeriodStart,
paymentAllowablePeriodEnd = paymentAllowablePeriodEnd
)

/**
* Indicates which types of expenses are authorized to be charged to the VCC. * `prestay_expenses_only` - Indicates that the provided VCC is for pre-stay charges only (e.g., deposits, cancellation fees, no-show fees). A physical card must be presented at check-in for any remaining balance, as well as incidentals. * `total_booking_amount` - Indicates that both pre-stay charges and the total booking amount are authorized, but no incidentals are authorized. A physical card must be presented at check-in for any incidentals. * `total_plus_incidentals` - Indicates that pre-stay, total booking, and incidental expenses are authorized. See `specified_incidental_expenses`. A physical card may be required for additional incidental expenses. * `see_authorization_form` - Indicates that a property should refer to the authorization form that will be sent either by the card provider or the authorizing company.
* Values: PRESTAY_EXPENSES_ONLY,TOTAL_BOOKING_AMOUNT,TOTAL_PLUS_INCIDENTALS,SEE_AUTHORIZATION_FORM
*/
enum class AuthorizedExpenses(val value: kotlin.String) {
@JsonProperty("prestay_expenses_only")
PRESTAY_EXPENSES_ONLY("prestay_expenses_only"),

@JsonProperty("total_booking_amount")
TOTAL_BOOKING_AMOUNT("total_booking_amount"),

@JsonProperty("total_plus_incidentals")
TOTAL_PLUS_INCIDENTALS("total_plus_incidentals"),

@JsonProperty("see_authorization_form")
SEE_AUTHORIZATION_FORM("see_authorization_form")
}

/**
* Included list of enumerated categories to restrict the authorized incidentals. This is only utilized when `authorized_expenses` is supplied with `total_plus_incidentals` and restrictions on incidentals are desired.<br> Example: To allow any incidental expenses, specify `authorized_expenses` equal to `total_plus_incidentals` and omit `specified_incidental_expenses`.
* Values: BREAKFAST,ENTERTAINMENT,INTERNET,MEETING_EXPENSES,OTHER_FOOD_BEVERAGE,PARKING,PHONE,TAXES,TRANSFER,OTHER
*/
enum class SpecifiedIncidentalExpenses(val value: kotlin.String) {
@JsonProperty("breakfast")
BREAKFAST("breakfast"),

@JsonProperty("entertainment")
ENTERTAINMENT("entertainment"),

@JsonProperty("internet")
INTERNET("internet"),

@JsonProperty("meeting_expenses")
MEETING_EXPENSES("meeting_expenses"),

@JsonProperty("other_food_beverage")
OTHER_FOOD_BEVERAGE("other_food_beverage"),

@JsonProperty("parking")
PARKING("parking"),

@JsonProperty("phone")
PHONE("phone"),

@JsonProperty("taxes")
TAXES("taxes"),

@JsonProperty("transfer")
TRANSFER("transfer"),

@JsonProperty("other")
OTHER("other")
}
}
Loading