|
| 1 | +/* |
| 2 | + * Copyright (C) 2022 Expedia, Inc. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +/** |
| 17 | + * |
| 18 | + * Please note: |
| 19 | + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 20 | + * Do not edit this file manually. |
| 21 | + * |
| 22 | + */ |
| 23 | + |
| 24 | +@file:Suppress( |
| 25 | + "ArrayInDataClass", |
| 26 | + "EnumEntryName", |
| 27 | + "RemoveRedundantQualifierName", |
| 28 | + "UnusedImport" |
| 29 | +) |
| 30 | + |
| 31 | +package com.expediagroup.sdk.rapid.models |
| 32 | + |
| 33 | +import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException |
| 34 | +import com.expediagroup.sdk.rapid.models.AdditionalHandlingCardContact |
| 35 | +import com.expediagroup.sdk.rapid.models.Amount |
| 36 | +import com.fasterxml.jackson.annotation.JsonProperty |
| 37 | +import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator |
| 38 | +import javax.validation.Valid |
| 39 | +import javax.validation.Validation |
| 40 | +import javax.validation.constraints.NotNull |
| 41 | + |
| 42 | +/** |
| 43 | + * 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. |
| 44 | + * @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. |
| 45 | + * @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`. |
| 46 | + * @param totalChargesAllowed |
| 47 | + * @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. |
| 48 | + * @param authorizingCompany Company that will issue the authorization form for the virtual credit card payment. |
| 49 | + * @param cardContact |
| 50 | + * @param maxPaymentAttemptCount Requested limit to number of payment attempts. |
| 51 | + * @param paymentAllowablePeriodStart Start date for valid range of the VCC payment instrument, in ISO 8601 format (YYYY-MM-DD). |
| 52 | + * @param paymentAllowablePeriodEnd End date for valid range of the VCC payment instrument, in ISO 8601 format (YYYY-MM-DD). |
| 53 | + */ |
| 54 | +data class AdditionalHandling( |
| 55 | + // 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. |
| 56 | + @JsonProperty("authorized_expenses") |
| 57 | + @field:NotNull |
| 58 | + val authorizedExpenses: AdditionalHandling.AuthorizedExpenses, |
| 59 | + // 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`. |
| 60 | + @JsonProperty("specified_incidental_expenses") |
| 61 | + val specifiedIncidentalExpenses: kotlin.collections.List<AdditionalHandling.SpecifiedIncidentalExpenses>? = null, |
| 62 | + @JsonProperty("total_charges_allowed") |
| 63 | + @field:Valid |
| 64 | + val totalChargesAllowed: Amount? = null, |
| 65 | + // 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. |
| 66 | + @JsonProperty("is_cvc_required") |
| 67 | + @field:Valid |
| 68 | + val isCvcRequired: kotlin.Boolean? = null, |
| 69 | + // Company that will issue the authorization form for the virtual credit card payment. |
| 70 | + @JsonProperty("authorizing_company") |
| 71 | + @field:Valid |
| 72 | + val authorizingCompany: kotlin.String? = null, |
| 73 | + @JsonProperty("card_contact") |
| 74 | + @field:Valid |
| 75 | + val cardContact: AdditionalHandlingCardContact? = null, |
| 76 | + // Requested limit to number of payment attempts. |
| 77 | + @JsonProperty("max_payment_attempt_count") |
| 78 | + @field:Valid |
| 79 | + val maxPaymentAttemptCount: java.math.BigDecimal? = null, |
| 80 | + // Start date for valid range of the VCC payment instrument, in ISO 8601 format (YYYY-MM-DD). |
| 81 | + @JsonProperty("payment_allowable_period_start") |
| 82 | + @field:Valid |
| 83 | + val paymentAllowablePeriodStart: kotlin.String? = null, |
| 84 | + // End date for valid range of the VCC payment instrument, in ISO 8601 format (YYYY-MM-DD). |
| 85 | + @JsonProperty("payment_allowable_period_end") |
| 86 | + @field:Valid |
| 87 | + val paymentAllowablePeriodEnd: kotlin.String? = null |
| 88 | +) { |
| 89 | + companion object { |
| 90 | + @JvmStatic |
| 91 | + fun builder() = Builder() |
| 92 | + } |
| 93 | + |
| 94 | + class Builder( |
| 95 | + private var authorizedExpenses: AdditionalHandling.AuthorizedExpenses? = null, |
| 96 | + private var specifiedIncidentalExpenses: kotlin.collections.List<AdditionalHandling.SpecifiedIncidentalExpenses>? = null, |
| 97 | + private var totalChargesAllowed: Amount? = null, |
| 98 | + private var isCvcRequired: kotlin.Boolean? = null, |
| 99 | + private var authorizingCompany: kotlin.String? = null, |
| 100 | + private var cardContact: AdditionalHandlingCardContact? = null, |
| 101 | + private var maxPaymentAttemptCount: java.math.BigDecimal? = null, |
| 102 | + private var paymentAllowablePeriodStart: kotlin.String? = null, |
| 103 | + private var paymentAllowablePeriodEnd: kotlin.String? = null |
| 104 | + ) { |
| 105 | + fun authorizedExpenses(authorizedExpenses: AdditionalHandling.AuthorizedExpenses) = apply { this.authorizedExpenses = authorizedExpenses } |
| 106 | + |
| 107 | + fun specifiedIncidentalExpenses(specifiedIncidentalExpenses: kotlin.collections.List<AdditionalHandling.SpecifiedIncidentalExpenses>?) = |
| 108 | + apply { |
| 109 | + this.specifiedIncidentalExpenses = |
| 110 | + specifiedIncidentalExpenses |
| 111 | + } |
| 112 | + |
| 113 | + fun totalChargesAllowed(totalChargesAllowed: Amount?) = apply { this.totalChargesAllowed = totalChargesAllowed } |
| 114 | + |
| 115 | + fun isCvcRequired(isCvcRequired: kotlin.Boolean?) = apply { this.isCvcRequired = isCvcRequired } |
| 116 | + |
| 117 | + fun authorizingCompany(authorizingCompany: kotlin.String?) = apply { this.authorizingCompany = authorizingCompany } |
| 118 | + |
| 119 | + fun cardContact(cardContact: AdditionalHandlingCardContact?) = apply { this.cardContact = cardContact } |
| 120 | + |
| 121 | + fun maxPaymentAttemptCount(maxPaymentAttemptCount: java.math.BigDecimal?) = apply { this.maxPaymentAttemptCount = maxPaymentAttemptCount } |
| 122 | + |
| 123 | + fun paymentAllowablePeriodStart(paymentAllowablePeriodStart: kotlin.String?) = apply { this.paymentAllowablePeriodStart = paymentAllowablePeriodStart } |
| 124 | + |
| 125 | + fun paymentAllowablePeriodEnd(paymentAllowablePeriodEnd: kotlin.String?) = apply { this.paymentAllowablePeriodEnd = paymentAllowablePeriodEnd } |
| 126 | + |
| 127 | + fun build(): AdditionalHandling { |
| 128 | + val instance = |
| 129 | + AdditionalHandling( |
| 130 | + authorizedExpenses = authorizedExpenses!!, |
| 131 | + specifiedIncidentalExpenses = specifiedIncidentalExpenses, |
| 132 | + totalChargesAllowed = totalChargesAllowed, |
| 133 | + isCvcRequired = isCvcRequired, |
| 134 | + authorizingCompany = authorizingCompany, |
| 135 | + cardContact = cardContact, |
| 136 | + maxPaymentAttemptCount = maxPaymentAttemptCount, |
| 137 | + paymentAllowablePeriodStart = paymentAllowablePeriodStart, |
| 138 | + paymentAllowablePeriodEnd = paymentAllowablePeriodEnd |
| 139 | + ) |
| 140 | + |
| 141 | + validate(instance) |
| 142 | + |
| 143 | + return instance |
| 144 | + } |
| 145 | + |
| 146 | + private fun validate(instance: AdditionalHandling) { |
| 147 | + val validator = |
| 148 | + Validation |
| 149 | + .byDefaultProvider() |
| 150 | + .configure() |
| 151 | + .messageInterpolator(ParameterMessageInterpolator()) |
| 152 | + .buildValidatorFactory() |
| 153 | + .validator |
| 154 | + |
| 155 | + val violations = validator.validate(instance) |
| 156 | + |
| 157 | + if (violations.isNotEmpty()) { |
| 158 | + throw PropertyConstraintViolationException( |
| 159 | + constraintViolations = violations.map { "${it.propertyPath}: ${it.message}" } |
| 160 | + ) |
| 161 | + } |
| 162 | + } |
| 163 | + } |
| 164 | + |
| 165 | + fun toBuilder() = |
| 166 | + Builder( |
| 167 | + authorizedExpenses = authorizedExpenses!!, |
| 168 | + specifiedIncidentalExpenses = specifiedIncidentalExpenses, |
| 169 | + totalChargesAllowed = totalChargesAllowed, |
| 170 | + isCvcRequired = isCvcRequired, |
| 171 | + authorizingCompany = authorizingCompany, |
| 172 | + cardContact = cardContact, |
| 173 | + maxPaymentAttemptCount = maxPaymentAttemptCount, |
| 174 | + paymentAllowablePeriodStart = paymentAllowablePeriodStart, |
| 175 | + paymentAllowablePeriodEnd = paymentAllowablePeriodEnd |
| 176 | + ) |
| 177 | + |
| 178 | + /** |
| 179 | + * 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. |
| 180 | + * Values: PRESTAY_EXPENSES_ONLY,TOTAL_BOOKING_AMOUNT,TOTAL_PLUS_INCIDENTALS,SEE_AUTHORIZATION_FORM |
| 181 | + */ |
| 182 | + enum class AuthorizedExpenses(val value: kotlin.String) { |
| 183 | + @JsonProperty("prestay_expenses_only") |
| 184 | + PRESTAY_EXPENSES_ONLY("prestay_expenses_only"), |
| 185 | + |
| 186 | + @JsonProperty("total_booking_amount") |
| 187 | + TOTAL_BOOKING_AMOUNT("total_booking_amount"), |
| 188 | + |
| 189 | + @JsonProperty("total_plus_incidentals") |
| 190 | + TOTAL_PLUS_INCIDENTALS("total_plus_incidentals"), |
| 191 | + |
| 192 | + @JsonProperty("see_authorization_form") |
| 193 | + SEE_AUTHORIZATION_FORM("see_authorization_form") |
| 194 | + } |
| 195 | + |
| 196 | + /** |
| 197 | + * 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`. |
| 198 | + * Values: BREAKFAST,ENTERTAINMENT,INTERNET,MEETING_EXPENSES,OTHER_FOOD_BEVERAGE,PARKING,PHONE,TAXES,TRANSFER,OTHER |
| 199 | + */ |
| 200 | + enum class SpecifiedIncidentalExpenses(val value: kotlin.String) { |
| 201 | + @JsonProperty("breakfast") |
| 202 | + BREAKFAST("breakfast"), |
| 203 | + |
| 204 | + @JsonProperty("entertainment") |
| 205 | + ENTERTAINMENT("entertainment"), |
| 206 | + |
| 207 | + @JsonProperty("internet") |
| 208 | + INTERNET("internet"), |
| 209 | + |
| 210 | + @JsonProperty("meeting_expenses") |
| 211 | + MEETING_EXPENSES("meeting_expenses"), |
| 212 | + |
| 213 | + @JsonProperty("other_food_beverage") |
| 214 | + OTHER_FOOD_BEVERAGE("other_food_beverage"), |
| 215 | + |
| 216 | + @JsonProperty("parking") |
| 217 | + PARKING("parking"), |
| 218 | + |
| 219 | + @JsonProperty("phone") |
| 220 | + PHONE("phone"), |
| 221 | + |
| 222 | + @JsonProperty("taxes") |
| 223 | + TAXES("taxes"), |
| 224 | + |
| 225 | + @JsonProperty("transfer") |
| 226 | + TRANSFER("transfer"), |
| 227 | + |
| 228 | + @JsonProperty("other") |
| 229 | + OTHER("other") |
| 230 | + } |
| 231 | +} |
0 commit comments