diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..86098916d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ + +# Configuration file for EditorConfig: http://editorconfig.org +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +# space indentation for JSON and YML +[*.{json,json5,yml,yaml}] +indent_size = 2 + +[*.kt] +ktlint_standard_enum-entry-name-case = disabled \ No newline at end of file diff --git a/.github/workflows/generate-and-publish-sdk-sources.yaml b/.github/workflows/generate-and-publish-sdk-sources.yaml deleted file mode 100644 index 192ae1066..000000000 --- a/.github/workflows/generate-and-publish-sdk-sources.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Generate and Publish SDK Sources - -on: - workflow_dispatch: - inputs: - version: - description: | - SDK Version. - E.g., 1.0.0, 1.0.1, 1.0.0-SNAPSHOT, etc. - required: true - type: string - -jobs: - generate-and-publish-sources: - uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-full-workflow.yaml@v20250203 - secrets: inherit - with: - name: xap - ref: ${{ github.head_ref || github.ref_name }} - repository: 'ExpediaGroup/xap-java-sdk' - sdk_repo_ref: 'v20250203' - transformations: '--headers key --operationIdsToTags' - version: ${{ inputs.version }} diff --git a/.github/workflows/generate-docs-site.yml b/.github/workflows/generate-docs-site.yaml similarity index 87% rename from .github/workflows/generate-docs-site.yml rename to .github/workflows/generate-docs-site.yaml index 99492167a..734309dbc 100644 --- a/.github/workflows/generate-docs-site.yml +++ b/.github/workflows/generate-docs-site.yaml @@ -14,9 +14,9 @@ permissions: jobs: deploy-reference-docs: - uses: "ExpediaGroup/expediagroup-java-sdk/.github/workflows/generate-ref-docs.yaml@main" + uses: "ExpediaGroup/expediagroup-java-sdk/.github/workflows/generate-ref-docs.yaml@feature/new-sdk-core" with: - buildsystem: 'maven' ref: ${{ inputs.ref != '' && inputs.ref || github.ref }} + sources_dir: 'xap-sdk' secrets: GITHUB_PAT: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} diff --git a/.github/workflows/generate-publish-sdk.yaml b/.github/workflows/generate-publish-sdk.yaml new file mode 100644 index 000000000..9dd1e286e --- /dev/null +++ b/.github/workflows/generate-publish-sdk.yaml @@ -0,0 +1,60 @@ +on: + workflow_dispatch: + inputs: + version: + type: string + description: "Version to publish. For snapshot releases, add `-SNAPSHOT` suffix to the version. For example, `1.0.0-SNAPSHOT`." + required: true + +jobs: + generate-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: '21' + + - uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: "8.13" + + - name: Install Post Processor + working-directory: generator/src/main/resources/post-processor + run: npm ci && npm run clean && npm run compile + + - run: gradle build + + - name: Generate SDK + working-directory: generator + run: | + export KOTLIN_POST_PROCESS_FILE="npm run --prefix src/main/resources/post-processor process" + gradle openApiGenerate + + - name: Open PR + uses: peter-evans/create-pull-request@v7 + working-directory: xap-sdk + with: + token: ${{ secrets.GITHUB_PAT }} + commit-message: "chore: publishing code for sdk release $(date +'%Y%m%d%H%M%S')" + title: "chore: code update on $(date +'%Y%m%d%H%M%S')" + branch: "xap-sdk-code-update-$(date +'%Y%m%d%H%M%S')" + add-paths: . + + - name: Publish SDK + working-directory: xap-sdk + env: + GPG_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} + GPG_SECRET: ${{ secrets.GPG_PRIVATE_KEY }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + run: | + version="${{ github.event.inputs.version }}" + version="${version// /}" + if [[ "$version" == *"-SNAPSHOT" ]]; then + gradle publishSnapshot -PVERSION="${version}" + else + gradle publishToSonatype closeAndReleaseSonatypeStagingRepository -PVERSION="${version}" + fi diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml deleted file mode 100644 index f75a1cda2..000000000 --- a/.github/workflows/integration-tests.yaml +++ /dev/null @@ -1,65 +0,0 @@ -name: Integration Test - -on: - workflow_call: - inputs: - jdk: - description: 'JDK version to use' - required: true - type: string - distribution: - description: 'JDK distribution to use' - required: false - type: string - default: 'corretto' - branch: - description: 'Branch to build SDK and run integration tests from' - required: true - type: string - -jobs: - integration-tests: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - repository: 'ExpediaGroup/xap-java-sdk' - ref: ${{ inputs.branch }} - path: sdk-repo - - - name: Parse SDK version - id: parse-sdk-version - working-directory: sdk-repo/code - shell: python -u {0} - run: | - import os - import xml.etree.ElementTree as ET - - tree = ET.parse("pom.xml") - root = tree.getroot() - version = root.find("{*}version").text - - with open(os.getenv("GITHUB_OUTPUT"), "a") as GITHUB_OUTPUT: - print(f"version={version}", file=GITHUB_OUTPUT) - - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: ${{ inputs.jdk }} - distribution: ${{ inputs.distribution }} - - - name: Install SDK - working-directory: sdk-repo/code - run: | - mvn clean install - - - name: Run Integration Tests - working-directory: sdk-repo/tests/integration - run: | - mvn verify \ - -Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \ - -Dcom.expediagroup.xapjavasdk.apisecret="${{ secrets.API_SECRET }}" \ - -Dcom.expediagroup.xapjavasdk.vrbokey="${{ secrets.VRBO_KEY }}" \ - -Dcom.expediagroup.xapjavasdk.vrbosecret="${{ secrets.VRBO_SECRET }}" \ - -Dxap-java-sdk.sdk.version="${{ steps.parse-sdk-version.outputs.version }}" diff --git a/.github/workflows/release-sdk.yaml b/.github/workflows/release-sdk.yaml deleted file mode 100644 index 64871904d..000000000 --- a/.github/workflows/release-sdk.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: Release SDK - -on: - workflow_dispatch: - inputs: - branch: - description: | - Branch to release the SDK from. - Defaults to the branch the action is being run from. - type: string - default: '' - -jobs: - integration-tests: - strategy: - matrix: - jdk: [ 8, 11, 17, 21 ] - uses: ./.github/workflows/integration-tests.yaml - secrets: inherit - with: - branch: ${{ inputs.branch }} - jdk: ${{ matrix.jdk }} - - release-sdk: - uses: ExpediaGroup/expediagroup-java-sdk/.github/workflows/selfserve-release-sdk.yaml@v20250203 - needs: [ integration-tests ] - secrets: inherit - with: - branch: ${{ inputs.branch }} diff --git a/.github/workflows/run-examples.yaml b/.github/workflows/run-examples.yaml deleted file mode 100644 index d6f30fbea..000000000 --- a/.github/workflows/run-examples.yaml +++ /dev/null @@ -1,65 +0,0 @@ -name: Run Examples -on: - workflow_call: - inputs: - jdk: - description: 'JDK version to use' - required: true - type: string - distribution: - description: 'JDK distribution to use' - required: false - type: string - default: 'corretto' - branch: - description: 'Branch to build SDK and run examples from' - required: true - type: string - -jobs: - run-examples: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - repository: 'ExpediaGroup/xap-java-sdk' - ref: ${{ inputs.branch }} - path: sdk-repo - - - name: Parse SDK version - id: parse-sdk-version - working-directory: sdk-repo/code - shell: python -u {0} - run: | - import os - import xml.etree.ElementTree as ET - - tree = ET.parse("pom.xml") - root = tree.getroot() - version = root.find("{*}version").text - - with open(os.getenv("GITHUB_OUTPUT"), "a") as GITHUB_OUTPUT: - print(f"version={version}", file=GITHUB_OUTPUT) - - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: ${{ inputs.jdk }} - distribution: ${{ inputs.distribution }} - - - name: Install SDK - working-directory: sdk-repo/code - run: | - mvn clean install - - - name: Run Examples - working-directory: sdk-repo/examples - run: | - mvn install exec:java \ - -Dexec.mainClass="com.expediagroup.sdk.xap.examples.XapSdkDemoTestRun" \ - -Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \ - -Dcom.expediagroup.xapjavasdk.apisecret="${{ secrets.API_SECRET }}" \ - -Dcom.expediagroup.xapjavasdk.vrbokey="${{ secrets.VRBO_KEY }}" \ - -Dcom.expediagroup.xapjavasdk.vrbosecret="${{ secrets.VRBO_SECRET }}" \ - -Dxap-java-sdk.sdk.version="${{ steps.parse-sdk-version.outputs.version }}" diff --git a/.github/workflows/verify-examples-and-tests.yaml b/.github/workflows/verify-examples-and-tests.yaml deleted file mode 100644 index 804e7f315..000000000 --- a/.github/workflows/verify-examples-and-tests.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: Verify Examples and Integration Tests -on: - pull_request: - branches: - - 'main' -jobs: - detect-changes: - runs-on: ubuntu-latest - permissions: - pull-requests: read - outputs: - examples: ${{ steps.filter.outputs.examples }} - integration-tests: ${{ steps.filter.outputs.integration-tests }} - steps: - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - examples: - - 'examples/**' - integration-tests: - - 'tests/integration/**' - - verify-examples: - needs: detect-changes - if: ${{ needs.detect-changes.outputs.examples == 'true' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'temurin' - - name: verify examples - working-directory: examples - run: | - mvn verify \ - -Dcom.expediagroup.xapjavasdk.apikey="${{ secrets.API_KEY }}" \ - -Dcom.expediagroup.xapjavasdk.apisecret="${{ secrets.API_SECRET }}" \ - -Dcom.expediagroup.xapjavasdk.vrbokey="${{ secrets.VRBO_KEY }}" \ - -Dcom.expediagroup.xapjavasdk.vrbosecret="${{ secrets.VRBO_SECRET }}" \ - - verify-integration-tests: - needs: detect-changes - if: ${{ needs.detect-changes.outputs.integration-tests == 'true' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'temurin' - - name: verify integration tests - working-directory: tests/integration - run: | - mvn verify diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..8ecd06695 --- /dev/null +++ b/.gitignore @@ -0,0 +1,47 @@ +.gradle +.idea + +build/ +!gradle/wrapper/gradle-wrapper.jar +!**/src/main/**/build/ +!**/src/test/**/build/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Kotlin ### +.kotlin + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md new file mode 100644 index 000000000..f7ab94bd1 --- /dev/null +++ b/ARCHITECTURE.md @@ -0,0 +1,115 @@ +# Overview + +The XAP (Expedia API Platform) SDK is structured as a multi-module Gradle project designed to generate a Kotlin/Java SDK +from OpenAPI specifications. The architecture follows a code generation approach, where API client code is automatically +generated and then published to repositories for consumption by developers. + +The repository embraces the following key components and functionalities: + +| Component | Description | +|---------------------------------|-----------------------------------------------------------------------------------------------------------------| +| **OpenAPI Specifications** | Defines the API endpoints, request/response models, and data types. | +| **Code Generation** | Utilizes OpenAPI Generator to create the SDK code based on the specifications. | +| **Core Integration** | Integrates with the Expedia Group's SDK platform core libraries and frameworks. | +| **Post-Processing** | Enhances the generated code with additional features, optimizations, and customizations. | +| **Publishing Tasks** | Automates the release process to make the SDK available for developers. | +| **Examples** | Provides sample applications demonstrating how to use the generated SDK. | +| **Documentation** | Contains guides and references for developers to understand and utilize the SDK effectively. | +| **Testing** | Includes unit, integration and end-to-end tests to ensure the correctness and reliability of the generated SDK. | +| **OpenAPI Specification Files** | OpenAPI definitions. Located at `specs` directory in the root of the repository. | +| **Gradle Helper Tasks** | Gradle tasks that automate common tasks. | + +# Technology Stack + +| Capability | Technology | +|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------| +| **Build System** | [Gradle](https://docs.gradle.org/current/userguide/userguide.html) with [Kotlin DSL](https://docs.gradle.org/current/userguide/kotlin_dsl.html) | +| **Code Generation** | [OpenAPI Generator](https://openapi-generator.tech/) | +| **CI/CD** | GitHub Actions | +| **Testing** | [JUnit5](https://junit.org/junit5/) | +| **Version Control** | Git | +| **Code Quality** | [Kover](https://kotlin.github.io/kotlinx-kover/gradle-plugin/) | +| **Programming Languages** | Kotlin (JVM) | +| **Documentation** | [KDoc](https://kotlinlang.org/docs/kotlin-doc.html), [Dokka](https://kotlinlang.org/docs/dokka-introduction.html) | +| **Target** | [Java (LTS)](https://www.oracle.com/middleeast/java/technologies/java-se-support-roadmap.html) | + +# Modules + +The project is organized into several modules, each serving a specific purpose. The main modules include: +* Root Module: The root of the repository. +* Generator Module: Located at the `generator` directory. +* Build-Logic Module: Located at the `buildSrc` directory. +* XAP SDK Module: Located at the `xap-sdk` directory. + +## Root Module + +The root module serves as the entry point for the project. It contains the overall project configuration, including +dependency management, build scripts, and common configurations shared across all modules. This module also includes the +`settings.gradle.kts` file, which defines the structure of the multi-module project. +The module defines custom gradle tasks that live in the `gradle-tasks` directory. The defined tasks handle OpenAPI +specification files pre-processing, publishing, as well as for generating and publishing the SDK to a remote repository. +It also includes configurations for code quality checks, such as Ktlint and Kover. All tasks are defined using kotlin +DSL. + +| Defined Gradle Task | Description | +|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `mergeSpecs` | Executes the openapi-merge-cli command using npx to merge OpenAPI specs. | +| `transformSpecs` | Executes the spec-transformer CLI command using npx to transform the OpenAPI specs. | +| `prepareSpecs` | A wrapper for the sequential execution of `mergeSpecs` and `transformSpecs`. Generates and copies a final specs.yaml file to the generator module's resources directory | +| `publishSnapshot` | Triggers the execution of the `publish` task. It verifies the artifact has a valid snapshot version suffix, ensures the publish task exists, executes the publish task, and outputs confirmation messages with the repository URL where the artifact can be accessed. | + +## Generator Module + +The `generator` module is responsible for the core functionality of the SDK generation process. It consumes the OpenAPI +specifications and generates the initial SDK code using OpenAPI Generator. It also integrates with the +`expediagroup-sdk-openapi-plugin`. + +| Generator Component/Asset | Description | +|--------------------------------------|----------------------------------------------------------------------------------------------------------------------------| +| **OpenAPI Generator Configurations** | The core library that generates the SDK code from OpenAPI specifications. Lives in the `build.gradle.kts` file. | +| **Custom Templates** | Custom templates for generating Kotlin/Java code. Lives in the `src/main/resources/templates` directory. | +| **Post-Processing** | Enhancements and optimizations applied to the generated code. Lives in the `src/main/resources/post-processing` directory. | + +The generation process can be executed through the `openApiGenerate` Gradle task, which triggers the OpenAPI Generator +with the specified configurations. + +```shell +gradle clean build + +cd generator +gradle openApiGenerate --stacktrace +``` + +The `openApiGenerate` gradle task workflow is as follows: + +1. Locates the OpenAPI specification file through the `inputSpec` environment variable, falling back to + `generator/src/main/resources/specs.yaml` if not found. +2. Consumes the OpenAPI specification file to generates code into the `xap-sdk/src/main/kotlin` directory. +3. Generated code overrides the code present `xap-sdk/src/main/kotlin` directory, affecting only the `operations` and + `models` packages. +4. The generated code is then post-processed to apply additional customizations and optimizations. +5. Finally, the code is formatted and linted using Ktlint to ensure code quality and consistency. + +## Build-Logic Module + +The `buildSrc` module is +a [Gradle build logic module](https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html#sec:using_buildsrc) +that contains custom Gradle plugins and shared build logic used across the project. It allows for better organization +and reusability of build scripts and configurations. + +The `buildSrc` module is used to define OpenAPI Generator customizations, such as custom mustache lambdas. This module +can be used to define custom Gradle tasks, plugins, and other build-related logic that can be reused across the project. +It is automatically included in the build process and can be used to extend the functionality of Gradle. + +## XAP SDK Module + +The `xap-sdk` module is the main module that contains the generated SDK code. It includes the generated API client code, +along with SDK specific configurations and SDK core libraries integrations. The module is structured as follows: + +| Package | Generated | Description | +|-----------------|-----------|----------------------------------------------------------------------------------------------------| +| `core` | **No** | SDK core libraries integrations. Defines the workflow for sync and async operations execution. | +| `configuration` | **No** | SDK specific configurations such as endpoints, jackson configurations and others. | +| `client` | **No** | API clients that are responsible for executing operations. | +| `operations` | **YES** | Representations of available API requests. Generated based on the OpenAPI spec defined operations. | +| `models` | **YES** | Representation of API models. Generated based on the OpenAPI spec defined schemas | diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..b41d9b375 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,88 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import java.time.Duration + +plugins { + id("java") + id("org.jetbrains.kotlin.jvm") version "2.1.10" + id("org.jlleitschuh.gradle.ktlint") version "12.1.2" + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" +} + +group = project.property("GROUP_ID") as String + +apply("gradle-tasks/specs.gradle.kts") +apply("$rootDir/gradle-tasks/snapshot.gradle") + +allprojects { + repositories { + mavenCentral() + maven { + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + } + } +} + +subprojects { + apply(plugin = "java") + apply(plugin = "org.jetbrains.kotlin.jvm") + apply(plugin = "org.jlleitschuh.gradle.ktlint") + + plugins.withId("org.jetbrains.kotlin.jvm") { + kotlin { + jvmToolchain(8) + } + } + + plugins.withType().configureEach { + tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_1_8) + } + } + } + + java { + withSourcesJar() + withJavadocJar() + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + // Gradle 7+ Java toolchain approach (also sets 1.8) + toolchain { + languageVersion.set(JavaLanguageVersion.of(8)) + } + } + + ktlint { + debug.set(true) + version.set("1.5.0") + verbose.set(true) + + additionalEditorconfig.set( + mapOf( + "max_line_length" to "200", + "indent_style" to "space", + "indent_size" to "4", + "insert_final_newline" to "true", + "end_of_line" to "lf", + ), + ) + } +} + +nexusPublishing { + repositories { + sonatype { + username.set(System.getenv("SONATYPE_USERNAME")) + password.set(System.getenv("SONATYPE_PASSWORD")) + } + } + + transitionCheckOptions { + maxRetries.set(60) + delayBetween.set(Duration.ofMillis(5000)) + } +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 000000000..3921a96b5 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + `kotlin-dsl` +} + +repositories { + mavenCentral() +} + +dependencies { + api("org.openapitools:openapi-generator:7.11.0") + implementation("com.samskivert:jmustache:1.15") +} diff --git a/buildSrc/src/main/kotlin/com/expediagroup/sdk/xap/generator/mustache/AllowedMediaTypesLambda.kt b/buildSrc/src/main/kotlin/com/expediagroup/sdk/xap/generator/mustache/AllowedMediaTypesLambda.kt new file mode 100644 index 000000000..456507725 --- /dev/null +++ b/buildSrc/src/main/kotlin/com/expediagroup/sdk/xap/generator/mustache/AllowedMediaTypesLambda.kt @@ -0,0 +1,25 @@ +package com.expediagroup.sdk.xap.generator.mustache + +import com.samskivert.mustache.Mustache +import com.samskivert.mustache.Template +import java.io.Serializable +import java.io.Writer +import org.openapitools.codegen.CodegenResponse + +class AllowedMediaTypesLambda : Mustache.Lambda, Serializable { + override fun execute( + fragment: Template.Fragment, + writer: Writer, + ) { + val response: CodegenResponse = fragment.context() as CodegenResponse + if (response.is2xx) { + val mediaTypes: List = + response.content.keys.filter { + !it.contains("xml", ignoreCase = true) + } + + val context = mapOf("mediaTypes" to mediaTypes) + fragment.execute(context, writer) + } + } +} diff --git a/code/LICENSE-HEADER.txt b/code/LICENSE-HEADER.txt deleted file mode 100644 index 732a2da66..000000000 --- a/code/LICENSE-HEADER.txt +++ /dev/null @@ -1,13 +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. \ No newline at end of file diff --git a/code/README.md b/code/README.md deleted file mode 100644 index 8666c82ff..000000000 --- a/code/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Welcome to the xap-sdk SDK! - -## Usage -```xml - - com.expediagroup - xap-sdk - 1.1.0 - -``` - -## License - -This project is licensed under the Apache License v2.0 - see the [LICENSE](LICENSE) for details. diff --git a/code/pom.xml b/code/pom.xml deleted file mode 100644 index 208d3d4c4..000000000 --- a/code/pom.xml +++ /dev/null @@ -1,874 +0,0 @@ - - - 4.0.0 - com.expediagroup - xap-sdk - 1.1.0 - EG xap-sdk for Java - EG xap-sdk v1.1.0 - https://github.com/ExpediaGroup/test-sdk - 2022 - jar - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - Expedia Group Committers - Expedia Group - https://expediagroup.com - - - - - scm:git:git@github.com:ExpediaGroup/test-sdk.git - scm:git:git@github.com:ExpediaGroup/test-sdk.git - https://github.com/ExpediaGroup/test-sdk/ - - - - - oss-sonatype - Sonatype Nexus Release Repository - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - oss-sonatype - Sonatype Nexus Snapshots Repository - https://oss.sonatype.org/content/repositories/snapshots - - - - - 1.8 - 8 - - UTF-8 - UTF-8 - - 3.8.0 - 1.8.0 - - 0.90 - com.expediagroup.sdk - - ${project.version} - ${project.artifactId} - - - 3.13.0 - 3.8.1 - 3.5.0 - 3.4.2 - 3.3.1 - 3.6.0 - 3.3.1 - 3.5.2 - 3.6.0 - 3.4.0 - 0.8.12 - 1.9.20 - - 1.2.1 - 4.6 - 1.6.0 - 2.0.21 - 1.9.0 - 2.3.13 - 0.26.1 - 2.0.16 - 1.7.0 - 3.2.7 - - - - - - - org.jetbrains.kotlin - kotlin-bom - ${kotlin.version} - pom - import - - - org.jetbrains.kotlinx - kotlinx-coroutines-bom - ${kotlinx.coroutines.version} - pom - import - - - io.ktor - ktor-bom - ${ktor.version} - pom - import - - - org.jetbrains.kotlinx - atomicfu-jvm - ${kotlin-atomic.version} - - - - - org.slf4j - slf4j-api - ${slf4j.version} - - - - - - com.fasterxml.jackson - jackson-bom - 2.18.2 - pom - import - - - com.squareup.okio - okio-jvm - 3.9.1 - - - org.jetbrains - annotations - 26.0.1 - - - org.hibernate.validator - hibernate-validator - 6.2.5.Final - - - com.fasterxml.jackson.core - jackson-annotations - 2.18.2 - - - - - - - - org.apache.maven.plugins - maven-resources-plugin - ${maven-resources-plugin.version} - - false - - @@ - - - - - include-domain-helpers - generate-sources - - copy-resources - - - ${basedir}/src/main/kotlin/com/expediagroup/sdk/domain/xap - - - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - ${maven-dependency-plugin.version} - - - analyze - - analyze - - - true - true - - - - - - org.codehaus.mojo - flatten-maven-plugin - - all - true - true - bom - true - - - - - - - - ${flatten.maven.plugin.version} - - - flatten - process-resources - - flatten - - - - - - org.apache.maven.plugins - maven-jar-plugin - ${maven-jar-plugin.version} - - - attach-test-jar - - test-jar - - - - - true - - - true - true - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - - -parameters - -XDcompilePolicy=simple - - - - - - default-compile - none - - - - default-testCompile - none - - - kotlin-java-compile - compile - - compile - - - - kotlin-java-test-compile - test-compile - - testCompile - - - - - - org.codehaus.mojo - properties-maven-plugin - ${properties.maven.plugin.version} - - - generate-resources - - write-project-properties - - - ${project.build.outputDirectory}/sdk.properties - - - - - - - kotlin-maven-plugin - org.jetbrains.kotlin - ${kotlin.version} - - - compile-kotlin - - compile - - - - ${project.basedir}/src/main/kotlin - - ${java.release} - - - - test-compile-kotlin - - test-compile - - - - ${project.basedir}/src/test/kotlin - - ${java.release} - - - - - - kotlinx-serialization - - - - - org.jetbrains.kotlin - kotlin-maven-serialization - ${kotlin.version} - - - - - - org.codehaus.mojo - build-helper-maven-plugin - ${build-helper-maven-plugin.version} - - - add-kotlin-sources - generate-sources - - add-source - - - - - ${project.basedir}/src/main/kotlin - - - - - - add-kotlin-test-sources - generate-sources - - add-test-source - - - - - ${project.basedir}/src/test/kotlin - - - - - - get-the-year - - timestamp-property - - - current.year - yyyy - - - - - - - org.apache.maven.plugins - maven-source-plugin - ${maven-source-plugin.version} - - - attach-sources - - jar-no-fork - - - - - - - org.apache.maven.plugins - maven-shade-plugin - ${maven-shade-plugin.version} - - - - shade - - - true - true - true - - - - - - org.hibernate - ${shadePrefix}.dependencies.org.hibernate - - - - - org.jetbrains.kotlin:* - org.jetbrains.kotlinx:* - org.slf4j:slf4j-api - - - - - - - - - org.jetbrains.dokka - dokka-maven-plugin - - - ${project.basedir}/src/main/kotlin/com/expediagroup/sdk/xap - ${project.basedir}/src/main/kotlin/com/expediagroup/sdk/domain/xap - - - - org.jetbrains.dokka - kotlin-as-java-plugin - ${dokka-plugin.version} - - - org.jetbrains.dokka - versioning-plugin - ${dokka-plugin.version} - - - - - ${project.version} - ${dokka-old-versions.location} - - - true - - - - prepare-package - - dokka - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - ${maven-enforcer-plugin.version} - - - enforce-pom-standards - validate - - enforce - - - - - - - - - ${minimum.jdk.version} - - - ${minimum.maven.version} - - - true - Snapshot dependencies must be resolved before releasing - - - - - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco-plugin.version} - - ${project.build.directory}/jacoco.exec - ${project.build.directory}/jacoco - - - - instrument-coverage - initialize - - prepare-agent - - - - coverage-report - prepare-package - - report - - - - coverage-check - verify - - check - - - - - CLASS - - *Test - - - - INSTRUCTION - COVEREDRATIO - ${minimum.code.coverage} - - - BRANCH - COVEREDRATIO - ${minimum.code.coverage} - - - - - - - - - - - exec-maven-plugin - org.codehaus.mojo - - - delete-empty-files - process-sources - - exec - - - find - - src - -type - f - -empty - -print - -delete - - - - - - - - com.github.gantsign.maven - ktlint-maven-plugin - ${ktlint-plugin.version} - - - format - - format - - - - - - - - com.mycila - license-maven-plugin - ${maven.licence.plugin.version} - - - ${current.year} - Expedia, Inc. - - - -
./LICENSE-HEADER.txt
- - **/*.kt - -
-
-
- - - add-license-header - process-sources - - format - - - -
-
-
- - - - org.hibernate.validator - hibernate-validator - - - com.fasterxml.jackson.core - jackson-annotations - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - runtime - - - org.jetbrains - annotations - - - org.jetbrains.kotlin - kotlin-stdlib - - - io.ktor - ktor-serialization-jackson-jvm - - - com.fasterxml.jackson.core - jackson-databind - - - io.ktor - ktor-client-core-jvm - - - io.ktor - ktor-client-okhttp-jvm - - - io.ktor - ktor-client-auth-jvm - - - io.ktor - ktor-client-content-negotiation-jvm - - - io.ktor - ktor-http-jvm - - - io.ktor - ktor-utils-jvm - - - io.ktor - ktor-client-logging-jvm - - - org.jetbrains.kotlinx - kotlinx-coroutines-core-jvm - - - io.ktor - ktor-serialization-jvm - - - io.ktor - ktor-client-encoding-jvm - - - - org.slf4j - slf4j-api - - - - org.jetbrains.kotlinx - atomicfu-jvm - - - - org.apache.commons - commons-lang3 - 3.14.0 - - - - org.apache.commons - commons-text - 1.12.0 - - - - com.ebay.ejmask - ejmask-api - 1.3.0 - - - - com.ebay.ejmask - ejmask-extensions - 1.3.0 - - - - - - release - - true - false - true - - - - - org.apache.maven.plugins - maven-gpg-plugin - ${maven.gpg.plugin.version} - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - ${maven.nexus-staging.plugin.version} - true - - oss-sonatype - https://oss.sonatype.org/ - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - **/jacoco.exec - - - **/PerformanceTest.java - @{argLine} - - - - - - maven-jar-plugin - ${maven-jar-plugin.version} - - - - javadoc - ${project.basedir}/target/site/apidocs - **/* - ${project.build.finalName} - - pack-javadoc - package - - jar - - - - - - - org.jetbrains.dokka - dokka-maven-plugin - - - ${project.basedir}/src/main/kotlin/com/expediagroup/sdk/xap - - - - org.jetbrains.dokka - kotlin-as-java-plugin - ${dokka-plugin.version} - - - org.jetbrains.dokka - versioning-plugin - ${dokka-plugin.version} - - - - - ${project.version} - ${dokka-old-versions.location} - - - - - - prepare-package - - javadocJar - - - - - - - - -
diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt deleted file mode 100644 index d11f25e9f..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseRapidClient.kt +++ /dev/null @@ -1,73 +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. - */ -package com.expediagroup.sdk.core.client - -import com.expediagroup.sdk.core.configuration.RapidClientConfiguration -import com.expediagroup.sdk.core.configuration.collector.ConfigurationCollector -import com.expediagroup.sdk.core.configuration.provider.ConfigurationProvider -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider -import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy -import io.ktor.client.HttpClient -import io.ktor.client.engine.HttpClientEngine -import io.ktor.client.engine.okhttp.OkHttp - -/** - * The integration point between the SDK Core and the product SDKs. - * - * @param httpClientEngine The HTTP client engine to use. - * @param clientConfiguration The configuration for the client. - */ -abstract class BaseRapidClient( - namespace: String, - clientConfiguration: RapidClientConfiguration, - httpClientEngine: HttpClientEngine = DEFAULT_HTTP_CLIENT_ENGINE -) : Client(namespace) { - private val _configurationProvider: ConfigurationProvider = - ConfigurationCollector.create( - clientConfiguration.toProvider(), - RapidConfigurationProvider - ) - - private val engine: HttpClientEngine = - _configurationProvider.okHttpClient?.let { - OkHttp.create { - config { - preconfigured = it - dispatcher(it.dispatcher) - } - } - } ?: httpClientEngine - - private val _httpClient: HttpClient = buildHttpClient(_configurationProvider, AuthenticationStrategy.AuthenticationType.SIGNATURE, engine) - - init { - finalize() - } - - override val configurationProvider: ConfigurationProvider - get() = _configurationProvider - - override val httpClient: HttpClient - get() = _httpClient - - /** A [BaseRapidClient] builder. */ - @Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients. - abstract class Builder> : HttpConfigurableBuilder() - - /** A [BaseRapidClient] builder with ability to pass a custom okhttp client. */ - @Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients. - abstract class BuilderWithHttpClient> : Client.BuilderWithHttpClient() -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt deleted file mode 100644 index 2f440dc33..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/client/BaseXapClient.kt +++ /dev/null @@ -1,73 +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. - */ -package com.expediagroup.sdk.core.client - -import com.expediagroup.sdk.core.configuration.XapClientConfiguration -import com.expediagroup.sdk.core.configuration.collector.ConfigurationCollector -import com.expediagroup.sdk.core.configuration.provider.ConfigurationProvider -import com.expediagroup.sdk.core.configuration.provider.XapConfigurationProvider -import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy -import io.ktor.client.HttpClient -import io.ktor.client.engine.HttpClientEngine -import io.ktor.client.engine.okhttp.OkHttp - -/** - * The integration point between the SDK Core and the product SDKs. - * - * @param httpClientEngine The HTTP client engine to use. - * @param clientConfiguration The configuration for the client. - */ -abstract class BaseXapClient( - namespace: String, - clientConfiguration: XapClientConfiguration, - httpClientEngine: HttpClientEngine = DEFAULT_HTTP_CLIENT_ENGINE -) : Client(namespace) { - private val _configurationProvider: ConfigurationProvider = - ConfigurationCollector.create( - clientConfiguration.toProvider(), - XapConfigurationProvider - ) - - private val engine: HttpClientEngine = - _configurationProvider.okHttpClient?.let { - OkHttp.create { - config { - preconfigured = it - dispatcher(it.dispatcher) - } - } - } ?: httpClientEngine - - private val _httpClient: HttpClient = buildHttpClient(_configurationProvider, AuthenticationStrategy.AuthenticationType.BASIC, engine) - - init { - finalize() - } - - override val configurationProvider: ConfigurationProvider - get() = _configurationProvider - - override val httpClient: HttpClient - get() = _httpClient - - /** A [BaseXapClient] builder. */ - @Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients. - abstract class Builder> : HttpConfigurableBuilder() - - /** A [BaseXapClient] builder with ability to pass a custom okhttp client. */ - @Suppress("unused", "UnnecessaryAbstractClass") // This is used by the generated SDK clients. - abstract class BuilderWithHttpClient> : Client.BuilderWithHttpClient() -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/client/Client.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/client/Client.kt deleted file mode 100644 index de2847b94..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/client/Client.kt +++ /dev/null @@ -1,337 +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. - */ -package com.expediagroup.sdk.core.client - -import com.expediagroup.sdk.core.configuration.Credentials -import com.expediagroup.sdk.core.configuration.provider.ConfigurationProvider -import com.expediagroup.sdk.core.constant.ConfigurationName -import com.expediagroup.sdk.core.constant.Constant -import com.expediagroup.sdk.core.constant.provider.ExceptionMessageProvider.getMissingRequiredConfigurationMessage -import com.expediagroup.sdk.core.constant.provider.LoggingMessageProvider -import com.expediagroup.sdk.core.contract.Contract -import com.expediagroup.sdk.core.contract.adhereTo -import com.expediagroup.sdk.core.model.exception.client.ExpediaGroupConfigurationException -import com.expediagroup.sdk.core.model.getTransactionId -import com.expediagroup.sdk.core.plugin.Hooks -import com.expediagroup.sdk.core.plugin.authentication.AuthenticationConfiguration -import com.expediagroup.sdk.core.plugin.authentication.AuthenticationHookFactory -import com.expediagroup.sdk.core.plugin.authentication.AuthenticationPlugin -import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy -import com.expediagroup.sdk.core.plugin.encoding.EncodingConfiguration -import com.expediagroup.sdk.core.plugin.encoding.EncodingPlugin -import com.expediagroup.sdk.core.plugin.exception.ExceptionHandlingConfiguration -import com.expediagroup.sdk.core.plugin.exception.ExceptionHandlingPlugin -import com.expediagroup.sdk.core.plugin.hooks -import com.expediagroup.sdk.core.plugin.httptimeout.HttpTimeoutConfiguration -import com.expediagroup.sdk.core.plugin.httptimeout.HttpTimeoutPlugin -import com.expediagroup.sdk.core.plugin.logging.ExpediaGroupLoggerFactory -import com.expediagroup.sdk.core.plugin.logging.LoggingConfiguration -import com.expediagroup.sdk.core.plugin.logging.LoggingPlugin -import com.expediagroup.sdk.core.plugin.plugins -import com.expediagroup.sdk.core.plugin.request.DefaultRequestConfiguration -import com.expediagroup.sdk.core.plugin.request.DefaultRequestPlugin -import com.expediagroup.sdk.core.plugin.serialization.SerializationConfiguration -import com.expediagroup.sdk.core.plugin.serialization.SerializationPlugin -import io.ktor.client.HttpClient -import io.ktor.client.engine.HttpClientEngine -import io.ktor.client.engine.okhttp.OkHttp -import io.ktor.client.statement.HttpResponse -import io.ktor.client.statement.request -import okhttp3.Dispatcher -import okhttp3.OkHttpClient - -// Create a Dispatcher with limits -val dispatcher = - Dispatcher().apply { - maxRequests = 10000 // Maximum number of concurrent requests - maxRequestsPerHost = 1000 - } - -val DEFAULT_HTTP_CLIENT_ENGINE: HttpClientEngine = - OkHttp.create { - config { - eventListenerFactory(OkHttpEventListener.FACTORY) - dispatcher(dispatcher) - } - } - -/** - * The base integration point between the SDK Core and the product SDKs. - */ -abstract class Client( - namespace: String, - environmentProvider: EnvironmentProvider = DefaultEnvironmentProvider(namespace) -) : EnvironmentProvider by environmentProvider { - private val httpHandler = DefaultHttpHandler(environmentProvider) - - companion object { - private val log = ExpediaGroupLoggerFactory.getLogger(this::class.java) - } - - /** The configuration provider to use. */ - abstract val configurationProvider: ConfigurationProvider - - /** The HTTP client to perform requests with. */ - abstract val httpClient: HttpClient - - internal fun buildHttpClient( - configurationProvider: ConfigurationProvider, - authenticationType: AuthenticationStrategy.AuthenticationType, - httpClientEngine: HttpClientEngine = DEFAULT_HTTP_CLIENT_ENGINE - ): HttpClient = - HttpClient(httpClientEngine) { - val httpClientConfig = this - - val key: String = configurationProvider.key ?: fireMissingConfigurationIssue(ConfigurationName.KEY) - val secret: String = configurationProvider.secret ?: fireMissingConfigurationIssue(ConfigurationName.SECRET) - val endpoint: String = configurationProvider.endpoint ?: fireMissingConfigurationIssue(ConfigurationName.ENDPOINT) - val authEndpoint: String = configurationProvider.authEndpoint ?: fireMissingConfigurationIssue(ConfigurationName.AUTH_ENDPOINT) - val requestTimeout: Long = configurationProvider.requestTimeout ?: fireMissingConfigurationIssue(ConfigurationName.REQUEST_TIMEOUT_MILLIS) - val connectionTimeout: Long = configurationProvider.connectionTimeout ?: fireMissingConfigurationIssue(ConfigurationName.CONNECTION_TIMEOUT_MILLIS) - val socketTimeout: Long = configurationProvider.socketTimeout ?: fireMissingConfigurationIssue(ConfigurationName.SOCKET_TIMEOUT_MILLIS) - val maskedLoggingHeaders: Set = configurationProvider.maskedLoggingHeaders ?: setOf() - val maskedLoggingBodyFields: Set = configurationProvider.maskedLoggingBodyFields ?: setOf() - - val authenticationConfiguration = - AuthenticationConfiguration.from( - httpClientConfig, - Credentials.from(key, secret), - authEndpoint, - authenticationType - ) - - plugins { - use(LoggingPlugin).with(LoggingConfiguration.from(httpClientConfig, maskedLoggingHeaders, maskedLoggingBodyFields)) - use(SerializationPlugin).with(SerializationConfiguration.from(httpClientConfig)) - use(AuthenticationPlugin).with(authenticationConfiguration) - use(DefaultRequestPlugin).with(DefaultRequestConfiguration.from(httpClientConfig, endpoint)) - use(EncodingPlugin).with(EncodingConfiguration.from(httpClientConfig)) - use(HttpTimeoutPlugin).with(HttpTimeoutConfiguration.from(httpClientConfig, requestTimeout, connectionTimeout, socketTimeout)) - use(ExceptionHandlingPlugin).with(ExceptionHandlingConfiguration.from(httpClientConfig)) - } - - hooks { - use(AuthenticationHookFactory).with(authenticationConfiguration) - } - } - - /** Throw an exception if the configuration is missing. */ - private fun fireMissingConfigurationIssue(configurationKey: String): Nothing = throw ExpediaGroupConfigurationException(getMissingRequiredConfigurationMessage(configurationKey)) - - private fun isNotSuccessfulResponse(response: HttpResponse) = response.status.value !in Constant.SUCCESSFUL_STATUS_CODES_RANGE - - @Suppress("unused") // This is used by the product SDKs. - suspend fun throwIfError(response: HttpResponse, operationId: String) { - if (isNotSuccessfulResponse(response)) { - log.info(LoggingMessageProvider.getResponseUnsuccessfulMessage(response.status, response.request.headers.getTransactionId())) - throwServiceException(response, operationId) - } - } - - abstract suspend fun throwServiceException( - response: HttpResponse, - operationId: String - ) - - suspend fun performGet(url: String): HttpResponse = httpHandler.performGet(httpClient, url) - - /** - * A [Client] base builder. - */ - abstract class Builder> { - /** Sets the API key to use for authentication. */ - protected var key: String? = null - - /** Sets the API secret to use for authentication. */ - protected var secret: String? = null - - /** Sets the API endpoint to use for requests. */ - protected var endpoint: String? = null - - /** Sets tne body fields to be masked in logging. */ - protected var maskedLoggingHeaders: Set? = null - - /** Sets tne body fields to be masked in logging. */ - protected var maskedLoggingBodyFields: Set? = null - - /** Sets the API key to use for authentication. - * - * @param key The API key to use for authentication. - * @return The [Builder] instance. - */ - fun key(key: String): SELF { - this.key = key - return self() - } - - /** Sets the API secret to use for authentication. - * - * @param secret The API secret to use for authentication. - * @return The [Builder] instance. - */ - fun secret(secret: String): SELF { - this.secret = secret - return self() - } - - /** Sets the API endpoint to use for requests. - * - * @param endpoint The API endpoint to use for requests. - * @return The [Builder] instance. - */ - fun endpoint(endpoint: String): SELF { - this.endpoint = endpoint.adhereTo(Contract.TRAILING_SLASH) - log.info(LoggingMessageProvider.getRuntimeConfigurationProviderMessage(ConfigurationName.ENDPOINT, endpoint)) - return self() - } - - /** - * Sets tne headers to be masked in logging. - * - * @param headers the headers to be masked in logging. - * @return The [Builder] instance. - */ - fun maskedLoggingHeaders(vararg headers: String): SELF { - this.maskedLoggingHeaders = headers.toSet() - log.info(LoggingMessageProvider.getRuntimeConfigurationProviderMessage(ConfigurationName.MASKED_LOGGING_HEADERS, headers.joinToString())) - return self() - } - - /** - * Sets tne body fields to be masked in logging. - * - * @param fields the body fields to be masked in logging. - * @return The [Builder] instance. - */ - fun maskedLoggingBodyFields(vararg fields: String): SELF { - this.maskedLoggingBodyFields = fields.toSet() - log.info(LoggingMessageProvider.getRuntimeConfigurationProviderMessage(ConfigurationName.MASKED_LOGGING_BODY_FIELDS, fields.joinToString())) - return self() - } - - /** Create a [Client] object. */ - abstract fun build(): Client - - @Suppress("UNCHECKED_CAST") // This is safe because of the type parameter - protected open fun self(): SELF = this as SELF - } - - /** - * A builder class for configuring HTTP-related settings for a [Client]. - * - * This builder class extends the base [Client.Builder] class and provides additional methods - * for configuring HTTP-specific settings such as request timeout, connection timeout, and socket timeout. - * - * @param The type of the builder itself, used for method chaining. - */ - abstract class HttpConfigurableBuilder> : Builder() { - /** - * Sets the request timeout in milliseconds. - * - * Request timeout is the time period from the start of the request to the completion of the response. - * - * Default is infinite - no timeout. - */ - protected var requestTimeout: Long? = null - - /** - * Sets the connection timeout in milliseconds. - * - * Connection timeout is the time period from the start of the request to the establishment of the connection with the server. - * - * Default is 10 seconds (10000 milliseconds). - */ - protected var connectionTimeout: Long? = null - - /** - * Sets the socket timeout in milliseconds. - * - * Socket timeout is the maximum period of inactivity between two consecutive data packets. - * - * Default is 15 seconds (15000 milliseconds). - */ - protected var socketTimeout: Long? = null - - /** - * Sets the request timeout in milliseconds. - * Request timeout is the time period from the start of the request to the completion of the response. - * Default is infinite - no timeout. - * - * @param milliseconds The request timeout to be used. - * @return The [Builder] instance. - */ - fun requestTimeout(milliseconds: Long): SELF { - this.requestTimeout = milliseconds - log.info(LoggingMessageProvider.getRuntimeConfigurationProviderMessage(ConfigurationName.REQUEST_TIMEOUT_MILLIS, milliseconds.toString())) - return self() - } - - /** - * Sets the connection timeout in milliseconds. - * Connection timeout is the time period from the start of the request to the establishment of the connection with the server. - * Default is 10 seconds (10000 milliseconds). - * - * @param milliseconds The connection timeout to be used. - * @return The [Builder] instance. - */ - fun connectionTimeout(milliseconds: Long): SELF { - this.connectionTimeout = milliseconds - log.info(LoggingMessageProvider.getRuntimeConfigurationProviderMessage(ConfigurationName.CONNECTION_TIMEOUT_MILLIS, milliseconds.toString())) - return self() - } - - /** - * Sets the socket timeout in milliseconds. - * Socket timeout is the maximum period of inactivity between two consecutive data packets. - * Default is 15 seconds (15000 milliseconds). - * - * @param milliseconds The socket timeout to be used. - * @return The [Builder] instance. - */ - fun socketTimeout(milliseconds: Long): SELF { - this.socketTimeout = milliseconds - log.info(LoggingMessageProvider.getRuntimeConfigurationProviderMessage(ConfigurationName.SOCKET_TIMEOUT_MILLIS, milliseconds.toString())) - return self() - } - - /** Create a [Client] object. */ - abstract override fun build(): Client - } - - /** - * A builder class for configuring HTTP-related settings for a [Client] with the ability to pass a custom [OkHttpClient]. - * - * This builder class extends the base [Client.Builder] class and provides additional methods - * for setting a configured okhttp client. - * - * @param The type of the builder itself, used for method chaining. - */ - abstract class BuilderWithHttpClient> : Builder() { - protected var okHttpClient: OkHttpClient? = null - - @Suppress("UNCHECKED_CAST") - override fun self(): SELF = this as SELF - - /** Sets the [OkHttpClient] to use for the [Client]. */ - fun okHttpClient(okHttpClient: OkHttpClient): SELF { - this.okHttpClient = okHttpClient - return self() - } - } -} - -/** Executes the hooks for the client. */ -fun T.finalize() = Hooks.execute(this) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/client/ClientHelpers.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/client/ClientHelpers.kt deleted file mode 100644 index b2ed3e342..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/client/ClientHelpers.kt +++ /dev/null @@ -1,21 +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. - */ -package com.expediagroup.sdk.core.client - -/** Handy utils and helpers for a client. */ -abstract class ClientHelpers( - val client: Client -) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/client/Environment.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/client/Environment.kt deleted file mode 100644 index a0a76bcaf..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/client/Environment.kt +++ /dev/null @@ -1,45 +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. - */ -package com.expediagroup.sdk.core.client - -import com.expediagroup.sdk.core.constant.HeaderKey -import com.expediagroup.sdk.core.model.Properties -import com.expediagroup.sdk.core.model.TransactionId -import io.ktor.client.request.HttpRequestBuilder -import io.ktor.http.HttpHeaders - -interface EnvironmentProvider { - fun HttpRequestBuilder.appendHeaders(extraHeaders: Map = mapOf(HeaderKey.TRANSACTION_ID to TransactionId().dequeue().toString())) -} - -class DefaultEnvironmentProvider( - namespace: String -) : EnvironmentProvider { - private val properties = Properties.from(javaClass.classLoader.getResource("sdk.properties")!!) - private val javaVersion = System.getProperty("java.version") - private val operatingSystemName = System.getProperty("os.name") - private val operatingSystemVersion = System.getProperty("os.version") - private val userAgent = "expediagroup-sdk-java-$namespace/${properties["sdk-version"]!!} (Java $javaVersion; $operatingSystemName $operatingSystemVersion)" - - @Suppress("MemberVisibilityCanBePrivate") - override fun HttpRequestBuilder.appendHeaders(extraHeaders: Map) { - with(headers) { - append(HttpHeaders.UserAgent, userAgent) - append(HeaderKey.X_SDK_TITLE, properties["sdk-title"]!!) - extraHeaders.forEach { (key, value) -> append(key, value) } - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/client/ExpediaGroupClient.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/client/ExpediaGroupClient.kt deleted file mode 100644 index b47306deb..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/client/ExpediaGroupClient.kt +++ /dev/null @@ -1,70 +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. - */ -package com.expediagroup.sdk.core.client - -import com.expediagroup.sdk.core.configuration.ExpediaGroupClientConfiguration -import com.expediagroup.sdk.core.configuration.collector.ConfigurationCollector -import com.expediagroup.sdk.core.configuration.provider.ConfigurationProvider -import com.expediagroup.sdk.core.configuration.provider.ExpediaGroupConfigurationProvider -import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy -import io.ktor.client.HttpClient -import io.ktor.client.engine.HttpClientEngine - -/** - * The integration point between the SDK Core and the product SDKs. - * - * @param httpClientEngine The HTTP client engine to use. - * @param clientConfiguration The configuration for the client. - */ -abstract class ExpediaGroupClient( - namespace: String, - clientConfiguration: ExpediaGroupClientConfiguration, - httpClientEngine: HttpClientEngine = DEFAULT_HTTP_CLIENT_ENGINE -) : Client(namespace) { - private val _configurationProvider: ConfigurationProvider = - ConfigurationCollector.create( - clientConfiguration.toProvider(), - ExpediaGroupConfigurationProvider - ) - private val _httpClient: HttpClient = buildHttpClient(_configurationProvider, AuthenticationStrategy.AuthenticationType.BEARER, httpClientEngine) - - init { - finalize() - } - - override val configurationProvider: ConfigurationProvider - get() = _configurationProvider - - override val httpClient: HttpClient - get() = _httpClient - - /** An [ExpediaGroupClient] builder. */ - @Suppress("unused") // This is used by the generated SDK clients. - abstract class Builder> : HttpConfigurableBuilder() { - /** Sets the API auth endpoint to use for requests. */ - protected var authEndpoint: String? = null - - /** Sets the API auth endpoint to use for requests. - * - * @param authEndpoint The API auth endpoint to use for requests. - * @return The [Builder] instance. - */ - fun authEndpoint(authEndpoint: String): SELF { - this.authEndpoint = authEndpoint - return self() - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/client/HttpHandler.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/client/HttpHandler.kt deleted file mode 100644 index 28101ef39..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/client/HttpHandler.kt +++ /dev/null @@ -1,43 +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. - */ -package com.expediagroup.sdk.core.client - -import io.ktor.client.HttpClient -import io.ktor.client.request.request -import io.ktor.client.request.url -import io.ktor.client.statement.HttpResponse -import io.ktor.http.HttpMethod - -internal interface HttpHandler { - suspend fun performGet( - httpClient: HttpClient, - link: String - ): HttpResponse -} - -internal class DefaultHttpHandler( - private val environmentProvider: EnvironmentProvider -) : HttpHandler, EnvironmentProvider by environmentProvider { - override suspend fun performGet( - httpClient: HttpClient, - link: String - ): HttpResponse = - httpClient.request { - method = HttpMethod.Get - url(link) - appendHeaders() - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/client/OkHttpEventListener.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/client/OkHttpEventListener.kt deleted file mode 100644 index 7986d9520..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/client/OkHttpEventListener.kt +++ /dev/null @@ -1,202 +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. - */ -package com.expediagroup.sdk.core.client - -import com.expediagroup.sdk.core.constant.HeaderKey -import com.expediagroup.sdk.core.plugin.logging.ExpediaGroupLoggerFactory -import okhttp3.Call -import okhttp3.Connection -import okhttp3.EventListener -import okhttp3.Handshake -import okhttp3.Protocol -import okhttp3.Request -import okhttp3.Response -import java.io.IOException -import java.net.InetSocketAddress -import java.net.Proxy -import java.util.concurrent.atomic.AtomicReference - -/** - * An `EventListener` implementation for OkHttp that logs various events during the lifecycle of an HTTP call. - * - * This listener logs events such as call start, call end, connection start, connection end, request headers start, - * request headers end, request body start, request body end, response headers start, response headers end, - * response body start, response body end, and failures. - * - * @property transactionId A reference to the unique transaction ID associated with the HTTP call. - */ -class OkHttpEventListener private constructor(private val transactionId: AtomicReference) : EventListener() { - private val log = ExpediaGroupLoggerFactory.getLogger(this::class.java) - - companion object { - val FACTORY: Factory = - Factory { call -> - val transactionIdHeader = call.request().header(HeaderKey.TRANSACTION_ID) - val transactionId = AtomicReference(transactionIdHeader.toString()) - OkHttpEventListener(transactionId) - } - } - - override fun callStart(call: Call) { - super.callStart(call) - log.debug("Call start for transaction-id: [{}]", transactionId.get()) - } - - override fun callEnd(call: Call) { - super.callEnd(call) - log.debug("Call end for transaction-id: [{}]", transactionId.get()) - } - - override fun callFailed( - call: Call, - ioe: IOException - ) { - super.callFailed(call, ioe) - log.debug("Call failed for transaction-id: [{}] with exception message: {}", transactionId.get(), ioe.message) - } - - override fun canceled(call: Call) { - super.canceled(call) - log.debug("Call canceled for transaction-id: [{}]", transactionId.get()) - } - - override fun connectStart( - call: Call, - inetSocketAddress: InetSocketAddress, - proxy: Proxy - ) { - super.connectStart(call, inetSocketAddress, proxy) - log.debug("Connect start for transaction-id: [{}]", transactionId.get()) - } - - override fun connectEnd( - call: Call, - inetSocketAddress: InetSocketAddress, - proxy: Proxy, - protocol: Protocol? - ) { - super.connectEnd(call, inetSocketAddress, proxy, protocol) - log.debug("Connect end for transaction-id: [{}]", transactionId.get()) - } - - override fun connectFailed( - call: Call, - inetSocketAddress: InetSocketAddress, - proxy: Proxy, - protocol: Protocol?, - ioe: IOException - ) { - super.connectFailed(call, inetSocketAddress, proxy, protocol, ioe) - log.debug("Connect failed for transaction-id: [{}] with exception message: {}", transactionId.get(), ioe.message) - } - - override fun connectionAcquired( - call: Call, - connection: Connection - ) { - super.connectionAcquired(call, connection) - log.debug("Connection acquired for transaction-id: [{}]", transactionId.get()) - } - - override fun connectionReleased( - call: Call, - connection: Connection - ) { - super.connectionReleased(call, connection) - log.debug("Connection released for transaction-id: [{}]", transactionId.get()) - } - - override fun secureConnectStart(call: Call) { - super.secureConnectStart(call) - log.debug("Secure connect start for transaction-id: [{}]", transactionId.get()) - } - - override fun secureConnectEnd( - call: Call, - handshake: Handshake? - ) { - super.secureConnectEnd(call, handshake) - log.debug("Secure connect end for transaction-id: [{}]", transactionId.get()) - } - - override fun requestHeadersStart(call: Call) { - super.requestHeadersStart(call) - log.debug("Sending request headers start for transaction-id: [{}]", transactionId.get()) - } - - override fun requestHeadersEnd( - call: Call, - request: Request - ) { - super.requestHeadersEnd(call, request) - log.debug("Sending request headers end for transaction-id: [{}]", transactionId.get()) - } - - override fun requestBodyStart(call: Call) { - super.requestBodyStart(call) - log.debug("Sending request body start for transaction-id: [{}]", transactionId.get()) - } - - override fun requestBodyEnd( - call: Call, - byteCount: Long - ) { - super.requestBodyEnd(call, byteCount) - log.debug("Sending request body end for transaction-id: [{}] with byte count: {}", transactionId.get(), byteCount) - } - - override fun requestFailed( - call: Call, - ioe: IOException - ) { - super.requestFailed(call, ioe) - log.debug("Request failed for transaction-id: [{}] with exception message: {}", transactionId.get(), ioe.message) - } - - override fun responseHeadersStart(call: Call) { - super.responseHeadersStart(call) - log.debug("Receiving response headers start for transaction-id: [{}]", transactionId.get()) - } - - override fun responseHeadersEnd( - call: Call, - response: Response - ) { - super.responseHeadersEnd(call, response) - log.debug("Receiving response headers end for transaction-id: [{}]", transactionId.get()) - } - - override fun responseBodyStart(call: Call) { - super.responseBodyStart(call) - log.debug("Receiving response body start for transaction-id: [{}]", transactionId.get()) - } - - override fun responseBodyEnd( - call: Call, - byteCount: Long - ) { - super.responseBodyEnd(call, byteCount) - log.debug("Receiving response body end for transaction-id: [{}] with byte count: {}", transactionId.get(), byteCount) - } - - override fun responseFailed( - call: Call, - ioe: IOException - ) { - super.responseFailed(call, ioe) - log.debug("Receiving response failed for transaction-id: [{}] with exception message: {}", transactionId.get(), ioe.message) - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/ClientConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/ClientConfiguration.kt deleted file mode 100644 index 557db5ed6..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/ClientConfiguration.kt +++ /dev/null @@ -1,45 +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. - */ -package com.expediagroup.sdk.core.configuration - -import com.expediagroup.sdk.core.configuration.provider.RuntimeConfigurationProvider -import okhttp3.OkHttpClient - -interface ClientConfiguration { - val key: String? - val secret: String? - val endpoint: String? - val requestTimeout: Long? - val connectionTimeout: Long? - val socketTimeout: Long? - val maskedLoggingHeaders: Set? - val maskedLoggingBodyFields: Set? - val okHttpClient: OkHttpClient? - - /** Build a [RuntimeConfigurationProvider] from a [ClientConfiguration]. */ - fun toProvider(): RuntimeConfigurationProvider = - RuntimeConfigurationProvider( - key = key, - secret = secret, - endpoint = endpoint, - requestTimeout = requestTimeout, - connectionTimeout = connectionTimeout, - socketTimeout = socketTimeout, - maskedLoggingHeaders = maskedLoggingHeaders, - maskedLoggingBodyFields = maskedLoggingBodyFields, - okHttpClient = okHttpClient - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/Credentials.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/Credentials.kt deleted file mode 100644 index 1e249b810..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/Credentials.kt +++ /dev/null @@ -1,45 +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. - */ -package com.expediagroup.sdk.core.configuration - -/** - * A pair of key-secret. - * - * @property key the client key - * @property secret the client secret - */ -internal data class Credentials( - val key: String, - val secret: String -) { - /** - * A factory of [Credentials]. - */ - companion object Factory { - /** - * Create a [Credentials] object. - * - * @param key Client key. - * @param secret Client secret. - * @return ClientCredentials object. - */ - @JvmStatic - fun from( - key: String, - secret: String - ): Credentials = Credentials(key, secret) - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/ExpediaGroupClientConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/ExpediaGroupClientConfiguration.kt deleted file mode 100644 index 917604d76..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/ExpediaGroupClientConfiguration.kt +++ /dev/null @@ -1,50 +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. - */ -package com.expediagroup.sdk.core.configuration - -import com.expediagroup.sdk.core.client.ExpediaGroupClient -import com.expediagroup.sdk.core.configuration.provider.RuntimeConfigurationProvider -import okhttp3.OkHttpClient - -/** - * Configuration for the [ExpediaGroupClient]. - * - * @property key The API key to use for authentication. - * @property secret The API secret to use for authentication. - * @property endpoint The API endpoint to use for requests. - * @property requestTimeout The request timeout to be used in milliseconds. - * @property connectionTimeout The connection timeout to be used in milliseconds. - * @property socketTimeout The socket timeout to be used in milliseconds. - * @property maskedLoggingHeaders The headers to be masked in logging. - * @property maskedLoggingBodyFields The body fields to be masked in logging. - * @property authEndpoint The API endpoint to use for authentication. - * @property okHttpClient The okhttp client to be used by the sdk. - */ -data class ExpediaGroupClientConfiguration( - override val key: String? = null, - override val secret: String? = null, - override val endpoint: String? = null, - override val requestTimeout: Long? = null, - override val connectionTimeout: Long? = null, - override val socketTimeout: Long? = null, - override val maskedLoggingHeaders: Set? = null, - override val maskedLoggingBodyFields: Set? = null, - override val okHttpClient: OkHttpClient? = null, - val authEndpoint: String? = null -) : ClientConfiguration { - /** Build a [RuntimeConfigurationProvider] from an [ExpediaGroupClientConfiguration]. */ - override fun toProvider(): RuntimeConfigurationProvider = super.toProvider().copy(authEndpoint = authEndpoint) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/RapidClientConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/RapidClientConfiguration.kt deleted file mode 100644 index 48a1cef94..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/RapidClientConfiguration.kt +++ /dev/null @@ -1,43 +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. - */ -package com.expediagroup.sdk.core.configuration - -import com.expediagroup.sdk.core.client.BaseRapidClient -import okhttp3.OkHttpClient - -/** - * Configuration for the [BaseRapidClient]. - * - * @property key The API key to use for authentication. - * @property secret The API secret to use for authentication. - * @property endpoint The API endpoint to use for requests. - * @property requestTimeout The request timeout to be used in milliseconds. - * @property connectionTimeout The connection timeout to be used in milliseconds. - * @property socketTimeout The socket timeout to be used in milliseconds. - * @property maskedLoggingHeaders The headers to be masked in logging. - * @property maskedLoggingBodyFields The body fields to be masked in logging. - */ -data class RapidClientConfiguration( - override val key: String? = null, - override val secret: String? = null, - override val endpoint: String? = null, - override val requestTimeout: Long? = null, - override val connectionTimeout: Long? = null, - override val socketTimeout: Long? = null, - override val maskedLoggingHeaders: Set? = null, - override val maskedLoggingBodyFields: Set? = null, - override val okHttpClient: OkHttpClient? = null -) : ClientConfiguration diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/XapClientConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/XapClientConfiguration.kt deleted file mode 100644 index ec72f80d7..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/XapClientConfiguration.kt +++ /dev/null @@ -1,43 +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. - */ -package com.expediagroup.sdk.core.configuration - -import com.expediagroup.sdk.core.client.BaseXapClient -import okhttp3.OkHttpClient - -/** - * Configuration for the [BaseXapClient]. - * - * @property key The API key to use for authentication. - * @property secret The API secret to use for authentication. - * @property endpoint The API endpoint to use for requests. - * @property requestTimeout The request timeout to be used in milliseconds. - * @property connectionTimeout The connection timeout to be used in milliseconds. - * @property socketTimeout The socket timeout to be used in milliseconds. - * @property maskedLoggingHeaders The headers to be masked in logging. - * @property maskedLoggingBodyFields The body fields to be masked in logging. - */ -data class XapClientConfiguration( - override val key: String? = null, - override val secret: String? = null, - override val endpoint: String? = null, - override val requestTimeout: Long? = null, - override val connectionTimeout: Long? = null, - override val socketTimeout: Long? = null, - override val maskedLoggingHeaders: Set? = null, - override val maskedLoggingBodyFields: Set? = null, - override val okHttpClient: OkHttpClient? = null -) : ClientConfiguration diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/collector/ConfigurationCollector.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/collector/ConfigurationCollector.kt deleted file mode 100644 index 49b674182..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/collector/ConfigurationCollector.kt +++ /dev/null @@ -1,75 +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. - */ -package com.expediagroup.sdk.core.configuration.collector - -import com.expediagroup.sdk.core.configuration.provider.ConfigurationProvider -import com.expediagroup.sdk.core.constant.ConfigurationName.AUTH_ENDPOINT -import com.expediagroup.sdk.core.constant.ConfigurationName.CONFIGURATION_COLLECTOR -import com.expediagroup.sdk.core.constant.ConfigurationName.CONNECTION_TIMEOUT_MILLIS -import com.expediagroup.sdk.core.constant.ConfigurationName.ENDPOINT -import com.expediagroup.sdk.core.constant.ConfigurationName.KEY -import com.expediagroup.sdk.core.constant.ConfigurationName.MASKED_LOGGING_BODY_FIELDS -import com.expediagroup.sdk.core.constant.ConfigurationName.MASKED_LOGGING_HEADERS -import com.expediagroup.sdk.core.constant.ConfigurationName.REQUEST_TIMEOUT_MILLIS -import com.expediagroup.sdk.core.constant.ConfigurationName.SECRET -import com.expediagroup.sdk.core.constant.ConfigurationName.SOCKET_TIMEOUT_MILLIS -import com.expediagroup.sdk.core.constant.provider.LoggingMessageProvider -import com.expediagroup.sdk.core.plugin.logging.ExpediaGroupLoggerFactory -import okhttp3.OkHttpClient - -/** - * Configuration collector that collects configuration from all available providers. - * - * @param providers A configuration providers queue. - */ -internal class ConfigurationCollector private constructor(providers: ConfigurationProviderQueue) : ConfigurationProvider { - override val name: String = CONFIGURATION_COLLECTOR - - companion object Factory { - private val log = ExpediaGroupLoggerFactory.getLogger(ConfigurationCollector::class.java) - - /** - * Creates a new [ConfigurationCollector] with the given [providerQueue]. - * - * @param providerQueue the [ConfigurationProviderQueue] to use. - * @return a new [ConfigurationCollector] with the given [providerQueue]. - */ - fun create(providerQueue: ConfigurationProviderQueue): ConfigurationCollector = ConfigurationCollector(providerQueue) - - /** - * Creates a new [ConfigurationCollector] with the given [providers]. - * - * @param providers the [ConfigurationProvider]s to use. - * @return a new [ConfigurationCollector] with the given [providers]. - */ - fun create(vararg providers: ConfigurationProvider): ConfigurationCollector = create(ConfigurationProviderQueue.from(providers.asList())) - } - - override val key: String? = providers.firstWith { it.key }.also { it?.log(KEY) }?.retrieve() - override val secret: String? = providers.firstWith { it.secret }.also { it?.log(SECRET) }?.retrieve() - override val endpoint: String? = providers.firstWith { it.endpoint }.also { it?.log(ENDPOINT) }?.retrieve() - override val authEndpoint: String? = providers.firstWith { it.authEndpoint }.also { it?.log(AUTH_ENDPOINT) }?.retrieve() - override val requestTimeout: Long? = providers.firstWith { it.requestTimeout }.also { it?.log(REQUEST_TIMEOUT_MILLIS) }?.retrieve() - override val connectionTimeout: Long? = providers.firstWith { it.connectionTimeout }.also { it?.log(CONNECTION_TIMEOUT_MILLIS) }?.retrieve() - override val socketTimeout: Long? = providers.firstWith { it.socketTimeout }.also { it?.log(SOCKET_TIMEOUT_MILLIS) }?.retrieve() - override val maskedLoggingHeaders: Set? = providers.firstWith { it.maskedLoggingHeaders }.also { it?.log(MASKED_LOGGING_HEADERS) }?.retrieve() - override val maskedLoggingBodyFields: Set? = providers.firstWith { it.maskedLoggingBodyFields }.also { it?.log(MASKED_LOGGING_BODY_FIELDS) }?.retrieve() - override val okHttpClient: OkHttpClient? = providers.firstWith { it.okHttpClient }?.retrieve() - - private fun ProvidedConfiguration.log(configurationName: String) { - log.info(LoggingMessageProvider.getChosenProviderMessage(configurationName, providerName)) - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/collector/ConfigurationProviderQueue.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/collector/ConfigurationProviderQueue.kt deleted file mode 100644 index 3a964739c..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/collector/ConfigurationProviderQueue.kt +++ /dev/null @@ -1,47 +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. - */ -package com.expediagroup.sdk.core.configuration.collector - -import com.expediagroup.sdk.core.configuration.provider.ConfigurationProvider - -/** - * A queue of all configuration providers. - * - * @property providers List of configuration providers - */ -internal class ConfigurationProviderQueue private constructor(private val providers: List) { - /** Returns the first provider in the queue. */ - fun first(): ConfigurationProvider? = providers.firstOrNull() - - /** Returns the first provider in the queue that matches the given [predicate]. */ - fun first(predicate: (ConfigurationProvider) -> Boolean): ConfigurationProvider? = providers.firstOrNull(predicate) - - /** Returns the first provider in the queue that matches the given [predicate] if found, null otherwise.*/ - fun firstWith(predicate: (provider: ConfigurationProvider) -> T?): ProvidedConfiguration? = first { predicate(it) != null }?.let { ProvidedConfiguration(predicate(it)!!, it.name) } - - companion object { - /** Builds a [ConfigurationProviderQueue] from the given [providers]. - * - * @param providers the providers to build the queue from. - * @return a [ConfigurationProviderQueue] instance. - */ - fun from(providers: List) = ConfigurationProviderQueue(providers.toList()) - } -} - -internal data class ProvidedConfiguration(private val configuration: T, val providerName: String) { - fun retrieve(): T = configuration -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/ConfigurationProvider.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/ConfigurationProvider.kt deleted file mode 100644 index 0a14edd19..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/ConfigurationProvider.kt +++ /dev/null @@ -1,63 +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. - */ -package com.expediagroup.sdk.core.configuration.provider - -import com.expediagroup.sdk.core.constant.Constant -import okhttp3.OkHttpClient - -/** - * A configuration provider that can be used to provide configuration values. - */ -interface ConfigurationProvider { - /** The name of the provider. */ - val name: String - - /** The API key to use for authentication. */ - val key: String? - get() = Constant.EMPTY_STRING - - /** The API secret to use for authentication. */ - val secret: String? - get() = Constant.EMPTY_STRING - - /** The API endpoint to use for requests. */ - val endpoint: String? - - /** The API endpoint to use for authentication. */ - val authEndpoint: String? - get() = Constant.EMPTY_STRING - - /** The time period from the start of the request to the completion of the response. */ - val requestTimeout: Long? - - /** The time period from the start of the request to the establishment of the connection with the server. */ - val connectionTimeout: Long? - - /** The maximum period of inactivity between two consecutive data packets. */ - val socketTimeout: Long? - - /** The headers to be masked in logging. */ - val maskedLoggingHeaders: Set? - get() = setOf() - - /** The body fields to be masked in logging.*/ - val maskedLoggingBodyFields: Set? - get() = setOf() - - /** The okhttp client to be used by the sdk.*/ - val okHttpClient: OkHttpClient? - get() = null -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/ExpediaGroupConfigurationProvider.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/ExpediaGroupConfigurationProvider.kt deleted file mode 100644 index 75295aeb2..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/ExpediaGroupConfigurationProvider.kt +++ /dev/null @@ -1,43 +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. - */ -package com.expediagroup.sdk.core.configuration.provider - -import com.expediagroup.sdk.core.configuration.provider.ExpediaGroupConfigurationProvider.authEndpoint -import com.expediagroup.sdk.core.configuration.provider.ExpediaGroupConfigurationProvider.connectionTimeout -import com.expediagroup.sdk.core.configuration.provider.ExpediaGroupConfigurationProvider.endpoint -import com.expediagroup.sdk.core.configuration.provider.ExpediaGroupConfigurationProvider.name -import com.expediagroup.sdk.core.configuration.provider.ExpediaGroupConfigurationProvider.requestTimeout -import com.expediagroup.sdk.core.configuration.provider.ExpediaGroupConfigurationProvider.socketTimeout -import com.expediagroup.sdk.core.constant.Constant - -/** - * Default configuration provider for ExpediaGroup. - * - * @property name The name of the provider. - * @property endpoint The API endpoint to use for requests. - * @property authEndpoint The API endpoint to use for authentication. - * @property requestTimeout The API response timeout to use for requests. - * @property connectionTimeout The connection timeout to be used in milliseconds. - * @property socketTimeout The socket timeout to be used in milliseconds. - */ -internal object ExpediaGroupConfigurationProvider : ConfigurationProvider { - override val name: String = "ExpediaGroup Configuration Provider" - override val endpoint: String = "https://api.expediagroup.com/" - override val authEndpoint: String = "${endpoint}identity/oauth2/v3/token/" - override val requestTimeout: Long = Constant.INFINITE_TIMEOUT - override val connectionTimeout: Long = Constant.TEN_SECONDS_IN_MILLIS - override val socketTimeout: Long = Constant.FIFTEEN_SECONDS_IN_MILLIS -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/RapidConfigurationProvider.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/RapidConfigurationProvider.kt deleted file mode 100644 index bc8e06c60..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/RapidConfigurationProvider.kt +++ /dev/null @@ -1,40 +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. - */ -package com.expediagroup.sdk.core.configuration.provider - -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.connectionTimeout -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.endpoint -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.name -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.requestTimeout -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.socketTimeout -import com.expediagroup.sdk.core.constant.Constant - -/** - * Default configuration provider for Rapid. - * - * @property name The name of the provider. - * @property endpoint The API endpoint to use for requests. - * @property requestTimeout The API response timeout to use for requests. - * @property connectionTimeout The connection timeout to use for requests. - * @property socketTimeout The socket timeout to use for requests. - */ -internal object RapidConfigurationProvider : ConfigurationProvider { - override val name: String = "Rapid Configuration Provider" - override val endpoint: String = "https://api.ean.com/v3" - override val requestTimeout: Long = Constant.INFINITE_TIMEOUT - override val connectionTimeout: Long = Constant.TEN_SECONDS_IN_MILLIS - override val socketTimeout: Long = Constant.FIFTEEN_SECONDS_IN_MILLIS -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/RuntimeConfigurationProvider.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/RuntimeConfigurationProvider.kt deleted file mode 100644 index d6e607e09..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/RuntimeConfigurationProvider.kt +++ /dev/null @@ -1,47 +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. - */ -package com.expediagroup.sdk.core.configuration.provider - -import com.expediagroup.sdk.core.constant.ConfigurationName.RUNTIME_CONFIGURATION_PROVIDER -import okhttp3.OkHttpClient - -/** - * A runtime-built configuration provider. - * - * @property name The name of the provider. - * @property key The API key to use for authentication. - * @property secret The API secret to use for authentication. - * @property endpoint The API endpoint to use for requests. - * @property authEndpoint The API endpoint to use for authentication. - * @property requestTimeout The request timeout to be used in milliseconds. - * @property connectionTimeout The connection timeout to be used in milliseconds. - * @property socketTimeout The socket timeout to be used in milliseconds. - * @property maskedLoggingHeaders The headers to be masked in logging. - * @property maskedLoggingBodyFields The body fields to be masked in logging. - */ -data class RuntimeConfigurationProvider( - override val name: String = RUNTIME_CONFIGURATION_PROVIDER, - override val key: String? = null, - override val secret: String? = null, - override val endpoint: String? = null, - override val authEndpoint: String? = null, - override val requestTimeout: Long? = null, - override val connectionTimeout: Long? = null, - override val socketTimeout: Long? = null, - override val maskedLoggingHeaders: Set? = null, - override val maskedLoggingBodyFields: Set? = null, - override val okHttpClient: OkHttpClient? = null -) : ConfigurationProvider diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/XapConfigurationProvider.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/XapConfigurationProvider.kt deleted file mode 100644 index 20857cce7..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/configuration/provider/XapConfigurationProvider.kt +++ /dev/null @@ -1,40 +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. - */ -package com.expediagroup.sdk.core.configuration.provider - -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.connectionTimeout -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.endpoint -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.name -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.requestTimeout -import com.expediagroup.sdk.core.configuration.provider.RapidConfigurationProvider.socketTimeout -import com.expediagroup.sdk.core.constant.Constant - -/** - * Default configuration provider for Rapid. - * - * @property name The name of the provider. - * @property endpoint The API endpoint to use for requests. - * @property requestTimeout The API response timeout to use for requests. - * @property connectionTimeout The connection timeout to use for requests. - * @property socketTimeout The socket timeout to use for requests. - */ -internal object XapConfigurationProvider : ConfigurationProvider { - override val name: String = "XAP Configuration Provider" - override val endpoint: String = "https://apim.expedia.com" - override val requestTimeout: Long = Constant.INFINITE_TIMEOUT - override val connectionTimeout: Long = Constant.TEN_SECONDS_IN_MILLIS - override val socketTimeout: Long = Constant.FIFTEEN_SECONDS_IN_MILLIS -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/Authentication.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/Authentication.kt deleted file mode 100644 index 2b22a50e1..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/Authentication.kt +++ /dev/null @@ -1,29 +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. - */ -package com.expediagroup.sdk.core.constant - -internal object Authentication { - const val AUTHORIZATION_REQUEST_LOCK_DELAY = 20L - const val BEARER_EXPIRY_DATE_MARGIN: Long = 10 // In seconds - - const val EAN = "EAN" - - const val BEARER = "Bearer" - - const val GRANT_TYPE = "grant_type" - - const val CLIENT_CREDENTIALS = "client_credentials" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/ConfigurationName.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/ConfigurationName.kt deleted file mode 100644 index 0d9b9a955..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/ConfigurationName.kt +++ /dev/null @@ -1,42 +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. - */ -package com.expediagroup.sdk.core.constant - -internal object ConfigurationName { - const val KEY = "key" - - const val SECRET = "secret" - - const val ENDPOINT = "endpoint" - - const val AUTH_ENDPOINT = "auth endpoint" - - const val REQUEST_TIMEOUT_MILLIS = "request timeout in milliseconds" - - const val CONNECTION_TIMEOUT_MILLIS = "connection timeout in milliseconds" - - const val SOCKET_TIMEOUT_MILLIS = "socket timeout in milliseconds" - - const val MASKED_LOGGING_HEADERS = "masked logging headers" - - const val MASKED_LOGGING_BODY_FIELDS = "masked logging body fields" - - const val RUNTIME_CONFIGURATION_PROVIDER = "runtime configuration" - - const val CONFIGURATION_COLLECTOR = "configuration collector" - - const val OKHTTP_CLIENT = "okhttp client" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/Constant.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/Constant.kt deleted file mode 100644 index 5f7a9d8c1..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/Constant.kt +++ /dev/null @@ -1,29 +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. - */ -package com.expediagroup.sdk.core.constant - -import io.ktor.client.plugins.HttpTimeout - -internal object Constant { - const val EMPTY_STRING = "" - const val TEN_SECONDS_IN_MILLIS = 10_000L - const val FIFTEEN_SECONDS_IN_MILLIS = 15_000L - const val INFINITE_TIMEOUT = HttpTimeout.INFINITE_TIMEOUT_MS - - private const val SUCCESSFUL_STATUS_CODES_RANGE_START = 200 - private const val SUCCESSFUL_STATUS_CODES_RANGE_END = 299 - val SUCCESSFUL_STATUS_CODES_RANGE: IntRange = SUCCESSFUL_STATUS_CODES_RANGE_START..SUCCESSFUL_STATUS_CODES_RANGE_END -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/ExceptionMessage.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/ExceptionMessage.kt deleted file mode 100644 index 332204407..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/ExceptionMessage.kt +++ /dev/null @@ -1,24 +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. - */ -package com.expediagroup.sdk.core.constant - -internal object ExceptionMessage { - const val AUTHENTICATION_FAILURE = "Unable to authenticate" - - const val AUTHENTICATION_NOT_CONFIGURED_FOR_CLIENT = "Authentication is not configured" - - const val LOGGING_MASKED_FIELDS_NOT_CONFIGURED_FOR_CLIENT = "Logging masked fields is not configured" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/HeaderKey.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/HeaderKey.kt deleted file mode 100644 index 425d0f5fc..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/HeaderKey.kt +++ /dev/null @@ -1,26 +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. - */ -package com.expediagroup.sdk.core.constant - -internal object HeaderKey { - const val PAGINATION_TOTAL_RESULTS = "pagination-total-results" - - const val LINK = "link" - - const val TRANSACTION_ID = "Partner-Transaction-Id" - - const val X_SDK_TITLE = "x-sdk-title" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/HeaderValue.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/HeaderValue.kt deleted file mode 100644 index 3c418bc74..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/HeaderValue.kt +++ /dev/null @@ -1,20 +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. - */ -package com.expediagroup.sdk.core.constant - -internal object HeaderValue { - const val GZIP = "gzip" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/Key.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/Key.kt deleted file mode 100644 index a7a71ca1c..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/Key.kt +++ /dev/null @@ -1,26 +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. - */ -package com.expediagroup.sdk.core.constant - -internal object Key { - const val CLIENT_KEY = "client_key" - - const val CLIENT_SECRET = "client_secret" - - const val ENDPOINT = "endpoint" - - const val AUTH_ENDPOINT = "auth_endpoint" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LogMaskingFields.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LogMaskingFields.kt deleted file mode 100644 index f66681346..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LogMaskingFields.kt +++ /dev/null @@ -1,36 +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. - */ -package com.expediagroup.sdk.core.constant - -import io.ktor.http.HttpHeaders - -internal data object LogMaskingFields { - val DEFAULT_MASKED_HEADER_FIELDS: Set = setOf(HttpHeaders.Authorization) - val DEFAULT_MASKED_BODY_FIELDS: Set = - setOf( - "cvv", - "pin", - "card_cvv", - "card_cvv2", - "card_number", - "access_token", - "security_code", - "account_number", - "card_avs_response", - "card_cvv_response", - "card_cvv2_response" - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LogMaskingRegex.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LogMaskingRegex.kt deleted file mode 100644 index 63d51c0be..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LogMaskingRegex.kt +++ /dev/null @@ -1,22 +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. - */ -package com.expediagroup.sdk.core.constant - -internal object LogMaskingRegex { - val FIELD_REGEX = "^[a-zA-Z0-9-_]+$".toRegex() - - val NUMBER_FIELD_REGEX = "(?<=[\"']?number[\"']?:\\s?[\"'])(\\s*\\d{15,16}\\s*)(?=[\"'])".toRegex() -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LoggingMessage.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LoggingMessage.kt deleted file mode 100644 index 50d9b3bce..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LoggingMessage.kt +++ /dev/null @@ -1,32 +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. - */ -package com.expediagroup.sdk.core.constant - -internal object LoggingMessage { - const val LOGGING_PREFIX = "ExpediaSDK:" - - const val TOKEN_RENEWAL_IN_PROGRESS = "Renewing token" - - const val TOKEN_RENEWAL_SUCCESSFUL = "Token renewal successful" - - const val TOKEN_CLEARING_IN_PROGRESS = "Clearing tokens" - - const val TOKEN_CLEARING_SUCCESSFUL = "Tokens successfully cleared" - - const val TOKEN_EXPIRED = "Token expired or is about to expire. Request will wait until token is renewed" - - const val OMITTED = "<-- omitted -->" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/SignatureValues.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/SignatureValues.kt deleted file mode 100644 index cdf04e37d..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/SignatureValues.kt +++ /dev/null @@ -1,30 +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. - */ -package com.expediagroup.sdk.core.constant - -internal object SignatureValues { - const val ONE_BYTE_MASK = 0xFF - - const val INCREMENT = 0x100 - - const val RADIX = 16 - - const val API_KEY = "apikey" - - const val SIGNATURE = "signature" - - const val TIMESTAMP = "timestamp" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/ExceptionMessageProvider.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/ExceptionMessageProvider.kt deleted file mode 100644 index 316ef3906..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/ExceptionMessageProvider.kt +++ /dev/null @@ -1,29 +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. - */ -package com.expediagroup.sdk.core.constant.provider - -import com.expediagroup.sdk.core.constant.provider.LoggingMessageProvider.getTransactionIdMessage - -internal object ExceptionMessageProvider { - fun getMissingRequiredConfigurationMessage(name: String): String = "Missing required configuration: $name" - - fun getExceptionOccurredWithTransactionIdMessage( - transactionId: String?, - message: String? - ): String = "Exception occurred" + getTransactionIdMessage(transactionId) + getConcatenatedMessage(message) - - private fun getConcatenatedMessage(message: String?) = if (message != null) ": $message" else "" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/LogMaskingRegexProvider.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/LogMaskingRegexProvider.kt deleted file mode 100644 index 475e6f4c2..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/LogMaskingRegexProvider.kt +++ /dev/null @@ -1,20 +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. - */ -package com.expediagroup.sdk.core.constant.provider - -internal object LogMaskingRegexProvider { - fun getMaskedFieldsRegex(maskedBodyFields: Set) = "(?<=[\"']?(${maskedBodyFields.joinToString("|")})[\"']?:\\s?[\"'])(\\s*[^\"']+\\s*)(?=[\"'])".toRegex() -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/LoggingMessageProvider.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/LoggingMessageProvider.kt deleted file mode 100644 index f9d358ad3..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/provider/LoggingMessageProvider.kt +++ /dev/null @@ -1,49 +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. - */ -package com.expediagroup.sdk.core.constant.provider - -import io.ktor.http.HttpStatusCode - -internal object LoggingMessageProvider { - fun getTokenExpiresInMessage(expiresIn: Int) = "New token expires in $expiresIn seconds" - - fun getResponseUnsuccessfulMessage( - httpStatusCode: HttpStatusCode, - transactionId: String? - ) = "Unsuccessful response [$httpStatusCode]${getTransactionIdMessage(transactionId)}" - - fun getChosenProviderMessage( - property: String, - providerName: String - ) = "Successfully loaded [$property] from [$providerName]" - - fun getRuntimeConfigurationProviderMessage( - property: String, - value: T - ) = "Setting [$property] to [$value] from runtime configuration provider" - - fun getResponseBodyMessage( - body: String, - transactionId: String? - ) = "Response Body${getTransactionIdMessage(transactionId)}: $body" - - fun getRequestBodyMessage( - body: String, - transactionId: String? - ) = "Request Body${getTransactionIdMessage(transactionId)}: $body" - - fun getTransactionIdMessage(transactionId: String?) = if (transactionId != null) " for transaction-id [$transactionId]" else "" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/contract/Contract.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/contract/Contract.kt deleted file mode 100644 index 6527759ca..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/contract/Contract.kt +++ /dev/null @@ -1,35 +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. - */ -package com.expediagroup.sdk.core.contract - -internal typealias Operation = (String) -> String - -/** - * A contract for a specific [operation]. - * - * @property operation The operation to perform on a string. - */ -internal enum class Contract(val operation: Operation) { - TRAILING_SLASH({ if (it.endsWith("/")) it else "$it/" }) -} - -/** - * Adheres to the given [contract] on a [String]. - * - * @param contract the [Contract] to adhere to. - * @return the [String] adhering to the given [contract]. - */ -internal fun String.adhereTo(contract: Contract): String = contract.operation(this) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/Headers.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/Headers.kt deleted file mode 100644 index 93bc60783..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/Headers.kt +++ /dev/null @@ -1,26 +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. - */ -package com.expediagroup.sdk.core.model - -import com.expediagroup.sdk.core.constant.HeaderKey -import io.ktor.http.Headers -import io.ktor.http.HeadersBuilder - -/** Get transaction id from headers. */ -fun Headers.getTransactionId(): String? = get(HeaderKey.TRANSACTION_ID) - -/** Get transaction id from headers builder. */ -fun HeadersBuilder.getTransactionId(): String? = get(HeaderKey.TRANSACTION_ID) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/Nothing.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/Nothing.kt deleted file mode 100644 index bd6863c42..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/Nothing.kt +++ /dev/null @@ -1,21 +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. - */ -package com.expediagroup.sdk.core.model - -/** - * A representation of nothingness. Philosophers have debated the existence of nothing for centuries, but we have finally found it. - */ -data object Nothing diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/Operation.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/Operation.kt deleted file mode 100644 index baf620810..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/Operation.kt +++ /dev/null @@ -1,27 +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. - */ -package com.expediagroup.sdk.core.model - -abstract class Operation( - val url: String, - val method: String, - val operationId: String, - val requestBody: T?, - val params: OperationParams? -) { - var transactionId: TransactionId = TransactionId() - private set -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/OperationParams.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/OperationParams.kt deleted file mode 100644 index c78314c41..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/OperationParams.kt +++ /dev/null @@ -1,27 +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. - */ -package com.expediagroup.sdk.core.model - -import io.ktor.http.Headers -import io.ktor.http.Parameters - -interface OperationParams { - fun getHeaders(): Headers - - fun getQueryParams(): Parameters - - fun getPathParams(): Map -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/Properties.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/Properties.kt deleted file mode 100644 index 5c93b9990..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/Properties.kt +++ /dev/null @@ -1,36 +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. - */ -package com.expediagroup.sdk.core.model - -import java.io.BufferedReader -import java.io.InputStreamReader -import java.net.URL - -/** A model of "*.properties" file with some handy methods. */ -class Properties(private val data: Map) { - companion object { - /** Creates a new SdkProperties with the given data. */ - fun from(path: URL) = - Properties( - java.util.Properties().apply { - load(BufferedReader(InputStreamReader(path.openStream()))) - }.map { it.key.toString() to it.value.toString() }.toMap() - ) - } - - /** Returns the data for a given [key]. */ - operator fun get(key: String): String? = data[key] -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/Response.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/Response.kt deleted file mode 100644 index d5bd9747e..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/Response.kt +++ /dev/null @@ -1,62 +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. - */ -@file:Suppress("unused") - -package com.expediagroup.sdk.core.model - -import java.util.stream.Collectors -import kotlin.collections.Map.Entry - -/** - * A Generic Response to represent the response from a service call. - * - * @property statusCode The HTTP status code of the response - * @property data The body of the response - * @property headers The headers of the response - */ -@Suppress("MemberVisibilityCanBePrivate") -open class Response( - val statusCode: Int, - val data: T, - val headers: Map> -) { - constructor(statusCode: Int, data: T, headers: Set>>) : this(statusCode, data, toHeadersMap(headers)) - - companion object { - @JvmStatic - fun toHeadersMap(headers: Set>>): Map> = - headers.stream().collect( - Collectors.toMap( - Entry>::key, - Entry>::value - ) - ) - } - - override fun toString() = "Response(statusCode=$statusCode, data=$data, headers=$headers)" - - @Deprecated("Use getData() instead", replaceWith = ReplaceWith("getData()")) - fun getBody() = data -} - -class EmptyResponse( - statusCode: Int, - headers: Map> -) : Response(statusCode, Nothing, headers) { - constructor(statusCode: Int, headers: Set>>) : this(statusCode, toHeadersMap(headers)) - - override fun toString(): String = "EmptyResponse(statusCode=$statusCode, headers=$headers)" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/TransactionId.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/TransactionId.kt deleted file mode 100644 index 07333147e..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/TransactionId.kt +++ /dev/null @@ -1,26 +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. - */ -package com.expediagroup.sdk.core.model - -import java.util.UUID - -class TransactionId { - private var transactionId: UUID = UUID.randomUUID() - - fun peek(): UUID = transactionId - - fun dequeue(): UUID = transactionId.also { transactionId = UUID.randomUUID() } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/ExceptionUtils.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/ExceptionUtils.kt deleted file mode 100644 index 02fcaabd8..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/ExceptionUtils.kt +++ /dev/null @@ -1,40 +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. - */ -package com.expediagroup.sdk.core.model.exception - -import com.expediagroup.sdk.core.constant.provider.ExceptionMessageProvider -import com.expediagroup.sdk.core.model.exception.service.ExpediaGroupServiceException - -/** Handles exceptions by ensuring that only instances of [ExpediaGroupException] are thrown. */ -fun Throwable.handle(): Nothing = handleWith(null) - -/** - * Handles exceptions by ensuring that only instances of [ExpediaGroupException] are thrown. - * - * @param transactionId the transaction ID to be included in the exception message, can be null. - */ -fun Throwable.handleWith(transactionId: String?): Nothing { - if (this is ExpediaGroupException) throw this - - when (val cause = this.cause) { - is ExpediaGroupException -> throw cause - else -> throw ExpediaGroupServiceException( - ExceptionMessageProvider.getExceptionOccurredWithTransactionIdMessage(transactionId, message), - this, - transactionId - ) - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/ExpediaGroupException.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/ExpediaGroupException.kt deleted file mode 100644 index cf3d8b72c..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/ExpediaGroupException.kt +++ /dev/null @@ -1,27 +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. - */ -package com.expediagroup.sdk.core.model.exception - -/** - * A base exception for all ExpediaGroup exceptions. - * - * @param message An optional error message. - * @param cause An optional cause of the error. - */ -open class ExpediaGroupException( - message: String? = null, - cause: Throwable? = null -) : RuntimeException(message, cause) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/ExpediaGroupClientException.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/ExpediaGroupClientException.kt deleted file mode 100644 index 4ea0b2ed2..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/ExpediaGroupClientException.kt +++ /dev/null @@ -1,29 +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. - */ -package com.expediagroup.sdk.core.model.exception.client - -import com.expediagroup.sdk.core.model.exception.ExpediaGroupException - -/** - * An exception that is thrown when a client error occurs. - * - * @param message An optional message. - * @param cause An optional cause. - */ -open class ExpediaGroupClientException( - message: String? = null, - cause: Throwable? = null -) : ExpediaGroupException(message, cause) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/ExpediaGroupConfigurationException.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/ExpediaGroupConfigurationException.kt deleted file mode 100644 index 63fd9ca96..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/ExpediaGroupConfigurationException.kt +++ /dev/null @@ -1,27 +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. - */ -package com.expediagroup.sdk.core.model.exception.client - -/** - * An exception that is thrown when a configuration error occurs. - * - * @param message An optional error message. - * @param cause An optional cause of the error. - */ -class ExpediaGroupConfigurationException( - message: String? = null, - cause: Throwable? = null -) : ExpediaGroupClientException(message, cause) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/ExpediaGroupInvalidFieldNameException.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/ExpediaGroupInvalidFieldNameException.kt deleted file mode 100644 index 6d06ffc87..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/ExpediaGroupInvalidFieldNameException.kt +++ /dev/null @@ -1,24 +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. - */ -package com.expediagroup.sdk.core.model.exception.client - -/** - * Thrown to indicate that one or more passed field names are invalid. - * - * @param invalidFields the names of the invalid fields. - */ -class ExpediaGroupInvalidFieldNameException(invalidFields: Collection) : - ExpediaGroupClientException("All fields names must contain only alphanumeric characters in addition to - and _ but found [${invalidFields.joinToString(",")}]") diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/PropertyConstraintViolationException.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/PropertyConstraintViolationException.kt deleted file mode 100644 index 8f05fec81..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/client/PropertyConstraintViolationException.kt +++ /dev/null @@ -1,27 +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. - */ -package com.expediagroup.sdk.core.model.exception.client - -/** - * An exception to be thrown when a constraint on some property has been violated. - * - * @property message The detail message. - * @property constraintViolations A list of the constraint violations that occurred - */ -class PropertyConstraintViolationException( - message: String = "Some field constraints have been violated", - constraintViolations: List -) : ExpediaGroupClientException("$message ${constraintViolations.joinToString(separator = ",\n\t- ", prefix = "[\n\t- ", postfix = "\n]")}") diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupApiException.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupApiException.kt deleted file mode 100644 index 64e901c52..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupApiException.kt +++ /dev/null @@ -1,23 +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. - */ -package com.expediagroup.sdk.core.model.exception.service - -import com.expediagroup.sdk.core.constant.provider.LoggingMessageProvider.getTransactionIdMessage - -abstract class ExpediaGroupApiException(val statusCode: Int, open val errorObject: Any, transactionId: String?) : - ExpediaGroupServiceException("Unsuccessful response code [$statusCode]${getTransactionIdMessage(transactionId)}${stringifyErrorObject(errorObject.toString())}", transactionId = transactionId) - -private fun stringifyErrorObject(stringValue: String): String = if (stringValue.isBlank()) " with an empty response body" else ": $stringValue" diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupAuthException.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupAuthException.kt deleted file mode 100644 index d3d6ac149..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupAuthException.kt +++ /dev/null @@ -1,43 +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. - */ -package com.expediagroup.sdk.core.model.exception.service - -import io.ktor.http.HttpStatusCode - -/** - * An exception that is thrown when an authentication error occurs. - * - * @param message The error message. - * @param cause The cause of the error. - * @param transactionId The transaction-id of the auth request. - */ -class ExpediaGroupAuthException( - message: String? = null, - cause: Throwable? = null, - transactionId: String? = null -) : ExpediaGroupServiceException(message, cause, transactionId) { - /** - * An exception that is thrown when an authentication error occurs. - * - * @param errorCode The HTTP status code of the error. - * @param message The error message. - */ - constructor( - errorCode: HttpStatusCode, - message: String, - transactionId: String? - ) : this(message = "[${errorCode.value}] $message", transactionId = transactionId) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupServiceDefaultErrorException.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupServiceDefaultErrorException.kt deleted file mode 100644 index e25db920b..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupServiceDefaultErrorException.kt +++ /dev/null @@ -1,18 +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. - */ -package com.expediagroup.sdk.core.model.exception.service - -class ExpediaGroupServiceDefaultErrorException(code: Int, override val errorObject: String, transactionId: String?) : ExpediaGroupApiException(code, errorObject, transactionId) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupServiceException.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupServiceException.kt deleted file mode 100644 index 130c1c19f..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/exception/service/ExpediaGroupServiceException.kt +++ /dev/null @@ -1,30 +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. - */ -package com.expediagroup.sdk.core.model.exception.service - -import com.expediagroup.sdk.core.model.exception.ExpediaGroupException - -/** - * An exception that is thrown when a service error occurs. - * - * @param message An optional error message. - * @param cause An optional cause of the error. - */ -open class ExpediaGroupServiceException( - message: String? = null, - cause: Throwable? = null, - val transactionId: String? = null -) : ExpediaGroupException(message, cause) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/paging/Paginator.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/paging/Paginator.kt deleted file mode 100644 index 7fbaa064b..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/paging/Paginator.kt +++ /dev/null @@ -1,89 +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. - */ -package com.expediagroup.sdk.core.model.paging - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.constant.HeaderKey.LINK -import com.expediagroup.sdk.core.constant.HeaderKey.PAGINATION_TOTAL_RESULTS -import com.expediagroup.sdk.core.model.Response -import io.ktor.client.statement.HttpResponse - -sealed class BasePaginator( - private val client: Client, - firstResponse: Response, - private val fallbackBody: T, - private val getBody: suspend (HttpResponse) -> T -) : Iterator { - private var state: ResponseState = DefaultResponseState(firstResponse) - val paginationTotalResults: Long = firstResponse.headers[PAGINATION_TOTAL_RESULTS]?.getOrNull(0)?.toLongOrNull() ?: 0 - - override fun hasNext(): Boolean = state.hasNext() - - private fun extractLink(headers: Map>): String? = - headers[LINK]?.getOrNull(0)?.split(";")?.let { - if (it.isNotEmpty()) it[0] else null - }?.let { - it.substring(it.indexOf("<") + 1, it.indexOf(">")) - } - - protected fun nextResponse(): Response { - val response = state.getNextResponse() - state = ResponseStateFactory.getState(extractLink(response.headers), client, fallbackBody, getBody) - return response - } -} - -/** - * Paginator that returns the body of the response. - * - * @param client The client to use to fetch the next response - * @param firstResponse The first response to start the paginator with - * @param getBody A function to extract the body from the response - */ -class Paginator( - client: Client, - firstResponse: Response, - fallbackBody: T, - getBody: suspend (HttpResponse) -> T -) : BasePaginator(client, firstResponse, fallbackBody, getBody) { - /** - * Returns the body of the next response. - * - * @throws NoSuchElementException if the iteration has no next element. - */ - override fun next(): T = nextResponse().data -} - -/** - * Paginator that returns the full response. - * - * @param client The client to use to fetch the next response - * @param firstResponse The first response to start the paginator with - * @param getBody A function to extract the body from the response - */ -class ResponsePaginator( - client: Client, - firstResponse: Response, - fallbackBody: T, - getBody: suspend (HttpResponse) -> T -) : BasePaginator, T>(client, firstResponse, fallbackBody, getBody) { - /** - * Returns the next response. - * - * @throws NoSuchElementException if the iteration has no next element. - */ - override fun next(): Response = nextResponse() -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/model/paging/ResponseState.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/model/paging/ResponseState.kt deleted file mode 100644 index 19897831d..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/model/paging/ResponseState.kt +++ /dev/null @@ -1,94 +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. - */ -package com.expediagroup.sdk.core.model.paging - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.constant.HeaderValue -import com.expediagroup.sdk.core.model.Response -import com.expediagroup.sdk.core.plugin.logging.GZipEncoder.decode -import com.expediagroup.sdk.core.plugin.logging.contentEncoding -import io.ktor.client.statement.HttpResponse -import io.ktor.util.InternalAPI -import io.ktor.util.moveToByteArray -import io.ktor.utils.io.ByteReadChannel -import io.ktor.utils.io.bits.Memory -import kotlinx.coroutines.runBlocking -import java.nio.ByteBuffer - -internal interface ResponseState { - fun getNextResponse(): Response - - fun hasNext(): Boolean -} - -internal class DefaultResponseState( - private val response: Response -) : ResponseState { - override fun getNextResponse(): Response = response - - override fun hasNext(): Boolean = true -} - -internal class LastResponseState : ResponseState { - override fun getNextResponse(): Response = throw NoSuchElementException() - - override fun hasNext(): Boolean = false -} - -internal class FetchLinkState( - private val link: String, - private val client: Client, - private val fallbackBody: T, - private val getBody: suspend (HttpResponse) -> T -) : ResponseState { - override fun getNextResponse(): Response = - runBlocking { - val response = client.performGet(link) - val body = parseBody(response) - Response(response.status.value, body, response.headers.entries()) - } - - override fun hasNext(): Boolean = true - - private suspend fun parseBody(response: HttpResponse): T = if (decodeBody(response).isEmpty()) fallbackBody else getBody(response) - - private suspend fun decodeBody(response: HttpResponse): String { - val byteReadChannel = prepareByteReadChannel(response) - val decodedByteReadChannel = if (response.contentEncoding().equals(HeaderValue.GZIP)) client.httpClient.decode(byteReadChannel) else byteReadChannel - val bodyString: String = decodedByteReadChannel.readRemaining().readText() - return bodyString - } - - @OptIn(InternalAPI::class) - private suspend fun prepareByteReadChannel(response: HttpResponse): ByteReadChannel { - val bufferSize = response.content.availableForRead - val buffer = ByteBuffer.allocate(bufferSize) - val numberOfBytesRead = response.content.peekTo(Memory(buffer), 0, 0, 0, bufferSize.toLong()).toInt() - val byteReadChannel = ByteReadChannel(buffer.moveToByteArray(), 0, numberOfBytesRead) - return byteReadChannel - } -} - -internal class ResponseStateFactory { - companion object { - fun getState( - link: String?, - client: Client, - fallbackBody: T, - getBody: suspend (HttpResponse) -> T - ): ResponseState = link?.let { FetchLinkState(it, client, fallbackBody, getBody) } ?: LastResponseState() - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/Hook.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/Hook.kt deleted file mode 100644 index 9a688c6b2..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/Hook.kt +++ /dev/null @@ -1,75 +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. - */ -package com.expediagroup.sdk.core.plugin - -import com.expediagroup.sdk.core.client.Client - -/** - * A helper to build a hook. - */ -internal interface HookBuilder { - fun build(configs: C) -} - -/** - * A hook is a post action we need to apply after creating a [Client]. - */ -internal open class Hook( - private val configuration: C, - private val builder: HookBuilder -) { - fun execute() = builder.build(configuration) -} - -/** A singleton repository of all [Hook]s we need to apply on the [Client]. */ -internal object Hooks { - private val clientsHooks: MutableMap>> = mutableMapOf() - - fun add( - client: Client, - hook: Hook - ) { - clientsHooks.getOrPut(client) { mutableListOf() } += hook - } - - fun execute(client: Client) { - clientsHooks[client]?.forEach { it.execute() } - } -} - -/** - * Provide an idiomatic scope to define hooks. - */ -internal fun Client.hooks(block: HookContext.() -> Unit) = block(HookContext(this)) - -internal class HookContext(private val client: Client) { - /** - * Provides an idiomatic way of defining a hook. - */ - fun use(hookFactory: HookFactory) = hookFactory - - /** - * Provides an idiomatic way of configuring a hook. - */ - fun HookFactory.with(config: C) = Hooks.add(client, create(client, config)) -} - -internal interface HookFactory { - fun create( - client: Client, - configuration: C - ): Hook -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/Plugin.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/Plugin.kt deleted file mode 100644 index 6a81db9d9..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/Plugin.kt +++ /dev/null @@ -1,43 +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. - */ -package com.expediagroup.sdk.core.plugin - -import com.expediagroup.sdk.core.client.Client - -internal interface Plugin { - /** Install a plugin. */ - fun install( - client: Client, - configurations: C - ) -} - -/** - * Provide an idiomatic scope to define plugins. - */ -internal fun Client.plugins(block: PluginContext.() -> Unit) = block(PluginContext(this)) - -internal class PluginContext(private val client: Client) { - /** - * Provides an idiomatic way of starting a plugin. - */ - fun > use(plugin: P): P = plugin - - /** - * Provides an idiomatic way of configuring a plugin. - */ - fun Plugin.with(configs: C) = install(client, configs) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/PluginConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/PluginConfiguration.kt deleted file mode 100644 index 8eafdd383..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/PluginConfiguration.kt +++ /dev/null @@ -1,23 +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. - */ -package com.expediagroup.sdk.core.plugin - -import io.ktor.client.HttpClientConfig -import io.ktor.client.engine.HttpClientEngineConfig - -internal interface PluginConfiguration - -internal abstract class KtorPluginConfiguration(open val httpClientConfiguration: HttpClientConfig) : PluginConfiguration diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/AuthenticationConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/AuthenticationConfiguration.kt deleted file mode 100644 index 4e0a69c26..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/AuthenticationConfiguration.kt +++ /dev/null @@ -1,38 +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. - */ -package com.expediagroup.sdk.core.plugin.authentication - -import com.expediagroup.sdk.core.configuration.Credentials -import com.expediagroup.sdk.core.plugin.KtorPluginConfiguration -import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy.AuthenticationType -import io.ktor.client.HttpClientConfig -import io.ktor.client.engine.HttpClientEngineConfig - -internal data class AuthenticationConfiguration( - override val httpClientConfiguration: HttpClientConfig, - val credentials: Credentials, - val authUrl: String, - val authType: AuthenticationType -) : KtorPluginConfiguration(httpClientConfiguration) { - companion object { - fun from( - httpClientConfig: HttpClientConfig, - credentials: Credentials, - authUrl: String, - authType: AuthenticationType = AuthenticationType.BEARER - ) = AuthenticationConfiguration(httpClientConfig, credentials, authUrl, authType) - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/AuthenticationHookFactory.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/AuthenticationHookFactory.kt deleted file mode 100644 index ca6d13a76..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/AuthenticationHookFactory.kt +++ /dev/null @@ -1,65 +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. - */ -package com.expediagroup.sdk.core.plugin.authentication - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.constant.Authentication.AUTHORIZATION_REQUEST_LOCK_DELAY -import com.expediagroup.sdk.core.plugin.Hook -import com.expediagroup.sdk.core.plugin.HookBuilder -import com.expediagroup.sdk.core.plugin.HookFactory -import io.ktor.client.plugins.HttpSend -import io.ktor.client.plugins.plugin -import io.ktor.client.request.HttpRequestBuilder -import io.ktor.http.HttpHeaders -import kotlinx.atomicfu.atomic -import kotlinx.coroutines.delay - -internal object AuthenticationHookFactory : HookFactory { - override fun create( - client: Client, - configuration: AuthenticationConfiguration - ): Hook = Hook(configuration, AuthenticationHookBuilder(client)) -} - -private class AuthenticationHookBuilder(private val client: Client) : HookBuilder { - private val lock = atomic(false) - private val authenticationStrategy = client.getAuthenticationStrategy() - - override fun build(configs: AuthenticationConfiguration) { - val httpClient = client.httpClient - - httpClient.plugin(HttpSend).intercept { request -> - if (!authenticationStrategy.isIdentityRequest(request)) { - if (authenticationStrategy.isTokenAboutToExpire()) { - if (!lock.getAndSet(true)) { - try { - authenticationStrategy.renewToken() - } finally { - lock.compareAndSet(expect = true, update = false) - } - } - } - while (lock.value) delay(AUTHORIZATION_REQUEST_LOCK_DELAY) - assignLatestToken(request) - } - execute(request) - } - } - - private fun assignLatestToken(request: HttpRequestBuilder) { - request.headers[HttpHeaders.Authorization] = authenticationStrategy.getAuthorizationHeader() - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/AuthenticationPlugin.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/AuthenticationPlugin.kt deleted file mode 100644 index 174f9feea..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/AuthenticationPlugin.kt +++ /dev/null @@ -1,42 +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. - */ -package com.expediagroup.sdk.core.plugin.authentication - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.constant.ExceptionMessage.AUTHENTICATION_NOT_CONFIGURED_FOR_CLIENT -import com.expediagroup.sdk.core.model.exception.client.ExpediaGroupClientException -import com.expediagroup.sdk.core.plugin.Plugin -import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy -import io.ktor.client.plugins.auth.Auth -import kotlin.collections.set - -internal object AuthenticationPlugin : Plugin { - val clientAuthenticationStrategies = mutableMapOf() - - override fun install( - client: Client, - configurations: AuthenticationConfiguration - ) { - val strategy = AuthenticationStrategy.from(configurations, client) - clientAuthenticationStrategies[client] = strategy - configurations.httpClientConfiguration.install(Auth) { - strategy.loadAuth(this) - } - } -} - -internal fun Client.getAuthenticationStrategy(): AuthenticationStrategy = - AuthenticationPlugin.clientAuthenticationStrategies[this] ?: throw ExpediaGroupClientException(AUTHENTICATION_NOT_CONFIGURED_FOR_CLIENT) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/AuthenticationStrategy.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/AuthenticationStrategy.kt deleted file mode 100644 index 6a44a53d4..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/AuthenticationStrategy.kt +++ /dev/null @@ -1,54 +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. - */ -package com.expediagroup.sdk.core.plugin.authentication.strategy - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.plugin.authentication.AuthenticationConfiguration -import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy.AuthenticationType.BASIC -import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy.AuthenticationType.BEARER -import com.expediagroup.sdk.core.plugin.authentication.strategy.AuthenticationStrategy.AuthenticationType.SIGNATURE -import io.ktor.client.plugins.auth.Auth -import io.ktor.client.request.HttpRequestBuilder - -internal interface AuthenticationStrategy { - fun loadAuth(auth: Auth) {} - - fun isTokenAboutToExpire(): Boolean - - fun renewToken() - - fun isIdentityRequest(request: HttpRequestBuilder): Boolean - - fun getAuthorizationHeader(): String - - companion object { - fun from( - configs: AuthenticationConfiguration, - client: Client - ): AuthenticationStrategy = - when (configs.authType) { - BASIC -> BasicAuthenticationStrategy(configs) - BEARER -> ExpediaGroupAuthenticationStrategy(client, configs) - SIGNATURE -> RapidAuthenticationStrategy(configs) - } - } - - enum class AuthenticationType { - BASIC, - BEARER, - SIGNATURE - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/BasicAuthenticationStrategy.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/BasicAuthenticationStrategy.kt deleted file mode 100644 index 2d87d76df..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/BasicAuthenticationStrategy.kt +++ /dev/null @@ -1,43 +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. - */ -package com.expediagroup.sdk.core.plugin.authentication.strategy - -import com.expediagroup.sdk.core.plugin.authentication.AuthenticationConfiguration -import io.ktor.client.plugins.auth.Auth -import io.ktor.client.plugins.auth.providers.BasicAuthCredentials -import io.ktor.client.plugins.auth.providers.basic -import io.ktor.client.request.HttpRequestBuilder - -internal class BasicAuthenticationStrategy( - private val configs: AuthenticationConfiguration -) : AuthenticationStrategy { - override fun loadAuth(auth: Auth) { - auth.basic { - sendWithoutRequest { true } - credentials { - BasicAuthCredentials(username = configs.credentials.key, password = configs.credentials.secret) - } - } - } - - override fun isTokenAboutToExpire(): Boolean = false - - override fun renewToken() = Unit - - override fun isIdentityRequest(request: HttpRequestBuilder) = true - - override fun getAuthorizationHeader() = String() -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/ExpediaGroupAuthenticationStrategy.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/ExpediaGroupAuthenticationStrategy.kt deleted file mode 100644 index 1404a27bc..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/ExpediaGroupAuthenticationStrategy.kt +++ /dev/null @@ -1,138 +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. - */ -package com.expediagroup.sdk.core.plugin.authentication.strategy - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.configuration.Credentials -import com.expediagroup.sdk.core.constant.Authentication -import com.expediagroup.sdk.core.constant.Constant -import com.expediagroup.sdk.core.constant.ExceptionMessage -import com.expediagroup.sdk.core.constant.LoggingMessage -import com.expediagroup.sdk.core.constant.provider.LoggingMessageProvider -import com.expediagroup.sdk.core.model.exception.service.ExpediaGroupAuthException -import com.expediagroup.sdk.core.model.getTransactionId -import com.expediagroup.sdk.core.plugin.authentication.AuthenticationConfiguration -import com.expediagroup.sdk.core.plugin.logging.ExpediaGroupLoggerFactory -import io.ktor.client.HttpClient -import io.ktor.client.call.body -import io.ktor.client.plugins.auth.Auth -import io.ktor.client.plugins.auth.providers.BearerAuthProvider -import io.ktor.client.plugins.auth.providers.BearerTokens -import io.ktor.client.plugins.auth.providers.bearer -import io.ktor.client.plugins.plugin -import io.ktor.client.request.HttpRequestBuilder -import io.ktor.client.request.basicAuth -import io.ktor.client.request.parameter -import io.ktor.client.request.request -import io.ktor.client.request.url -import io.ktor.http.ContentType -import io.ktor.http.HttpMethod -import io.ktor.http.ParametersBuilder -import io.ktor.http.clone -import io.ktor.http.contentType -import kotlinx.coroutines.runBlocking -import java.time.LocalDateTime - -internal class ExpediaGroupAuthenticationStrategy( - private val client: Client, - private val configs: AuthenticationConfiguration -) : AuthenticationStrategy { - private val log = ExpediaGroupLoggerFactory.getLogger(javaClass) - private var bearerTokenStorage = BearerTokensInfo.emptyBearerTokenInfo - - override fun loadAuth(auth: Auth) { - auth.bearer { - sendWithoutRequest { request -> - isIdentityRequest(request) - } - } - } - - override fun isTokenAboutToExpire(): Boolean = bearerTokenStorage.isAboutToExpire().also { if (it) log.info(LoggingMessage.TOKEN_EXPIRED) } - - override fun renewToken() { - val httpClient = client.httpClient - log.info(LoggingMessage.TOKEN_RENEWAL_IN_PROGRESS) - clearTokens(httpClient) - val renewTokenResponse = - runBlocking { - httpClient.request { - method = HttpMethod.Post - parameter(Authentication.GRANT_TYPE, Authentication.CLIENT_CREDENTIALS) - contentType(ContentType.Application.FormUrlEncoded) - url(configs.authUrl) - basicAuth(configs.credentials) - with(client) { appendHeaders() } - } - } - if (renewTokenResponse.status.value !in Constant.SUCCESSFUL_STATUS_CODES_RANGE) { - throw ExpediaGroupAuthException(renewTokenResponse.status, ExceptionMessage.AUTHENTICATION_FAILURE, renewTokenResponse.headers.getTransactionId()) - } - val renewedTokenInfo: TokenResponse = runBlocking { renewTokenResponse.body() } - log.info(LoggingMessage.TOKEN_RENEWAL_SUCCESSFUL) - log.info(LoggingMessageProvider.getTokenExpiresInMessage(renewedTokenInfo.expiresIn)) - bearerTokenStorage = - BearerTokensInfo( - BearerTokens(renewedTokenInfo.accessToken, renewedTokenInfo.accessToken), - renewedTokenInfo.expiresIn - ) - bearerTokenStorage - } - - private fun clearTokens(client: HttpClient) { - log.info(LoggingMessage.TOKEN_CLEARING_IN_PROGRESS) - client.plugin(Auth).providers.filterIsInstance().first().clearToken() - bearerTokenStorage = BearerTokensInfo.emptyBearerTokenInfo - log.info(LoggingMessage.TOKEN_CLEARING_SUCCESSFUL) - } - - private fun getTokens(): BearerTokens = bearerTokenStorage.bearerTokens - - private fun HttpRequestBuilder.basicAuth(credentials: Credentials) { - basicAuth( - credentials.key, - credentials.secret - ) - } - - override fun isIdentityRequest(request: HttpRequestBuilder): Boolean = request.url.clone().apply { encodedParameters = ParametersBuilder() }.buildString() == configs.authUrl - - override fun getAuthorizationHeader() = "${Authentication.BEARER} ${getTokens().accessToken}" - - internal open class BearerTokensInfo(val bearerTokens: BearerTokens, expiresIn: Int) { - private val expiryDate: LocalDateTime - - init { - this.expiryDate = calculateExpiryDate(expiresIn) - } - - private fun calculateExpiryDate(expiresIn: Int): LocalDateTime = LocalDateTime.now().plusSeconds(expiresIn.toLong()) - - open fun isAboutToExpire(): Boolean = LocalDateTime.now().isAfter(expiryDate.minusSeconds(Authentication.BEARER_EXPIRY_DATE_MARGIN)) - - companion object { - internal val emptyBearerTokenInfo = - object : BearerTokensInfo(BearerTokens(Constant.EMPTY_STRING, Constant.EMPTY_STRING), -1) { - override fun isAboutToExpire() = true - } - } - } - - internal data class TokenResponse( - val accessToken: String, - val expiresIn: Int - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/RapidAuthenticationStrategy.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/RapidAuthenticationStrategy.kt deleted file mode 100644 index 0927b7566..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/authentication/strategy/RapidAuthenticationStrategy.kt +++ /dev/null @@ -1,61 +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. - */ -package com.expediagroup.sdk.core.plugin.authentication.strategy - -import com.expediagroup.sdk.core.constant.Authentication -import com.expediagroup.sdk.core.constant.Constant -import com.expediagroup.sdk.core.constant.SignatureValues -import com.expediagroup.sdk.core.plugin.authentication.AuthenticationConfiguration -import io.ktor.client.request.HttpRequestBuilder -import java.math.BigInteger -import java.nio.charset.StandardCharsets -import java.security.MessageDigest -import java.security.spec.MGF1ParameterSpec -import java.time.Instant - -internal class RapidAuthenticationStrategy(private val configs: AuthenticationConfiguration) : AuthenticationStrategy { - private var signature: String = Constant.EMPTY_STRING - - override fun isTokenAboutToExpire(): Boolean = true - - override fun renewToken() { - val credentials = configs.credentials - signature = calculateSignature(credentials.key, credentials.secret, Instant.now().epochSecond) - } - - override fun isIdentityRequest(request: HttpRequestBuilder) = false - - override fun getAuthorizationHeader() = createAuthorizationHeader(signature) - - private fun createAuthorizationHeader(signature: String?): String = "${Authentication.EAN} $signature" - - private fun calculateSignature( - apiKey: String, - secret: String, - timestamp: Long - ): String { - val toBeHashed = apiKey + secret + timestamp - val messageDigest = MessageDigest.getInstance(MGF1ParameterSpec.SHA512.digestAlgorithm) - val bytes = messageDigest.digest(toBeHashed.toByteArray(StandardCharsets.UTF_8)) - val signature = - buildString { - bytes.forEach { - append(((it.toInt() and SignatureValues.ONE_BYTE_MASK) + SignatureValues.INCREMENT).toString(SignatureValues.RADIX).substring(BigInteger.ONE.toInt())) - } - } - return "${SignatureValues.API_KEY}=$apiKey,${SignatureValues.SIGNATURE}=$signature,${SignatureValues.TIMESTAMP}=$timestamp" - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/encoding/EncodingConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/encoding/EncodingConfiguration.kt deleted file mode 100644 index c789bc69f..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/encoding/EncodingConfiguration.kt +++ /dev/null @@ -1,28 +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. - */ -package com.expediagroup.sdk.core.plugin.encoding - -import com.expediagroup.sdk.core.plugin.KtorPluginConfiguration -import io.ktor.client.HttpClientConfig -import io.ktor.client.engine.HttpClientEngineConfig - -internal data class EncodingConfiguration( - override val httpClientConfiguration: HttpClientConfig -) : KtorPluginConfiguration(httpClientConfiguration) { - companion object { - fun from(httpClientConfig: HttpClientConfig) = EncodingConfiguration(httpClientConfig) - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/encoding/EncodingPlugin.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/encoding/EncodingPlugin.kt deleted file mode 100644 index 658dd6362..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/encoding/EncodingPlugin.kt +++ /dev/null @@ -1,31 +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. - */ -package com.expediagroup.sdk.core.plugin.encoding - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.plugin.Plugin -import io.ktor.client.plugins.compression.ContentEncoding - -internal object EncodingPlugin : Plugin { - override fun install( - client: Client, - configurations: EncodingConfiguration - ) { - configurations.httpClientConfiguration.install(ContentEncoding) { - gzip() - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/exception/ExceptionHandlingConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/exception/ExceptionHandlingConfiguration.kt deleted file mode 100644 index 89cdd14c4..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/exception/ExceptionHandlingConfiguration.kt +++ /dev/null @@ -1,28 +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. - */ -package com.expediagroup.sdk.core.plugin.exception - -import com.expediagroup.sdk.core.plugin.KtorPluginConfiguration -import io.ktor.client.HttpClientConfig -import io.ktor.client.engine.HttpClientEngineConfig - -internal data class ExceptionHandlingConfiguration( - override val httpClientConfiguration: HttpClientConfig -) : KtorPluginConfiguration(httpClientConfiguration) { - companion object { - fun from(httpClientConfig: HttpClientConfig) = ExceptionHandlingConfiguration(httpClientConfig) - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/exception/ExceptionHandlingPlugin.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/exception/ExceptionHandlingPlugin.kt deleted file mode 100644 index 15d58a136..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/exception/ExceptionHandlingPlugin.kt +++ /dev/null @@ -1,37 +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. - */ -package com.expediagroup.sdk.core.plugin.exception - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.model.exception.handleWith -import com.expediagroup.sdk.core.model.getTransactionId -import com.expediagroup.sdk.core.plugin.Plugin -import io.ktor.client.plugins.HttpResponseValidator - -internal object ExceptionHandlingPlugin : Plugin { - override fun install( - client: Client, - configurations: ExceptionHandlingConfiguration - ) { - with(configurations.httpClientConfiguration) { - HttpResponseValidator { - handleResponseExceptionWithRequest { exception, request -> - exception.handleWith(request.headers.getTransactionId()) - } - } - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/httptimeout/HttpTimeoutConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/httptimeout/HttpTimeoutConfiguration.kt deleted file mode 100644 index a0d28f3cb..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/httptimeout/HttpTimeoutConfiguration.kt +++ /dev/null @@ -1,36 +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. - */ -package com.expediagroup.sdk.core.plugin.httptimeout - -import com.expediagroup.sdk.core.plugin.KtorPluginConfiguration -import io.ktor.client.HttpClientConfig -import io.ktor.client.engine.HttpClientEngineConfig - -internal data class HttpTimeoutConfiguration( - override val httpClientConfiguration: HttpClientConfig, - val requestTimeout: Long, - val connectionTimeout: Long, - val socketTimeout: Long -) : KtorPluginConfiguration(httpClientConfiguration) { - companion object { - fun from( - httpClientConfig: HttpClientConfig, - requestTimeout: Long, - connectionTimeout: Long, - socketTimeout: Long - ) = HttpTimeoutConfiguration(httpClientConfig, requestTimeout, connectionTimeout, socketTimeout) - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/httptimeout/HttpTimeoutPlugin.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/httptimeout/HttpTimeoutPlugin.kt deleted file mode 100644 index 0590d8847..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/httptimeout/HttpTimeoutPlugin.kt +++ /dev/null @@ -1,33 +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. - */ -package com.expediagroup.sdk.core.plugin.httptimeout - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.plugin.Plugin -import io.ktor.client.plugins.HttpTimeout - -internal object HttpTimeoutPlugin : Plugin { - override fun install( - client: Client, - configurations: HttpTimeoutConfiguration - ) { - configurations.httpClientConfiguration.install(HttpTimeout) { - requestTimeoutMillis = configurations.requestTimeout - connectTimeoutMillis = configurations.connectionTimeout - socketTimeoutMillis = configurations.socketTimeout - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupJsonFieldFilter.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupJsonFieldFilter.kt deleted file mode 100644 index 9a60c277d..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupJsonFieldFilter.kt +++ /dev/null @@ -1,23 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import com.ebay.ejmask.core.BaseFilter - -internal class ExpediaGroupJsonFieldFilter(maskedFields: Array) : BaseFilter( - ExpediaGroupJsonFieldPatternBuilder::class.java, - *maskedFields -) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupJsonFieldPatternBuilder.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupJsonFieldPatternBuilder.kt deleted file mode 100644 index 63ca9cfdb..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupJsonFieldPatternBuilder.kt +++ /dev/null @@ -1,26 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import com.ebay.ejmask.extenstion.builder.json.JsonFieldPatternBuilder -import com.expediagroup.sdk.core.constant.LoggingMessage.OMITTED - -internal class ExpediaGroupJsonFieldPatternBuilder : JsonFieldPatternBuilder() { - override fun buildReplacement( - visibleCharacters: Int, - vararg fieldNames: String? - ): String = "\"$1$2$OMITTED\"" -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupLogger.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupLogger.kt deleted file mode 100644 index 6390f5c7a..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupLogger.kt +++ /dev/null @@ -1,52 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.constant.LogMaskingFields -import com.expediagroup.sdk.core.constant.LoggingMessage.LOGGING_PREFIX -import org.slf4j.Logger - -internal class ExpediaGroupLogger(private val logger: Logger, private val client: Client? = null) : Logger by logger { - private val mask = LogMasker(getMaskedBodyFieldFilters()) - - override fun info(msg: String) { - if (logger.isInfoEnabled) { - logger.info(decorate(msg)) - } - } - - override fun warn(msg: String) { - if (logger.isWarnEnabled) { - logger.warn(decorate(msg)) - } - } - - override fun debug(msg: String) { - if (logger.isDebugEnabled) { - logger.debug(decorate(msg)) - } - } - - private fun decorate(msg: String): String = "$LOGGING_PREFIX ${mask(msg)}" - - private fun getMaskedBodyFields(): Set = client?.getLoggingMaskedFieldsProvider()?.getMaskedBodyFields() ?: LogMaskingFields.DEFAULT_MASKED_BODY_FIELDS - - private fun getMaskedBodyFieldFilters(): Iterable = - listOf( - ExpediaGroupJsonFieldFilter(getMaskedBodyFields().toTypedArray()) - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupLoggerFactory.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupLoggerFactory.kt deleted file mode 100644 index e2d2326eb..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ExpediaGroupLoggerFactory.kt +++ /dev/null @@ -1,28 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import com.expediagroup.sdk.core.client.Client -import org.slf4j.LoggerFactory - -internal object ExpediaGroupLoggerFactory { - fun getLogger(clazz: Class<*>) = ExpediaGroupLogger(LoggerFactory.getLogger(clazz)) - - fun getLogger( - clazz: Class<*>, - client: Client - ) = ExpediaGroupLogger(LoggerFactory.getLogger(clazz), client) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LogMasker.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LogMasker.kt deleted file mode 100644 index 36628610f..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LogMasker.kt +++ /dev/null @@ -1,32 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import com.ebay.ejmask.core.BaseFilter -import com.ebay.ejmask.core.EJMask -import com.ebay.ejmask.core.EJMaskInitializer -import com.ebay.ejmask.core.util.LoggerUtil - -internal class LogMasker( - filters: Iterable -) : (String) -> String { - init { - LoggerUtil.register { _, _, _ -> /* disable logging */ } - filters.forEach { EJMaskInitializer.addFilter(it) } - } - - override fun invoke(message: String): String = EJMask.mask(message) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggableContentTypes.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggableContentTypes.kt deleted file mode 100644 index 9031d78b3..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggableContentTypes.kt +++ /dev/null @@ -1,32 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import io.ktor.http.ContentType - -val LoggableContentTypes: List = - buildList { - add(ContentType.Application.Json) - add(ContentType.Application.Xml) - add(ContentType.Application.Xml_Dtd) - add(ContentType.Application.ProblemXml) - add(ContentType.Application.Json) - add(ContentType.Application.HalJson) - add(ContentType.Application.FormUrlEncoded) - add(ContentType.Application.ProblemJson) - add(ContentType.Text.Xml) - add(ContentType.Text.Plain) - } diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggingConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggingConfiguration.kt deleted file mode 100644 index cd34324a9..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggingConfiguration.kt +++ /dev/null @@ -1,48 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.plugin.KtorPluginConfiguration -import io.ktor.client.HttpClientConfig -import io.ktor.client.engine.HttpClientEngineConfig -import io.ktor.client.plugins.logging.LogLevel -import io.ktor.client.plugins.logging.Logger - -internal data class LoggingConfiguration( - override val httpClientConfiguration: HttpClientConfig, - val maskedLoggingHeaders: Set, - val maskedLoggingBodyFields: Set, - val level: LogLevel = LogLevel.HEADERS, - val getLogger: (client: Client) -> Logger = createCustomLogger -) : KtorPluginConfiguration(httpClientConfiguration) { - companion object { - fun from( - httpClientConfig: HttpClientConfig, - maskedLoggingHeaders: Set, - maskedLoggingBodyFields: Set - ) = LoggingConfiguration(httpClientConfig, maskedLoggingHeaders, maskedLoggingBodyFields) - } -} - -private val createCustomLogger: (client: Client) -> Logger - get() = { - object : Logger { - val delegate = ExpediaGroupLoggerFactory.getLogger(Client::class.java, it) - - override fun log(message: String) = delegate.info(message) - } - } diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggingMaskedFieldsProvider.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggingMaskedFieldsProvider.kt deleted file mode 100644 index 033ff1f6f..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggingMaskedFieldsProvider.kt +++ /dev/null @@ -1,45 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import com.expediagroup.sdk.core.constant.LogMaskingFields.DEFAULT_MASKED_BODY_FIELDS -import com.expediagroup.sdk.core.constant.LogMaskingFields.DEFAULT_MASKED_HEADER_FIELDS -import com.expediagroup.sdk.core.constant.LogMaskingRegex.FIELD_REGEX -import com.expediagroup.sdk.core.model.exception.client.ExpediaGroupInvalidFieldNameException - -class LoggingMaskedFieldsProvider(maskedLoggingHeaders: Set, maskedLoggingBodyFields: Set) { - private val maskedHeaderFields: Set - private val maskedBodyFields: Set - - init { - maskedLoggingHeaders.filter(::isInvalid).takeIf { it.isNotEmpty() }?.let { throw ExpediaGroupInvalidFieldNameException(it) } - maskedLoggingBodyFields.filter(::isInvalid).takeIf { it.isNotEmpty() }?.let { throw ExpediaGroupInvalidFieldNameException(it) } - maskedHeaderFields = DEFAULT_MASKED_HEADER_FIELDS.union(maskedLoggingHeaders) - maskedBodyFields = DEFAULT_MASKED_BODY_FIELDS.union(maskedLoggingBodyFields) - } - - /** - * @return a copy of the list of headers to be masked - */ - fun getMaskedHeaderFields(): Set = maskedHeaderFields.toSet() - - /** - * @return a copy of the list of body fields to be masked - */ - fun getMaskedBodyFields(): Set = maskedBodyFields.toSet() - - private fun isInvalid(fieldName: String): Boolean = !fieldName.matches(FIELD_REGEX) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggingPlugin.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggingPlugin.kt deleted file mode 100644 index 758a5df72..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/LoggingPlugin.kt +++ /dev/null @@ -1,50 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.constant.ExceptionMessage -import com.expediagroup.sdk.core.constant.LoggingMessage -import com.expediagroup.sdk.core.model.exception.client.ExpediaGroupClientException -import com.expediagroup.sdk.core.plugin.Plugin -import io.ktor.client.plugins.logging.Logging - -internal object LoggingPlugin : Plugin { - val clientLoggingMaskedFieldsProviders = mutableMapOf() - - override fun install( - client: Client, - configurations: LoggingConfiguration - ) { - clientLoggingMaskedFieldsProviders[client] = - LoggingMaskedFieldsProvider( - configurations.maskedLoggingHeaders, - configurations.maskedLoggingBodyFields - ) - configurations.httpClientConfiguration.install(Logging) { - logger = configurations.getLogger(client) - level = configurations.level - sanitizeHeader(LoggingMessage.OMITTED) { header -> - client.getLoggingMaskedFieldsProvider().getMaskedHeaderFields().contains(header) - } - } - configurations.httpClientConfiguration.install(RequestBodyLogger) - configurations.httpClientConfiguration.install(ResponseBodyLogger) - } -} - -internal fun Client.getLoggingMaskedFieldsProvider(): LoggingMaskedFieldsProvider = - LoggingPlugin.clientLoggingMaskedFieldsProviders[this] ?: throw ExpediaGroupClientException(ExceptionMessage.LOGGING_MASKED_FIELDS_NOT_CONFIGURED_FOR_CLIENT) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/RequestBodyLogger.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/RequestBodyLogger.kt deleted file mode 100644 index 5a077a148..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/RequestBodyLogger.kt +++ /dev/null @@ -1,70 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import com.expediagroup.sdk.core.constant.LoggerName -import com.expediagroup.sdk.core.constant.provider.LoggingMessageProvider -import com.expediagroup.sdk.core.model.getTransactionId -import io.ktor.client.HttpClient -import io.ktor.client.plugins.HttpClientPlugin -import io.ktor.client.request.HttpRequestBuilder -import io.ktor.client.request.HttpSendPipeline -import io.ktor.http.content.OutputStreamContent -import io.ktor.http.contentType -import io.ktor.util.AttributeKey -import io.ktor.util.pipeline.PipelineContext -import io.ktor.utils.io.writer -import kotlinx.coroutines.coroutineScope - -internal class RequestBodyLogger { - private val log = ExpediaGroupLoggerFactory.getLogger(javaClass) - - companion object Plugin : HttpClientPlugin { - override val key: AttributeKey = AttributeKey(LoggerName.REQUEST_BODY_LOGGER) - - override fun install( - plugin: RequestBodyLogger, - scope: HttpClient - ) { - scope.sendPipeline.intercept(HttpSendPipeline.Monitoring) { - val body: String = getBody() - plugin.log.debug(LoggingMessageProvider.getRequestBodyMessage(body, context.headers.getTransactionId())) - proceed() - } - } - - private suspend fun PipelineContext.getBody(): String { - val body = - when { - context.contentType() in LoggableContentTypes -> context.body - else -> return "Body of type ${context.contentType()?.contentType} cannot be logged!" - } - - if (body is OutputStreamContent) { - return coroutineScope { - writer { - body.writeTo(channel) - }.channel.readRemaining().readText() - } - } - return body.toString() - } - - override fun prepare(block: RequestBodyLoggerConfig.() -> Unit): RequestBodyLogger = RequestBodyLogger() - } -} - -internal class RequestBodyLoggerConfig diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ResponseBodyLogger.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ResponseBodyLogger.kt deleted file mode 100644 index c06f8fdc7..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/logging/ResponseBodyLogger.kt +++ /dev/null @@ -1,77 +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. - */ -package com.expediagroup.sdk.core.plugin.logging - -import com.expediagroup.sdk.core.constant.HeaderValue -import com.expediagroup.sdk.core.constant.LoggerName -import com.expediagroup.sdk.core.constant.provider.LoggingMessageProvider -import com.expediagroup.sdk.core.model.getTransactionId -import com.expediagroup.sdk.core.plugin.logging.GZipEncoder.decode -import io.ktor.client.HttpClient -import io.ktor.client.plugins.HttpClientPlugin -import io.ktor.client.plugins.compression.ContentEncoder -import io.ktor.client.statement.HttpResponse -import io.ktor.client.statement.HttpResponsePipeline -import io.ktor.client.statement.request -import io.ktor.http.HttpHeaders -import io.ktor.http.contentType -import io.ktor.util.AttributeKey -import io.ktor.util.Encoder -import io.ktor.util.GZip -import io.ktor.util.InternalAPI -import io.ktor.utils.io.ByteReadChannel - -class ResponseBodyLogger { - private val log = ExpediaGroupLoggerFactory.getLogger(javaClass) - - companion object Plugin : HttpClientPlugin { - override val key: AttributeKey = AttributeKey(LoggerName.RESPONSE_BODY_LOGGER) - - @OptIn(InternalAPI::class) - override fun install( - plugin: ResponseBodyLogger, - scope: HttpClient - ) { - scope.responsePipeline.intercept(HttpResponsePipeline.Receive) { - val response: HttpResponse = context.response - val byteReadChannel: ByteReadChannel = if (response.contentEncoding().equals(HeaderValue.GZIP)) scope.decode(response.content) else response.content - - when { - response.contentType() in LoggableContentTypes -> - LoggingMessageProvider.getResponseBodyMessage( - byteReadChannel.readRemaining().readText(), - response.request.headers.getTransactionId() - ) - else -> LoggingMessageProvider.getResponseBodyMessage("Body of type ${response.contentType()?.contentType} cannot be logged!", response.request.headers.getTransactionId()) - }.let { - plugin.log.debug(it) - } - - proceed() - } - } - - override fun prepare(block: ResponseBodyLoggerConfig.() -> Unit): ResponseBodyLogger = ResponseBodyLogger() - } -} - -fun HttpResponse.contentEncoding(): String? = headers[HttpHeaders.ContentEncoding] - -internal object GZipEncoder : ContentEncoder, Encoder by GZip { - override val name: String = HeaderValue.GZIP -} - -class ResponseBodyLoggerConfig diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/request/DefaultRequestConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/request/DefaultRequestConfiguration.kt deleted file mode 100644 index c1114a221..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/request/DefaultRequestConfiguration.kt +++ /dev/null @@ -1,32 +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. - */ -package com.expediagroup.sdk.core.plugin.request - -import com.expediagroup.sdk.core.plugin.KtorPluginConfiguration -import io.ktor.client.HttpClientConfig -import io.ktor.client.engine.HttpClientEngineConfig - -internal data class DefaultRequestConfiguration( - override val httpClientConfiguration: HttpClientConfig, - val endpoint: String -) : KtorPluginConfiguration(httpClientConfiguration) { - companion object { - fun from( - httpClientConfig: HttpClientConfig, - endpoint: String - ) = DefaultRequestConfiguration(httpClientConfig, endpoint) - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/request/DefaultRequestPlugin.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/request/DefaultRequestPlugin.kt deleted file mode 100644 index 745c67718..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/request/DefaultRequestPlugin.kt +++ /dev/null @@ -1,31 +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. - */ -package com.expediagroup.sdk.core.plugin.request - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.plugin.Plugin -import io.ktor.client.plugins.DefaultRequest - -internal object DefaultRequestPlugin : Plugin { - override fun install( - client: Client, - configurations: DefaultRequestConfiguration - ) { - configurations.httpClientConfiguration.install(DefaultRequest) { - url(configurations.endpoint) - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/ContentNegotiation.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/ContentNegotiation.kt deleted file mode 100644 index 00d4e672a..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/ContentNegotiation.kt +++ /dev/null @@ -1,246 +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. - */ -package com.expediagroup.sdk.core.plugin.serialization - -import com.expediagroup.sdk.core.plugin.logging.ExpediaGroupLoggerFactory -import io.ktor.client.HttpClient -import io.ktor.client.plugins.HttpClientPlugin -import io.ktor.client.plugins.contentnegotiation.ContentConverterException -import io.ktor.client.plugins.contentnegotiation.JsonContentTypeMatcher -import io.ktor.client.request.HttpRequestBuilder -import io.ktor.client.request.HttpRequestPipeline -import io.ktor.client.statement.HttpResponseContainer -import io.ktor.client.statement.HttpResponsePipeline -import io.ktor.client.utils.EmptyContent -import io.ktor.http.ContentType -import io.ktor.http.ContentTypeMatcher -import io.ktor.http.HttpHeaders -import io.ktor.http.HttpStatusCode -import io.ktor.http.Url -import io.ktor.http.charset -import io.ktor.http.content.NullBody -import io.ktor.http.content.OutgoingContent -import io.ktor.http.contentType -import io.ktor.serialization.Configuration -import io.ktor.serialization.ContentConverter -import io.ktor.serialization.deserialize -import io.ktor.serialization.suitableCharset -import io.ktor.util.AttributeKey -import io.ktor.util.InternalAPI -import io.ktor.util.reflect.TypeInfo -import io.ktor.utils.io.ByteReadChannel -import io.ktor.utils.io.charsets.Charset -import java.io.InputStream -import kotlin.reflect.KClass - -internal val DefaultCommonIgnoredTypes: Set> = - setOf( - ByteArray::class, - String::class, - HttpStatusCode::class, - ByteReadChannel::class, - OutgoingContent::class - ) - -internal val DefaultIgnoredTypes: Set> = mutableSetOf(InputStream::class) - -internal class ContentNegotiation( - private val registrations: List, - private val ignoredTypes: Set> -) { - internal class Config : Configuration { - internal class ConverterRegistration( - val converter: ContentConverter, - val contentTypeToSend: ContentType, - val contentTypeMatcher: ContentTypeMatcher - ) - - val registrations = mutableListOf() - val ignoredTypes: MutableSet> = - (DefaultIgnoredTypes + DefaultCommonIgnoredTypes).toMutableSet() - - override fun register( - contentType: ContentType, - converter: T, - configuration: T.() -> Unit - ) { - val matcher = - when (contentType) { - ContentType.Application.Json -> JsonContentTypeMatcher - else -> defaultMatcher(contentType) - } - register(contentType, converter, matcher, configuration) - } - - private fun register( - contentTypeToSend: ContentType, - converter: T, - contentTypeMatcher: ContentTypeMatcher, - configuration: T.() -> Unit - ) { - val registration = - ConverterRegistration( - converter.apply(configuration), - contentTypeToSend, - contentTypeMatcher - ) - registrations.add(registration) - } - - private fun defaultMatcher(pattern: ContentType): ContentTypeMatcher = - object : ContentTypeMatcher { - override fun contains(contentType: ContentType): Boolean = contentType.match(pattern) - } - } - - private val log = ExpediaGroupLoggerFactory.getLogger(this::class.java) - - internal suspend fun convertRequest( - request: HttpRequestBuilder, - body: Any - ): Any? { - if (body is OutgoingContent || ignoredTypes.any { it.isInstance(body) }) { - log.trace( - "Body type ${body::class} is in ignored types. " + - "Skipping ContentNegotiation for ${request.url}." - ) - return null - } - val contentType = - request.contentType() ?: run { - log.trace("Request doesn't have Content-Type header. Skipping ContentNegotiation for ${request.url}.") - return null - } - - if (body is Unit) { - log.trace("Sending empty body for ${request.url}") - request.headers.remove(HttpHeaders.ContentType) - return EmptyContent - } - - val matchingRegistrations = - registrations.filter { it.contentTypeMatcher.contains(contentType) } - .takeIf { it.isNotEmpty() } ?: run { - log.trace( - "None of the registered converters match request Content-Type=$contentType. " + - "Skipping ContentNegotiation for ${request.url}." - ) - return null - } - if (request.bodyType == null) { - log.trace("Request has unknown body type. Skipping ContentNegotiation for ${request.url}.") - return null - } - request.headers.remove(HttpHeaders.ContentType) - - // Pick the first one that can convert the subject successfully - val serializedContent = - matchingRegistrations.firstNotNullOfOrNull { registration -> - val result = - registration.converter.serializeNullable( - contentType, - contentType.charset() ?: Charsets.UTF_8, - request.bodyType!!, - body.takeIf { it != NullBody } - ) - if (result != null) { - log.trace("Converted request body using ${registration.converter} for ${request.url}") - } - result - } ?: throw ContentConverterException( - "Can't convert $body with contentType $contentType using converters " + - matchingRegistrations.joinToString { it.converter.toString() } - ) - - return serializedContent - } - - @OptIn(InternalAPI::class) - internal suspend fun convertResponse( - requestUrl: Url, - info: TypeInfo, - body: Any, - responseContentType: ContentType, - charset: Charset = Charsets.UTF_8 - ): Any? { - if (body !is ByteReadChannel) { - log.trace("Response body is already transformed. Skipping ContentNegotiation for $requestUrl.") - return null - } - if (info.type in ignoredTypes) { - log.trace( - "Response body type ${info.type} is in ignored types. " + - "Skipping ContentNegotiation for $requestUrl." - ) - return null - } - - log.debug("Test: ${registrations.size}") - val suitableConverters = - registrations - .filter { it.contentTypeMatcher.contains(responseContentType) } - .map { it.converter } - .takeIf { it.isNotEmpty() } - ?: run { - log.trace( - "None of the registered converters match response with Content-Type=$responseContentType. " + - "Skipping ContentNegotiation for $requestUrl." - ) - return null - } - - val result = suitableConverters.deserialize(body, info, charset) - if (result !is ByteReadChannel) { - log.trace("Response body was converted to ${result::class} for $requestUrl.") - } - return result - } - - companion object Plugin : HttpClientPlugin { - override val key: AttributeKey = AttributeKey("ContentNegotiation") - private val log = ExpediaGroupLoggerFactory.getLogger(this::class.java) - - override fun install( - plugin: ContentNegotiation, - scope: HttpClient - ) { - scope.requestPipeline.intercept(HttpRequestPipeline.Transform) { - val result = plugin.convertRequest(context, subject) ?: return@intercept - proceedWith(result) - } - - scope.responsePipeline.intercept(HttpResponsePipeline.Transform) { (info, body) -> - val contentType = - context.response.contentType() ?: run { - log.trace("Response doesn't have \"Content-Type\" header, skipping ContentNegotiation plugin") - return@intercept - } - val charset = context.request.headers.suitableCharset() - - val deserializedBody = - plugin.convertResponse(context.request.url, info, body, contentType, charset) - ?: return@intercept - val result = HttpResponseContainer(info, deserializedBody) - proceedWith(result) - } - } - - override fun prepare(block: Config.() -> Unit): ContentNegotiation { - val config = Config().apply(block) - return ContentNegotiation(config.registrations, config.ignoredTypes) - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/SerializationConfiguration.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/SerializationConfiguration.kt deleted file mode 100644 index dc1546df3..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/SerializationConfiguration.kt +++ /dev/null @@ -1,30 +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. - */ -package com.expediagroup.sdk.core.plugin.serialization - -import com.expediagroup.sdk.core.plugin.KtorPluginConfiguration -import io.ktor.client.HttpClientConfig -import io.ktor.client.engine.HttpClientEngineConfig -import io.ktor.http.ContentType - -internal data class SerializationConfiguration( - override val httpClientConfiguration: HttpClientConfig, - val contentType: ContentType = ContentType.Application.Json -) : KtorPluginConfiguration(httpClientConfiguration) { - companion object { - fun from(httpClientConfig: HttpClientConfig) = SerializationConfiguration(httpClientConfig) - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/SerializationPlugin.kt b/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/SerializationPlugin.kt deleted file mode 100644 index eda9abc14..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/SerializationPlugin.kt +++ /dev/null @@ -1,40 +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. - */ -package com.expediagroup.sdk.core.plugin.serialization - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.plugin.Plugin -import com.fasterxml.jackson.databind.DeserializationFeature -import com.fasterxml.jackson.databind.PropertyNamingStrategies -import io.ktor.serialization.jackson.jackson -import java.text.SimpleDateFormat - -internal object SerializationPlugin : Plugin { - override fun install( - client: Client, - configurations: SerializationConfiguration - ) { - configurations.httpClientConfiguration.install(ContentNegotiation) { - jackson { - enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS) - disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) - setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE) - setDateFormat(SimpleDateFormat()) - findAndRegisterModules() - } - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt deleted file mode 100644 index 0be57e544..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt +++ /dev/null @@ -1,367 +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. - */ -package com.expediagroup.sdk.xap.client - -import com.expediagroup.sdk.core.client.BaseXapClient -import com.expediagroup.sdk.core.configuration.XapClientConfiguration -import com.expediagroup.sdk.core.constant.ConfigurationName -import com.expediagroup.sdk.core.constant.provider.ExceptionMessageProvider.getMissingRequiredConfigurationMessage -import com.expediagroup.sdk.core.model.EmptyResponse -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation -import com.expediagroup.sdk.core.model.Response -import com.expediagroup.sdk.core.model.exception.client.ExpediaGroupConfigurationException -import com.expediagroup.sdk.core.model.exception.handle -import com.expediagroup.sdk.xap.models.* -import com.expediagroup.sdk.xap.models.exception.ErrorObjectMapper -import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiAPIGatewayErrorException -import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiAPIMErrorException -import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiActivitiesErrorsException -import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiCarsErrorsException -import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiErrorsException -import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiLodgingErrorsException -import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiPresignedUrlResponseException -import com.expediagroup.sdk.xap.models.exception.ExpediaGroupApiSdpAPIMErrorException -import com.expediagroup.sdk.xap.operations.GetActivityDetailsOperation -import com.expediagroup.sdk.xap.operations.GetActivityListingsOperation -import com.expediagroup.sdk.xap.operations.GetCarDetailsOperation -import com.expediagroup.sdk.xap.operations.GetCarsListingsOperation -import com.expediagroup.sdk.xap.operations.GetFeedDownloadUrlOperation -import com.expediagroup.sdk.xap.operations.GetLodgingAvailabilityCalendarsOperation -import com.expediagroup.sdk.xap.operations.GetLodgingDetailsOperation -import com.expediagroup.sdk.xap.operations.GetLodgingListingsOperation -import com.expediagroup.sdk.xap.operations.GetLodgingQuotesOperation -import com.expediagroup.sdk.xap.operations.GetLodgingRateCalendarOperation -import io.ktor.client.call.body -import io.ktor.client.request.request -import io.ktor.client.request.setBody -import io.ktor.client.request.url -import io.ktor.client.statement.HttpResponse -import io.ktor.http.ContentType -import io.ktor.http.HttpMethod -import io.ktor.http.contentType -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.future.future -import java.util.concurrent.CompletableFuture - -/** -* The XAP Lodging Search APIs can be used by partners both booking via an Expedia website, or by partners that -will be booking via the XAP APIs. Each API also provides pre-configured links to the Expedia website, -the XAP Booking API, or both. - -*/ - -class XapClient private constructor(clientConfiguration: XapClientConfiguration) : BaseXapClient("xap", clientConfiguration) { - class Builder : BaseXapClient.Builder() { - override fun build() = - XapClient( - XapClientConfiguration(key, secret, endpoint, requestTimeout, connectionTimeout, socketTimeout, maskedLoggingHeaders, maskedLoggingBodyFields) - ) - } - - class BuilderWithHttpClient() : BaseXapClient.BuilderWithHttpClient() { - override fun build(): XapClient { - if (okHttpClient == null) { - throw ExpediaGroupConfigurationException(getMissingRequiredConfigurationMessage(ConfigurationName.OKHTTP_CLIENT)) - } - - return XapClient( - XapClientConfiguration(key, secret, endpoint, null, null, null, maskedLoggingHeaders, maskedLoggingBodyFields, okHttpClient) - ) - } - } - - companion object { - @JvmStatic fun builder() = Builder() - - @JvmStatic fun builderWithHttpClient() = BuilderWithHttpClient() - } - - override suspend fun throwServiceException( - response: HttpResponse, - operationId: String - ): Unit = throw ErrorObjectMapper.process(response, operationId) - - private suspend inline fun executeHttpRequest(operation: Operation): HttpResponse = - httpClient.request { - method = HttpMethod.parse(operation.method) - url(operation.url) - - operation.params?.getHeaders()?.let { - headers.appendAll(it) - } - - operation.params?.getQueryParams()?.let { - url.parameters.appendAll(it) - } - - val extraHeaders = - buildMap { - put("key", configurationProvider.key ?: "") - } - - appendHeaders(extraHeaders) - contentType(ContentType.Application.Json) - setBody(operation.requestBody) - } - - private inline fun executeWithEmptyResponse(operation: Operation): EmptyResponse { - try { - return executeAsyncWithEmptyResponse(operation).get() - } catch (exception: Exception) { - exception.handle() - } - } - - private inline fun executeAsyncWithEmptyResponse(operation: Operation): CompletableFuture = - GlobalScope.future(Dispatchers.IO) { - try { - val response = executeHttpRequest(operation) - throwIfError(response, operation.operationId) - EmptyResponse(response.status.value, response.headers.entries()) - } catch (exception: Exception) { - exception.handle() - } - } - - private inline fun execute(operation: Operation): Response { - try { - return executeAsync(operation).get() - } catch (exception: Exception) { - exception.handle() - } - } - - private inline fun executeAsync(operation: Operation): CompletableFuture> = - GlobalScope.future(Dispatchers.IO) { - try { - val response = executeHttpRequest(operation) - throwIfError(response, operation.operationId) - Response(response.status.value, response.body(), response.headers.entries()) - } catch (exception: Exception) { - exception.handle() - } - } - - /** - * - * The Activity Details API provides detailed information about one selected activity. - * @param operation [GetActivityDetailsOperation] - * @throws ExpediaGroupApiActivitiesErrorsException - * @throws ExpediaGroupApiAPIMErrorException - * @throws ExpediaGroupApiException - * @return a [Response] object with a body of type ActivityDetailsResponse - */ - fun execute(operation: GetActivityDetailsOperation): Response = execute(operation) - - /** - * - * The Activity Details API provides detailed information about one selected activity. - * @param operation [GetActivityDetailsOperation] - * @throws ExpediaGroupApiActivitiesErrorsException - * @throws ExpediaGroupApiAPIMErrorException - * @throws ExpediaGroupApiException - * @return a [CompletableFuture] object with a body of type ActivityDetailsResponse - */ - fun executeAsync(operation: GetActivityDetailsOperation): CompletableFuture> = executeAsync(operation) - - /** - * - * The Activities Search API allows partners to search for Expedia Activity inventory. - * @param operation [GetActivityListingsOperation] - * @throws ExpediaGroupApiActivitiesErrorsException - * @throws ExpediaGroupApiAPIMErrorException - * @throws ExpediaGroupApiException - * @return a [Response] object with a body of type ActivityListingsResponse - */ - fun execute(operation: GetActivityListingsOperation): Response = execute(operation) - - /** - * - * The Activities Search API allows partners to search for Expedia Activity inventory. - * @param operation [GetActivityListingsOperation] - * @throws ExpediaGroupApiActivitiesErrorsException - * @throws ExpediaGroupApiAPIMErrorException - * @throws ExpediaGroupApiException - * @return a [CompletableFuture] object with a body of type ActivityListingsResponse - */ - fun executeAsync(operation: GetActivityListingsOperation): CompletableFuture> = executeAsync(operation) - - /** - * Get Extended information with a single car offer - * Extended information about the rates, charges, fees, and other terms associated with a single car offer. - * @param operation [GetCarDetailsOperation] - * @throws ExpediaGroupApiCarsErrorsException - * @throws ExpediaGroupApiAPIMErrorException - * @throws ExpediaGroupApiException - * @return a [Response] object with a body of type CarDetailsResponse - */ - fun execute(operation: GetCarDetailsOperation): Response = execute(operation) - - /** - * Get Extended information with a single car offer - * Extended information about the rates, charges, fees, and other terms associated with a single car offer. - * @param operation [GetCarDetailsOperation] - * @throws ExpediaGroupApiCarsErrorsException - * @throws ExpediaGroupApiAPIMErrorException - * @throws ExpediaGroupApiException - * @return a [CompletableFuture] object with a body of type CarDetailsResponse - */ - fun executeAsync(operation: GetCarDetailsOperation): CompletableFuture> = executeAsync(operation) - - /** - * Search Expedia car inventory - * Search Expedia car inventory by date, pickup, and dropoff location to return a listing of available cars for hire. - * @param operation [GetCarsListingsOperation] - * @throws ExpediaGroupApiCarsErrorsException - * @throws ExpediaGroupApiAPIMErrorException - * @throws ExpediaGroupApiException - * @return a [Response] object with a body of type CarListingsResponse - */ - fun execute(operation: GetCarsListingsOperation): Response = execute(operation) - - /** - * Search Expedia car inventory - * Search Expedia car inventory by date, pickup, and dropoff location to return a listing of available cars for hire. - * @param operation [GetCarsListingsOperation] - * @throws ExpediaGroupApiCarsErrorsException - * @throws ExpediaGroupApiAPIMErrorException - * @throws ExpediaGroupApiException - * @return a [CompletableFuture] object with a body of type CarListingsResponse - */ - fun executeAsync(operation: GetCarsListingsOperation): CompletableFuture> = executeAsync(operation) - - /** - * - * Get the Download URL and other details of the static files. - * @param operation [GetFeedDownloadUrlOperation] - * @throws ExpediaGroupApiPresignedUrlResponseException - * @throws ExpediaGroupApiSdpAPIMErrorException - * @return a [Response] object with a body of type PresignedUrlResponse - */ - fun execute(operation: GetFeedDownloadUrlOperation): Response = execute(operation) - - /** - * - * Get the Download URL and other details of the static files. - * @param operation [GetFeedDownloadUrlOperation] - * @throws ExpediaGroupApiPresignedUrlResponseException - * @throws ExpediaGroupApiSdpAPIMErrorException - * @return a [CompletableFuture] object with a body of type PresignedUrlResponse - */ - fun executeAsync(operation: GetFeedDownloadUrlOperation): CompletableFuture> = executeAsync(operation) - - /** - * Get availability calendars of properties - * Returns the availability of each day for a range of dates for given Expedia lodging properties. - * @param operation [GetLodgingAvailabilityCalendarsOperation] - * @throws ExpediaGroupApiLodgingErrorsException - * @throws ExpediaGroupApiAPIGatewayErrorException - * @return a [Response] object with a body of type AvailabilityCalendarResponse - */ - fun execute(operation: GetLodgingAvailabilityCalendarsOperation): Response = execute(operation) - - /** - * Get availability calendars of properties - * Returns the availability of each day for a range of dates for given Expedia lodging properties. - * @param operation [GetLodgingAvailabilityCalendarsOperation] - * @throws ExpediaGroupApiLodgingErrorsException - * @throws ExpediaGroupApiAPIGatewayErrorException - * @return a [CompletableFuture] object with a body of type AvailabilityCalendarResponse - */ - fun executeAsync(operation: GetLodgingAvailabilityCalendarsOperation): CompletableFuture> = executeAsync(operation) - - /** - * Get Extended information with a single property offer - * Extended information about the rate, charges, fees, and financial terms associated with booking a single lodging rate plan offer. - * @param operation [GetLodgingDetailsOperation] - * @throws ExpediaGroupApiErrorsException - * @throws ExpediaGroupApiAPIGatewayErrorException - * @return a [Response] object with a body of type HotelDetailsResponse - */ - fun execute(operation: GetLodgingDetailsOperation): Response = execute(operation) - - /** - * Get Extended information with a single property offer - * Extended information about the rate, charges, fees, and financial terms associated with booking a single lodging rate plan offer. - * @param operation [GetLodgingDetailsOperation] - * @throws ExpediaGroupApiErrorsException - * @throws ExpediaGroupApiAPIGatewayErrorException - * @return a [CompletableFuture] object with a body of type HotelDetailsResponse - */ - fun executeAsync(operation: GetLodgingDetailsOperation): CompletableFuture> = executeAsync(operation) - - /** - * Search lodging inventory - * Search Expedia lodging inventory by Location Keyword, Region ID, Lat/Long, or Hotel ID(s) and return up to 1,000 offers in response. Provides deeplink to Expedia site to book, or rate plan info to enable API booking. - * @param operation [GetLodgingListingsOperation] - * @throws ExpediaGroupApiErrorsException - * @throws ExpediaGroupApiAPIGatewayErrorException - * @return a [Response] object with a body of type HotelListingsResponse - */ - fun execute(operation: GetLodgingListingsOperation): Response = execute(operation) - - /** - * Search lodging inventory - * Search Expedia lodging inventory by Location Keyword, Region ID, Lat/Long, or Hotel ID(s) and return up to 1,000 offers in response. Provides deeplink to Expedia site to book, or rate plan info to enable API booking. - * @param operation [GetLodgingListingsOperation] - * @throws ExpediaGroupApiErrorsException - * @throws ExpediaGroupApiAPIGatewayErrorException - * @return a [CompletableFuture] object with a body of type HotelListingsResponse - */ - fun executeAsync(operation: GetLodgingListingsOperation): CompletableFuture> = executeAsync(operation) - - /** - * Get properties price and availability information - * The Lodging Quotes API will return the price and availability information for given Expedia lodging property ID(s). - * @param operation [GetLodgingQuotesOperation] - * @throws ExpediaGroupApiLodgingErrorsException - * @throws ExpediaGroupApiAPIGatewayErrorException - * @return a [Response] object with a body of type LodgingQuotesResponse - */ - fun execute(operation: GetLodgingQuotesOperation): Response = execute(operation) - - /** - * Get properties price and availability information - * The Lodging Quotes API will return the price and availability information for given Expedia lodging property ID(s). - * @param operation [GetLodgingQuotesOperation] - * @throws ExpediaGroupApiLodgingErrorsException - * @throws ExpediaGroupApiAPIGatewayErrorException - * @return a [CompletableFuture] object with a body of type LodgingQuotesResponse - */ - fun executeAsync(operation: GetLodgingQuotesOperation): CompletableFuture> = executeAsync(operation) - - /** - * Get rate calendar of a property - * The Rate Calendar API will return the lowest rate plan for a range of days for one selected Expedia lodging property. - * @param operation [GetLodgingRateCalendarOperation] - * @throws ExpediaGroupApiErrorsException - * @throws ExpediaGroupApiAPIGatewayErrorException - * @return a [Response] object with a body of type RateCalendarResponse - */ - fun execute(operation: GetLodgingRateCalendarOperation): Response = execute(operation) - - /** - * Get rate calendar of a property - * The Rate Calendar API will return the lowest rate plan for a range of days for one selected Expedia lodging property. - * @param operation [GetLodgingRateCalendarOperation] - * @throws ExpediaGroupApiErrorsException - * @throws ExpediaGroupApiAPIGatewayErrorException - * @return a [CompletableFuture] object with a body of type RateCalendarResponse - */ - fun executeAsync(operation: GetLodgingRateCalendarOperation): CompletableFuture> = executeAsync(operation) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/infrastructure/ApiAbstractions.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ae25a7478..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,45 +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. - */ -package com.expediagroup.sdk.xap.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = - when (collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" - } - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue( - items: Array, - collectionFormat: String, - map: (item: T) -> String = defaultMultiValueConverter -) = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue( - items: Iterable, - collectionFormat: String, - map: (item: T) -> String = defaultMultiValueConverter -): List = - when (collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/APIGatewayError.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/APIGatewayError.kt deleted file mode 100644 index 09112ca39..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/APIGatewayError.kt +++ /dev/null @@ -1,92 +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 message - */ -data class APIGatewayError( - @JsonProperty("message") - @field:Valid - val message: kotlin.String? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var message: kotlin.String? = null - ) { - fun message(message: kotlin.String?) = apply { this.message = message } - - fun build(): APIGatewayError { - val instance = - APIGatewayError( - 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 - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/APIMError.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/APIMError.kt deleted file mode 100644 index 25345be0b..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/APIMError.kt +++ /dev/null @@ -1,92 +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 message - */ -data class APIMError( - @JsonProperty("message") - @field:Valid - val message: kotlin.String? = null -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var message: kotlin.String? = null - ) { - fun message(message: kotlin.String?) = apply { this.message = message } - - fun build(): APIMError { - val instance = - APIMError( - 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 - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt deleted file mode 100644 index a7cec9c15..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt +++ /dev/null @@ -1,106 +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 -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. - * @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 -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var id: kotlin.String? = null, - private var name: kotlin.String? = null - ) { - fun id(id: kotlin.String) = apply { this.id = id } - - fun name(name: kotlin.String) = apply { this.name = name } - - fun build(): ActivitiesNeighborhood { - val instance = - ActivitiesNeighborhood( - id = id!!, - 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!! - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/BedType.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/BedType.kt deleted file mode 100644 index 8dd01d693..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/BedType.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 - -/** - * 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 -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var id: kotlin.String? = null, - private var description: kotlin.String? = null - ) { - fun id(id: kotlin.String?) = apply { this.id = id } - - fun description(description: kotlin.String?) = apply { this.description = description } - - fun build(): BedType { - val instance = - BedType( - id = id, - 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 - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarCategory.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarCategory.kt deleted file mode 100644 index df984b321..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarCategory.kt +++ /dev/null @@ -1,106 +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 -import javax.validation.constraints.NotNull - -/** - * 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 -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var code: kotlin.String? = null, - private var `value`: kotlin.String? = null - ) { - fun code(code: kotlin.String) = apply { this.code = code } - - fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } - - fun build(): CarCategory { - val instance = - CarCategory( - code = code!!, - `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`!! - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarType.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarType.kt deleted file mode 100644 index e5694075b..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarType.kt +++ /dev/null @@ -1,106 +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 -import javax.validation.constraints.NotNull - -/** - * 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 -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var code: kotlin.String? = null, - private var `value`: kotlin.String? = null - ) { - fun code(code: kotlin.String) = apply { this.code = code } - - fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } - - fun build(): CarType { - val instance = - CarType( - code = code!!, - `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`!! - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsNeighborhood.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsNeighborhood.kt deleted file mode 100644 index 2bff29b2d..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsNeighborhood.kt +++ /dev/null @@ -1,106 +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 -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. - * @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 -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var id: kotlin.String? = null, - private var name: kotlin.String? = null - ) { - fun id(id: kotlin.String) = apply { this.id = id } - - fun name(name: kotlin.String) = apply { this.name = name } - - fun build(): CarsNeighborhood { - val instance = - CarsNeighborhood( - id = id!!, - 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!! - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/FuelAC.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/FuelAC.kt deleted file mode 100644 index fb7b26c15..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/FuelAC.kt +++ /dev/null @@ -1,106 +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 -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 - * @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 -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var code: kotlin.String? = null, - private var `value`: kotlin.String? = null - ) { - fun code(code: kotlin.String) = apply { this.code = code } - - fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } - - fun build(): FuelAC { - val instance = - FuelAC( - code = code!!, - `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`!! - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInnerAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInnerAllOf.kt deleted file mode 100644 index 693532359..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDatesAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDatesAllOf.kt deleted file mode 100644 index e259006c3..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInnerAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInnerAllOf.kt deleted file mode 100644 index b26f37431..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInnerAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInnerAllOf.kt deleted file mode 100644 index bccedad58..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPropertyType.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPropertyType.kt deleted file mode 100644 index f12b4691f..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPropertyType.kt +++ /dev/null @@ -1,102 +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 - -/** - * 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 -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var id: kotlin.Int? = null, - private var name: kotlin.String? = null - ) { - fun id(id: kotlin.Int?) = apply { this.id = id } - - fun name(name: kotlin.String?) = apply { this.name = name } - - fun build(): HotelPropertyType { - val instance = - HotelPropertyType( - id = id, - 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 - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInnerAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInnerAllOf.kt deleted file mode 100644 index 692b6c972..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocationAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocationAllOf.kt deleted file mode 100644 index 08d0f20bb..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePrice.kt deleted file mode 100644 index 091372351..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePrice.kt +++ /dev/null @@ -1,163 +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.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.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 - */ -data class LodgingRoomTypePrice( - @JsonProperty("BaseRate") - @field:Valid - val baseRate: LodgingRoomTypePriceBaseRate? = null, - @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: LodgingRoomTypePriceTaxesAndFees? = null, - @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: LodgingRoomTypePriceTotalPrice? = null, - @JsonProperty("AvgNightlyRate") - @field:Valid - val avgNightlyRate: LodgingRoomTypePriceAvgNightlyRate? = null, - @JsonProperty("AvgNightlyRateWithFees") - @field:Valid - val avgNightlyRateWithFees: LodgingRoomTypePriceAvgNightlyRateWithFees? = null, - @JsonProperty("PropertyMandatoryFees") - @field:Valid - val propertyMandatoryFees: LodgingRoomTypePricePropertyMandatoryFees? = null, - @JsonProperty("TotalPriceWithPropertyFees") - @field:Valid - val totalPriceWithPropertyFees: LodgingRoomTypePriceTotalPriceWithPropertyFees? = null, - @JsonProperty("RefundableDamageDeposit") - @field:Valid - val refundableDamageDeposit: LodgingRoomTypePriceRefundableDamageDeposit? = null -) { - 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 - ) { - fun baseRate(baseRate: LodgingRoomTypePriceBaseRate?) = apply { this.baseRate = baseRate } - - fun taxesAndFees(taxesAndFees: LodgingRoomTypePriceTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } - - fun totalPrice(totalPrice: LodgingRoomTypePriceTotalPrice?) = apply { this.totalPrice = totalPrice } - - fun avgNightlyRate(avgNightlyRate: LodgingRoomTypePriceAvgNightlyRate?) = apply { this.avgNightlyRate = avgNightlyRate } - - fun avgNightlyRateWithFees(avgNightlyRateWithFees: LodgingRoomTypePriceAvgNightlyRateWithFees?) = apply { this.avgNightlyRateWithFees = avgNightlyRateWithFees } - - fun propertyMandatoryFees(propertyMandatoryFees: LodgingRoomTypePricePropertyMandatoryFees?) = apply { this.propertyMandatoryFees = propertyMandatoryFees } - - fun totalPriceWithPropertyFees(totalPriceWithPropertyFees: LodgingRoomTypePriceTotalPriceWithPropertyFees?) = apply { this.totalPriceWithPropertyFees = totalPriceWithPropertyFees } - - fun refundableDamageDeposit(refundableDamageDeposit: LodgingRoomTypePriceRefundableDamageDeposit?) = apply { this.refundableDamageDeposit = refundableDamageDeposit } - - fun build(): LodgingRoomTypePrice { - val instance = - LodgingRoomTypePrice( - baseRate = baseRate, - taxesAndFees = taxesAndFees, - totalPrice = totalPrice, - avgNightlyRate = avgNightlyRate, - avgNightlyRateWithFees = avgNightlyRateWithFees, - propertyMandatoryFees = propertyMandatoryFees, - totalPriceWithPropertyFees = totalPriceWithPropertyFees, - 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() = - Builder( - baseRate = baseRate, - taxesAndFees = taxesAndFees, - totalPrice = totalPrice, - avgNightlyRate = avgNightlyRate, - avgNightlyRateWithFees = avgNightlyRateWithFees, - propertyMandatoryFees = propertyMandatoryFees, - totalPriceWithPropertyFees = totalPriceWithPropertyFees, - refundableDamageDeposit = refundableDamageDeposit - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceAvgNightlyRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceAvgNightlyRate.kt deleted file mode 100644 index 30334c5f6..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceAvgNightlyRateWithFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceAvgNightlyRateWithFees.kt deleted file mode 100644 index 0300b78dc..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceBaseRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceBaseRate.kt deleted file mode 100644 index f89218067..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePricePropertyMandatoryFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePricePropertyMandatoryFees.kt deleted file mode 100644 index df2af69c1..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceRefundableDamageDeposit.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceRefundableDamageDeposit.kt deleted file mode 100644 index 807018ac4..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTaxesAndFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTaxesAndFees.kt deleted file mode 100644 index 33e0db2f6..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTotalPrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTotalPrice.kt deleted file mode 100644 index 63812c3e4..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTotalPriceWithPropertyFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePriceTotalPriceWithPropertyFees.kt deleted file mode 100644 index 456c5aefb..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Neighborhood.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Neighborhood.kt deleted file mode 100644 index 38f7ad11c..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Neighborhood.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 - -/** - * 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 -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var id: kotlin.String? = null, - private var name: kotlin.String? = null - ) { - fun id(id: kotlin.String?) = apply { this.id = id } - - fun name(name: kotlin.String?) = apply { this.name = name } - - fun build(): Neighborhood { - val instance = - Neighborhood( - id = id, - 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 - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPriceAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPriceAllOf.kt deleted file mode 100644 index 4dbbf2fb6..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInnerAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInnerAllOf.kt deleted file mode 100644 index eb8caff62..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPrice.kt deleted file mode 100644 index e50b26b92..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPrice.kt +++ /dev/null @@ -1,196 +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.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.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.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 - * @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( - @JsonProperty("BaseRate") - @field:Valid - val baseRate: RatePlanPriceBaseRate? = null, - @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: RatePlanPriceTaxesAndFees? = null, - @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: RatePlanPriceTotalPrice? = null, - @JsonProperty("TotalStrikeOutPrice") - @field:Valid - val totalStrikeOutPrice: RatePlanPriceTotalStrikeOutPrice? = null, - @JsonProperty("AvgNightlyRate") - @field:Valid - val avgNightlyRate: RatePlanPriceAvgNightlyRate? = null, - @JsonProperty("AvgNightlyStrikeOutRate") - @field:Valid - val avgNightlyStrikeOutRate: RatePlanPriceAvgNightlyStrikeOutRate? = null, - @JsonProperty("HotelMandatoryFees") - @field:Valid - val hotelMandatoryFees: RatePlanPriceHotelMandatoryFees? = null, - @JsonProperty("RefundableDamageDeposit") - @field:Valid - val refundableDamageDeposit: RatePlanPriceRefundableDamageDeposit? = 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 -) { - 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 nightlyRates: kotlin.collections.List? = null, - private var taxesAndFeesDetails: kotlin.collections.List? = null, - private var roomRates: kotlin.collections.List? = null - ) { - fun baseRate(baseRate: RatePlanPriceBaseRate?) = apply { this.baseRate = baseRate } - - fun taxesAndFees(taxesAndFees: RatePlanPriceTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } - - fun totalPrice(totalPrice: RatePlanPriceTotalPrice?) = apply { this.totalPrice = totalPrice } - - fun totalStrikeOutPrice(totalStrikeOutPrice: RatePlanPriceTotalStrikeOutPrice?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } - - fun avgNightlyRate(avgNightlyRate: RatePlanPriceAvgNightlyRate?) = apply { this.avgNightlyRate = avgNightlyRate } - - fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: RatePlanPriceAvgNightlyStrikeOutRate?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } - - fun hotelMandatoryFees(hotelMandatoryFees: RatePlanPriceHotelMandatoryFees?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } - - fun refundableDamageDeposit(refundableDamageDeposit: RatePlanPriceRefundableDamageDeposit?) = 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 build(): RatePlanPrice { - val instance = - RatePlanPrice( - baseRate = baseRate, - taxesAndFees = taxesAndFees, - totalPrice = totalPrice, - totalStrikeOutPrice = totalStrikeOutPrice, - avgNightlyRate = avgNightlyRate, - avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, - hotelMandatoryFees = hotelMandatoryFees, - refundableDamageDeposit = refundableDamageDeposit, - nightlyRates = nightlyRates, - taxesAndFeesDetails = taxesAndFeesDetails, - 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() = - Builder( - baseRate = baseRate, - taxesAndFees = taxesAndFees, - totalPrice = totalPrice, - totalStrikeOutPrice = totalStrikeOutPrice, - avgNightlyRate = avgNightlyRate, - avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, - hotelMandatoryFees = hotelMandatoryFees, - refundableDamageDeposit = refundableDamageDeposit, - nightlyRates = nightlyRates, - taxesAndFeesDetails = taxesAndFeesDetails, - roomRates = roomRates - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceAvgNightlyRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceAvgNightlyRate.kt deleted file mode 100644 index 0b1c4f127..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceAvgNightlyStrikeOutRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceAvgNightlyStrikeOutRate.kt deleted file mode 100644 index 6b948ad35..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceBaseRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceBaseRate.kt deleted file mode 100644 index 845f676bf..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceHotelMandatoryFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceHotelMandatoryFees.kt deleted file mode 100644 index be55341fb..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInnerAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInnerAllOf.kt deleted file mode 100644 index a20247e9a..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceRefundableDamageDeposit.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceRefundableDamageDeposit.kt deleted file mode 100644 index c64b17ba3..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceRoomRatesInner.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceRoomRatesInner.kt deleted file mode 100644 index 58f63dc10..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFees.kt deleted file mode 100644 index abe8bca24..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInnerAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInnerAllOf.kt deleted file mode 100644 index e64d779c9..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTotalPrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTotalPrice.kt deleted file mode 100644 index f9a09b8e9..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTotalStrikeOutPrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTotalStrikeOutPrice.kt deleted file mode 100644 index 6ca234123..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePrice.kt deleted file mode 100644 index f4a1ec8d7..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePrice.kt +++ /dev/null @@ -1,187 +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.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.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 - */ -data class RatePlanStandalonePrice( - @JsonProperty("BaseRate") - @field:Valid - val baseRate: RatePlanStandalonePriceBaseRate? = null, - @JsonProperty("StrikeOutBaseRate") - @field:Valid - val strikeOutBaseRate: RatePlanStandalonePriceStrikeOutBaseRate? = null, - @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: RatePlanStandalonePriceTaxesAndFees? = null, - @JsonProperty("StrikeOutTaxesAndFees") - @field:Valid - val strikeOutTaxesAndFees: RatePlanStandalonePriceStrikeOutTaxesAndFees? = null, - @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: RatePlanStandalonePriceTotalPrice? = null, - @JsonProperty("TotalStrikeOutPrice") - @field:Valid - val totalStrikeOutPrice: RatePlanStandalonePriceTotalStrikeOutPrice? = null, - @JsonProperty("AvgNightlyRate") - @field:Valid - val avgNightlyRate: RatePlanStandalonePriceAvgNightlyRate? = null, - @JsonProperty("AvgNightlyStrikeOutRate") - @field:Valid - val avgNightlyStrikeOutRate: RatePlanStandalonePriceAvgNightlyStrikeOutRate? = null, - @JsonProperty("HotelMandatoryFees") - @field:Valid - val hotelMandatoryFees: RatePlanStandalonePriceHotelMandatoryFees? = null, - @JsonProperty("StrikeOutHotelMandatoryFees") - @field:Valid - val strikeOutHotelMandatoryFees: RatePlanStandalonePriceStrikeOutHotelMandatoryFees? = null -) { - 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 - ) { - fun baseRate(baseRate: RatePlanStandalonePriceBaseRate?) = apply { this.baseRate = baseRate } - - fun strikeOutBaseRate(strikeOutBaseRate: RatePlanStandalonePriceStrikeOutBaseRate?) = apply { this.strikeOutBaseRate = strikeOutBaseRate } - - fun taxesAndFees(taxesAndFees: RatePlanStandalonePriceTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } - - fun strikeOutTaxesAndFees(strikeOutTaxesAndFees: RatePlanStandalonePriceStrikeOutTaxesAndFees?) = apply { this.strikeOutTaxesAndFees = strikeOutTaxesAndFees } - - fun totalPrice(totalPrice: RatePlanStandalonePriceTotalPrice?) = apply { this.totalPrice = totalPrice } - - fun totalStrikeOutPrice(totalStrikeOutPrice: RatePlanStandalonePriceTotalStrikeOutPrice?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } - - fun avgNightlyRate(avgNightlyRate: RatePlanStandalonePriceAvgNightlyRate?) = apply { this.avgNightlyRate = avgNightlyRate } - - fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: RatePlanStandalonePriceAvgNightlyStrikeOutRate?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } - - fun hotelMandatoryFees(hotelMandatoryFees: RatePlanStandalonePriceHotelMandatoryFees?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } - - fun strikeOutHotelMandatoryFees(strikeOutHotelMandatoryFees: RatePlanStandalonePriceStrikeOutHotelMandatoryFees?) = - apply { - this.strikeOutHotelMandatoryFees = - strikeOutHotelMandatoryFees - } - - fun build(): RatePlanStandalonePrice { - val instance = - RatePlanStandalonePrice( - baseRate = baseRate, - strikeOutBaseRate = strikeOutBaseRate, - taxesAndFees = taxesAndFees, - strikeOutTaxesAndFees = strikeOutTaxesAndFees, - totalPrice = totalPrice, - totalStrikeOutPrice = totalStrikeOutPrice, - avgNightlyRate = avgNightlyRate, - avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, - hotelMandatoryFees = hotelMandatoryFees, - 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() = - Builder( - baseRate = baseRate, - strikeOutBaseRate = strikeOutBaseRate, - taxesAndFees = taxesAndFees, - strikeOutTaxesAndFees = strikeOutTaxesAndFees, - totalPrice = totalPrice, - totalStrikeOutPrice = totalStrikeOutPrice, - avgNightlyRate = avgNightlyRate, - avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, - hotelMandatoryFees = hotelMandatoryFees, - strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceAvgNightlyRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceAvgNightlyRate.kt deleted file mode 100644 index f420ce0d1..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceAvgNightlyStrikeOutRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceAvgNightlyStrikeOutRate.kt deleted file mode 100644 index 61d776320..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceBaseRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceBaseRate.kt deleted file mode 100644 index 731322a14..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceHotelMandatoryFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceHotelMandatoryFees.kt deleted file mode 100644 index fca3776fc..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutBaseRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutBaseRate.kt deleted file mode 100644 index 074cbd2e0..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutHotelMandatoryFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutHotelMandatoryFees.kt deleted file mode 100644 index a2d729701..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutTaxesAndFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceStrikeOutTaxesAndFees.kt deleted file mode 100644 index 51fee932a..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTaxesAndFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTaxesAndFees.kt deleted file mode 100644 index 61764d1e2..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTotalPrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTotalPrice.kt deleted file mode 100644 index da20178e9..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTotalStrikeOutPrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePriceTotalStrikeOutPrice.kt deleted file mode 100644 index 953de54d9..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInnerAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInnerAllOf.kt deleted file mode 100644 index 2120e407b..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInnerAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInnerAllOf.kt deleted file mode 100644 index ad1bc49e8..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInnerAllOf.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInnerAllOf.kt deleted file mode 100644 index fefe33cec..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePrice.kt deleted file mode 100644 index d2fbf24c9..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePrice.kt +++ /dev/null @@ -1,197 +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.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.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 - */ -data class RoomTypePrice( - @JsonProperty("BaseRate") - @field:Valid - val baseRate: RatePlanPriceBaseRate? = null, - @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: RatePlanPriceTaxesAndFees? = null, - @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: RoomTypePriceTotalPrice? = null, - @JsonProperty("TotalStrikeOutPrice") - @field:Valid - val totalStrikeOutPrice: RoomTypePriceTotalStrikeOutPrice? = null, - @JsonProperty("AvgNightlyRate") - @field:Valid - val avgNightlyRate: RoomTypePriceAvgNightlyRate? = null, - @JsonProperty("AvgNightlyStrikeOutRate") - @field:Valid - val avgNightlyStrikeOutRate: RoomTypePriceAvgNightlyStrikeOutRate? = null, - @JsonProperty("AvgNightlyRateWithFees") - @field:Valid - val avgNightlyRateWithFees: RoomTypePriceAvgNightlyRateWithFees? = null, - @JsonProperty("AvgNightlyStrikeoutRateWithFees") - @field:Valid - val avgNightlyStrikeoutRateWithFees: RoomTypePriceAvgNightlyStrikeoutRateWithFees? = null, - @JsonProperty("HotelMandatoryFees") - @field:Valid - val hotelMandatoryFees: RatePlanPriceHotelMandatoryFees? = null, - @JsonProperty("TotalPriceWithHotelFees") - @field:Valid - val totalPriceWithHotelFees: RoomTypePriceTotalPriceWithHotelFees? = null, - @JsonProperty("RefundableDamageDeposit") - @field:Valid - val refundableDamageDeposit: RoomTypePriceRefundableDamageDeposit? = null -) { - 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 - ) { - fun baseRate(baseRate: RatePlanPriceBaseRate?) = apply { this.baseRate = baseRate } - - fun taxesAndFees(taxesAndFees: RatePlanPriceTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } - - fun totalPrice(totalPrice: RoomTypePriceTotalPrice?) = apply { this.totalPrice = totalPrice } - - fun totalStrikeOutPrice(totalStrikeOutPrice: RoomTypePriceTotalStrikeOutPrice?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } - - fun avgNightlyRate(avgNightlyRate: RoomTypePriceAvgNightlyRate?) = apply { this.avgNightlyRate = avgNightlyRate } - - fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: RoomTypePriceAvgNightlyStrikeOutRate?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } - - fun avgNightlyRateWithFees(avgNightlyRateWithFees: RoomTypePriceAvgNightlyRateWithFees?) = apply { this.avgNightlyRateWithFees = avgNightlyRateWithFees } - - fun avgNightlyStrikeoutRateWithFees(avgNightlyStrikeoutRateWithFees: RoomTypePriceAvgNightlyStrikeoutRateWithFees?) = - apply { - this.avgNightlyStrikeoutRateWithFees = - avgNightlyStrikeoutRateWithFees - } - - fun hotelMandatoryFees(hotelMandatoryFees: RatePlanPriceHotelMandatoryFees?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } - - fun totalPriceWithHotelFees(totalPriceWithHotelFees: RoomTypePriceTotalPriceWithHotelFees?) = apply { this.totalPriceWithHotelFees = totalPriceWithHotelFees } - - fun refundableDamageDeposit(refundableDamageDeposit: RoomTypePriceRefundableDamageDeposit?) = apply { this.refundableDamageDeposit = refundableDamageDeposit } - - fun build(): RoomTypePrice { - val instance = - RoomTypePrice( - baseRate = baseRate, - taxesAndFees = taxesAndFees, - totalPrice = totalPrice, - totalStrikeOutPrice = totalStrikeOutPrice, - avgNightlyRate = avgNightlyRate, - avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, - avgNightlyRateWithFees = avgNightlyRateWithFees, - avgNightlyStrikeoutRateWithFees = avgNightlyStrikeoutRateWithFees, - hotelMandatoryFees = hotelMandatoryFees, - totalPriceWithHotelFees = totalPriceWithHotelFees, - 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() = - Builder( - baseRate = baseRate, - taxesAndFees = taxesAndFees, - totalPrice = totalPrice, - totalStrikeOutPrice = totalStrikeOutPrice, - avgNightlyRate = avgNightlyRate, - avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, - avgNightlyRateWithFees = avgNightlyRateWithFees, - avgNightlyStrikeoutRateWithFees = avgNightlyStrikeoutRateWithFees, - hotelMandatoryFees = hotelMandatoryFees, - totalPriceWithHotelFees = totalPriceWithHotelFees, - refundableDamageDeposit = refundableDamageDeposit - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyRate.kt deleted file mode 100644 index 88210c328..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyRateWithFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyRateWithFees.kt deleted file mode 100644 index 837173151..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyStrikeOutRate.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyStrikeOutRate.kt deleted file mode 100644 index c1137a3b7..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyStrikeoutRateWithFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceAvgNightlyStrikeoutRateWithFees.kt deleted file mode 100644 index 05a62a690..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceRefundableDamageDeposit.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceRefundableDamageDeposit.kt deleted file mode 100644 index b579bee8b..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalPrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalPrice.kt deleted file mode 100644 index b77edc08d..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalPriceWithHotelFees.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalPriceWithHotelFees.kt deleted file mode 100644 index ff1db94d0..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalStrikeOutPrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePriceTotalStrikeOutPrice.kt deleted file mode 100644 index 5e044604d..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeStandalonePrice.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeStandalonePrice.kt deleted file mode 100644 index 2d55a3109..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeStandalonePrice.kt +++ /dev/null @@ -1,187 +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.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.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 - */ -data class RoomTypeStandalonePrice( - @JsonProperty("BaseRate") - @field:Valid - val baseRate: RatePlanStandalonePriceBaseRate? = null, - @JsonProperty("StrikeOutBaseRate") - @field:Valid - val strikeOutBaseRate: RatePlanStandalonePriceStrikeOutBaseRate? = null, - @JsonProperty("TaxesAndFees") - @field:Valid - val taxesAndFees: RatePlanStandalonePriceTaxesAndFees? = null, - @JsonProperty("StrikeOutTaxesAndFees") - @field:Valid - val strikeOutTaxesAndFees: RatePlanStandalonePriceStrikeOutTaxesAndFees? = null, - @JsonProperty("TotalPrice") - @field:Valid - val totalPrice: RatePlanStandalonePriceTotalPrice? = null, - @JsonProperty("TotalStrikeOutPrice") - @field:Valid - val totalStrikeOutPrice: RatePlanStandalonePriceTotalStrikeOutPrice? = null, - @JsonProperty("AvgNightlyRate") - @field:Valid - val avgNightlyRate: RatePlanStandalonePriceAvgNightlyRate? = null, - @JsonProperty("AvgNightlyStrikeOutRate") - @field:Valid - val avgNightlyStrikeOutRate: RatePlanStandalonePriceAvgNightlyStrikeOutRate? = null, - @JsonProperty("HotelMandatoryFees") - @field:Valid - val hotelMandatoryFees: RatePlanStandalonePriceHotelMandatoryFees? = null, - @JsonProperty("StrikeOutHotelMandatoryFees") - @field:Valid - val strikeOutHotelMandatoryFees: RatePlanStandalonePriceStrikeOutHotelMandatoryFees? = null -) { - 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 - ) { - fun baseRate(baseRate: RatePlanStandalonePriceBaseRate?) = apply { this.baseRate = baseRate } - - fun strikeOutBaseRate(strikeOutBaseRate: RatePlanStandalonePriceStrikeOutBaseRate?) = apply { this.strikeOutBaseRate = strikeOutBaseRate } - - fun taxesAndFees(taxesAndFees: RatePlanStandalonePriceTaxesAndFees?) = apply { this.taxesAndFees = taxesAndFees } - - fun strikeOutTaxesAndFees(strikeOutTaxesAndFees: RatePlanStandalonePriceStrikeOutTaxesAndFees?) = apply { this.strikeOutTaxesAndFees = strikeOutTaxesAndFees } - - fun totalPrice(totalPrice: RatePlanStandalonePriceTotalPrice?) = apply { this.totalPrice = totalPrice } - - fun totalStrikeOutPrice(totalStrikeOutPrice: RatePlanStandalonePriceTotalStrikeOutPrice?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } - - fun avgNightlyRate(avgNightlyRate: RatePlanStandalonePriceAvgNightlyRate?) = apply { this.avgNightlyRate = avgNightlyRate } - - fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: RatePlanStandalonePriceAvgNightlyStrikeOutRate?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } - - fun hotelMandatoryFees(hotelMandatoryFees: RatePlanStandalonePriceHotelMandatoryFees?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } - - fun strikeOutHotelMandatoryFees(strikeOutHotelMandatoryFees: RatePlanStandalonePriceStrikeOutHotelMandatoryFees?) = - apply { - this.strikeOutHotelMandatoryFees = - strikeOutHotelMandatoryFees - } - - fun build(): RoomTypeStandalonePrice { - val instance = - RoomTypeStandalonePrice( - baseRate = baseRate, - strikeOutBaseRate = strikeOutBaseRate, - taxesAndFees = taxesAndFees, - strikeOutTaxesAndFees = strikeOutTaxesAndFees, - totalPrice = totalPrice, - totalStrikeOutPrice = totalStrikeOutPrice, - avgNightlyRate = avgNightlyRate, - avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, - hotelMandatoryFees = hotelMandatoryFees, - 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() = - Builder( - baseRate = baseRate, - strikeOutBaseRate = strikeOutBaseRate, - taxesAndFees = taxesAndFees, - strikeOutTaxesAndFees = strikeOutTaxesAndFees, - totalPrice = totalPrice, - totalStrikeOutPrice = totalStrikeOutPrice, - avgNightlyRate = avgNightlyRate, - avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, - hotelMandatoryFees = hotelMandatoryFees, - strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpAPIMError.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpAPIMError.kt deleted file mode 100644 index f38340930..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpAPIMError.kt +++ /dev/null @@ -1,93 +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 - -/** - * 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 -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var message: kotlin.String? = null - ) { - fun message(message: kotlin.String?) = apply { this.message = message } - - fun build(): SdpAPIMError { - val instance = - SdpAPIMError( - 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 - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/TransmissionDrive.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/TransmissionDrive.kt deleted file mode 100644 index 1fc2fa112..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/TransmissionDrive.kt +++ /dev/null @@ -1,106 +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 -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 - * @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 -) { - companion object { - @JvmStatic - fun builder() = Builder() - } - - class Builder( - private var code: kotlin.String? = null, - private var `value`: kotlin.String? = null - ) { - fun code(code: kotlin.String) = apply { this.code = code } - - fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } - - fun build(): TransmissionDrive { - val instance = - TransmissionDrive( - code = code!!, - `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`!! - ) -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/exception/ApiException.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/models/exception/ApiException.kt deleted file mode 100644 index 56dc289dc..000000000 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt deleted file mode 100644 index ce5455483..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt +++ /dev/null @@ -1,44 +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. - */ -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 - -/** - * - * @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) - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt deleted file mode 100644 index 795784611..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt +++ /dev/null @@ -1,35 +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. - */ -package com.expediagroup.sdk.xap.operations - -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation - -/** - * - * @property params [GetActivityListingsOperationParams] - */ -class GetActivityListingsOperation( - params: GetActivityListingsOperationParams -) : Operation< - Nothing - >( - "/activities/listings", - "GET", - "getActivityListings", - null, - params - ) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperation.kt deleted file mode 100644 index 69021e83d..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperation.kt +++ /dev/null @@ -1,44 +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. - */ -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 - -/** - * 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) - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperation.kt deleted file mode 100644 index 8e61afc6b..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperation.kt +++ /dev/null @@ -1,35 +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. - */ -package com.expediagroup.sdk.xap.operations - -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation - -/** - * Search Expedia car inventory - * @property params [GetCarsListingsOperationParams] - */ -class GetCarsListingsOperation( - params: GetCarsListingsOperationParams -) : Operation< - Nothing - >( - "/cars/listings", - "GET", - "getCarsListings", - null, - params - ) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperation.kt deleted file mode 100644 index 87d5a5ab7..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperation.kt +++ /dev/null @@ -1,35 +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. - */ -package com.expediagroup.sdk.xap.operations - -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation - -/** - * - * @property params [GetFeedDownloadUrlOperationParams] - */ -class GetFeedDownloadUrlOperation( - params: GetFeedDownloadUrlOperationParams -) : Operation< - Nothing - >( - "/feed/v1/download-url", - "GET", - "getFeedDownloadUrl", - null, - params - ) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperation.kt deleted file mode 100644 index 4878aee01..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperation.kt +++ /dev/null @@ -1,35 +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. - */ -package com.expediagroup.sdk.xap.operations - -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation - -/** - * Get availability calendars of properties - * @property params [GetLodgingAvailabilityCalendarsOperationParams] - */ -class GetLodgingAvailabilityCalendarsOperation( - params: GetLodgingAvailabilityCalendarsOperationParams -) : Operation< - Nothing - >( - "/lodging/availabilityCalendars", - "GET", - "getLodgingAvailabilityCalendars", - null, - params - ) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperation.kt deleted file mode 100644 index 3c8b9b0a4..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperation.kt +++ /dev/null @@ -1,44 +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. - */ -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 - -/** - * 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) - } - } -} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperation.kt deleted file mode 100644 index 8c1263988..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperation.kt +++ /dev/null @@ -1,35 +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. - */ -package com.expediagroup.sdk.xap.operations - -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation - -/** - * Search lodging inventory - * @property params [GetLodgingListingsOperationParams] - */ -class GetLodgingListingsOperation( - params: GetLodgingListingsOperationParams -) : Operation< - Nothing - >( - "/hotels/listings", - "GET", - "getLodgingListings", - null, - params - ) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperation.kt deleted file mode 100644 index 88996be23..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperation.kt +++ /dev/null @@ -1,35 +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. - */ -package com.expediagroup.sdk.xap.operations - -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation - -/** - * Get properties price and availability information - * @property params [GetLodgingQuotesOperationParams] - */ -class GetLodgingQuotesOperation( - params: GetLodgingQuotesOperationParams -) : Operation< - Nothing - >( - "/lodging/quotes", - "GET", - "getLodgingQuotes", - null, - params - ) diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperation.kt b/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperation.kt deleted file mode 100644 index a375d6b7d..000000000 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperation.kt +++ /dev/null @@ -1,35 +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. - */ -package com.expediagroup.sdk.xap.operations - -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Operation - -/** - * Get rate calendar of a property - * @property params [GetLodgingRateCalendarOperationParams] - */ -class GetLodgingRateCalendarOperation( - params: GetLodgingRateCalendarOperationParams -) : Operation< - Nothing - >( - "/hotels/rateCalendar", - "GET", - "getLodgingRateCalendar", - null, - params - ) diff --git a/customizations/core/src/main/kotlin/com/expediagroup/sdk/core/constant/HeaderKey.kt b/customizations/core/src/main/kotlin/com/expediagroup/sdk/core/constant/HeaderKey.kt deleted file mode 100644 index 425d0f5fc..000000000 --- a/customizations/core/src/main/kotlin/com/expediagroup/sdk/core/constant/HeaderKey.kt +++ /dev/null @@ -1,26 +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. - */ -package com.expediagroup.sdk.core.constant - -internal object HeaderKey { - const val PAGINATION_TOTAL_RESULTS = "pagination-total-results" - - const val LINK = "link" - - const val TRANSACTION_ID = "Partner-Transaction-Id" - - const val X_SDK_TITLE = "x-sdk-title" -} diff --git a/customizations/core/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/ContentNegotiation.kt b/customizations/core/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/ContentNegotiation.kt deleted file mode 100644 index 00d4e672a..000000000 --- a/customizations/core/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/ContentNegotiation.kt +++ /dev/null @@ -1,246 +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. - */ -package com.expediagroup.sdk.core.plugin.serialization - -import com.expediagroup.sdk.core.plugin.logging.ExpediaGroupLoggerFactory -import io.ktor.client.HttpClient -import io.ktor.client.plugins.HttpClientPlugin -import io.ktor.client.plugins.contentnegotiation.ContentConverterException -import io.ktor.client.plugins.contentnegotiation.JsonContentTypeMatcher -import io.ktor.client.request.HttpRequestBuilder -import io.ktor.client.request.HttpRequestPipeline -import io.ktor.client.statement.HttpResponseContainer -import io.ktor.client.statement.HttpResponsePipeline -import io.ktor.client.utils.EmptyContent -import io.ktor.http.ContentType -import io.ktor.http.ContentTypeMatcher -import io.ktor.http.HttpHeaders -import io.ktor.http.HttpStatusCode -import io.ktor.http.Url -import io.ktor.http.charset -import io.ktor.http.content.NullBody -import io.ktor.http.content.OutgoingContent -import io.ktor.http.contentType -import io.ktor.serialization.Configuration -import io.ktor.serialization.ContentConverter -import io.ktor.serialization.deserialize -import io.ktor.serialization.suitableCharset -import io.ktor.util.AttributeKey -import io.ktor.util.InternalAPI -import io.ktor.util.reflect.TypeInfo -import io.ktor.utils.io.ByteReadChannel -import io.ktor.utils.io.charsets.Charset -import java.io.InputStream -import kotlin.reflect.KClass - -internal val DefaultCommonIgnoredTypes: Set> = - setOf( - ByteArray::class, - String::class, - HttpStatusCode::class, - ByteReadChannel::class, - OutgoingContent::class - ) - -internal val DefaultIgnoredTypes: Set> = mutableSetOf(InputStream::class) - -internal class ContentNegotiation( - private val registrations: List, - private val ignoredTypes: Set> -) { - internal class Config : Configuration { - internal class ConverterRegistration( - val converter: ContentConverter, - val contentTypeToSend: ContentType, - val contentTypeMatcher: ContentTypeMatcher - ) - - val registrations = mutableListOf() - val ignoredTypes: MutableSet> = - (DefaultIgnoredTypes + DefaultCommonIgnoredTypes).toMutableSet() - - override fun register( - contentType: ContentType, - converter: T, - configuration: T.() -> Unit - ) { - val matcher = - when (contentType) { - ContentType.Application.Json -> JsonContentTypeMatcher - else -> defaultMatcher(contentType) - } - register(contentType, converter, matcher, configuration) - } - - private fun register( - contentTypeToSend: ContentType, - converter: T, - contentTypeMatcher: ContentTypeMatcher, - configuration: T.() -> Unit - ) { - val registration = - ConverterRegistration( - converter.apply(configuration), - contentTypeToSend, - contentTypeMatcher - ) - registrations.add(registration) - } - - private fun defaultMatcher(pattern: ContentType): ContentTypeMatcher = - object : ContentTypeMatcher { - override fun contains(contentType: ContentType): Boolean = contentType.match(pattern) - } - } - - private val log = ExpediaGroupLoggerFactory.getLogger(this::class.java) - - internal suspend fun convertRequest( - request: HttpRequestBuilder, - body: Any - ): Any? { - if (body is OutgoingContent || ignoredTypes.any { it.isInstance(body) }) { - log.trace( - "Body type ${body::class} is in ignored types. " + - "Skipping ContentNegotiation for ${request.url}." - ) - return null - } - val contentType = - request.contentType() ?: run { - log.trace("Request doesn't have Content-Type header. Skipping ContentNegotiation for ${request.url}.") - return null - } - - if (body is Unit) { - log.trace("Sending empty body for ${request.url}") - request.headers.remove(HttpHeaders.ContentType) - return EmptyContent - } - - val matchingRegistrations = - registrations.filter { it.contentTypeMatcher.contains(contentType) } - .takeIf { it.isNotEmpty() } ?: run { - log.trace( - "None of the registered converters match request Content-Type=$contentType. " + - "Skipping ContentNegotiation for ${request.url}." - ) - return null - } - if (request.bodyType == null) { - log.trace("Request has unknown body type. Skipping ContentNegotiation for ${request.url}.") - return null - } - request.headers.remove(HttpHeaders.ContentType) - - // Pick the first one that can convert the subject successfully - val serializedContent = - matchingRegistrations.firstNotNullOfOrNull { registration -> - val result = - registration.converter.serializeNullable( - contentType, - contentType.charset() ?: Charsets.UTF_8, - request.bodyType!!, - body.takeIf { it != NullBody } - ) - if (result != null) { - log.trace("Converted request body using ${registration.converter} for ${request.url}") - } - result - } ?: throw ContentConverterException( - "Can't convert $body with contentType $contentType using converters " + - matchingRegistrations.joinToString { it.converter.toString() } - ) - - return serializedContent - } - - @OptIn(InternalAPI::class) - internal suspend fun convertResponse( - requestUrl: Url, - info: TypeInfo, - body: Any, - responseContentType: ContentType, - charset: Charset = Charsets.UTF_8 - ): Any? { - if (body !is ByteReadChannel) { - log.trace("Response body is already transformed. Skipping ContentNegotiation for $requestUrl.") - return null - } - if (info.type in ignoredTypes) { - log.trace( - "Response body type ${info.type} is in ignored types. " + - "Skipping ContentNegotiation for $requestUrl." - ) - return null - } - - log.debug("Test: ${registrations.size}") - val suitableConverters = - registrations - .filter { it.contentTypeMatcher.contains(responseContentType) } - .map { it.converter } - .takeIf { it.isNotEmpty() } - ?: run { - log.trace( - "None of the registered converters match response with Content-Type=$responseContentType. " + - "Skipping ContentNegotiation for $requestUrl." - ) - return null - } - - val result = suitableConverters.deserialize(body, info, charset) - if (result !is ByteReadChannel) { - log.trace("Response body was converted to ${result::class} for $requestUrl.") - } - return result - } - - companion object Plugin : HttpClientPlugin { - override val key: AttributeKey = AttributeKey("ContentNegotiation") - private val log = ExpediaGroupLoggerFactory.getLogger(this::class.java) - - override fun install( - plugin: ContentNegotiation, - scope: HttpClient - ) { - scope.requestPipeline.intercept(HttpRequestPipeline.Transform) { - val result = plugin.convertRequest(context, subject) ?: return@intercept - proceedWith(result) - } - - scope.responsePipeline.intercept(HttpResponsePipeline.Transform) { (info, body) -> - val contentType = - context.response.contentType() ?: run { - log.trace("Response doesn't have \"Content-Type\" header, skipping ContentNegotiation plugin") - return@intercept - } - val charset = context.request.headers.suitableCharset() - - val deserializedBody = - plugin.convertResponse(context.request.url, info, body, contentType, charset) - ?: return@intercept - val result = HttpResponseContainer(info, deserializedBody) - proceedWith(result) - } - } - - override fun prepare(block: Config.() -> Unit): ContentNegotiation { - val config = Config().apply(block) - return ContentNegotiation(config.registrations, config.ignoredTypes) - } - } -} diff --git a/customizations/core/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/SerializationPlugin.kt b/customizations/core/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/SerializationPlugin.kt deleted file mode 100644 index eda9abc14..000000000 --- a/customizations/core/src/main/kotlin/com/expediagroup/sdk/core/plugin/serialization/SerializationPlugin.kt +++ /dev/null @@ -1,40 +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. - */ -package com.expediagroup.sdk.core.plugin.serialization - -import com.expediagroup.sdk.core.client.Client -import com.expediagroup.sdk.core.plugin.Plugin -import com.fasterxml.jackson.databind.DeserializationFeature -import com.fasterxml.jackson.databind.PropertyNamingStrategies -import io.ktor.serialization.jackson.jackson -import java.text.SimpleDateFormat - -internal object SerializationPlugin : Plugin { - override fun install( - client: Client, - configurations: SerializationConfiguration - ) { - configurations.httpClientConfiguration.install(ContentNegotiation) { - jackson { - enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS) - disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) - setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE) - setDateFormat(SimpleDateFormat()) - findAndRegisterModules() - } - } - } -} diff --git a/customizations/generator/openapi/src/main/kotlin/com/expediagroup/sdk/generators/openapi/OpenApiSdkGenerator.kt b/customizations/generator/openapi/src/main/kotlin/com/expediagroup/sdk/generators/openapi/OpenApiSdkGenerator.kt deleted file mode 100644 index b930fe0d9..000000000 --- a/customizations/generator/openapi/src/main/kotlin/com/expediagroup/sdk/generators/openapi/OpenApiSdkGenerator.kt +++ /dev/null @@ -1,172 +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. - */ -package com.expediagroup.sdk.generators.openapi - -import com.expediagroup.sdk.model.ClientGenerationException -import com.expediagroup.sdk.product.Product -import com.expediagroup.sdk.product.ProgrammingLanguage -import com.github.rvesse.airline.SingleCommand -import com.github.rvesse.airline.annotations.Command -import com.github.rvesse.airline.annotations.Option -import org.openapitools.codegen.CodegenConstants -import org.openapitools.codegen.DefaultGenerator -import org.openapitools.codegen.SupportingFile -import org.openapitools.codegen.api.TemplateDefinition -import org.openapitools.codegen.api.TemplateFileType -import org.openapitools.codegen.config.CodegenConfigurator - -/** - * Configures the OpenAPI Generator based on command line parameters to generate an EG Travel SDK project - * This will produce a maven project in the specified output directory - */ -@Command(name = "generate", description = "Let's build an EG Travel SDK!") -class OpenApiSdkGenerator { - private val supportingFiles = - mutableListOf( - "pom.xml", - "README.md", - "ApiException.kt", - "LinkableOperation.kt", - "ApiAbstractions.kt" - ) - - companion object { - /** - * Main Entry Point - * - * Parses command line arguments and then generates an EG Travel SDK - */ - @JvmStatic - fun main(args: Array) { - val generator = SingleCommand.singleCommand(OpenApiSdkGenerator::class.java).parse(*args) - generator.run() - } - } - - @Option(name = ["-i", "--input-spec"]) - lateinit var inputFile: String - - @Option(name = ["-o", "--output-directory"]) - lateinit var outputDirectory: String - - @Option(name = ["-n", "--namespace"]) - lateinit var namespace: String - - @Option(name = ["-v", "--version"]) - lateinit var version: String - - @Option(name = ["-l", "--language"]) - lateinit var programmingLanguage: String - - @Option(name = ["-t", "--templates-dir"]) - lateinit var templateDir: String - - @Option(name = ["-r", "--repo-name"]) - lateinit var repoName: String - - fun run() { - try { - val product = Product(namespace, repoName, programmingLanguage) - val config = - CodegenConfigurator().apply { - setGeneratorName("kotlin") - setTemplateDir(templateDir) - setInputSpec(inputFile) - setOutputDir(outputDirectory) - setArtifactId(product.artifactId) - setArtifactVersion(version) - setGroupId(product.groupId) - setPackageName(product.packageName) - setEnablePostProcessFile(true) - - addGlobalProperty(CodegenConstants.APIS, "") - addGlobalProperty(CodegenConstants.API_DOCS, "false") - addGlobalProperty(CodegenConstants.MODELS, "") - addGlobalProperty(CodegenConstants.MODEL_DOCS, "false") - - supportingFiles.add("${namespace.replaceFirstChar(Char::titlecase)}Client.kt") - supportingFiles.add("Room.kt") - - addGlobalProperty(CodegenConstants.SUPPORTING_FILES, supportingFiles.joinToString(",")) - // addGlobalProperty("debugSupportingFiles", "") - - addAdditionalProperty(CodegenConstants.API_SUFFIX, "Operation") - addAdditionalProperty(CodegenConstants.API_PACKAGE, product.apiPackage) - addAdditionalProperty(CodegenConstants.ENUM_PROPERTY_NAMING, "UPPERCASE") - addAdditionalProperty(CodegenConstants.LIBRARY, "jvm-ktor") - addAdditionalProperty(CodegenConstants.SERIALIZATION_LIBRARY, "jackson") - addAdditionalProperty(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, true) - - // Template specific properties - addAdditionalProperty("shadePrefix", product.shadePrefix) - addAdditionalProperty("namespace", product.namespace) - addAdditionalProperty("clientClassname", namespace.pascalCase()) - addAdditionalProperty("language", product.programmingLanguage.id) - addAdditionalProperty("repoName", product.repoName) - addAdditionalProperty("isKotlin", ProgrammingLanguage.isKotlin(product.programmingLanguage)) - - // Mustache Helpers - mustacheHelpers.forEach { (name, function) -> addAdditionalProperty(name, function()) } - } - - val generatorInput = - config.toClientOptInput().apply { - val packagePath = product.packagePath - - userDefinedTemplates( - buildList { - add( - SupportingFile( - "client.mustache", - "$packagePath/client/", - "${namespace.replaceFirstChar(Char::titlecase)}Client.kt" - ) - ) - add(SupportingFile("pom.mustache", "pom.xml")) - add(SupportingFile("README.mustache", "README.md")) - add( - SupportingFile( - "models/apiException.mustache", - "$packagePath/models/exception/", - "ApiException.kt" - ) - ) - - add( - TemplateDefinition( - "operation_params.mustache", - "Params.kt" - ).also { it.templateType = TemplateFileType.API } - ) - - add( - SupportingFile( - "xap/room.mustache", - "$packagePath/models/", - "Room.kt" - ) - ) - } - ) - } - - val generator = DefaultGenerator(false).apply { opts(generatorInput) } - generator.generate() - } catch (e: Exception) { - throw ClientGenerationException("Failed to generate SDK", e) - } - } -} diff --git a/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/client.mustache b/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/client.mustache deleted file mode 100644 index 45c4b3442..000000000 --- a/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/client.mustache +++ /dev/null @@ -1,161 +0,0 @@ -package com.expediagroup.sdk.{{namespace}}.client - -import java.util.concurrent.CompletableFuture -import java.util.stream.Collectors -import kotlin.collections.Map.Entry -import kotlinx.coroutines.runBlocking - -{{#imports}} - import {{import}} -{{/imports}} - -{{>imports/domain}} - -{{>imports/core}} - -{{>imports/defaults}} - -/** -* {{#openAPI}}{{#info}}{{{description}}}{{/info}}{{/openAPI}} -*/ - -class {{clientClassname}}Client private constructor(clientConfiguration: XapClientConfiguration) : BaseXapClient("{{namespace}}", clientConfiguration) { - class Builder : BaseXapClient.Builder() { - override fun build() = {{clientClassname}}Client( - XapClientConfiguration(key, secret, endpoint, requestTimeout, connectionTimeout, socketTimeout, maskedLoggingHeaders, maskedLoggingBodyFields) - ) - } - - class BuilderWithHttpClient() : BaseXapClient.BuilderWithHttpClient() { - override fun build() : {{clientClassname}}Client { - - if (okHttpClient == null) { - throw ExpediaGroupConfigurationException(getMissingRequiredConfigurationMessage(ConfigurationName.OKHTTP_CLIENT)) - } - - return {{clientClassname}}Client( - XapClientConfiguration(key, secret, endpoint, null, null, null, maskedLoggingHeaders, maskedLoggingBodyFields, okHttpClient) - ) - } - } - - companion object { - @JvmStatic fun builder() = Builder() - - @JvmStatic fun builderWithHttpClient() = BuilderWithHttpClient() - } - - override suspend fun throwServiceException(response: HttpResponse, operationId: String) { - throw ErrorObjectMapper.process(response, operationId) - } - - private suspend inline fun executeHttpRequest(operation: Operation): HttpResponse { - return httpClient.request { - method = HttpMethod.parse(operation.method) - url(operation.url) - - operation.params?.getHeaders()?.let { - headers.appendAll(it) - } - - operation.params?.getQueryParams()?.let { - url.parameters.appendAll(it) - } - - val extraHeaders = buildMap { - put("key", configurationProvider.key ?: "") - } - - appendHeaders(extraHeaders) - contentType(ContentType.Application.Json) - setBody(operation.requestBody) - } - } - - private inline fun executeWithEmptyResponse(operation: Operation) : EmptyResponse { - try { - return executeAsyncWithEmptyResponse(operation).get() - } catch (exception: Exception) { - exception.handle() - } - } - - private inline fun executeAsyncWithEmptyResponse(operation: Operation) : CompletableFuture { - return GlobalScope.future(Dispatchers.IO) { - try { - val response = executeHttpRequest(operation) - throwIfError(response, operation.operationId) - EmptyResponse(response.status.value, response.headers.entries()) - - } catch (exception: Exception) { - exception.handle() - } - } - } - - private inline fun execute(operation: Operation) : Response { - try { - return executeAsync(operation).get() - } catch (exception: Exception) { - exception.handle() - } - } - - private inline fun executeAsync(operation: Operation) : CompletableFuture> { - return GlobalScope.future(Dispatchers.IO) { - try { - val response = executeHttpRequest(operation) - throwIfError(response, operation.operationId) - Response(response.status.value, response.body(), response.headers.entries()) - } catch (exception: Exception) { - exception.handle() - } - } - } - - {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} - /** - * {{{summary}}} - * {{{notes}}} - * @param operation [{{operationIdCamelCase}}Operation] - {{#exceptionDataTypes}} - {{#dataTypes}} - * @throws ExpediaGroupApi{{.}}Exception - {{/dataTypes}} - {{/exceptionDataTypes}} - * @return a [Response] object with a body of type {{{returnType}}}{{^returnType}}Nothing{{/returnType}} - */ - fun execute(operation: {{operationIdCamelCase}}Operation) : {{#returnType}}Response<{{{returnType}}}>{{/returnType}}{{^returnType}}EmptyResponse{{/returnType}} { - {{#returnType}} - return execute<{{#bodyParam}}{{dataType}}{{/bodyParam}}{{^hasBodyParam}}Nothing{{/hasBodyParam}}, {{{returnType}}}>(operation) - {{/returnType}} - {{^returnType}} - return executeWithEmptyResponse<{{#bodyParam}}{{dataType}}{{/bodyParam}}{{^hasBodyParam}}Nothing{{/hasBodyParam}}>(operation) - {{/returnType}} - } - - /** - * {{{summary}}} - * {{{notes}}} - * @param operation [{{operationIdCamelCase}}Operation] - {{#exceptionDataTypes}} - {{#dataTypes}} - * @throws ExpediaGroupApi{{.}}Exception - {{/dataTypes}} - {{/exceptionDataTypes}} - * @return a [CompletableFuture] object with a body of type {{{returnType}}}{{^returnType}}Nothing{{/returnType}} - */ - fun executeAsync(operation: {{operationIdCamelCase}}Operation) : CompletableFuture<{{#returnType}}Response<{{{returnType}}}>{{/returnType}}{{^returnType}}EmptyResponse{{/returnType}}> { - {{#returnType}} - return executeAsync<{{#bodyParam}}{{dataType}}{{/bodyParam}}{{^hasBodyParam}}Nothing{{/hasBodyParam}}, {{{returnType}}}>(operation) - {{/returnType}} - {{^returnType}} - return executeAsyncWithEmptyResponse<{{#bodyParam}}{{dataType}}{{/bodyParam}}{{^hasBodyParam}}Nothing{{/hasBodyParam}}>(operation) - {{/returnType}} - } - - {{#isPaginatable}} - {{>client/paginatorMethods}} - {{/isPaginatable}} - {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} -} diff --git a/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/imports/core.mustache b/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/imports/core.mustache deleted file mode 100644 index 45ac72ec9..000000000 --- a/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/imports/core.mustache +++ /dev/null @@ -1,16 +0,0 @@ -import com.expediagroup.sdk.core.client.BaseXapClient -import com.expediagroup.sdk.core.configuration.XapClientConfiguration -import com.expediagroup.sdk.core.constant.ConfigurationName -import com.expediagroup.sdk.core.constant.HeaderKey -import com.expediagroup.sdk.core.constant.provider.ExceptionMessageProvider.getMissingRequiredConfigurationMessage -import com.expediagroup.sdk.core.model.exception.ExpediaGroupException -import com.expediagroup.sdk.core.model.exception.client.ExpediaGroupConfigurationException -import com.expediagroup.sdk.core.model.exception.service.ExpediaGroupServiceException -import com.expediagroup.sdk.core.model.exception.handle -import com.expediagroup.sdk.core.model.paging.Paginator -import com.expediagroup.sdk.core.model.paging.ResponsePaginator -import com.expediagroup.sdk.core.model.EmptyResponse -import com.expediagroup.sdk.core.model.Nothing -import com.expediagroup.sdk.core.model.Properties -import com.expediagroup.sdk.core.model.Response -import com.expediagroup.sdk.core.model.Operation \ No newline at end of file diff --git a/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/operation_params.mustache b/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/operation_params.mustache deleted file mode 100644 index aeaea1529..000000000 --- a/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/operation_params.mustache +++ /dev/null @@ -1,165 +0,0 @@ -{{#operations}} - {{#operation}} - {{#hasNonBodyParams}} - package com.expediagroup.sdk.{{namespace}}.operations - - import com.expediagroup.sdk.core.model.exception.client.PropertyConstraintViolationException - import com.expediagroup.sdk.core.model.OperationParams - - import {{packageName}}.infrastructure.* - import com.fasterxml.jackson.annotation.JsonProperty - import com.fasterxml.jackson.databind.annotation.JsonDeserialize - import io.ktor.http.Headers - import io.ktor.http.Parameters - - import javax.validation.constraints.Max - import javax.validation.constraints.Min - import javax.validation.constraints.NotNull - import javax.validation.constraints.Pattern - import javax.validation.constraints.Size - import javax.validation.Valid - import javax.validation.Validation - - import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator - - /** - {{#nonBodyParams}} - {{#params}} - * @property {{{paramName}}} {{{description}}} - {{/params}} - {{/nonBodyParams}} - */ - @JsonDeserialize(builder = {{classname}}Params.Builder::class) - data class {{classname}}Params( - {{#nonBodyParams}} - {{#params}} - {{>models/constraints}} - {{>modelMutable}} {{>client/apiParam}}{{^-last}}, {{/-last}} - {{/params}} - {{/nonBodyParams}} - ) : OperationParams { - companion object { - @JvmStatic - fun builder() = Builder() - } - - {{#nonBodyParams}} - {{#params}} - {{#isEnum}} - enum class {{enumName}}( - val value: - {{#isContainer}}{{{items.dataType}}}{{/isContainer}} - {{^isContainer}}{{dataType}}{{/isContainer}} - ) { - {{#allowableValues}} - {{#enumVars}} - {{name}}({{{value}}}) - {{^-last}},{{/-last}} - {{/enumVars}} - {{/allowableValues}} - } - {{/isEnum}} - {{/params}} - {{/nonBodyParams}} - - class Builder( - {{#nonBodyParams}} - {{#params}} - @JsonProperty("{{{baseName}}}") private var {{{paramName}}}: {{>partials/datatype}}? = null - {{^-last}},{{/-last}} - {{/params}} - {{/nonBodyParams}} - ) { - {{#nonBodyParams}} - {{#params}} - /** - * @param {{{paramName}}} {{{description}}} - */ - fun {{{paramName}}}({{{paramName}}}: {{>partials/datatype}}) = apply { this.{{{paramName}}} = {{{paramName}}} } - {{/params}} - {{/nonBodyParams}} - - fun build(): {{classname}}Params { - val params = {{classname}}Params( - {{#nonBodyParams}} - {{#params}} - {{{paramName}}} = {{{paramName}}}{{#required}}!!{{/required}}{{^-last}},{{/-last}} - {{/params}} - {{/nonBodyParams}} - ) - - validate(params) - - return params - } - - private fun validate(params: {{classname}}Params) { - 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( - {{#nonBodyParams}} - {{#params}} - {{{paramName}}} = {{{paramName}}}{{^-last}},{{/-last}} - {{/params}} - {{/nonBodyParams}} - ) - - override fun getHeaders(): Headers { - return Headers.build { - {{#headerParams}} - {{paramName}}?.let { - append("{{baseName}}", it{{#isEnum}}.value{{/isEnum}}) - } - {{/headerParams}} - {{#responses}} - {{#httpAcceptHeader}} - append("Accept", "{{mediaTypes}}") - {{/httpAcceptHeader}} - {{/responses}} - } - } - - override fun getQueryParams(): Parameters { - return Parameters.build { - {{#queryParams}} - {{paramName}}?.let { - {{#isContainer}} - appendAll("{{baseName}}", toMultiValue(it{{#isEnum}}.map { item -> item.value }{{/isEnum}}, "{{collectionFormat}}")) - {{/isContainer}} - {{^isContainer}} - append("{{baseName}}", it{{#isEnum}}.value{{/isEnum}}{{^isString}}.toString(){{/isString}}) - {{/isContainer}} - } - {{/queryParams}} - } - } - - override fun getPathParams() : Map { - return buildMap { - {{#pathParams}} - {{paramName}}?.also { - put("{{baseName}}", {{paramName}}{{#isEnum}}.value{{/isEnum}}) - } - {{/pathParams}} - } - } - } - {{/hasNonBodyParams}} - {{/operation}} -{{/operations}} diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 06edf03d1..000000000 --- a/examples/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# XAP Java SDK Examples - -This repository contains examples of how to use the Expedia Group XAP Java SDK. The examples are -written in Java and use Maven for dependency management. - -## Examples - -The example implementation provided in the examples package demonstrates different scenarios -utilizing various XAP APIs through the SDK. - -Currently, the following scenarios are included: - -### Lodging - -- [`ListingsQuickStartScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/ListingsQuickStartScenario.java): - - This example demonstrates how to search for properties with a location keyword with filters - applied in Lodging Listings API. - -- [`HotelIdsSearchEndToEndScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/ListingsHotelIdsSearchScenario.java): - - This example demonstrates how to retrieve accessible property ids from SDP DownloadURL API and - then get the content and prices of these properties using the Lodging Listings API. - -- [`QuotesQuickStartScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/QuotesQuickStartScenario.java): - - This example demonstrates how to search for property quotes with property IDs in - Lodging Quotes API. - -- [`VrboPropertySearchEndToEndScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboPropertySearchEndToEndScenario.java): - - This example demonstrates how to retrieve accessible Vrbo property ids and location content from - SDP DownloadURL API and then get the prices of these properties using the Lodging Quotes API. - -- [ - `AvailabilityCalendarsQuickStartScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/AvailabilityCalendarsQuickStartScenario.java): - - This example demonstrates how to use Availability Calendar api with simple search. - In terms of how to get property ids, you can refer to `QuotesQuickStartScenario.java`. - -### Car - -- [`CarDetailsQuickStartScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/car/CarListingsQuickStartScenario.java): - - This example demonstrates how to search for cars using an airport keyword with filters applied in the Car Listings API. - -- [`CarDetailsQuickStartScenario.java`](src/main/java/com/expediagroup/sdk/xap/examples/scenarios/car/CarDetailsQuickStartScenario.java): - - This example demonstrates how to search for car details using the offerToken obtained from the car listing in the Car Details API. - -We are continuously adding more scenarios to demonstrate the usage of other XAP APIs. - -## Requirements - -- Ensure you have a valid API key and secret from Expedia Group. - Check [Getting started with XAP](https://developers.expediagroup.com/xap/products/xap/set-up/getting-started) - for more info. -- Java 1.8 or higher -- Maven - -## Setup - -1. Clone the repository. -2. Navigate to the project directory `examples`. -3. Run `mvn clean install` to build the project and install the dependencies including the XAP SDK. - -## Running the Examples - -### Run with IntelliJ IDEA -1. Navigate to the example class you want to run -2. Right-click on the class name and select `More Run/Debug` -> `Modify Run Configuration` -3. Check the `Modify options` -> `Add VM options` and add the following VM options: - ``` - -Dcom.expediagroup.xapjavasdk.apikey="{API_KEY}" - -Dcom.expediagroup.xapjavasdk.apisecret="{API_SECRET}" - ``` - Replace `{API_KEY}` and `{API_SECRET}` with your actual API key and secret. - > **Note:** If you are running the examples for Vrbo, you would need the following VM options instead: - > ``` - > -Dcom.expediagroup.xapjavasdk.vrbokey="{VRBO_KEY}" - > -Dcom.expediagroup.xapjavasdk.vrbosecret="{VRBO_SECRET}" - > ``` - > The key you use must be enabled for Vrbo brand. If you are not sure, please reach out to your account manager. -4. Click `OK` and then run the `main` method of the example class. - -### Run with Command Line -Run the following command to run the example class you want to run: -``` -mvn exec:java -Dexec.mainClass="path.to.example.ExampleClassName" \ - -Dcom.expediagroup.xapjavasdk.apikey="{API_KEY}" \ - -Dcom.expediagroup.xapjavasdk.apisecret="{API_SECRET}" -``` -Replace `path.to.example.ExampleClassName` with the full path to the example class you want to run, -and `{API_KEY}` and `{API_SECRET}` with your actual API key and secret. - -> **Note:** If you are running the examples for Vrbo, you should use the following command instead: -> ``` -> mvn exec:java -Dexec.mainClass="path.to.example.ExampleClassName" \ -> -Dcom.expediagroup.xapjavasdk.vrbokey="{VRBO_KEY}" \ -> -Dcom.expediagroup.xapjavasdk.vrbosecret="{VRBO_SECRET}" -> ``` -> The key you use must be enabled for Vrbo brand. If you are not sure, please reach out to your account manager. - -## License - -This project is licensed under the Apache License v2.0 - see the [LICENSE](../LICENSE) for details. \ No newline at end of file diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts new file mode 100644 index 000000000..17290e473 --- /dev/null +++ b/examples/build.gradle.kts @@ -0,0 +1,12 @@ +group = project.property("GROUP_ID") as String + +dependencies { + api(project(":xap-sdk")) + + implementation("com.expediagroup:expediagroup-sdk-transport-okhttp:0.0.4-alpha") + + implementation("org.apache.logging.log4j:log4j-api:2.24.3") + implementation("org.apache.logging.log4j:log4j-slf4j2-impl:2.24.3") + implementation("com.fasterxml.jackson.core:jackson-databind:2.18.3") + implementation("org.apache.commons:commons-lang3:3.17.0") +} diff --git a/examples/pom.xml b/examples/pom.xml deleted file mode 100644 index 0c8e4d50d..000000000 --- a/examples/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - 4.0.0 - - com.expediagroup - xap-java-sdk-examples - 1.0-SNAPSHOT - XAP Java SDK Examples - Expedia Group XAP Java SDK Examples - - - 1.8 - 1.8 - 1.8 - UTF-8 - 1.1.0 - - - - - oss.sonatype.org-snapshot - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - - - - - - com.expediagroup - xap-sdk - ${xap-java-sdk.sdk.version} - - - - org.apache.logging.log4j - log4j-api - 2.24.3 - - - - org.apache.logging.log4j - log4j-slf4j2-impl - 2.24.3 - - - - com.fasterxml.jackson.core - jackson-databind - 2.18.2 - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.6.0 - - google_checks.xml - true - warning - - - - - check - - - - - - - diff --git a/examples/src/main/java/com/expediagroup/sdk/xap/examples/XapSdkDemoTestRun.java b/examples/src/main/java/com/expediagroup/sdk/xap/examples/XapSdkDemoTestRun.java index f2c985fae..270adc9c8 100644 --- a/examples/src/main/java/com/expediagroup/sdk/xap/examples/XapSdkDemoTestRun.java +++ b/examples/src/main/java/com/expediagroup/sdk/xap/examples/XapSdkDemoTestRun.java @@ -1,21 +1,6 @@ -/* - * Copyright (C) 2024 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. - */ - package com.expediagroup.sdk.xap.examples; + import com.expediagroup.sdk.xap.examples.scenarios.car.CarDetailsQuickStartScenario; import com.expediagroup.sdk.xap.examples.scenarios.car.CarListingsQuickStartScenario; import com.expediagroup.sdk.xap.examples.scenarios.lodging.AvailabilityCalendarsQuickStartScenario; @@ -30,46 +15,46 @@ * For reference, see the individual scenarios in the scenarios package. */ public class XapSdkDemoTestRun { - private static final Logger logger = LoggerFactory.getLogger(XapSdkDemoTestRun.class); + private static final Logger logger = LoggerFactory.getLogger(XapSdkDemoTestRun.class); - /** - * Main method. - */ - public static void main(String[] args) { + /** + * Main method. + */ + public static void main(String[] args) { - logger.info( - "============================== Running Lodging Scenarios ============================="); + logger.info( + "============================== Running Lodging Scenarios ============================="); - AvailabilityCalendarsQuickStartScenario availabilityCalendarsQuickStartScenario = - new AvailabilityCalendarsQuickStartScenario(); - availabilityCalendarsQuickStartScenario.run(); + AvailabilityCalendarsQuickStartScenario availabilityCalendarsQuickStartScenario = + new AvailabilityCalendarsQuickStartScenario(); + availabilityCalendarsQuickStartScenario.run(); - ListingsQuickStartScenario listingsQuickStartScenario = new ListingsQuickStartScenario(); - listingsQuickStartScenario.run(); + ListingsQuickStartScenario listingsQuickStartScenario = new ListingsQuickStartScenario(); + listingsQuickStartScenario.run(); - HotelIdsSearchEndToEndScenario hotelIdsSearchEndToEndScenario = - new HotelIdsSearchEndToEndScenario(); - hotelIdsSearchEndToEndScenario.run(); + HotelIdsSearchEndToEndScenario hotelIdsSearchEndToEndScenario = + new HotelIdsSearchEndToEndScenario(); + hotelIdsSearchEndToEndScenario.run(); - VrboPropertySearchEndToEndScenario vrboPropertySearchEndToEndScenario = - new VrboPropertySearchEndToEndScenario(); - vrboPropertySearchEndToEndScenario.run(); + VrboPropertySearchEndToEndScenario vrboPropertySearchEndToEndScenario = + new VrboPropertySearchEndToEndScenario(); + vrboPropertySearchEndToEndScenario.run(); - logger.info( - "=============================== End of Lodging Scenarios =============================="); + logger.info( + "=============================== End of Lodging Scenarios =============================="); - logger.info( - "============================== Running Car Scenarios ============================="); - CarListingsQuickStartScenario carListingsQuickStartScenario = - new CarListingsQuickStartScenario(); + logger.info( + "============================== Running Car Scenarios ============================="); + CarListingsQuickStartScenario carListingsQuickStartScenario = + new CarListingsQuickStartScenario(); - carListingsQuickStartScenario.run(); + carListingsQuickStartScenario.run(); - CarDetailsQuickStartScenario carDetailsQuickStartScenario = new CarDetailsQuickStartScenario(); - carDetailsQuickStartScenario.run(); - logger.info( - "=============================== End of Car Scenarios =============================="); + CarDetailsQuickStartScenario carDetailsQuickStartScenario = new CarDetailsQuickStartScenario(); + carDetailsQuickStartScenario.run(); + logger.info( + "=============================== End of Car Scenarios =============================="); - System.exit(0); - } + System.exit(0); + } } diff --git a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/XapScenario.java b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/XapScenario.java index d28fefb5e..852016cf3 100644 --- a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/XapScenario.java +++ b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/XapScenario.java @@ -1,21 +1,6 @@ -/* - * Copyright (C) 2024 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. - */ - package com.expediagroup.sdk.xap.examples.scenarios; +import com.expediagroup.sdk.core.auth.basic.BasicAuthCredentials; import com.expediagroup.sdk.xap.client.XapClient; /** @@ -23,22 +8,27 @@ */ public interface XapScenario { - String PARTNER_TRANSACTION_ID = "xap-java-sdk-examples"; - - void run(); - - /** - * Create a client. - * - * @return XapClient - */ - default XapClient createClient() { - String key = System.getProperty("com.expediagroup.xapjavasdk.apikey"); - String secret = System.getProperty("com.expediagroup.xapjavasdk.apisecret"); - return XapClient - .builder() - .key(key) - .secret(secret) - .build(); - } + String PARTNER_TRANSACTION_ID = "xap-java-sdk-examples"; + + void run(); + + /** + * Create a client. + * + * @return XapClient + */ + default XapClient createClient() { + String key = System.getProperty("com.expediagroup.xapjavasdk.apikey"); + String secret = System.getProperty("com.expediagroup.xapjavasdk.apisecret"); + + BasicAuthCredentials credentials = new BasicAuthCredentials(key, secret); + + // Or enable OAuth by passing OAuthCredentials instead: + // OAuthCredentials credentials = new OAuthCredentials("api-key", "api-secret"); + + return XapClient + .builder() + .credentials(credentials) + .build(); + } } diff --git a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/car/CarDetailsQuickStartScenario.java b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/car/CarDetailsQuickStartScenario.java index b16c0060a..12d9ec00e 100644 --- a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/car/CarDetailsQuickStartScenario.java +++ b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/car/CarDetailsQuickStartScenario.java @@ -1,6 +1,6 @@ package com.expediagroup.sdk.xap.examples.scenarios.car; -import com.expediagroup.sdk.core.model.Response; +import com.expediagroup.sdk.rest.model.Response; import com.expediagroup.sdk.xap.client.XapClient; import com.expediagroup.sdk.xap.examples.scenarios.XapScenario; import com.expediagroup.sdk.xap.models.CarDetails; @@ -24,225 +24,239 @@ */ public class CarDetailsQuickStartScenario implements XapScenario { - private static final Logger LOGGER = LoggerFactory.getLogger(CarDetailsQuickStartScenario.class); - - /** - * Summary: main function. - */ - public static void main(String[] args) { - new CarListingsQuickStartScenario().run(); - new CarDetailsQuickStartScenario().run(); - System.exit(0); - } - - /** - * Summary: split URL into components. - */ - public static String[] splitUrl(String url) { - String[] parts = url.split("\\?"); - String base = parts[0]; - String query = parts[1]; - - String offerToken = base.substring(base.lastIndexOf("/") + 1); - String[] queryParams = query.split("&"); - String price = queryParams[0].split("=")[1]; - String currency = queryParams[1].split("=")[1]; - - return new String[] {offerToken, price, currency}; - } - - @Override - public void run() { - LOGGER.info("========== Start QuickStartScenario =========="); - - LOGGER.info("========== Car Listing Start =========="); - - // This example demonstrates how to obtain the Car Details Deep Link from the CarListing. - // For information on using car search, refer to - // car/shopping/listings/ListingsQuickStartExample. - List linksList = new ArrayList<>(); - linksList.add(GetCarsListingsOperationParams.Links.AD); - linksList.add(GetCarsListingsOperationParams.Links.WS); - linksList.add(GetCarsListingsOperationParams.Links.WD); - GetCarsListingsOperationParams getCarsListingsOperationParams = - GetCarsListingsOperationParams.builder() - .partnerTransactionId("EWSCar_Automation") - .dropOffAirport("MCO") - .pickupAirport("MCO") - .pickupTime(LocalDateTime.now().plusDays(5)) - .dropOffTime(LocalDateTime.now().plusDays(8)) - .limit(1) - .links(linksList) - .build(); - - XapClient xapClient = createClient(); - GetCarsListingsOperation getCarsListingsOperation = - new GetCarsListingsOperation(getCarsListingsOperationParams); - Response carListingsResponse = xapClient.execute(getCarsListingsOperation); - - LOGGER.info("========== Car Listing Property End =========="); - - // Iterate through the car listings and retrieve the Car Details Deep Link. - LOGGER.info("========== Car Details Start =========="); - Objects.requireNonNull(carListingsResponse.getData().getCars()).forEach(car -> { - if (!car.getLinks().get("ApiDetails").getHref().isEmpty()) { - // Retrieve the Car Details Deep Link from the car listing. - LOGGER.info("Car Details Deep Link: " + car.getLinks().get("ApiDetails").getHref()); - String[] strings = splitUrl(car.getLinks().get("ApiDetails").getHref()); - - // Retrieve the Car Details information using the Car Details Deep Link, which - // includes (offerToken, price, currency) - GetCarDetailsOperationParams getCarDetailsOperationParams = - GetCarDetailsOperationParams.builder().partnerTransactionId("EWSCar_Automation") - .offerToken(strings[0]).price(strings[1]).currency(strings[2]).build(); - - // Execute the operation and get the CarDetailsResponse - LOGGER.info("========== Executing GetCarDetailsOperation =========="); - CarDetailsResponse carDetailsResponse = xapClient.execute( - new GetCarDetailsOperation(getCarDetailsOperationParams)).getData(); - LOGGER.info("========== GetCarDetailsOperation Executed =========="); - - if (carDetailsResponse == null || carDetailsResponse.getLinks() == null) { - throw new IllegalStateException("No car found."); - } - - LOGGER.info("========== Car Properties Start =========="); - - // The CarDetailsResponse contains a transaction ID for troubleshooting - LOGGER.info("Transaction ID: {}", carDetailsResponse.getTransactionId()); - - // List Container for warning messages - if (carDetailsResponse.getWarnings() != null) { - LOGGER.info("Warnings: {}", carDetailsResponse.getWarnings()); - } - - // Details of requested car. - // Details refer to the CarDetails Section table below. - if (carDetailsResponse.getValidFormsOfPayment() != null) { - LOGGER.info("Valid Forms Of Payment: {}", carDetailsResponse.getValidFormsOfPayment()); - } - - // A map of links to other Car APIs. - if (carDetailsResponse.getLinks() != null) { - LOGGER.info("Links: {}", carDetailsResponse.getLinks()); - } - - // Specific information for a car. - CarDetails carDetails = carDetailsResponse.getCarDetails(); - VehicleDetails vehicleDetails = carDetails.getVehicleDetails(); - if (vehicleDetails.getMake() != null) { - //Car manufacturer and model. - LOGGER.info("Make: {}", vehicleDetails.getMake()); - } - - // Car category and type. - LOGGER.info("Car Class: {}", vehicleDetails.getCarClass()); - - // Minimal car door count. - if (vehicleDetails.getMinDoors() != null) { - LOGGER.info("Min Doors: {}", vehicleDetails.getMinDoors()); - } - - // Maximum car door count. - if (vehicleDetails.getMaxDoors() != null) { - LOGGER.info("Max Doors: {}", vehicleDetails.getMaxDoors()); - } - - // Car fuel information. - if (vehicleDetails.getFuelLevel() != null) { - // Fuel level of the car. - LOGGER.info("Fuel Level: {}", vehicleDetails.getFuelLevel()); - } - - // Car category. - LOGGER.info("Car Category: {}", vehicleDetails.getCarCategory()); - - // Car type. - LOGGER.info("Car Type: {}", vehicleDetails.getCarType()); - - // Car transmission and drive. - LOGGER.info("Transmission Drive: {}", vehicleDetails.getTransmissionDrive()); - - // Car fuel type and whether Air Conditioning is included. - LOGGER.info("Fuel AC: {}", vehicleDetails.getFuelAC()); - - // Capacity for car's properties, which include AdultCount, ChildCount, SmallLuggageCount - // and LargeLuggageCount. - if (vehicleDetails.getCapacity() != null) { - LOGGER.info("Capacity: {}", vehicleDetails.getCapacity()); - } - - // Car rental supplier. - LOGGER.info(" : {}", carDetails.getSupplier()); - - // Pickup information - LOGGER.info("Pickup Details: {}", carDetails.getPickupDetails()); - - // Drop off information, include drop off date time and drop off location information. - LOGGER.info("Drop Off Details: {}", carDetails.getDropOffDetails()); - - // The rate information for a car product. - LOGGER.info("Rate Details: {}", carDetails.getRateDetails()); - - // Base price per rate period. - LOGGER.info("Price: {}", carDetails.getPrice()); - - // List of TaxesAndFees Details. - if (carDetails.getTaxesAndFeesDetails() != null) { - LOGGER.info("Taxes And Fees Details: {}", carDetails.getTaxesAndFeesDetails()); - } - - // List of ExtraFeesDetails - if (carDetails.getExtraFeesDetails() != null) { - LOGGER.info("Extra Fees Details: {}", carDetails.getExtraFeesDetails()); - } - - // ReferencePrice is the totalPrice for the comparable standalone car, when there is - // a discounted car or need to show strike through pricing. - if (carDetails.getReferencePrice() != null) { - LOGGER.info("Reference Price: {}", carDetails.getReferencePrice()); - } - - // List of additional fees including both mandatory and optional fees such as young driver - // fee/drop off fee /CollisionDamageWaiver. - if (carDetails.getAdditionalFees() != null) { - LOGGER.info("Additional Fees: {}", carDetails.getAdditionalFees()); - } - - // Description and costs of any optional special equipment that may be rented with the car. - if (carDetails.getSpecialEquipments() != null) { - LOGGER.info("Special Equipments: {}", carDetails.getSpecialEquipments()); - } - - // Limitations that are part of this rental agreement. - if (carDetails.getRentalLimits() != null) { - LOGGER.info("Rental Limits: {}", carDetails.getRentalLimits()); - } - - // Cancellation Policy Container. - LOGGER.info("Cancellation Policy: {}", carDetails.getCancellationPolicy()); - - // Container for no show penalty - if (carDetails.getNoShowPenalty() != null) { - LOGGER.info("No Show Penalty: {}", carDetails.getNoShowPenalty()); - } - - // A list of policies that apply to this car rental. - if (carDetails.getCarPolicies() != null) { - LOGGER.info("Policies: {}", carDetails.getCarPolicies()); - } - - // List of image resources of the car product. - if (carDetails.getImages() != null) { - LOGGER.info("Images: {}", carDetails.getImages()); - } - - LOGGER.info("========== Property End =========="); - } - - }); + private static final Logger LOGGER = LoggerFactory.getLogger(CarDetailsQuickStartScenario.class); + + /** + * Summary: main function. + */ + public static void main(String[] args) { + new CarListingsQuickStartScenario().run(); + new CarDetailsQuickStartScenario().run(); + System.exit(0); + } + + /** + * Summary: split URL into components. + */ + public static String[] splitUrl(String url) { + String[] parts = url.split("\\?"); + String base = parts[0]; + String query = parts[1]; + + String offerToken = base.substring(base.lastIndexOf("/") + 1); + String[] queryParams = query.split("&"); + String price = queryParams[0].split("=")[1]; + String currency = queryParams[1].split("=")[1]; + + return new String[] {offerToken, price, currency}; + } + + @Override + public void run() { + LOGGER.info("========== Start QuickStartScenario =========="); + + LOGGER.info("========== Car Listing Start =========="); + + // This example demonstrates how to obtain the Car Details Deep Link from the CarListing. + // For information on using car search, refer to + // car/shopping/listings/ListingsQuickStartExample. + List linksList = new ArrayList<>(); + linksList.add(GetCarsListingsOperationParams.Links.AD); + linksList.add(GetCarsListingsOperationParams.Links.WS); + linksList.add(GetCarsListingsOperationParams.Links.WD); + GetCarsListingsOperationParams getCarsListingsOperationParams = + GetCarsListingsOperationParams.builder() + .partnerTransactionId("EWSCar_Automation") + .dropOffAirport("MCO") + .pickupAirport("MCO") + .pickupTime( + LocalDateTime.now() + .withNano(0) + .withSecond(0) + .withHour(10) + .plusDays(10) + .plusMonths(1) + ) + .dropOffTime( + LocalDateTime.now() + .withNano(0) + .withSecond(0) + .withHour(10) + .plusDays(15) + .plusMonths(1) + ) + .limit(1) + .links(linksList) + .build(); + + XapClient xapClient = createClient(); + GetCarsListingsOperation getCarsListingsOperation = + new GetCarsListingsOperation(getCarsListingsOperationParams); + Response carListingsResponse = xapClient.execute(getCarsListingsOperation); + + LOGGER.info("========== Car Listing Property End =========="); + + // Iterate through the car listings and retrieve the Car Details Deep Link. + LOGGER.info("========== Car Details Start =========="); + Objects.requireNonNull(carListingsResponse.getData().getCars()).forEach(car -> { + if (!car.getLinks().get("ApiDetails").getHref().isEmpty()) { + // Retrieve the Car Details Deep Link from the car listing. + LOGGER.info("Car Details Deep Link: " + car.getLinks().get("ApiDetails").getHref()); + String[] strings = splitUrl(car.getLinks().get("ApiDetails").getHref()); + + // Retrieve the Car Details information using the Car Details Deep Link, which + // includes (offerToken, price, currency) + GetCarDetailsOperationParams getCarDetailsOperationParams = + GetCarDetailsOperationParams.builder().partnerTransactionId("EWSCar_Automation") + .offerToken(strings[0]).price(strings[1]).currency(strings[2]).build(); + + // Execute the operation and get the CarDetailsResponse + LOGGER.info("========== Executing GetCarDetailsOperation =========="); + CarDetailsResponse carDetailsResponse = xapClient.execute( + new GetCarDetailsOperation(getCarDetailsOperationParams)).getData(); + LOGGER.info("========== GetCarDetailsOperation Executed =========="); + + if (carDetailsResponse == null || carDetailsResponse.getLinks() == null) { + throw new IllegalStateException("No car found."); + } + + LOGGER.info("========== Car Properties Start =========="); + + // The CarDetailsResponse contains a transaction ID for troubleshooting + LOGGER.info("Transaction ID: {}", carDetailsResponse.getTransactionId()); + + // List Container for warning messages + if (carDetailsResponse.getWarnings() != null) { + LOGGER.info("Warnings: {}", carDetailsResponse.getWarnings()); + } + + // Details of requested car. + // Details refer to the CarDetails Section table below. + if (carDetailsResponse.getValidFormsOfPayment() != null) { + LOGGER.info("Valid Forms Of Payment: {}", carDetailsResponse.getValidFormsOfPayment()); + } + + // A map of links to other Car APIs. + if (carDetailsResponse.getLinks() != null) { + LOGGER.info("Links: {}", carDetailsResponse.getLinks()); + } + + // Specific information for a car. + CarDetails carDetails = carDetailsResponse.getCarDetails(); + VehicleDetails vehicleDetails = carDetails.getVehicleDetails(); + if (vehicleDetails.getMake() != null) { + //Car manufacturer and model. + LOGGER.info("Make: {}", vehicleDetails.getMake()); + } + + // Car category and type. + LOGGER.info("Car Class: {}", vehicleDetails.getCarClass()); + + // Minimal car door count. + if (vehicleDetails.getMinDoors() != null) { + LOGGER.info("Min Doors: {}", vehicleDetails.getMinDoors()); + } + + // Maximum car door count. + if (vehicleDetails.getMaxDoors() != null) { + LOGGER.info("Max Doors: {}", vehicleDetails.getMaxDoors()); + } + + // Car fuel information. + if (vehicleDetails.getFuelLevel() != null) { + // Fuel level of the car. + LOGGER.info("Fuel Level: {}", vehicleDetails.getFuelLevel()); + } + + // Car category. + LOGGER.info("Car Category: {}", vehicleDetails.getCarCategory()); + + // Car type. + LOGGER.info("Car Type: {}", vehicleDetails.getCarType()); + + // Car transmission and drive. + LOGGER.info("Transmission Drive: {}", vehicleDetails.getTransmissionDrive()); + + // Car fuel type and whether Air Conditioning is included. + LOGGER.info("Fuel AC: {}", vehicleDetails.getFuelAC()); + + // Capacity for car's properties, which include AdultCount, ChildCount, SmallLuggageCount + // and LargeLuggageCount. + if (vehicleDetails.getCapacity() != null) { + LOGGER.info("Capacity: {}", vehicleDetails.getCapacity()); + } + + // Car rental supplier. + LOGGER.info(" : {}", carDetails.getSupplier()); + + // Pickup information + LOGGER.info("Pickup Details: {}", carDetails.getPickupDetails()); + + // Drop off information, include drop off date time and drop off location information. + LOGGER.info("Drop Off Details: {}", carDetails.getDropOffDetails()); + + // The rate information for a car product. + LOGGER.info("Rate Details: {}", carDetails.getRateDetails()); + + // Base price per rate period. + LOGGER.info("Price: {}", carDetails.getPrice()); + + // List of TaxesAndFees Details. + if (carDetails.getTaxesAndFeesDetails() != null) { + LOGGER.info("Taxes And Fees Details: {}", carDetails.getTaxesAndFeesDetails()); + } + + // List of ExtraFeesDetails + if (carDetails.getExtraFeesDetails() != null) { + LOGGER.info("Extra Fees Details: {}", carDetails.getExtraFeesDetails()); + } + + // ReferencePrice is the totalPrice for the comparable standalone car, when there is + // a discounted car or need to show strike through pricing. + if (carDetails.getReferencePrice() != null) { + LOGGER.info("Reference Price: {}", carDetails.getReferencePrice()); + } + + // List of additional fees including both mandatory and optional fees such as young driver + // fee/drop off fee /CollisionDamageWaiver. + if (carDetails.getAdditionalFees() != null) { + LOGGER.info("Additional Fees: {}", carDetails.getAdditionalFees()); + } + + // Description and costs of any optional special equipment that may be rented with the car. + if (carDetails.getSpecialEquipments() != null) { + LOGGER.info("Special Equipments: {}", carDetails.getSpecialEquipments()); + } + + // Limitations that are part of this rental agreement. + if (carDetails.getRentalLimits() != null) { + LOGGER.info("Rental Limits: {}", carDetails.getRentalLimits()); + } + + // Cancellation Policy Container. + LOGGER.info("Cancellation Policy: {}", carDetails.getCancellationPolicy()); + + // Container for no show penalty + if (carDetails.getNoShowPenalty() != null) { + LOGGER.info("No Show Penalty: {}", carDetails.getNoShowPenalty()); + } + + // A list of policies that apply to this car rental. + if (carDetails.getCarPolicies() != null) { + LOGGER.info("Policies: {}", carDetails.getCarPolicies()); + } + + // List of image resources of the car product. + if (carDetails.getImages() != null) { + LOGGER.info("Images: {}", carDetails.getImages()); + } + + LOGGER.info("========== Property End =========="); + } + + }); - LOGGER.info("========== End QuickStartExample =========="); - } + LOGGER.info("========== End QuickStartExample =========="); + } } diff --git a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/car/CarListingsQuickStartScenario.java b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/car/CarListingsQuickStartScenario.java index 28532acd1..4851f2d45 100644 --- a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/car/CarListingsQuickStartScenario.java +++ b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/car/CarListingsQuickStartScenario.java @@ -17,140 +17,160 @@ */ public class CarListingsQuickStartScenario implements XapScenario { - private static final Logger LOGGER = LoggerFactory.getLogger(CarListingsQuickStartScenario.class); - - /** - * Summary: main function. - */ - public static void main(String[] args) { - new CarListingsQuickStartScenario().run(); - System.exit(0); - } - - @Override - public void run() { - LOGGER.info( - "========================= Running CarListingsQuickStartScenario ========================"); - - LOGGER.info( - "======================== Executing GetCarsListingsOperation ======================="); - // This example will search for properties based on the following criteria: - // 1. The pickup airport is MCO, and the drop-off airport is MCO; - // 2. The pickup time is "2025-01-15T11:00", and the drop-off time is "2025-01-19T11:00"; - // 3. The results should include API details, web search, and web details link; - // 4. Limit the results to 5; - - // Create a list to store the types of links to be returned. - // The added link types include(API details link, Web search link, and Web details link). - List linksList = new ArrayList<>(); - linksList.add(GetCarsListingsOperationParams.Links.AD); - linksList.add(GetCarsListingsOperationParams.Links.WS); - linksList.add(GetCarsListingsOperationParams.Links.WD); - - GetCarsListingsOperationParams getCarsListingsOperationParams = - GetCarsListingsOperationParams.builder().partnerTransactionId("EWSCar_Automation") - //Three letter code for the airport at which the customer would like to pick up the car. - //Supported values: standard 3 letter IATA Airport Code. - //Cannot coexist with other pickup parameters, only one pickup parameter is allowed per - //request. - .pickupAirport("MCO") - //Three letter code for the airport at which the customer would like to drop off the - //car. - //Supported values: standard 3 letter IATA Airport Code. - //Cannot coexist with other drop off parameters, only one drop off parameter is allowed - //per request. - //If no drop off location is specified, it is assumed that the customer will be dropping - //the car off at the same location at which they picked it up. - .dropOffAirport("MCO") - //Requested car pickup date and time. - //Date should be ISO8601 Date format.The supported search window is today to 330 days in - //the future. - //(Note that each rental counter has different hours of operation. If you select a time - //in the middle of the night there may be no inventory available as all locations may be - //closed.) - .pickupTime(LocalDateTime.now().plusDays(5)) - //Requested car drop off date and time. - //Date should be ISO8601 Date format.The supported search window is today to 330 days in - //the future. - //The drop-off datetime should occur at least 2 hours after the pickup datetime. - .dropOffTime(LocalDateTime.now().plusDays(8)) - //The maximum number of search results that will be returned by the query. - .limit(5).links(linksList).build(); - XapClient xapClient = createClient(); - - // Execute the operation and get the CarListingsResponse - CarListingsResponse carListingsResponse = - xapClient.execute(new GetCarsListingsOperation(getCarsListingsOperationParams)).getData(); - LOGGER.info( - "======================== GetCarsListingsOperation Executed ========================"); - - if (carListingsResponse == null || carListingsResponse.getCars() == null - || carListingsResponse.getCars().isEmpty()) { - throw new IllegalStateException("No cars found."); + private static final Logger LOGGER = LoggerFactory.getLogger(CarListingsQuickStartScenario.class); + + /** + * Summary: main function. + */ + public static void main(String[] args) { + new CarListingsQuickStartScenario().run(); + System.exit(0); } - // The CarListingsResponse contains a transaction ID for troubleshooting - LOGGER.info("Transaction ID: {}", carListingsResponse.getTransactionId()); - // To get the total number of car found - LOGGER.info("Car Count: {}", carListingsResponse.getCarCount()); - - // To access the properties, iterate through the list of car properties - carListingsResponse.getCars().forEach(car -> { - LOGGER.info("======================== Car Properties Start ========================"); - - // Uniquely identifies a Car Offer. - LOGGER.info("Car Id: {}", car.getId()); - - // Specific information for a car. - LOGGER.info("Car VehicleDetails: {}", car.getVehicleDetails()); - - // The supplier of the car being offered. - LOGGER.info("Car Supplier: {}", car.getSupplier()); - - // Get Pickup information of the car. - LOGGER.info("Pick up Details: {}", car.getPickupDetails()); - - // Get Drop off information of the car. - LOGGER.info("Drop Off Details: {}", car.getDropOffDetails()); - - // Get the API details link, web search link, and web details link from the links collection. - if (!car.getLinks().isEmpty()) { - if (car.getLinks().get("ApiDetails") != null) { - LOGGER.info("ApiDetails Link: {}", car.getLinks().get("ApiDetails")); - } - if (car.getLinks().get("WebSearch") != null) { - LOGGER.info("WebSearch Link: {}", car.getLinks().get("WebSearch")); + @Override + public void run() { + LOGGER.info( + "========================= Running CarListingsQuickStartScenario ========================"); + + LOGGER.info( + "======================== Executing GetCarsListingsOperation ======================="); + // This example will search for properties based on the following criteria: + // 1. The pickup airport is MCO, and the drop-off airport is MCO; + // 2. The pickup time is "2025-01-15T11:00", and the drop-off time is "2025-01-19T11:00"; + // 3. The results should include API details, web search, and web details link; + // 4. Limit the results to 5; + + // Create a list to store the types of links to be returned. + // The added link types include(API details link, Web search link, and Web details link). + List linksList = new ArrayList<>(); + linksList.add(GetCarsListingsOperationParams.Links.AD); + linksList.add(GetCarsListingsOperationParams.Links.WS); + linksList.add(GetCarsListingsOperationParams.Links.WD); + + GetCarsListingsOperationParams getCarsListingsOperationParams = + GetCarsListingsOperationParams.builder().partnerTransactionId("EWSCar_Automation") + //Three letter code for the airport at which the customer would like to pick up the car. + //Supported values: standard 3 letter IATA Airport Code. + //Cannot coexist with other pickup parameters, only one pickup parameter is allowed per + //request. + .pickupAirport("MCO") + //Three letter code for the airport at which the customer would like to drop off the + //car. + //Supported values: standard 3 letter IATA Airport Code. + //Cannot coexist with other drop off parameters, only one drop off parameter is allowed + //per request. + //If no drop off location is specified, it is assumed that the customer will be dropping + //the car off at the same location at which they picked it up. + .dropOffAirport("MCO") + //Requested car pickup date and time. + //Date should be ISO8601 Date format.The supported search window is today to 330 days in + //the future. + //(Note that each rental counter has different hours of operation. If you select a time + //in the middle of the night there may be no inventory available as all locations may be + //closed.) + .pickupTime( + LocalDateTime.now() + .withNano(0) + .withSecond(0) + .withHour(10) + .plusDays(10) + .plusMonths(1) + ) + //Requested car drop off date and time. + //Date should be ISO8601 Date format.The supported search window is today to 330 days in + //the future. + //The drop-off datetime should occur at least 2 hours after the pickup datetime. + .dropOffTime( + LocalDateTime.now() + .withNano(0) + .withSecond(0) + .withHour(10) + .plusDays(15) + .plusMonths(1) + ) + .pickupRadius(10) + .dropOffRadius(10) + //The maximum number of search results that will be returned by the query. + .limit(5) + .partnerTransactionId("BestTravel-123456-798101112") + .links(linksList) + .build(); + + XapClient xapClient = createClient(); + + // Execute the operation and get the CarListingsResponse + CarListingsResponse carListingsResponse = + xapClient.execute(new GetCarsListingsOperation(getCarsListingsOperationParams)).getData(); + LOGGER.info( + "======================== GetCarsListingsOperation Executed ========================"); + + if (carListingsResponse == null || carListingsResponse.getCars() == null + || carListingsResponse.getCars().isEmpty()) { + throw new IllegalStateException("No cars found."); } - if (car.getLinks().get("WebDetails") != null) { - LOGGER.info("WebDetails Link: {}", car.getLinks().get("WebDetails")); - } - } - - // The rate detail information for a car offer. - if (car.getRateDetails() != null) { - LOGGER.info("Rate Details: {}", car.getRateDetails()); - } - - // Get the detailed pricing information for the rental of the car offer, - LOGGER.info("Car Price: {}", car.getPrice()); - - // Get a list of additional fees, including both mandatory and optional fees. - if (car.getAdditionalFees() != null) { - LOGGER.info("Additional Fees: {}", car.getAdditionalFees()); - } - - // Get the cancellation policy for the car offer, - LOGGER.info("Cancellation Policy: {}", car.getCancellationPolicy()); - - // Container for no show penalty element. - if (car.getNoShowPenalty() != null) { - LOGGER.info("No Show Penalty: {}", car.getNoShowPenalty()); - } - - LOGGER.info("======================== Property End ========================"); - }); - LOGGER.info( - "======================== End CarListingsQuickStartScenario ========================"); - } + // The CarListingsResponse contains a transaction ID for troubleshooting + LOGGER.info("Transaction ID: {}", carListingsResponse.getTransactionId()); + // To get the total number of car found + LOGGER.info("Car Count: {}", carListingsResponse.getCarCount()); + + // To access the properties, iterate through the list of car properties + carListingsResponse.getCars().forEach(car -> { + LOGGER.info("======================== Car Properties Start ========================"); + + // Uniquely identifies a Car Offer. + LOGGER.info("Car Id: {}", car.getId()); + + // Specific information for a car. + LOGGER.info("Car VehicleDetails: {}", car.getVehicleDetails()); + + // The supplier of the car being offered. + LOGGER.info("Car Supplier: {}", car.getSupplier()); + + // Get Pickup information of the car. + LOGGER.info("Pick up Details: {}", car.getPickupDetails()); + + // Get Drop off information of the car. + LOGGER.info("Drop Off Details: {}", car.getDropOffDetails()); + + // Get the API details link, web search link, and web details link from the links collection. + if (!car.getLinks().isEmpty()) { + if (car.getLinks().get("ApiDetails") != null) { + LOGGER.info("ApiDetails Link: {}", car.getLinks().get("ApiDetails")); + } + if (car.getLinks().get("WebSearch") != null) { + LOGGER.info("WebSearch Link: {}", car.getLinks().get("WebSearch")); + } + if (car.getLinks().get("WebDetails") != null) { + LOGGER.info("WebDetails Link: {}", car.getLinks().get("WebDetails")); + } + } + + // The rate detail information for a car offer. + if (car.getRateDetails() != null) { + LOGGER.info("Rate Details: {}", car.getRateDetails()); + } + + // Get the detailed pricing information for the rental of the car offer, + LOGGER.info("Car Price: {}", car.getPrice()); + + + // Get a list of additional fees, including both mandatory and optional fees. + if (car.getAdditionalFees() != null) { + LOGGER.info("Additional Fees: {}", car.getAdditionalFees()); + } + + // Get the cancellation policy for the car offer, + LOGGER.info("Cancellation Policy: {}", car.getCancellationPolicy()); + + // Container for no show penalty element. + if (car.getNoShowPenalty() != null) { + LOGGER.info("No Show Penalty: {}", car.getNoShowPenalty()); + } + + LOGGER.info("======================== Property End ========================"); + }); + LOGGER.info( + "======================== End CarListingsQuickStartScenario ========================"); + } } diff --git a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/AvailabilityCalendarsQuickStartScenario.java b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/AvailabilityCalendarsQuickStartScenario.java index b439fdb36..a3fe7f9e1 100644 --- a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/AvailabilityCalendarsQuickStartScenario.java +++ b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/AvailabilityCalendarsQuickStartScenario.java @@ -1,21 +1,6 @@ -/* - * Copyright (C) 2024 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. - */ - package com.expediagroup.sdk.xap.examples.scenarios.lodging; + import com.expediagroup.sdk.xap.client.XapClient; import com.expediagroup.sdk.xap.models.AvailabilityCalendarResponse; import com.expediagroup.sdk.xap.operations.GetLodgingAvailabilityCalendarsOperation; @@ -33,77 +18,77 @@ */ public class AvailabilityCalendarsQuickStartScenario implements VrboScenario { - private static final Logger LOGGER = - LoggerFactory.getLogger(AvailabilityCalendarsQuickStartScenario.class); - - public static void main(String[] args) { - new AvailabilityCalendarsQuickStartScenario().run(); - System.exit(0); - } - - @Override - public void run() { - // This example returns the availability of each day for a range of dates for given Expedia - // lodging properties. - - LOGGER.info( - "=================== Running AvailabilityCalendarsQuickStartScenario ==================="); - - LOGGER.info( - "================= Executing GetLodgingAvailabilityCalendars Operation ================"); - - - // Build the query parameters with GetLodgingAvailabilityCalendarsOperationParams - GetLodgingAvailabilityCalendarsOperationParams availabilityCalendarsOperationParams = - GetLodgingAvailabilityCalendarsOperationParams.builder() - .partnerTransactionId(PARTNER_TRANSACTION_ID) - // Set of Expedia Property IDs. - .propertyIds(new HashSet<>(Arrays.asList("87704892", "36960201"))) - .build(); - - XapClient xapClient = createClient(); - - // Execute the operation and get the AvailabilityCalendarsResponse - AvailabilityCalendarResponse availabilityCalendarResponse = - xapClient.execute(new GetLodgingAvailabilityCalendarsOperation( - availabilityCalendarsOperationParams)).getData(); - - // If you want to use the async method, you can use the following code: - // --------------------------------------------------------------- - // CompletableFuture> completableFuture = - // xapClient.executeAsync( - // new GetLodgingAvailabilityCalendarsOperation(availabilityCalendarsOperationParams)); - // completableFuture.thenAccept(availCalendarResponse -> { - // // Your code here - // }); - // --------------------------------------------------------------- - - LOGGER.info( - "================== GetLodgingAvailabilityCalendarsOperation Executed ================="); - - if (availabilityCalendarResponse == null - || availabilityCalendarResponse.getAvailabilityCalendars() == null - || availabilityCalendarResponse.getAvailabilityCalendars().isEmpty()) { - throw new IllegalStateException("No properties found."); - } - - // The AvailabilityCalendarsResponse contains a transaction ID for troubleshooting - LOGGER.info("Transaction ID: {}", availabilityCalendarResponse.getTransactionId()); - - // To access the properties, iterate through the list of properties - availabilityCalendarResponse.getAvailabilityCalendars().forEach(availCalendar -> { - LOGGER.info("========== Property:{} Start ==========", availCalendar.getPropertyId()); + private static final Logger LOGGER = + LoggerFactory.getLogger(AvailabilityCalendarsQuickStartScenario.class); - // Availability of property: 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). - LOGGER.info("Availability: {}", availCalendar.getAvailability()); - - LOGGER.info( - "==================================== Property End ==================================="); + public static void main(String[] args) { + new AvailabilityCalendarsQuickStartScenario().run(); + System.exit(0); + } - LOGGER.info( - "===================== End AvailabilityCalendarsQuickStartScenario ===================="); - }); - } + @Override + public void run() { + // This example returns the availability of each day for a range of dates for given Expedia + // lodging properties. + + LOGGER.info( + "=================== Running AvailabilityCalendarsQuickStartScenario ==================="); + + LOGGER.info( + "================= Executing GetLodgingAvailabilityCalendars Operation ================"); + + + // Build the query parameters with GetLodgingAvailabilityCalendarsOperationParams + GetLodgingAvailabilityCalendarsOperationParams availabilityCalendarsOperationParams = + GetLodgingAvailabilityCalendarsOperationParams.builder() + .partnerTransactionId(PARTNER_TRANSACTION_ID) + // Set of Expedia Property IDs. + .propertyIds(new HashSet<>(Arrays.asList("87704892", "36960201"))) + .build(); + + XapClient xapClient = createClient(); + + // Execute the operation and get the AvailabilityCalendarsResponse + AvailabilityCalendarResponse availabilityCalendarResponse = + xapClient.execute(new GetLodgingAvailabilityCalendarsOperation( + availabilityCalendarsOperationParams)).getData(); + + // If you want to use the async method, you can use the following code: + // --------------------------------------------------------------- + // CompletableFuture> completableFuture = + // xapClient.executeAsync( + // new GetLodgingAvailabilityCalendarsOperation(availabilityCalendarsOperationParams)); + // completableFuture.thenAccept(availCalendarResponse -> { + // // Your code here + // }); + // --------------------------------------------------------------- + + LOGGER.info( + "================== GetLodgingAvailabilityCalendarsOperation Executed ================="); + + if (availabilityCalendarResponse == null + || availabilityCalendarResponse.getAvailabilityCalendars() == null + || availabilityCalendarResponse.getAvailabilityCalendars().isEmpty()) { + throw new IllegalStateException("No properties found."); + } + + // The AvailabilityCalendarsResponse contains a transaction ID for troubleshooting + LOGGER.info("Transaction ID: {}", availabilityCalendarResponse.getTransactionId()); + + // To access the properties, iterate through the list of properties + availabilityCalendarResponse.getAvailabilityCalendars().forEach(availCalendar -> { + LOGGER.info("========== Property:{} Start ==========", availCalendar.getPropertyId()); + + // Availability of property: 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). + LOGGER.info("Availability: {}", availCalendar.getAvailability()); + + LOGGER.info( + "==================================== Property End ==================================="); + + LOGGER.info( + "===================== End AvailabilityCalendarsQuickStartScenario ===================="); + }); + } } diff --git a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/HotelIdsSearchEndToEndScenario.java b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/HotelIdsSearchEndToEndScenario.java index 168adfb3d..e055888f1 100644 --- a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/HotelIdsSearchEndToEndScenario.java +++ b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/HotelIdsSearchEndToEndScenario.java @@ -1,22 +1,7 @@ -/* - * Copyright (C) 2024 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. - */ - package com.expediagroup.sdk.xap.examples.scenarios.lodging; -import com.expediagroup.sdk.core.model.Response; + +import com.expediagroup.sdk.rest.model.Response; import com.expediagroup.sdk.xap.client.XapClient; import com.expediagroup.sdk.xap.examples.scenarios.XapScenario; import com.expediagroup.sdk.xap.models.Hotel; @@ -37,10 +22,8 @@ import java.time.LocalDate; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import org.apache.commons.lang3.StringUtils; @@ -56,149 +39,149 @@ */ public class HotelIdsSearchEndToEndScenario implements XapScenario { - private final XapClient client = createClient(); + private final XapClient client = createClient(); - private static final Logger LOGGER = - LoggerFactory.getLogger(HotelIdsSearchEndToEndScenario.class); + private static final Logger LOGGER = + LoggerFactory.getLogger(HotelIdsSearchEndToEndScenario.class); - /** - * This field limits the number of line to read from the SDP DownloadURL API Listings file to - * reduce time to run the example. - * If the first 20 properties from the file are not accessible OR available when you run this - * example, it may end with "No accessible property ids found." OR NO_RESULT_FOUND. In that case, - * you can adjust the property count to get more properties. - */ - private static final int SAMPLE_ITEMS_RESTRICTION = 20; + /** + * This field limits the number of line to read from the SDP DownloadURL API Listings file to + * reduce time to run the example. + * If the first 20 properties from the file are not accessible OR available when you run this + * example, it may end with "No accessible property ids found." OR NO_RESULT_FOUND. In that case, + * you can adjust the property count to get more properties. + */ + private static final int SAMPLE_ITEMS_RESTRICTION = 20; - public static void main(String[] args) { - new HotelIdsSearchEndToEndScenario().run(); - System.exit(0); - } + public static void main(String[] args) { + new HotelIdsSearchEndToEndScenario().run(); + System.exit(0); + } - @Override - public void run() { - LOGGER.info( - "======================== Running HotelIdsSearchEndToEndScenario ======================="); + @Override + public void run() { + LOGGER.info( + "======================== Running HotelIdsSearchEndToEndScenario ======================="); - List propertyIds = getPropertyIdsFromDownloadUrl(); - HotelListingsResponse hotelListingsResponse = getPropertiesFromLodgingListings(propertyIds); - displayResult(hotelListingsResponse); + List propertyIds = getPropertyIdsFromDownloadUrl(); + HotelListingsResponse hotelListingsResponse = getPropertiesFromLodgingListings(propertyIds); + displayResult(hotelListingsResponse); - LOGGER.info( - "========================== End HotelIdsSearchEndToEndScenario ========================="); - } + LOGGER.info( + "========================== End HotelIdsSearchEndToEndScenario ========================="); + } - /** - * Retrieve accessible property ids from SDP DownloadURL API. - * - * @return property ids - */ - private List getPropertyIdsFromDownloadUrl() { - LOGGER.info( - "==================== Executing Step I: getPropertyIdsFromDownloadUrl ==================="); + /** + * Retrieve accessible property ids from SDP DownloadURL API. + * + * @return property ids + */ + private List getPropertyIdsFromDownloadUrl() { + LOGGER.info( + "==================== Executing Step I: getPropertyIdsFromDownloadUrl ==================="); - GetFeedDownloadUrlOperationParams getPropertyIdListParams = - GetFeedDownloadUrlOperationParams.builder() - // Use the type LISTINGS to get the list of accessible property ids. - .type(GetFeedDownloadUrlOperationParams.Type.LISTINGS) - // Without any filters, this operation will return the information of all lodging - // properties in en_US by default. - .build(); + GetFeedDownloadUrlOperationParams getPropertyIdListParams = + GetFeedDownloadUrlOperationParams.builder() + // Use the type LISTINGS to get the list of accessible property ids. + .type(GetFeedDownloadUrlOperationParams.Type.LISTINGS) + // Without any filters, this operation will return the information of all lodging + // properties in en_US by default. + .build(); - Response downloadUrlListingsResponse = - client.execute(new GetFeedDownloadUrlOperation(getPropertyIdListParams)); + Response downloadUrlListingsResponse = + client.execute(new GetFeedDownloadUrlOperation(getPropertyIdListParams)); - if (downloadUrlListingsResponse.getData() == null - || downloadUrlListingsResponse.getData().getBestMatchedFile() == null) { - throw new IllegalStateException("No listings file found"); - } + if (downloadUrlListingsResponse.getData() == null + || downloadUrlListingsResponse.getData().getBestMatchedFile() == null) { + throw new IllegalStateException("No listings file found"); + } - // The download URL points to a zip file containing various jsonl files. - // Each line in the jsonl files contains a json object representing a property. - // For demonstration purposes, we will only read a few properties from the file without - // downloading the entire file. - String listingsDownloadUrl = downloadUrlListingsResponse.getData() - .getBestMatchedFile() - .getDownloadUrl(); - LOGGER.info("Listings Download URL: {}", listingsDownloadUrl); + // The download URL points to a zip file containing various jsonl files. + // Each line in the jsonl files contains a json object representing a property. + // For demonstration purposes, we will only read a few properties from the file without + // downloading the entire file. + String listingsDownloadUrl = downloadUrlListingsResponse.getData() + .getBestMatchedFile() + .getDownloadUrl(); + LOGGER.info("Listings Download URL: {}", listingsDownloadUrl); - // Read property ids from the file. - List propertyIds = getPropertyIdsFromListingsFile(listingsDownloadUrl); + // Read property ids from the file. + List propertyIds = getPropertyIdsFromListingsFile(listingsDownloadUrl); - if (propertyIds.isEmpty()) { - throw new IllegalStateException("No accessible property ids found."); - } - LOGGER.info("Accessible Property Ids: {}", propertyIds); + if (propertyIds.isEmpty()) { + throw new IllegalStateException("No accessible property ids found."); + } + LOGGER.info("Accessible Property Ids: {}", propertyIds); - LOGGER.info( - "==================== Step I: getPropertyIdsFromDownloadUrl Executed ===================="); - return propertyIds; - } + LOGGER.info( + "==================== Step I: getPropertyIdsFromDownloadUrl Executed ===================="); + return propertyIds; + } - /** - * Get prices of the properties using the Lodging Listings API. - * - * @param propertyIds The property ids to get the prices. - * @return The response of the Lodging Listings API. - */ - private HotelListingsResponse getPropertiesFromLodgingListings(List propertyIds) { - LOGGER.info( - "================ Step II: Executing getPropertiesFromLodgingListings ==============="); + /** + * Get prices of the properties using the Lodging Listings API. + * + * @param propertyIds The property ids to get the prices. + * @return The response of the Lodging Listings API. + */ + private HotelListingsResponse getPropertiesFromLodgingListings(List propertyIds) { + LOGGER.info( + "================ Step II: Executing getPropertiesFromLodgingListings ==============="); - GetLodgingListingsOperationParams getLodgingListingsOperationParams = - GetLodgingListingsOperationParams.builder() - .partnerTransactionId(PARTNER_TRANSACTION_ID) - // Use the property ids read from the file - .ecomHotelIds(new HashSet<>(propertyIds)) - // The links to return, WEB includes WS (Web Search Result Page) - // and WD (Web Details Page) - .links(Collections.singletonList(GetLodgingListingsOperationParams.Links.WEB)) - // Check-in 5 days from now - .checkIn(LocalDate.now().plusDays(5)) - // Check-out 10 days from now - .checkOut(LocalDate.now().plusDays(10)) - // Filter the properties that are available only - .availOnly(true) - // Use the default occupancy: 2 adults in one room - .build(); + GetLodgingListingsOperationParams getLodgingListingsOperationParams = + GetLodgingListingsOperationParams.builder() + .partnerTransactionId(PARTNER_TRANSACTION_ID) + // Use the property ids read from the file + .ecomHotelIds(new HashSet<>(propertyIds)) + // The links to return, WEB includes WS (Web Search Result Page) + // and WD (Web Details Page) + .links(Collections.singletonList(GetLodgingListingsOperationParams.Links.WEB)) + // Check-in 5 days from now + .checkIn(LocalDate.now().plusDays(5)) + // Check-out 10 days from now + .checkOut(LocalDate.now().plusDays(10)) + // Filter the properties that are available only + .availOnly(true) + // Use the default occupancy: 2 adults in one room + .build(); - HotelListingsResponse hotelListingsResponse = - client.execute(new GetLodgingListingsOperation(getLodgingListingsOperationParams)) - .getData(); + HotelListingsResponse hotelListingsResponse = + client.execute(new GetLodgingListingsOperation(getLodgingListingsOperationParams)) + .getData(); - LOGGER.info( - "================ Step II: getPropertiesFromLodgingListings Executed ================"); - return hotelListingsResponse; - } + LOGGER.info( + "================ Step II: getPropertiesFromLodgingListings Executed ================"); + return hotelListingsResponse; + } - /** - * Reads given number of property ids from the file pointed by the download URL. - * - * @param downloadUrl The download URL of the zip file containing the property information. - * @return A list of property ids read from the file. - */ - private List getPropertyIdsFromListingsFile(String downloadUrl) { - List propertyIds = new ArrayList<>(); - HttpURLConnection connection = null; - try { - // Open a connection to the URL - URL url = new URL(downloadUrl); - connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - connection.setDoInput(true); + /** + * Reads given number of property ids from the file pointed by the download URL. + * + * @param downloadUrl The download URL of the zip file containing the property information. + * @return A list of property ids read from the file. + */ + private List getPropertyIdsFromListingsFile(String downloadUrl) { + List propertyIds = new ArrayList<>(); + HttpURLConnection connection = null; + try { + // Open a connection to the URL + URL url = new URL(downloadUrl); + connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.setDoInput(true); - try (ZipInputStream zipStream = new ZipInputStream(connection.getInputStream())) { - ZipEntry entry; - while ((entry = zipStream.getNextEntry()) != null) { - if (entry.getName().endsWith(".jsonl")) { - LOGGER.info("Reading property ids from file: {}", entry.getName()); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(zipStream))) { - String line; - ObjectMapper objectMapper = new ObjectMapper(); - while ((line = reader.readLine()) != null - && propertyIds.size() < SAMPLE_ITEMS_RESTRICTION) { - // Parse the property id from the json object - // An example json line from the jsonl file: + try (ZipInputStream zipStream = new ZipInputStream(connection.getInputStream())) { + ZipEntry entry; + while ((entry = zipStream.getNextEntry()) != null) { + if (entry.getName().endsWith(".jsonl")) { + LOGGER.info("Reading property ids from file: {}", entry.getName()); + try (BufferedReader reader = new BufferedReader(new InputStreamReader(zipStream))) { + String line; + ObjectMapper objectMapper = new ObjectMapper(); + while ((line = reader.readLine()) != null + && propertyIds.size() < SAMPLE_ITEMS_RESTRICTION) { + // Parse the property id from the json object + // An example json line from the jsonl file: /* { "propertyId": { @@ -227,126 +210,126 @@ private List getPropertyIdsFromListingsFile(String downloadUrl) { } } */ - JsonNode jsonNode = objectMapper.readTree(line); - // Check if the property is accessible from Lodging Listings API - // (Vrbo properties that are not instantBookable are not accessible for now) - if (!jsonNode.get("propertyId").get("vrbo").asText().isEmpty() - && jsonNode.has("vrboPropertyType") - && !jsonNode.get("vrboPropertyType").get("instantBook").asBoolean() - ) { - // Skip the property if it is not an instant bookable Vrbo property - continue; - } else { - // Get the Expedia property id for the Lodging Listings API - propertyIds.add(jsonNode.get("propertyId").get("expedia").asText()); + JsonNode jsonNode = objectMapper.readTree(line); + // Check if the property is accessible from Lodging Listings API + // (Vrbo properties that are not instantBookable are not accessible for now) + if (!jsonNode.get("propertyId").get("vrbo").asText().isEmpty() + && jsonNode.has("vrboPropertyType") + && !jsonNode.get("vrboPropertyType").get("instantBook").asBoolean() + ) { + // Skip the property if it is not an instant bookable Vrbo property + continue; + } else { + // Get the Expedia property id for the Lodging Listings API + propertyIds.add(jsonNode.get("propertyId").get("expedia").asText()); + } + } + } + } } - } } - } - } - } - } catch (IOException e) { - LOGGER.error("Error reading property ids from download URL", e); - } finally { - if (connection != null) { - connection.disconnect(); - } + } catch (IOException e) { + LOGGER.error("Error reading property ids from download URL", e); + } finally { + if (connection != null) { + connection.disconnect(); + } + } + return propertyIds; } - return propertyIds; - } - /** - * Display the result of the operations. - * - * @param hotelListingsResponse The response of the Lodging Listings API. - */ - private static void displayResult(HotelListingsResponse hotelListingsResponse) { - LOGGER.info("====================== Executing Step III: DisplayResult ======================="); - if (hotelListingsResponse == null || hotelListingsResponse.getHotels() == null - || hotelListingsResponse.getHotels().isEmpty()) { - throw new IllegalStateException("No properties found."); - } + /** + * Display the result of the operations. + * + * @param hotelListingsResponse The response of the Lodging Listings API. + */ + private static void displayResult(HotelListingsResponse hotelListingsResponse) { + LOGGER.info("====================== Executing Step III: DisplayResult ======================="); + if (hotelListingsResponse == null || hotelListingsResponse.getHotels() == null + || hotelListingsResponse.getHotels().isEmpty()) { + throw new IllegalStateException("No properties found."); + } - // The HotelListingsResponse contains a transaction ID for troubleshooting - LOGGER.info("Transaction ID: {}", hotelListingsResponse.getTransactionId()); + // The HotelListingsResponse contains a transaction ID for troubleshooting + LOGGER.info("Transaction ID: {}", hotelListingsResponse.getTransactionId()); - // To access the properties, iterate through the list of hotel properties - hotelListingsResponse.getHotels().forEach(hotel -> { - // Check if the property is available - if (Hotel.Status.AVAILABLE != hotel.getStatus()) { - LOGGER.info("Property {} is not available.", hotel.getId()); - return; - } - LOGGER.info( - "=================================== Property Start ==================================="); - // To get the property name - if (StringUtils.isNotEmpty(hotel.getName())) { - LOGGER.info("Property Name: {}", hotel.getName()); - } - // To get the property address - if (hotel.getLocation() != null) { - LOGGER.info("Property Address: {}", hotel.getLocation().getAddress()); - } - // To get the property thumbnail URL - if (StringUtils.isNotEmpty(hotel.getThumbnailUrl())) { - LOGGER.info("Thumbnail URL: {}", hotel.getThumbnailUrl()); - } - // To get the star rating of the property. The value is between 1.0 and 5.0 - // in a 0.5 increment. - if (hotel.getStarRating() != null) { - LOGGER.info("Star Rating: {}", hotel.getStarRating().getValue()); - } - // To get the guest rating of the property. The value is between 1.0 and 5.0 - // in a 0.1 increment. - if (StringUtils.isNotEmpty(hotel.getGuestRating())) { - LOGGER.info("Guest Rating: {}", hotel.getGuestRating()); - } - // To get the total number of reviews for the property - if (hotel.getGuestReviewCount() != null) { - LOGGER.info("Review Count: {}", hotel.getGuestReviewCount()); - } - if (hotel.getRoomTypes() != null && !hotel.getRoomTypes().isEmpty()) { - // To get the first room type information - RoomType roomType = hotel.getRoomTypes().get(0); - if (StringUtils.isNotEmpty(roomType.getDescription())) { - LOGGER.info("Room Type: {}", roomType.getDescription()); - } - if (roomType.getPrice() != null) { - // To get the total price of the room type - if (roomType.getPrice().getTotalPrice() != null) { - LOGGER.info("Price: {}, Currency: {}", - roomType.getPrice().getTotalPrice().getValue(), - roomType.getPrice().getTotalPrice().getCurrency()); - } - // To get the average nightly rate of the room type - if (roomType.getPrice().getAvgNightlyRate() != null) { - LOGGER.info("Average Nightly Rate: {}, Currency: {}", - roomType.getPrice().getAvgNightlyRate().getValue(), - roomType.getPrice().getAvgNightlyRate().getCurrency()); - } - } - // To get the free cancellation flag of the selected room - if (roomType.getRatePlans() != null && !roomType.getRatePlans().isEmpty() - && roomType.getRatePlans().get(0).getCancellationPolicy() != null) { - LOGGER.info("Free Cancellation: {}", - roomType.getRatePlans().get(0).getCancellationPolicy().getFreeCancellation()); - } - if (roomType.getLinks() != null) { - // To get the deeplink to the Expedia Web Search Result Page - if (roomType.getLinks().getWebSearchResult() != null) { - LOGGER.info("WebSearchResult Link: {}", - roomType.getLinks().getWebSearchResult().getHref()); - } - // To get the deeplink to the Expedia Web Details Page - if (roomType.getLinks().getWebDetails() != null) { - LOGGER.info("WebDetails Link: {}", roomType.getLinks().getWebDetails().getHref()); - } - } - } - LOGGER.info( - "==================================== Property End ===================================="); - }); - LOGGER.info("====================== Step III: DisplayResult Executed ========================"); - } + // To access the properties, iterate through the list of hotel properties + hotelListingsResponse.getHotels().forEach(hotel -> { + // Check if the property is available + if (Hotel.Status.AVAILABLE != hotel.getStatus()) { + LOGGER.info("Property {} is not available.", hotel.getId()); + return; + } + LOGGER.info( + "=================================== Property Start ==================================="); + // To get the property name + if (StringUtils.isNotEmpty(hotel.getName())) { + LOGGER.info("Property Name: {}", hotel.getName()); + } + // To get the property address + if (hotel.getLocation() != null) { + LOGGER.info("Property Address: {}", hotel.getLocation().getAddress()); + } + // To get the property thumbnail URL + if (StringUtils.isNotEmpty(hotel.getThumbnailUrl())) { + LOGGER.info("Thumbnail URL: {}", hotel.getThumbnailUrl()); + } + // To get the star rating of the property. The value is between 1.0 and 5.0 + // in a 0.5 increment. + if (hotel.getStarRating() != null) { + LOGGER.info("Star Rating: {}", hotel.getStarRating().getValue()); + } + // To get the guest rating of the property. The value is between 1.0 and 5.0 + // in a 0.1 increment. + if (StringUtils.isNotEmpty(hotel.getGuestRating())) { + LOGGER.info("Guest Rating: {}", hotel.getGuestRating()); + } + // To get the total number of reviews for the property + if (hotel.getGuestReviewCount() != null) { + LOGGER.info("Review Count: {}", hotel.getGuestReviewCount()); + } + if (hotel.getRoomTypes() != null && !hotel.getRoomTypes().isEmpty()) { + // To get the first room type information + RoomType roomType = hotel.getRoomTypes().get(0); + if (StringUtils.isNotEmpty(roomType.getDescription())) { + LOGGER.info("Room Type: {}", roomType.getDescription()); + } + if (roomType.getPrice() != null) { + // To get the total price of the room type + if (roomType.getPrice().getTotalPrice() != null) { + LOGGER.info("Price: {}, Currency: {}", + roomType.getPrice().getTotalPrice().getValue(), + roomType.getPrice().getTotalPrice().getCurrency()); + } + // To get the average nightly rate of the room type + if (roomType.getPrice().getAvgNightlyRate() != null) { + LOGGER.info("Average Nightly Rate: {}, Currency: {}", + roomType.getPrice().getAvgNightlyRate().getValue(), + roomType.getPrice().getAvgNightlyRate().getCurrency()); + } + } + // To get the free cancellation flag of the selected room + if (roomType.getRatePlans() != null && !roomType.getRatePlans().isEmpty() + && roomType.getRatePlans().get(0).getCancellationPolicy() != null) { + LOGGER.info("Free Cancellation: {}", + roomType.getRatePlans().get(0).getCancellationPolicy().getFreeCancellation()); + } + if (roomType.getLinks() != null) { + // To get the deeplink to the Expedia Web Search Result Page + if (roomType.getLinks().getWebSearchResult() != null) { + LOGGER.info("WebSearchResult Link: {}", + roomType.getLinks().getWebSearchResult().getHref()); + } + // To get the deeplink to the Expedia Web Details Page + if (roomType.getLinks().getWebDetails() != null) { + LOGGER.info("WebDetails Link: {}", roomType.getLinks().getWebDetails().getHref()); + } + } + } + LOGGER.info( + "==================================== Property End ===================================="); + }); + LOGGER.info("====================== Step III: DisplayResult Executed ========================"); + } } diff --git a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/ListingsQuickStartScenario.java b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/ListingsQuickStartScenario.java index 141eb7627..55bae46c7 100644 --- a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/ListingsQuickStartScenario.java +++ b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/ListingsQuickStartScenario.java @@ -1,21 +1,6 @@ -/* - * Copyright (C) 2024 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. - */ - package com.expediagroup.sdk.xap.examples.scenarios.lodging; + import com.expediagroup.sdk.xap.client.XapClient; import com.expediagroup.sdk.xap.examples.scenarios.XapScenario; import com.expediagroup.sdk.xap.models.Hotel; @@ -37,173 +22,173 @@ */ public class ListingsQuickStartScenario implements XapScenario { - private static final Logger LOGGER = LoggerFactory.getLogger(ListingsQuickStartScenario.class); - - public static void main(String[] args) { - new ListingsQuickStartScenario().run(); - System.exit(0); - } - - @Override - public void run() { - // This example will search for properties with the following criteria: - // 1. Occupancy of 1 adult in the first room and 2 adults and 2 children (10 and 12 years old) - // in the second room; - // 2. Properties located within 10 km of the Space Needle in Seattle; - // 3. Check-in date 5 days from now, check-out date 10 days from now; - // 4. Return web links to Expedia website; - // 5. Limit the results to 5 properties; - // 6. Order the results by price in ascending order. - - LOGGER.info( - "========================== Running ListingsQuickStartScenario ========================="); - - LOGGER.info( - "======================== Executing GetLodgingListingsOperation ======================="); - - // Build the occupancy - ArrayList rooms = new ArrayList<>(); - // The first room, with 1 adult - rooms.add(Room.builder().adults(1L).build()); - // The second room, with 2 adults and 2 children - ArrayList childrenAges = new ArrayList<>(); - childrenAges.add(10L); - childrenAges.add(12L); - rooms.add(Room.builder().adults(2L).childAges(childrenAges).build()); - - // Build the query parameters with GetLodgingListingsOperationParams - GetLodgingListingsOperationParams getLodgingListingsOperationParams = - GetLodgingListingsOperationParams.builder() - .partnerTransactionId(PARTNER_TRANSACTION_ID) - // The location keyword can be a city, address, airport or a landmark. - .locationKeyword("Space Needle, Seattle") - // The radius specifies the size of search area around the location keyword. - // The default value is 25. - .radius(10) - // The unit specifies the unit of the radius. The default value is KM. - .unit(GetLodgingListingsOperationParams.Unit.KM) - // Check-in 5 days from now - .checkIn(LocalDate.now().plusDays(5)) - // Check-out 10 days from now - .checkOut(LocalDate.now().plusDays(10)) - // The occupancy - .rooms(rooms) - // The links to return, WEB includes WS (Web Search Result Page) - // and WD (Web Details Page) - .links(Collections.singletonList(GetLodgingListingsOperationParams.Links.WEB)) - // Limit the results to 5 properties - .limit(5) - // Order the results by price in ascending order - .sortType(GetLodgingListingsOperationParams.SortType.PRICE) - .sortOrder(GetLodgingListingsOperationParams.SortOrder.ASC) - .build(); - - XapClient xapClient = createClient(); - - // Execute the operation and get the HotelListingsResponse - HotelListingsResponse hotelListingsResponse = - xapClient.execute(new GetLodgingListingsOperation(getLodgingListingsOperationParams)) - .getData(); - - // If you want to use the async method, you can use the following code: - // --------------------------------------------------------------- - // CompletableFuture> completableFuture = - // xapClient.executeAsync( - // new GetLodgingListingsOperation(getLodgingListingsOperationParams)); - // completableFuture.thenAccept(hotelListingsResponse -> { - // // Your code here - // }); - // --------------------------------------------------------------- - - LOGGER.info( - "======================== GetLodgingListingsOperation Executed ========================"); - - if (hotelListingsResponse == null || hotelListingsResponse.getHotels() == null - || hotelListingsResponse.getHotels().isEmpty()) { - throw new IllegalStateException("No properties found."); + private static final Logger LOGGER = LoggerFactory.getLogger(ListingsQuickStartScenario.class); + + public static void main(String[] args) { + new ListingsQuickStartScenario().run(); + System.exit(0); } - // The HotelListingsResponse contains a transaction ID for troubleshooting - LOGGER.info("Transaction ID: {}", hotelListingsResponse.getTransactionId()); - - // To access the properties, iterate through the list of hotel properties - hotelListingsResponse.getHotels().forEach(hotel -> { - // Check if the property is available - if (Hotel.Status.AVAILABLE != hotel.getStatus()) { - LOGGER.info("Property {} is not available.", hotel.getId()); - return; - } - LOGGER.info( - "=================================== Property Start ==================================="); - // To get the property name - if (StringUtils.isNotEmpty(hotel.getName())) { - LOGGER.info("Property Name: {}", hotel.getName()); - } - // To get the property address - if (hotel.getLocation() != null) { - LOGGER.info("Property Address: {}", hotel.getLocation().getAddress()); - } - // To get the property thumbnail URL - if (StringUtils.isNotEmpty(hotel.getThumbnailUrl())) { - LOGGER.info("Thumbnail URL: {}", hotel.getThumbnailUrl()); - } - // To get the star rating of the property. The value is between 1.0 and 5.0 - // in a 0.5 increment. - if (hotel.getStarRating() != null) { - LOGGER.info("Star Rating: {}", hotel.getStarRating().getValue()); - } - // To get the guest rating of the property. The value is between 1.0 and 5.0 - // in a 0.1 increment. - if (StringUtils.isNotEmpty(hotel.getGuestRating())) { - LOGGER.info("Guest Rating: {}", hotel.getGuestRating()); - } - // To get the total number of reviews for the property - if (hotel.getGuestReviewCount() != null) { - LOGGER.info("Review Count: {}", hotel.getGuestReviewCount()); - } - if (hotel.getRoomTypes() != null && !hotel.getRoomTypes().isEmpty()) { - // To get the first room type information - RoomType roomType = hotel.getRoomTypes().get(0); - if (StringUtils.isNotEmpty(roomType.getDescription())) { - LOGGER.info("Room Type: {}", roomType.getDescription()); - } - if (roomType.getPrice() != null) { - // To get the total price of the room type - if (roomType.getPrice().getTotalPrice() != null) { - LOGGER.info("Price: {}, Currency: {}", - roomType.getPrice().getTotalPrice().getValue(), - roomType.getPrice().getTotalPrice().getCurrency()); - } - // To get the average nightly rate of the room type - if (roomType.getPrice().getAvgNightlyRate() != null) { - LOGGER.info("Average Nightly Rate: {}, Currency: {}", - roomType.getPrice().getAvgNightlyRate().getValue(), - roomType.getPrice().getAvgNightlyRate().getCurrency()); - } + @Override + public void run() { + // This example will search for properties with the following criteria: + // 1. Occupancy of 1 adult in the first room and 2 adults and 2 children (10 and 12 years old) + // in the second room; + // 2. Properties located within 10 km of the Space Needle in Seattle; + // 3. Check-in date 5 days from now, check-out date 10 days from now; + // 4. Return web links to Expedia website; + // 5. Limit the results to 5 properties; + // 6. Order the results by price in ascending order. + + LOGGER.info( + "========================== Running ListingsQuickStartScenario ========================="); + + LOGGER.info( + "======================== Executing GetLodgingListingsOperation ======================="); + + // Build the occupancy + ArrayList rooms = new ArrayList<>(); + // The first room, with 1 adult + rooms.add(Room.builder().adults(1L).build()); + // The second room, with 2 adults and 2 children + ArrayList childrenAges = new ArrayList<>(); + childrenAges.add(10L); + childrenAges.add(12L); + rooms.add(Room.builder().adults(2L).childAges(childrenAges).build()); + + // Build the query parameters with GetLodgingListingsOperationParams + GetLodgingListingsOperationParams getLodgingListingsOperationParams = + GetLodgingListingsOperationParams.builder() + .partnerTransactionId(PARTNER_TRANSACTION_ID) + // The location keyword can be a city, address, airport or a landmark. + .locationKeyword("Space Needle, Seattle") + // The radius specifies the size of search area around the location keyword. + // The default value is 25. + .radius(10) + // The unit specifies the unit of the radius. The default value is KM. + .unit(GetLodgingListingsOperationParams.Unit.KM) + // Check-in 5 days from now + .checkIn(LocalDate.now().plusDays(5)) + // Check-out 10 days from now + .checkOut(LocalDate.now().plusDays(10)) + // The occupancy + .rooms(rooms) + // The links to return, WEB includes WS (Web Search Result Page) + // and WD (Web Details Page) + .links(Collections.singletonList(GetLodgingListingsOperationParams.Links.WEB)) + // Limit the results to 5 properties + .limit(5) + // Order the results by price in ascending order + .sortType(GetLodgingListingsOperationParams.SortType.PRICE) + .sortOrder(GetLodgingListingsOperationParams.SortOrder.ASC) + .build(); + + XapClient xapClient = createClient(); + + // Execute the operation and get the HotelListingsResponse + HotelListingsResponse hotelListingsResponse = + xapClient.execute(new GetLodgingListingsOperation(getLodgingListingsOperationParams)) + .getData(); + + // If you want to use the async method, you can use the following code: + // --------------------------------------------------------------- + // CompletableFuture> completableFuture = + // xapClient.executeAsync( + // new GetLodgingListingsOperation(getLodgingListingsOperationParams)); + // completableFuture.thenAccept(hotelListingsResponse -> { + // // Your code here + // }); + // --------------------------------------------------------------- + + LOGGER.info( + "======================== GetLodgingListingsOperation Executed ========================"); + + if (hotelListingsResponse == null || hotelListingsResponse.getHotels() == null + || hotelListingsResponse.getHotels().isEmpty()) { + throw new IllegalStateException("No properties found."); } - // To get the free cancellation flag of the selected room - if (roomType.getRatePlans() != null && !roomType.getRatePlans().isEmpty() - && roomType.getRatePlans().get(0).getCancellationPolicy() != null) { - LOGGER.info("Free Cancellation: {}", - roomType.getRatePlans().get(0).getCancellationPolicy().getFreeCancellation()); - } - if (roomType.getLinks() != null) { - // To get the deeplink to the Expedia Web Search Result Page - if (roomType.getLinks().getWebSearchResult() != null) { - LOGGER.info("WebSearchResult Link: {}", - roomType.getLinks().getWebSearchResult().getHref()); - } - // To get the deeplink to the Expedia Web Details Page - if (roomType.getLinks().getWebDetails() != null) { - LOGGER.info("WebDetails Link: {}", roomType.getLinks().getWebDetails().getHref()); - } - } - } - LOGGER.info( - "==================================== Property End ===================================="); - }); - - LOGGER.info( - "============================ End ListingsQuickStartScenario ==========================="); - } + + // The HotelListingsResponse contains a transaction ID for troubleshooting + LOGGER.info("Transaction ID: {}", hotelListingsResponse.getTransactionId()); + + // To access the properties, iterate through the list of hotel properties + hotelListingsResponse.getHotels().forEach(hotel -> { + // Check if the property is available + if (Hotel.Status.AVAILABLE != hotel.getStatus()) { + LOGGER.info("Property {} is not available.", hotel.getId()); + return; + } + LOGGER.info( + "=================================== Property Start ==================================="); + // To get the property name + if (StringUtils.isNotEmpty(hotel.getName())) { + LOGGER.info("Property Name: {}", hotel.getName()); + } + // To get the property address + if (hotel.getLocation() != null) { + LOGGER.info("Property Address: {}", hotel.getLocation().getAddress()); + } + // To get the property thumbnail URL + if (StringUtils.isNotEmpty(hotel.getThumbnailUrl())) { + LOGGER.info("Thumbnail URL: {}", hotel.getThumbnailUrl()); + } + // To get the star rating of the property. The value is between 1.0 and 5.0 + // in a 0.5 increment. + if (hotel.getStarRating() != null) { + LOGGER.info("Star Rating: {}", hotel.getStarRating().getValue()); + } + // To get the guest rating of the property. The value is between 1.0 and 5.0 + // in a 0.1 increment. + if (StringUtils.isNotEmpty(hotel.getGuestRating())) { + LOGGER.info("Guest Rating: {}", hotel.getGuestRating()); + } + // To get the total number of reviews for the property + if (hotel.getGuestReviewCount() != null) { + LOGGER.info("Review Count: {}", hotel.getGuestReviewCount()); + } + if (hotel.getRoomTypes() != null && !hotel.getRoomTypes().isEmpty()) { + // To get the first room type information + RoomType roomType = hotel.getRoomTypes().get(0); + if (StringUtils.isNotEmpty(roomType.getDescription())) { + LOGGER.info("Room Type: {}", roomType.getDescription()); + } + if (roomType.getPrice() != null) { + // To get the total price of the room type + if (roomType.getPrice().getTotalPrice() != null) { + LOGGER.info("Price: {}, Currency: {}", + roomType.getPrice().getTotalPrice().getValue(), + roomType.getPrice().getTotalPrice().getCurrency()); + } + // To get the average nightly rate of the room type + if (roomType.getPrice().getAvgNightlyRate() != null) { + LOGGER.info("Average Nightly Rate: {}, Currency: {}", + roomType.getPrice().getAvgNightlyRate().getValue(), + roomType.getPrice().getAvgNightlyRate().getCurrency()); + } + } + // To get the free cancellation flag of the selected room + if (roomType.getRatePlans() != null && !roomType.getRatePlans().isEmpty() + && roomType.getRatePlans().get(0).getCancellationPolicy() != null) { + LOGGER.info("Free Cancellation: {}", + roomType.getRatePlans().get(0).getCancellationPolicy().getFreeCancellation()); + } + if (roomType.getLinks() != null) { + // To get the deeplink to the Expedia Web Search Result Page + if (roomType.getLinks().getWebSearchResult() != null) { + LOGGER.info("WebSearchResult Link: {}", + roomType.getLinks().getWebSearchResult().getHref()); + } + // To get the deeplink to the Expedia Web Details Page + if (roomType.getLinks().getWebDetails() != null) { + LOGGER.info("WebDetails Link: {}", roomType.getLinks().getWebDetails().getHref()); + } + } + } + LOGGER.info( + "==================================== Property End ===================================="); + }); + + LOGGER.info( + "============================ End ListingsQuickStartScenario ==========================="); + } } diff --git a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/QuotesQuickStartScenario.java b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/QuotesQuickStartScenario.java index 7e1f807e4..a89db04ae 100644 --- a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/QuotesQuickStartScenario.java +++ b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/QuotesQuickStartScenario.java @@ -1,19 +1,3 @@ -/* - * Copyright (C) 2024 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. - */ - package com.expediagroup.sdk.xap.examples.scenarios.lodging; import com.expediagroup.sdk.xap.client.XapClient; @@ -38,124 +22,124 @@ */ public class QuotesQuickStartScenario implements VrboScenario { - private static final Logger LOGGER = LoggerFactory.getLogger(QuotesQuickStartScenario.class); - - public static void main(String[] args) { - new QuotesQuickStartScenario().run(); - System.exit(0); - } - - @Override - public void run() { - // This example will get quotes response for mentioned Expedia properties with the following - // criteria: - // 1. Occupancy of 1 adult in the first room and 2 adults and 2 children (10 and 12 years old) - // in the second room; - // 3. Check-in date 5 days from now, check-out date 10 days from now; - // 4. Return web links to Expedia website; - - LOGGER.info( - "============================ Running QuotesQuickStartScenario =========================="); - - LOGGER.info( - "========================= Executing GetLodgingQuotesOperation ========================="); - - // Build the occupancy - ArrayList rooms = new ArrayList<>(); - // The first room, with 2 adult - rooms.add(Room.builder().adults(2L).childAges(null).build()); - - // Build the query parameters with GetLodgingQuotesOperationParams - GetLodgingQuotesOperationParams quotesOperationParams = - GetLodgingQuotesOperationParams.builder() - .partnerTransactionId(PARTNER_TRANSACTION_ID) - // Check-in 5 days from now - .checkIn(LocalDate.now().plusDays(5)) - // Check-out 10 days from now - .checkOut(LocalDate.now().plusDays(10)) - // Set of Expedia Property IDs. - .propertyIds(new HashSet<>(Arrays.asList("87704892", "36960201"))) - // The links to return, WEB includes WS (Web Search Result Page) and - // WD (Web Details Page) - .links(Collections.singletonList(GetLodgingQuotesOperationParams.Links.WEB)) - .rooms(rooms) - .build(); - - XapClient xapClient = createClient(); - - // Execute the operation and get the QuotesResponse - LodgingQuotesResponse quotesResponse = - xapClient.execute(new GetLodgingQuotesOperation(quotesOperationParams)).getData(); - - // If you want to use the async method, you can use the following code: - // --------------------------------------------------------------- - // CompletableFuture> completableFuture = - // xapClient.executeAsync( - // new GetLodgingQuotesOperation(quotesOperationParams)); - // completableFuture.thenAccept(quotesResponse -> { - // // Your code here - // }); - // --------------------------------------------------------------- - - LOGGER.info( - "========================== GetLodgingQuotesOperation Executed ========================="); - - if (quotesResponse == null || quotesResponse.getProperties() == null - || quotesResponse.getProperties().isEmpty()) { - throw new IllegalStateException("No properties found."); + private static final Logger LOGGER = LoggerFactory.getLogger(QuotesQuickStartScenario.class); + + public static void main(String[] args) { + new QuotesQuickStartScenario().run(); + System.exit(0); } - // The LodgingQuotesResponse contains a transaction ID for troubleshooting - LOGGER.info("Transaction ID: {}", quotesResponse.getTransactionId()); - - // To access the properties, iterate through the list of properties - quotesResponse.getProperties().forEach(quote -> { - LOGGER.info("========== Property:{} Start ==========", quote.getId()); - if (Property.Status.AVAILABLE != quote.getStatus()) { - LOGGER.info("Property is not available."); - return; - } - if (quote.getRoomTypes() != null && !quote.getRoomTypes().isEmpty()) { - // To get the first room type information - LodgingRoomType roomType = quote.getRoomTypes().get(0); - - if (roomType.getPrice() != null) { - // To get the total price of the room type - if (roomType.getPrice().getTotalPrice() != null) { - LOGGER.info("Price: {}, Currency: {}", - roomType.getPrice().getTotalPrice().getValue(), - roomType.getPrice().getTotalPrice().getCurrency()); - } - // To get the average nightly rate of the room type - if (roomType.getPrice().getAvgNightlyRate() != null) { - LOGGER.info("Average Nightly Rate: {}, Currency: {}", - roomType.getPrice().getAvgNightlyRate().getValue(), - roomType.getPrice().getAvgNightlyRate().getCurrency()); - } - } - // To get the free cancellation flag of the selected room - if (roomType.getRatePlans() != null && !roomType.getRatePlans().isEmpty() - && roomType.getRatePlans().get(0).getCancellationPolicy() != null) { - LOGGER.info("Free Cancellation: {}", - roomType.getRatePlans().get(0).getCancellationPolicy().getFreeCancellation()); + @Override + public void run() { + // This example will get quotes response for mentioned Expedia properties with the following + // criteria: + // 1. Occupancy of 1 adult in the first room and 2 adults and 2 children (10 and 12 years old) + // in the second room; + // 3. Check-in date 5 days from now, check-out date 10 days from now; + // 4. Return web links to Expedia website; + + LOGGER.info( + "============================ Running QuotesQuickStartScenario =========================="); + + LOGGER.info( + "========================= Executing GetLodgingQuotesOperation ========================="); + + // Build the occupancy + ArrayList rooms = new ArrayList<>(); + // The first room, with 2 adult + rooms.add(Room.builder().adults(2L).childAges(null).build()); + + // Build the query parameters with GetLodgingQuotesOperationParams + GetLodgingQuotesOperationParams quotesOperationParams = + GetLodgingQuotesOperationParams.builder() + .partnerTransactionId(PARTNER_TRANSACTION_ID) + // Check-in 5 days from now + .checkIn(LocalDate.now().plusDays(5)) + // Check-out 10 days from now + .checkOut(LocalDate.now().plusDays(10)) + // Set of Expedia Property IDs. + .propertyIds(new HashSet<>(Arrays.asList("87704892", "36960201"))) + // The links to return, WEB includes WS (Web Search Result Page) and + // WD (Web Details Page) + .links(Collections.singletonList(GetLodgingQuotesOperationParams.Links.WEB)) + .rooms(rooms) + .build(); + + XapClient xapClient = createClient(); + + // Execute the operation and get the QuotesResponse + LodgingQuotesResponse quotesResponse = + xapClient.execute(new GetLodgingQuotesOperation(quotesOperationParams)).getData(); + + // If you want to use the async method, you can use the following code: + // --------------------------------------------------------------- + // CompletableFuture> completableFuture = + // xapClient.executeAsync( + // new GetLodgingQuotesOperation(quotesOperationParams)); + // completableFuture.thenAccept(quotesResponse -> { + // // Your code here + // }); + // --------------------------------------------------------------- + + LOGGER.info( + "========================== GetLodgingQuotesOperation Executed ========================="); + + if (quotesResponse == null || quotesResponse.getProperties() == null + || quotesResponse.getProperties().isEmpty()) { + throw new IllegalStateException("No properties found."); } - if (roomType.getLinks() != null) { - // To get the deeplink to the Expedia Web Search Result Page - if (roomType.getLinks().getWebSearchResult() != null) { - LOGGER.info("WebSearchResult Link: {}", - roomType.getLinks().getWebSearchResult().getHref()); - } - // To get the deeplink to the Expedia Web Details Page - if (roomType.getLinks().getWebDetails() != null) { - LOGGER.info("WebDetails Link: {}", roomType.getLinks().getWebDetails().getHref()); - } - } - } - LOGGER.info( - "=================================== Property End ==================================="); - }); - - LOGGER.info( - "============================= End QuotesQuickStartScenario ============================"); - } + + // The LodgingQuotesResponse contains a transaction ID for troubleshooting + LOGGER.info("Transaction ID: {}", quotesResponse.getTransactionId()); + + // To access the properties, iterate through the list of properties + quotesResponse.getProperties().forEach(quote -> { + LOGGER.info("========== Property:{} Start ==========", quote.getId()); + if (Property.Status.AVAILABLE != quote.getStatus()) { + LOGGER.info("Property is not available."); + return; + } + if (quote.getRoomTypes() != null && !quote.getRoomTypes().isEmpty()) { + // To get the first room type information + LodgingRoomType roomType = quote.getRoomTypes().get(0); + + if (roomType.getPrice() != null) { + // To get the total price of the room type + if (roomType.getPrice().getTotalPrice() != null) { + LOGGER.info("Price: {}, Currency: {}", + roomType.getPrice().getTotalPrice().getValue(), + roomType.getPrice().getTotalPrice().getCurrency()); + } + // To get the average nightly rate of the room type + if (roomType.getPrice().getAvgNightlyRate() != null) { + LOGGER.info("Average Nightly Rate: {}, Currency: {}", + roomType.getPrice().getAvgNightlyRate().getValue(), + roomType.getPrice().getAvgNightlyRate().getCurrency()); + } + } + // To get the free cancellation flag of the selected room + if (roomType.getRatePlans() != null && !roomType.getRatePlans().isEmpty() + && roomType.getRatePlans().get(0).getCancellationPolicy() != null) { + LOGGER.info("Free Cancellation: {}", + roomType.getRatePlans().get(0).getCancellationPolicy().getFreeCancellation()); + } + if (roomType.getLinks() != null) { + // To get the deeplink to the Expedia Web Search Result Page + if (roomType.getLinks().getWebSearchResult() != null) { + LOGGER.info("WebSearchResult Link: {}", + roomType.getLinks().getWebSearchResult().getHref()); + } + // To get the deeplink to the Expedia Web Details Page + if (roomType.getLinks().getWebDetails() != null) { + LOGGER.info("WebDetails Link: {}", roomType.getLinks().getWebDetails().getHref()); + } + } + } + LOGGER.info( + "=================================== Property End ==================================="); + }); + + LOGGER.info( + "============================= End QuotesQuickStartScenario ============================"); + } } diff --git a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboPropertySearchEndToEndScenario.java b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboPropertySearchEndToEndScenario.java index e4396c7e3..ba5659835 100644 --- a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboPropertySearchEndToEndScenario.java +++ b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboPropertySearchEndToEndScenario.java @@ -1,22 +1,7 @@ -/* - * Copyright (C) 2024 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. - */ - package com.expediagroup.sdk.xap.examples.scenarios.lodging; -import com.expediagroup.sdk.core.model.Response; + +import com.expediagroup.sdk.rest.model.Response; import com.expediagroup.sdk.xap.client.XapClient; import com.expediagroup.sdk.xap.models.LodgingQuotesResponse; import com.expediagroup.sdk.xap.models.LodgingRoomType; @@ -59,192 +44,192 @@ */ public class VrboPropertySearchEndToEndScenario implements VrboScenario { - private final XapClient client = createClient(); - - private static final Logger LOGGER = - LoggerFactory.getLogger(VrboPropertySearchEndToEndScenario.class); - - /** - * This field limits the number of line to read from the SDP DownloadURL API Listings file to - * reduce time to run the example. - * If the first 20 properties from the file are not accessible OR available when you run this - * example, it may end with "No accessible property ids found." OR NO_RESULT_FOUND. In that case, - * you can adjust the property count to get more properties. - */ - private static final int SAMPLE_ITEMS_RESTRICTION = 20; - - /** - * A property id to location map. This mocks a cache in this example to store the static content - * of the properties. - */ - private static final Map PROPERTY_ID_AND_LOCATION_CACHE = new HashMap<>(); - - public static void main(String[] args) { - new VrboPropertySearchEndToEndScenario().run(); - System.exit(0); - } - - @Override - public void run() { - LOGGER.info( - "====================== Running VrboPropertySearchEndToEndScenario ======================"); - - List propertyIds = getPropertyIdsFromDownloadUrl(); - cachePropertyLocationFromDownloadUrl(propertyIds); - LodgingQuotesResponse lodgingQuotesResponse = getPropertyPriceFromLodgingQuotes(propertyIds); - displayResult(lodgingQuotesResponse); - - LOGGER.info( - "======================= End VrboPropertySearchEndToEndScenario ========================="); - } - - private List getPropertyIdsFromDownloadUrl() { - LOGGER.info( - "==================== Executing Step I: getPropertyIdsFromDownloadUrl ==================="); - - GetFeedDownloadUrlOperationParams getPropertyIdListParams = - GetFeedDownloadUrlOperationParams.builder() - // Use the type VACATION_RENTAL to get the list of accessible Vrbo property ids. - .type(GetFeedDownloadUrlOperationParams.Type.VACATION_RENTAL) - // Without any filters, this operation will return the information of all Vrbo - // properties in en_US by default. - .build(); - - Response downloadUrlListingsResponse = - client.execute(new GetFeedDownloadUrlOperation(getPropertyIdListParams)); - - if (downloadUrlListingsResponse.getData() == null - || downloadUrlListingsResponse.getData().getBestMatchedFile() == null) { - throw new IllegalStateException("No vacation rental file found"); + private final XapClient client = createClient(); + + private static final Logger LOGGER = + LoggerFactory.getLogger(VrboPropertySearchEndToEndScenario.class); + + /** + * This field limits the number of line to read from the SDP DownloadURL API Listings file to + * reduce time to run the example. + * If the first 20 properties from the file are not accessible OR available when you run this + * example, it may end with "No accessible property ids found." OR NO_RESULT_FOUND. In that case, + * you can adjust the property count to get more properties. + */ + private static final int SAMPLE_ITEMS_RESTRICTION = 20; + + /** + * A property id to location map. This mocks a cache in this example to store the static content + * of the properties. + */ + private static final Map PROPERTY_ID_AND_LOCATION_CACHE = new HashMap<>(); + + public static void main(String[] args) { + new VrboPropertySearchEndToEndScenario().run(); + System.exit(0); + } + + @Override + public void run() { + LOGGER.info( + "====================== Running VrboPropertySearchEndToEndScenario ======================"); + + List propertyIds = getPropertyIdsFromDownloadUrl(); + cachePropertyLocationFromDownloadUrl(propertyIds); + LodgingQuotesResponse lodgingQuotesResponse = getPropertyPriceFromLodgingQuotes(propertyIds); + displayResult(lodgingQuotesResponse); + + LOGGER.info( + "======================= End VrboPropertySearchEndToEndScenario ========================="); + } + + private List getPropertyIdsFromDownloadUrl() { + LOGGER.info( + "==================== Executing Step I: getPropertyIdsFromDownloadUrl ==================="); + + GetFeedDownloadUrlOperationParams getPropertyIdListParams = + GetFeedDownloadUrlOperationParams.builder() + // Use the type VACATION_RENTAL to get the list of accessible Vrbo property ids. + .type(GetFeedDownloadUrlOperationParams.Type.VACATION_RENTAL) + // Without any filters, this operation will return the information of all Vrbo + // properties in en_US by default. + .build(); + + Response downloadUrlListingsResponse = + client.execute(new GetFeedDownloadUrlOperation(getPropertyIdListParams)); + + if (downloadUrlListingsResponse.getData() == null + || downloadUrlListingsResponse.getData().getBestMatchedFile() == null) { + throw new IllegalStateException("No vacation rental file found"); + } + + // The download URL points to a zip file containing various jsonl files. + // Each line in the jsonl files contains a json object representing a Vrbo property. + // For demonstration purposes, we will only read a few properties from the file without + // downloading the entire file. + String vacationRentalDownloadUrl = downloadUrlListingsResponse.getData() + .getBestMatchedFile() + .getDownloadUrl(); + LOGGER.info("Vacation Rental Download URL: {}", vacationRentalDownloadUrl); + + // Read property ids from the file. + List propertyIds = getPropertyIdsFromVacationRentalFile(vacationRentalDownloadUrl + ); + + if (propertyIds.isEmpty()) { + throw new IllegalStateException("No accessible Vrbo property ids found."); + } + LOGGER.info("Accessible Vrbo Property Ids: {}", propertyIds); + + LOGGER.info( + "==================== Step I: getPropertyIdsFromDownloadUrl Executed ===================="); + return propertyIds; } - // The download URL points to a zip file containing various jsonl files. - // Each line in the jsonl files contains a json object representing a Vrbo property. - // For demonstration purposes, we will only read a few properties from the file without - // downloading the entire file. - String vacationRentalDownloadUrl = downloadUrlListingsResponse.getData() - .getBestMatchedFile() - .getDownloadUrl(); - LOGGER.info("Vacation Rental Download URL: {}", vacationRentalDownloadUrl); - - // Read property ids from the file. - List propertyIds = getPropertyIdsFromVacationRentalFile(vacationRentalDownloadUrl - ); - - if (propertyIds.isEmpty()) { - throw new IllegalStateException("No accessible Vrbo property ids found."); + /** + * Cache the location content from SDP DownloadURL API. + * + * @param propertyIds The property ids that need the location content. + */ + private void cachePropertyLocationFromDownloadUrl(List propertyIds) { + LOGGER.info( + "================ Executing Step II: CachePropertyLocationFromDownloadUrl ==============="); + GetFeedDownloadUrlOperationParams getPropertyLocationParams = + GetFeedDownloadUrlOperationParams.builder() + // Use the type LOCATIONS to get the address of accessible properties. + .type(GetFeedDownloadUrlOperationParams.Type.LOCATIONS) + // Filter the properties by brand. + .brand(GetFeedDownloadUrlOperationParams.Brand.VRBO) + .build(); + + Response downloadUrlLocationsResponse = + client.execute(new GetFeedDownloadUrlOperation(getPropertyLocationParams)); + + if (downloadUrlLocationsResponse.getData() == null + || downloadUrlLocationsResponse.getData().getBestMatchedFile() == null) { + throw new IllegalStateException("No location file found"); + } + + String locationsDownloadUrl = downloadUrlLocationsResponse.getData() + .getBestMatchedFile() + .getDownloadUrl(); + LOGGER.info("Locations Download URL: {}", locationsDownloadUrl); + + // Read and cache property locations from the file. + cachePropertyLocationFromLocationsFile(locationsDownloadUrl, propertyIds); + + LOGGER.info( + "================= Step II: CachePropertyLocationFromDownloadUrl Executed ==============="); } - LOGGER.info("Accessible Vrbo Property Ids: {}", propertyIds); - - LOGGER.info( - "==================== Step I: getPropertyIdsFromDownloadUrl Executed ===================="); - return propertyIds; - } - - /** - * Cache the location content from SDP DownloadURL API. - * - * @param propertyIds The property ids that need the location content. - */ - private void cachePropertyLocationFromDownloadUrl(List propertyIds) { - LOGGER.info( - "================ Executing Step II: CachePropertyLocationFromDownloadUrl ==============="); - GetFeedDownloadUrlOperationParams getPropertyLocationParams = - GetFeedDownloadUrlOperationParams.builder() - // Use the type LOCATIONS to get the address of accessible properties. - .type(GetFeedDownloadUrlOperationParams.Type.LOCATIONS) - // Filter the properties by brand. - .brand(GetFeedDownloadUrlOperationParams.Brand.VRBO) - .build(); - - Response downloadUrlLocationsResponse = - client.execute(new GetFeedDownloadUrlOperation(getPropertyLocationParams)); - - if (downloadUrlLocationsResponse.getData() == null - || downloadUrlLocationsResponse.getData().getBestMatchedFile() == null) { - throw new IllegalStateException("No location file found"); + + /** + * Get prices of the properties using the Lodging Quotes API. + * + * @param propertyIds The property ids to get the prices. + * @return The response of the Lodging Quotes API. + */ + private LodgingQuotesResponse getPropertyPriceFromLodgingQuotes(List propertyIds) { + LOGGER.info( + "================= Executing Step III: GetPropertyPriceFromLodgingQuotes ================"); + + // Build the occupancy + ArrayList rooms = new ArrayList<>(); + // The first room, with 2 adult + rooms.add(Room.builder().adults(2L).childAges(null).build()); + + // Build the query parameters with GetLodgingQuotesOperationParams + GetLodgingQuotesOperationParams quotesOperationParams = + GetLodgingQuotesOperationParams.builder() + .partnerTransactionId(PARTNER_TRANSACTION_ID) + // Check-in 5 days from now + .checkIn(LocalDate.now().plusDays(5)) + // Check-out 10 days from now + .checkOut(LocalDate.now().plusDays(10)) + // Set of Expedia Property IDs. + .propertyIds(new HashSet<>(propertyIds)) + // The links to return, WEB includes WS (Web Search Result Page) and + // WD (Web Details Page) + .links(Collections.singletonList(GetLodgingQuotesOperationParams.Links.WEB)) + .rooms(rooms) + .build(); + + LodgingQuotesResponse lodgingQuotesResponse = + client.execute(new GetLodgingQuotesOperation(quotesOperationParams)) + .getData(); + + LOGGER.info( + "================= Step III: GetPropertyPriceFromLodgingQuotes Executed ================="); + return lodgingQuotesResponse; } - String locationsDownloadUrl = downloadUrlLocationsResponse.getData() - .getBestMatchedFile() - .getDownloadUrl(); - LOGGER.info("Locations Download URL: {}", locationsDownloadUrl); - - // Read and cache property locations from the file. - cachePropertyLocationFromLocationsFile(locationsDownloadUrl, propertyIds); - - LOGGER.info( - "================= Step II: CachePropertyLocationFromDownloadUrl Executed ==============="); - } - - /** - * Get prices of the properties using the Lodging Quotes API. - * - * @param propertyIds The property ids to get the prices. - * @return The response of the Lodging Quotes API. - */ - private LodgingQuotesResponse getPropertyPriceFromLodgingQuotes(List propertyIds) { - LOGGER.info( - "================= Executing Step III: GetPropertyPriceFromLodgingQuotes ================"); - - // Build the occupancy - ArrayList rooms = new ArrayList<>(); - // The first room, with 2 adult - rooms.add(Room.builder().adults(2L).childAges(null).build()); - - // Build the query parameters with GetLodgingQuotesOperationParams - GetLodgingQuotesOperationParams quotesOperationParams = - GetLodgingQuotesOperationParams.builder() - .partnerTransactionId(PARTNER_TRANSACTION_ID) - // Check-in 5 days from now - .checkIn(LocalDate.now().plusDays(5)) - // Check-out 10 days from now - .checkOut(LocalDate.now().plusDays(10)) - // Set of Expedia Property IDs. - .propertyIds(new HashSet<>(propertyIds)) - // The links to return, WEB includes WS (Web Search Result Page) and - // WD (Web Details Page) - .links(Collections.singletonList(GetLodgingQuotesOperationParams.Links.WEB)) - .rooms(rooms) - .build(); - - LodgingQuotesResponse lodgingQuotesResponse = - client.execute(new GetLodgingQuotesOperation(quotesOperationParams)) - .getData(); - - LOGGER.info( - "================= Step III: GetPropertyPriceFromLodgingQuotes Executed ================="); - return lodgingQuotesResponse; - } - - /** - * Reads given number of property ids from the file pointed by the download URL. - * - * @param downloadUrl The download URL of the zip file containing the property information. - * @return A list of property ids read from the file. - */ - private List getPropertyIdsFromVacationRentalFile(String downloadUrl) { - List propertyIds = new ArrayList<>(); - HttpURLConnection connection = null; - try { - // Open a connection to the URL - URL url = new URL(downloadUrl); - connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - connection.setDoInput(true); - - try (ZipInputStream zipStream = new ZipInputStream(connection.getInputStream())) { - ZipEntry entry; - while ((entry = zipStream.getNextEntry()) != null) { - if (entry.getName().endsWith(".jsonl")) { - LOGGER.info("Reading property ids from file: {}", entry.getName()); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(zipStream))) { - String line; - ObjectMapper objectMapper = new ObjectMapper(); - while ((line = reader.readLine()) != null - && propertyIds.size() < SAMPLE_ITEMS_RESTRICTION) { - // Parse the property id from the json object - // An example json line from the jsonl file: + /** + * Reads given number of property ids from the file pointed by the download URL. + * + * @param downloadUrl The download URL of the zip file containing the property information. + * @return A list of property ids read from the file. + */ + private List getPropertyIdsFromVacationRentalFile(String downloadUrl) { + List propertyIds = new ArrayList<>(); + HttpURLConnection connection = null; + try { + // Open a connection to the URL + URL url = new URL(downloadUrl); + connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.setDoInput(true); + + try (ZipInputStream zipStream = new ZipInputStream(connection.getInputStream())) { + ZipEntry entry; + while ((entry = zipStream.getNextEntry()) != null) { + if (entry.getName().endsWith(".jsonl")) { + LOGGER.info("Reading property ids from file: {}", entry.getName()); + try (BufferedReader reader = new BufferedReader(new InputStreamReader(zipStream))) { + String line; + ObjectMapper objectMapper = new ObjectMapper(); + while ((line = reader.readLine()) != null + && propertyIds.size() < SAMPLE_ITEMS_RESTRICTION) { + // Parse the property id from the json object + // An example json line from the jsonl file: /* { "propertyId": { @@ -290,52 +275,52 @@ private List getPropertyIdsFromVacationRentalFile(String downloadUrl) { "propertyLiveDate": "2022-05-31" } */ - JsonNode jsonNode = objectMapper.readTree(line); - propertyIds.add(jsonNode.get("propertyId").get("expedia").asText()); - } + JsonNode jsonNode = objectMapper.readTree(line); + propertyIds.add(jsonNode.get("propertyId").get("expedia").asText()); + } + } + } + } + } + + } catch (IOException e) { + LOGGER.error("Error reading property ids from download URL", e); + } finally { + if (connection != null) { + connection.disconnect(); } - } } - } - - } catch (IOException e) { - LOGGER.error("Error reading property ids from download URL", e); - } finally { - if (connection != null) { - connection.disconnect(); - } + return propertyIds; } - return propertyIds; - } - - /** - * Caches the location content of the properties from the file pointed by the download URL. - * - * @param locationsDownloadUrl The download URL of the zip file containing the property locations. - * @param propertyIds The property ids to get the location content. - */ - private void cachePropertyLocationFromLocationsFile(String locationsDownloadUrl, - List propertyIds) { - HttpURLConnection connection = null; - try { - // Open a connection to the URL - URL url = new URL(locationsDownloadUrl); - connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - connection.setDoInput(true); - - try (ZipInputStream zipStream = new ZipInputStream(connection.getInputStream())) { - ZipEntry entry; - while ((entry = zipStream.getNextEntry()) != null) { - if (entry.getName().endsWith(".jsonl")) { - LOGGER.info("Reading property locations from file: {}", entry.getName()); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(zipStream))) { - String line; - ObjectMapper objectMapper = new ObjectMapper(); - while ((line = reader.readLine()) != null - && PROPERTY_ID_AND_LOCATION_CACHE.size() < propertyIds.size()) { - // Parse the property location from the json object - // An example json line from the jsonl file: + + /** + * Caches the location content of the properties from the file pointed by the download URL. + * + * @param locationsDownloadUrl The download URL of the zip file containing the property locations. + * @param propertyIds The property ids to get the location content. + */ + private void cachePropertyLocationFromLocationsFile(String locationsDownloadUrl, + List propertyIds) { + HttpURLConnection connection = null; + try { + // Open a connection to the URL + URL url = new URL(locationsDownloadUrl); + connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + connection.setDoInput(true); + + try (ZipInputStream zipStream = new ZipInputStream(connection.getInputStream())) { + ZipEntry entry; + while ((entry = zipStream.getNextEntry()) != null) { + if (entry.getName().endsWith(".jsonl")) { + LOGGER.info("Reading property locations from file: {}", entry.getName()); + try (BufferedReader reader = new BufferedReader(new InputStreamReader(zipStream))) { + String line; + ObjectMapper objectMapper = new ObjectMapper(); + while ((line = reader.readLine()) != null + && PROPERTY_ID_AND_LOCATION_CACHE.size() < propertyIds.size()) { + // Parse the property location from the json object + // An example json line from the jsonl file: /* { "propertyId": { @@ -386,106 +371,106 @@ private void cachePropertyLocationFromLocationsFile(String locationsDownloadUrl, } } */ - JsonNode jsonNode = objectMapper.readTree(line); - // Check if the property id is in the list - if (propertyIds.contains(jsonNode.get("propertyId").get("expedia").asText())) { - // Get the location content of the property - String location = jsonNode.get("propertyName").asText() + ", " - + jsonNode.get("city").asText() + ", " - + jsonNode.get("province").asText() + ", " - + jsonNode.get("country").asText(); - // Store the location content in the cache - PROPERTY_ID_AND_LOCATION_CACHE.put( - jsonNode.get("propertyId") - .get("expedia") - .asText(), - location); + JsonNode jsonNode = objectMapper.readTree(line); + // Check if the property id is in the list + if (propertyIds.contains(jsonNode.get("propertyId").get("expedia").asText())) { + // Get the location content of the property + String location = jsonNode.get("propertyName").asText() + ", " + + jsonNode.get("city").asText() + ", " + + jsonNode.get("province").asText() + ", " + + jsonNode.get("country").asText(); + // Store the location content in the cache + PROPERTY_ID_AND_LOCATION_CACHE.put( + jsonNode.get("propertyId") + .get("expedia") + .asText(), + location); + } + } + } + } } - } } - } + + } catch (IOException e) { + LOGGER.error("Error reading property locations from download URL", e); + } finally { + if (connection != null) { + connection.disconnect(); + } } - } - - } catch (IOException e) { - LOGGER.error("Error reading property locations from download URL", e); - } finally { - if (connection != null) { - connection.disconnect(); - } - } - } - - /** - * Display the result of the operations. - * - * @param lodgingQuotesResponse The response of the Lodging Quotes API. - */ - private static void displayResult(LodgingQuotesResponse lodgingQuotesResponse) { - LOGGER.info("======================= Executing Step IV: DisplayResult ======================="); - if (lodgingQuotesResponse == null || lodgingQuotesResponse.getProperties() == null - || lodgingQuotesResponse.getProperties().isEmpty()) { - throw new IllegalStateException("No properties found."); } - // The HotelListingsResponse contains a transaction ID for troubleshooting - LOGGER.info("Transaction ID: {}", lodgingQuotesResponse.getTransactionId()); - - // To access the properties, iterate through the list of hotel properties - lodgingQuotesResponse.getProperties().forEach(property -> { - // Check if the property is available - if (Property.Status.AVAILABLE != property.getStatus()) { - LOGGER.info("Property {} is not available.", property.getId()); - return; - } - LOGGER.info( - "=================================== Property Start ==================================="); - String propertyId = property.getId(); - - // Get the location content of the property from the cache - LOGGER.info("Property Id: {}", propertyId); - LOGGER.info("Cached Property Location: {}", PROPERTY_ID_AND_LOCATION_CACHE.get(propertyId)); - - // Get the price of the property from the room type - if (property.getRoomTypes() != null && !property.getRoomTypes().isEmpty()) { - // To get the first room type information - LodgingRoomType roomType = property.getRoomTypes().get(0); - - if (roomType.getPrice() != null) { - // To get the total price of the room type - if (roomType.getPrice().getTotalPrice() != null) { - LOGGER.info("Price: {}, Currency: {}", - roomType.getPrice().getTotalPrice().getValue(), - roomType.getPrice().getTotalPrice().getCurrency()); - } - // To get the average nightly rate of the room type - if (roomType.getPrice().getAvgNightlyRate() != null) { - LOGGER.info("Average Nightly Rate: {}, Currency: {}", - roomType.getPrice().getAvgNightlyRate().getValue(), - roomType.getPrice().getAvgNightlyRate().getCurrency()); - } + /** + * Display the result of the operations. + * + * @param lodgingQuotesResponse The response of the Lodging Quotes API. + */ + private static void displayResult(LodgingQuotesResponse lodgingQuotesResponse) { + LOGGER.info("======================= Executing Step IV: DisplayResult ======================="); + if (lodgingQuotesResponse == null || lodgingQuotesResponse.getProperties() == null + || lodgingQuotesResponse.getProperties().isEmpty()) { + throw new IllegalStateException("No properties found."); } - // To get the free cancellation flag of the selected room - if (roomType.getRatePlans() != null && !roomType.getRatePlans().isEmpty() - && roomType.getRatePlans().get(0).getCancellationPolicy() != null) { - LOGGER.info("Free Cancellation: {}", - roomType.getRatePlans().get(0).getCancellationPolicy().getFreeCancellation()); - } - if (roomType.getLinks() != null) { - // To get the deeplink to the website Search Result Page - if (roomType.getLinks().getWebSearchResult() != null) { - LOGGER.info("WebSearchResult Link: {}", - roomType.getLinks().getWebSearchResult().getHref()); - } - // To get the deeplink to the website Details Page - if (roomType.getLinks().getWebDetails() != null) { - LOGGER.info("WebDetails Link: {}", roomType.getLinks().getWebDetails().getHref()); - } - } - } - LOGGER.info( - "==================================== Property End ===================================="); - }); - LOGGER.info("======================= Step IV: DisplayResult Executed ========================"); - } + + // The HotelListingsResponse contains a transaction ID for troubleshooting + LOGGER.info("Transaction ID: {}", lodgingQuotesResponse.getTransactionId()); + + // To access the properties, iterate through the list of hotel properties + lodgingQuotesResponse.getProperties().forEach(property -> { + // Check if the property is available + if (Property.Status.AVAILABLE != property.getStatus()) { + LOGGER.info("Property {} is not available.", property.getId()); + return; + } + LOGGER.info( + "=================================== Property Start ==================================="); + String propertyId = property.getId(); + + // Get the location content of the property from the cache + LOGGER.info("Property Id: {}", propertyId); + LOGGER.info("Cached Property Location: {}", PROPERTY_ID_AND_LOCATION_CACHE.get(propertyId)); + + // Get the price of the property from the room type + if (property.getRoomTypes() != null && !property.getRoomTypes().isEmpty()) { + // To get the first room type information + LodgingRoomType roomType = property.getRoomTypes().get(0); + + if (roomType.getPrice() != null) { + // To get the total price of the room type + if (roomType.getPrice().getTotalPrice() != null) { + LOGGER.info("Price: {}, Currency: {}", + roomType.getPrice().getTotalPrice().getValue(), + roomType.getPrice().getTotalPrice().getCurrency()); + } + // To get the average nightly rate of the room type + if (roomType.getPrice().getAvgNightlyRate() != null) { + LOGGER.info("Average Nightly Rate: {}, Currency: {}", + roomType.getPrice().getAvgNightlyRate().getValue(), + roomType.getPrice().getAvgNightlyRate().getCurrency()); + } + } + // To get the free cancellation flag of the selected room + if (roomType.getRatePlans() != null && !roomType.getRatePlans().isEmpty() + && roomType.getRatePlans().get(0).getCancellationPolicy() != null) { + LOGGER.info("Free Cancellation: {}", + roomType.getRatePlans().get(0).getCancellationPolicy().getFreeCancellation()); + } + if (roomType.getLinks() != null) { + // To get the deeplink to the website Search Result Page + if (roomType.getLinks().getWebSearchResult() != null) { + LOGGER.info("WebSearchResult Link: {}", + roomType.getLinks().getWebSearchResult().getHref()); + } + // To get the deeplink to the website Details Page + if (roomType.getLinks().getWebDetails() != null) { + LOGGER.info("WebDetails Link: {}", roomType.getLinks().getWebDetails().getHref()); + } + } + } + LOGGER.info( + "==================================== Property End ===================================="); + }); + LOGGER.info("======================= Step IV: DisplayResult Executed ========================"); + } } diff --git a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboScenario.java b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboScenario.java index 97f3ba810..da9443399 100644 --- a/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboScenario.java +++ b/examples/src/main/java/com/expediagroup/sdk/xap/examples/scenarios/lodging/VrboScenario.java @@ -1,5 +1,6 @@ package com.expediagroup.sdk.xap.examples.scenarios.lodging; +import com.expediagroup.sdk.core.auth.basic.BasicAuthCredentials; import com.expediagroup.sdk.xap.client.XapClient; import com.expediagroup.sdk.xap.examples.scenarios.XapScenario; @@ -9,20 +10,25 @@ */ public interface VrboScenario extends XapScenario { - /** - * Create a client with Vrbo key and secret. - * - * @return XapClient - */ - @Override - default XapClient createClient() { - String key = System.getProperty("com.expediagroup.xapjavasdk.vrbokey"); - String secret = System.getProperty("com.expediagroup.xapjavasdk.vrbosecret"); - return XapClient - .builder() - .key(key) - .secret(secret) - .build(); - } + /** + * Create a client with Vrbo key and secret. + * + * @return XapClient + */ + @Override + default XapClient createClient() { + String key = System.getProperty("com.expediagroup.xapjavasdk.vrbokey"); + String secret = System.getProperty("com.expediagroup.xapjavasdk.vrbosecret"); + + BasicAuthCredentials credentials = new BasicAuthCredentials(key, secret); + + // Or enable OAuth by passing OAuthCredentials instead: + // OAuthCredentials credentials = new OAuthCredentials("api-key", "api-secret"); + + return XapClient + .builder() + .credentials(credentials) + .build(); + } } diff --git a/generator/build.gradle.kts b/generator/build.gradle.kts new file mode 100644 index 000000000..3b09870a3 --- /dev/null +++ b/generator/build.gradle.kts @@ -0,0 +1,50 @@ +import com.expediagroup.sdk.xap.generator.mustache.AllowedMediaTypesLambda +import org.openapitools.codegen.CodegenConstants + +plugins { + id("com.expediagroup.sdk.openapigenerator") version "0.0.3-beta-SNAPSHOT" +} + +group = project.property("GROUP_ID") as String + +dependencies { + api("org.openapitools:openapi-generator:7.11.0") +} + +openApiGenerate { + inputSpec = System.getProperty("inputSpec") ?: "$projectDir/src/main/resources/specs.yaml" + + packageName = "com.expediagroup.sdk.xap" + invokerPackage = "com.expediagroup.sdk.xap" + apiPackage = "com.expediagroup.sdk.xap.operations" + modelPackage = "com.expediagroup.sdk.xap.models" + + dryRun = false + cleanupOutput = false + generateApiDocumentation = false + generateApiTests = false + generateModelTests = false + enablePostProcessFile = true + + templateDir = "$projectDir/src/main/resources/templates" + configFile = "$projectDir/src/main/resources/generator-config.yaml" + outputDir = "$rootDir/xap-sdk/src/main/kotlin" + + additionalProperties.put(CodegenConstants.ENUM_PROPERTY_NAMING, "UPPERCASE") + additionalProperties.put("allowedMediaTypes", AllowedMediaTypesLambda()) + + configOptions.put("sourceFolder", "") + + globalProperties.put("supportingFiles", "Room.kt") +} + +tasks.named("openApiGenerate").configure { + doLast { + exec { + commandLine( + "../gradlew ktlintFormat".split(" "), + ) + workingDir = File("$rootDir/xap-sdk").absoluteFile + } + } +} diff --git a/generator/gradle.properties b/generator/gradle.properties new file mode 100644 index 000000000..3dba81097 --- /dev/null +++ b/generator/gradle.properties @@ -0,0 +1 @@ +namespace=xap diff --git a/generator/src/main/resources/generator-config.yaml b/generator/src/main/resources/generator-config.yaml new file mode 100644 index 000000000..8ebdd1f90 --- /dev/null +++ b/generator/src/main/resources/generator-config.yaml @@ -0,0 +1,8 @@ +files: + operation_params.mustache: + templateType: API + destinationFilename: Params.kt + room.mustache: + templateType: SupportingFiles + destinationFilename: Room.kt + folder: com/expediagroup/sdk/xap/models diff --git a/generator/src/main/resources/post-processor/.editorconfig b/generator/src/main/resources/post-processor/.editorconfig new file mode 100644 index 000000000..79fe80267 --- /dev/null +++ b/generator/src/main/resources/post-processor/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +insert_final_newline = true diff --git a/generator/src/main/resources/post-processor/.eslintignore b/generator/src/main/resources/post-processor/.eslintignore new file mode 100644 index 000000000..567609b12 --- /dev/null +++ b/generator/src/main/resources/post-processor/.eslintignore @@ -0,0 +1 @@ +build/ diff --git a/generator/src/main/resources/post-processor/.eslintrc.json b/generator/src/main/resources/post-processor/.eslintrc.json new file mode 100644 index 000000000..f95bb333f --- /dev/null +++ b/generator/src/main/resources/post-processor/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts/" +} diff --git a/generator/src/main/resources/post-processor/.prettierrc.js b/generator/src/main/resources/post-processor/.prettierrc.js new file mode 100644 index 000000000..ff1548339 --- /dev/null +++ b/generator/src/main/resources/post-processor/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-builder-method-param-type.yaml b/generator/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-builder-method-param-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-builder-method-param-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-builder-method-param-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-class-param-type.yaml b/generator/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-class-param-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-class-param-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/activities-cancellation-policy/change-class-param-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-builder-method-param-type.yaml b/generator/src/main/resources/post-processor/assets/rules/available-time-slot/change-builder-method-param-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-builder-method-param-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/available-time-slot/change-builder-method-param-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-class-param-type.yaml b/generator/src/main/resources/post-processor/assets/rules/available-time-slot/change-class-param-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/available-time-slot/change-class-param-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/available-time-slot/change-class-param-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/car-cancellation-policy/change-builder-method-param-type.yaml b/generator/src/main/resources/post-processor/assets/rules/car-cancellation-policy/change-builder-method-param-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/car-cancellation-policy/change-builder-method-param-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/car-cancellation-policy/change-builder-method-param-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/car-cancellation-policy/change-class-param-type.yaml b/generator/src/main/resources/post-processor/assets/rules/car-cancellation-policy/change-class-param-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/car-cancellation-policy/change-class-param-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/car-cancellation-policy/change-class-param-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/change-builder-method-params-type.yaml b/generator/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/change-builder-method-params-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/change-builder-method-params-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/change-builder-method-params-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/change-class-params-type.yaml b/generator/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/change-class-params-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/change-class-params-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/change-class-params-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/import-chrono-unit.yaml b/generator/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/import-chrono-unit.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/import-chrono-unit.yaml rename to generator/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/import-chrono-unit.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/truncate-pickup-dropoff-times.yaml b/generator/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/truncate-pickup-dropoff-times.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/truncate-pickup-dropoff-times.yaml rename to generator/src/main/resources/post-processor/assets/rules/get-cars-listings-operation-params/truncate-pickup-dropoff-times.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/add-rooms-builder-method.yaml b/generator/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/add-rooms-builder-method.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/add-rooms-builder-method.yaml rename to generator/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/add-rooms-builder-method.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/import-room.yaml b/generator/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/import-room.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/import-room.yaml rename to generator/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/import-room.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/remove-room-builder-methods.yaml b/generator/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/remove-room-builder-methods.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/remove-room-builder-methods.yaml rename to generator/src/main/resources/post-processor/assets/rules/get-lodging-listings-operation-params/remove-room-builder-methods.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/add-rooms-builder-method.yaml b/generator/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/add-rooms-builder-method.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/add-rooms-builder-method.yaml rename to generator/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/add-rooms-builder-method.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/import-room.yaml b/generator/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/import-room.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/import-room.yaml rename to generator/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/import-room.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/remove-room-builder-methods.yaml b/generator/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/remove-room-builder-methods.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/remove-room-builder-methods.yaml rename to generator/src/main/resources/post-processor/assets/rules/get-lodging-quotes-operation-params/remove-room-builder-methods.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/non-cancellable-date-time-range/change-builder-method-params-type.yaml b/generator/src/main/resources/post-processor/assets/rules/non-cancellable-date-time-range/change-builder-method-params-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/non-cancellable-date-time-range/change-builder-method-params-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/non-cancellable-date-time-range/change-builder-method-params-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/non-cancellable-date-time-range/change-class-params-type.yaml b/generator/src/main/resources/post-processor/assets/rules/non-cancellable-date-time-range/change-class-params-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/non-cancellable-date-time-range/change-class-params-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/non-cancellable-date-time-range/change-class-params-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/penalty-rule/change-builder-method-params-type.yaml b/generator/src/main/resources/post-processor/assets/rules/penalty-rule/change-builder-method-params-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/penalty-rule/change-builder-method-params-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/penalty-rule/change-builder-method-params-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/penalty-rule/change-class-params-type.yaml b/generator/src/main/resources/post-processor/assets/rules/penalty-rule/change-class-params-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/penalty-rule/change-class-params-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/penalty-rule/change-class-params-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/vendor-location-details/change-builder-method-param-type.yaml b/generator/src/main/resources/post-processor/assets/rules/vendor-location-details/change-builder-method-param-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/vendor-location-details/change-builder-method-param-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/vendor-location-details/change-builder-method-param-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/rules/vendor-location-details/change-class-param-type.yaml b/generator/src/main/resources/post-processor/assets/rules/vendor-location-details/change-class-param-type.yaml similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/rules/vendor-location-details/change-class-param-type.yaml rename to generator/src/main/resources/post-processor/assets/rules/vendor-location-details/change-class-param-type.yaml diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/templates/get-lodging-listings-operation-params/rooms.kt b/generator/src/main/resources/post-processor/assets/templates/get-lodging-listings-operation-params/rooms.kt similarity index 90% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/templates/get-lodging-listings-operation-params/rooms.kt rename to generator/src/main/resources/post-processor/assets/templates/get-lodging-listings-operation-params/rooms.kt index 804d09cac..4f844ba41 100644 --- a/customizations/generator/openapi/src/main/resources/post-processor/assets/templates/get-lodging-listings-operation-params/rooms.kt +++ b/generator/src/main/resources/post-processor/assets/templates/get-lodging-listings-operation-params/rooms.kt @@ -1,7 +1,7 @@ -fun rooms(rooms: List) = +fun rooms(rooms: List) = apply { if (rooms.size > 8) { - throw PropertyConstraintViolationException( + throw com.expediagroup.sdk.rest.exception.client.PropertyConstraintViolationException( constraintViolations = listOf("rooms: size must be between 0 and 8") ) } diff --git a/customizations/generator/openapi/src/main/resources/post-processor/assets/templates/get-lodging-quotes-operation-params/rooms.kt b/generator/src/main/resources/post-processor/assets/templates/get-lodging-quotes-operation-params/rooms.kt similarity index 90% rename from customizations/generator/openapi/src/main/resources/post-processor/assets/templates/get-lodging-quotes-operation-params/rooms.kt rename to generator/src/main/resources/post-processor/assets/templates/get-lodging-quotes-operation-params/rooms.kt index 804d09cac..4f844ba41 100644 --- a/customizations/generator/openapi/src/main/resources/post-processor/assets/templates/get-lodging-quotes-operation-params/rooms.kt +++ b/generator/src/main/resources/post-processor/assets/templates/get-lodging-quotes-operation-params/rooms.kt @@ -1,7 +1,7 @@ -fun rooms(rooms: List) = +fun rooms(rooms: List) = apply { if (rooms.size > 8) { - throw PropertyConstraintViolationException( + throw com.expediagroup.sdk.rest.exception.client.PropertyConstraintViolationException( constraintViolations = listOf("rooms: size must be between 0 and 8") ) } diff --git a/generator/src/main/resources/post-processor/package-lock.json b/generator/src/main/resources/post-processor/package-lock.json new file mode 100644 index 000000000..ab72b7a21 --- /dev/null +++ b/generator/src/main/resources/post-processor/package-lock.json @@ -0,0 +1,3307 @@ +{ + "name": "post-processor", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "version": "0.0.0", + "license": "Apache-2.0", + "dependencies": { + "@ast-grep/napi": "0.33.1", + "yaml": "2.7.0" + }, + "devDependencies": { + "@types/node": "22.13.5", + "gts": "6.0.2", + "tsc-alias": "1.8.10", + "typescript": "5.7.3" + } + }, + "node_modules/@ast-grep/napi": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@ast-grep/napi/-/napi-0.33.1.tgz", + "integrity": "sha512-AfUsqmEa8NoYq1QhY2LWKCgKRBrCW89WB2D7t4hhTwXcfBB+CWRtY11vUughpfGLrdyziPst7kpdFzI9TC9Efw==", + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@ast-grep/napi-darwin-arm64": "0.33.1", + "@ast-grep/napi-darwin-x64": "0.33.1", + "@ast-grep/napi-linux-arm64-gnu": "0.33.1", + "@ast-grep/napi-linux-arm64-musl": "0.33.1", + "@ast-grep/napi-linux-x64-gnu": "0.33.1", + "@ast-grep/napi-linux-x64-musl": "0.33.1", + "@ast-grep/napi-win32-arm64-msvc": "0.33.1", + "@ast-grep/napi-win32-ia32-msvc": "0.33.1", + "@ast-grep/napi-win32-x64-msvc": "0.33.1" + } + }, + "node_modules/@ast-grep/napi-darwin-arm64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-darwin-arm64/-/napi-darwin-arm64-0.33.1.tgz", + "integrity": "sha512-HJcjxDhF1THn6VlUMpYFQoZBWWMk3flBJpLEDWLjH3Umk7/4tQvaJeKwhl32Snegj35p9SHGz1cS8D2k1nDsEg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-darwin-x64": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-darwin-x64/-/napi-darwin-x64-0.33.1.tgz", + "integrity": "sha512-Gu3dd+7RZcLyte/xwBX4ErT12GYgGeQGQh6743NffChyVnpwZpj2aWmdkD8gHRKswXz2dp5R01QMCV0G5o8rDQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-arm64-gnu": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-arm64-gnu/-/napi-linux-arm64-gnu-0.33.1.tgz", + "integrity": "sha512-4rvHBtq/0Ziwr93Mp86GQPMMySNHCMXnSIdJqJjTikt/LhJNdxmXtEVadashwxbBGWvcIy8dL6OCBHblzY/3ZQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-arm64-musl": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-arm64-musl/-/napi-linux-arm64-musl-0.33.1.tgz", + "integrity": "sha512-+vTHYYP8iRG9lZHhcpQRxAuD8CBYXJHFXgsevmnurS/R53r0YjNtrtj6W33e7RYXY5hehmey2Cz/5h6OhdLcJw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-x64-gnu": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-x64-gnu/-/napi-linux-x64-gnu-0.33.1.tgz", + "integrity": "sha512-Qm42//ZHIi2XvyvHboRPaNt32v143feG2aCqxZ2qhKJCI33abtH8pW8MF90Ix85d927xYtTwZX/ovOmJ4bghFQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-linux-x64-musl": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-linux-x64-musl/-/napi-linux-x64-musl-0.33.1.tgz", + "integrity": "sha512-+ye9d8nwgi+f9yhA0NEv5lDcpfIF7xhCcF9FerIKpksX57oI68QWNz1bOWHOuebaf9Wc0hgEtfai7lzcDWcsnA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-win32-arm64-msvc": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-arm64-msvc/-/napi-win32-arm64-msvc-0.33.1.tgz", + "integrity": "sha512-0IrPtvqMUJmvmbBN3JcAmUoKUxsWMmrp0VAoJ+zUBHcz3GeWDISgxrUcx1z6edMeF+Ktm0SUG2LfqrzFhUqMyw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-win32-ia32-msvc": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-ia32-msvc/-/napi-win32-ia32-msvc-0.33.1.tgz", + "integrity": "sha512-rM6kK19Z9mknXQLZYvIGW1vR472n0dzhexWRM4O8BAL33B4NXA0qa7lX7I3ioHBTOUx0dGW10oNRm3yindUohg==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ast-grep/napi-win32-x64-msvc": { + "version": "0.33.1", + "resolved": "https://registry.npmjs.org/@ast-grep/napi-win32-x64-msvc/-/napi-win32-x64-msvc-0.33.1.tgz", + "integrity": "sha512-8ATNhuU28PoUBxSgsPQnPpY+rl8DPEQCuUS55X0BLAvNQwR+Tc4MHHHX1FwjQxLLSAPfd5weiG4XQA+l7sIr0w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", + "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.25.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", + "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", + "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.11.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", + "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", + "dev": true + }, + "node_modules/@types/node": { + "version": "22.13.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.5.tgz", + "integrity": "sha512-+lTU0PxZXn0Dr1NBtC7Y8cR21AJr87dLLU953CWA6pMxxv/UDc7jYAY90upcrie1nRcD6XNG5HOYEDtgW5TxAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/builtins": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz", + "integrity": "sha512-SW9lzGTLvWTP1AY8xeAMZimqDrIaSdLQUcVr9DMef51niJ022Ri87SwRRKYm4A6iHfkPaiVUu/Duw2Wc4J7kKg==", + "dev": true, + "dependencies": { + "semver": "^7.0.0" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dev": true, + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-es": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", + "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", + "dev": true, + "dependencies": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=4.19.1" + } + }, + "node_modules/eslint-plugin-es/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-plugin-es/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-n": { + "version": "15.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", + "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", + "dev": true, + "dependencies": { + "builtins": "^5.0.1", + "eslint-plugin-es": "^4.1.0", + "eslint-utils": "^3.0.0", + "ignore": "^5.1.1", + "is-core-module": "^2.11.0", + "minimatch": "^3.1.2", + "resolve": "^1.22.1", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", + "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/gts": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/gts/-/gts-6.0.2.tgz", + "integrity": "sha512-lp9+eDzzm6TYqiBpgGY00EInxBHFTJiU5brsVp11qXCJEw7Q6WNNngja0spZeqSFWSquaRuHQUuWxdZLaxnKmw==", + "dev": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "5.62.0", + "@typescript-eslint/parser": "5.62.0", + "chalk": "^4.1.2", + "eslint": "8.57.1", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-n": "15.7.0", + "eslint-plugin-prettier": "5.2.1", + "execa": "^5.0.0", + "inquirer": "^7.3.3", + "json5": "^2.1.3", + "meow": "^9.0.0", + "ncp": "^2.0.0", + "prettier": "3.3.3", + "rimraf": "3.0.2", + "write-file-atomic": "^4.0.0" + }, + "bin": { + "gts": "build/src/cli.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "typescript": ">=5" + } + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/inquirer": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", + "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.19", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.6.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", + "integrity": "sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==", + "dev": true, + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "node_modules/mylas": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/mylas/-/mylas-2.1.13.tgz", + "integrity": "sha512-+MrqnJRtxdF+xngFfUUkIMQrUUL0KsxbADUkn23Z/4ibGg192Q+z+CQyiYwvWTsYjJygmMR8+w3ZDa98Zh6ESg==", + "dev": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/raouldeheer" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, + "node_modules/ncp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", + "dev": true, + "bin": { + "ncp": "bin/ncp" + } + }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/plimit-lit": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/plimit-lit/-/plimit-lit-1.6.1.tgz", + "integrity": "sha512-B7+VDyb8Tl6oMJT9oSO2CW8XC/T4UcJGrwOVoNGwOQsQYhlpfajmrMj5xeejqaASq3V/EqThyOeATEOMuSEXiA==", + "dev": true, + "dependencies": { + "queue-lit": "^1.5.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-lit": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/queue-lit/-/queue-lit-1.5.2.tgz", + "integrity": "sha512-tLc36IOPeMAubu8BkW8YDBV+WyIgKlYU7zUNs0J5Vk9skSZ4JfGlPOqplP0aHdfv7HL0B2Pg6nwiq60Qc6M2Hw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.20", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz", + "integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==", + "dev": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/synckit/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/tsc-alias": { + "version": "1.8.10", + "resolved": "https://registry.npmjs.org/tsc-alias/-/tsc-alias-1.8.10.tgz", + "integrity": "sha512-Ibv4KAWfFkFdKJxnWfVtdOmB0Zi1RJVxcbPGiCDsFpCQSsmpWyuzHG3rQyI5YkobWwxFPEyQfu1hdo4qLG2zPw==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.3", + "commander": "^9.0.0", + "globby": "^11.0.4", + "mylas": "^2.1.9", + "normalize-path": "^3.0.0", + "plimit-lit": "^1.2.6" + }, + "bin": { + "tsc-alias": "dist/bin/index.js" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "dev": true + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/generator/src/main/resources/post-processor/package.json b/generator/src/main/resources/post-processor/package.json new file mode 100644 index 000000000..dd0f05a29 --- /dev/null +++ b/generator/src/main/resources/post-processor/package.json @@ -0,0 +1,33 @@ +{ + "name": "", + "version": "0.0.0", + "description": "", + "main": "build/src/index.js", + "types": "build/src/index.d.ts", + "files": [ + "build/src" + ], + "license": "Apache-2.0", + "keywords": [], + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "lint": "gts lint", + "clean": "gts clean", + "compile": "tsc", + "fix": "gts fix", + "prepare": "npm run compile", + "pretest": "npm run compile", + "posttest": "npm run lint", + "process": "node build/src/index.js" + }, + "devDependencies": { + "@types/node": "22.13.5", + "gts": "6.0.2", + "tsc-alias": "1.8.10", + "typescript": "5.7.3" + }, + "dependencies": { + "@ast-grep/napi": "0.33.1", + "yaml": "2.7.0" + } +} diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/index.ts b/generator/src/main/resources/post-processor/src/index.ts similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/src/index.ts rename to generator/src/main/resources/post-processor/src/index.ts diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/activities-cancellation-policy-processor.ts b/generator/src/main/resources/post-processor/src/processors/activities-cancellation-policy-processor.ts similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/src/processors/activities-cancellation-policy-processor.ts rename to generator/src/main/resources/post-processor/src/processors/activities-cancellation-policy-processor.ts diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/available-time-slot-processor.ts b/generator/src/main/resources/post-processor/src/processors/available-time-slot-processor.ts similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/src/processors/available-time-slot-processor.ts rename to generator/src/main/resources/post-processor/src/processors/available-time-slot-processor.ts diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/cars-cancellation-policy-processor.ts b/generator/src/main/resources/post-processor/src/processors/cars-cancellation-policy-processor.ts similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/src/processors/cars-cancellation-policy-processor.ts rename to generator/src/main/resources/post-processor/src/processors/cars-cancellation-policy-processor.ts diff --git a/generator/src/main/resources/post-processor/src/processors/dummy-processor.ts b/generator/src/main/resources/post-processor/src/processors/dummy-processor.ts new file mode 100644 index 000000000..c42ebac7b --- /dev/null +++ b/generator/src/main/resources/post-processor/src/processors/dummy-processor.ts @@ -0,0 +1,15 @@ +import {Processor} from './processor'; +import {RuleFunction} from './shared.types'; +import { SgNode } from '@ast-grep/napi'; + +class DummyProcessor extends Processor { + id = 'dummy'; + rules: RuleFunction[] = [ + (root: SgNode) => { + // Dummy rule: No edits + return []; + } + ]; +} + +export default DummyProcessor; diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/get-cars-listings-operation-params-processor.ts b/generator/src/main/resources/post-processor/src/processors/get-cars-listings-operation-params-processor.ts similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/src/processors/get-cars-listings-operation-params-processor.ts rename to generator/src/main/resources/post-processor/src/processors/get-cars-listings-operation-params-processor.ts diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/get-lodging-listings-operation-params-processor.ts b/generator/src/main/resources/post-processor/src/processors/get-lodging-listings-operation-params-processor.ts similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/src/processors/get-lodging-listings-operation-params-processor.ts rename to generator/src/main/resources/post-processor/src/processors/get-lodging-listings-operation-params-processor.ts diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/get-lodging-quotes-operation-params-processor.ts b/generator/src/main/resources/post-processor/src/processors/get-lodging-quotes-operation-params-processor.ts similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/src/processors/get-lodging-quotes-operation-params-processor.ts rename to generator/src/main/resources/post-processor/src/processors/get-lodging-quotes-operation-params-processor.ts diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/non-cancellable-date-time-range-processor.ts b/generator/src/main/resources/post-processor/src/processors/non-cancellable-date-time-range-processor.ts similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/src/processors/non-cancellable-date-time-range-processor.ts rename to generator/src/main/resources/post-processor/src/processors/non-cancellable-date-time-range-processor.ts diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/penalty-rule-processor.ts b/generator/src/main/resources/post-processor/src/processors/penalty-rule-processor.ts similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/src/processors/penalty-rule-processor.ts rename to generator/src/main/resources/post-processor/src/processors/penalty-rule-processor.ts diff --git a/generator/src/main/resources/post-processor/src/processors/processor.ts b/generator/src/main/resources/post-processor/src/processors/processor.ts new file mode 100644 index 000000000..d7b2dac68 --- /dev/null +++ b/generator/src/main/resources/post-processor/src/processors/processor.ts @@ -0,0 +1,28 @@ +import {PathOrFileDescriptor} from 'fs'; +import * as fs from 'node:fs'; +import {Lang, NapiConfig, parse} from '@ast-grep/napi'; +import * as yaml from 'yaml'; +import {RuleFunction} from './shared.types'; + +export abstract class Processor { + abstract rules: RuleFunction[]; + abstract id: String; + + process(filePath: PathOrFileDescriptor): void { + const source = fs.readFileSync(filePath, 'utf-8'); + const ast = parse(Lang.Kotlin, source); + const root = ast.root(); + + const edits = this.rules.flatMap(func => func(root)); + const newSource = root.commitEdits(edits); + fs.writeFileSync(filePath, newSource); + } + + readRule(ruleName: string): NapiConfig { + const rule = fs.readFileSync( + `./assets/rules/${this.id}/${ruleName}.yaml`, + 'utf-8' + ); + return yaml.parse(rule); + } +} diff --git a/generator/src/main/resources/post-processor/src/processors/shared.types.ts b/generator/src/main/resources/post-processor/src/processors/shared.types.ts new file mode 100644 index 000000000..a86cb67d3 --- /dev/null +++ b/generator/src/main/resources/post-processor/src/processors/shared.types.ts @@ -0,0 +1,3 @@ +import {Edit, SgNode} from '@ast-grep/napi'; + +export type RuleFunction = {(root: SgNode): Edit[]}; diff --git a/customizations/generator/openapi/src/main/resources/post-processor/src/processors/vendor-location-details-processor.ts b/generator/src/main/resources/post-processor/src/processors/vendor-location-details-processor.ts similarity index 100% rename from customizations/generator/openapi/src/main/resources/post-processor/src/processors/vendor-location-details-processor.ts rename to generator/src/main/resources/post-processor/src/processors/vendor-location-details-processor.ts diff --git a/generator/src/main/resources/post-processor/tsconfig.json b/generator/src/main/resources/post-processor/tsconfig.json new file mode 100644 index 000000000..d1646f011 --- /dev/null +++ b/generator/src/main/resources/post-processor/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build" + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ] +} diff --git a/code/transformedSpecs.yaml b/generator/src/main/resources/specs.yaml similarity index 100% rename from code/transformedSpecs.yaml rename to generator/src/main/resources/specs.yaml diff --git a/generator/src/main/resources/templates/operations/params/get_headers.mustache b/generator/src/main/resources/templates/operations/params/get_headers.mustache new file mode 100644 index 000000000..255bdf06e --- /dev/null +++ b/generator/src/main/resources/templates/operations/params/get_headers.mustache @@ -0,0 +1,16 @@ +{{#hasHeaderParams}}fun getHeaders(): Headers { +return Headers.builder().apply { +{{#headerParams}} + {{paramName}}?.let { + add("{{baseName}}", it{{#isEnum}}.value{{/isEnum}}) + } +{{/headerParams}} +{{#responses}} + {{#allowedMediaTypes}} + {{#mediaTypes}} + add("Accept", "{{.}}") + {{/mediaTypes}} + {{/allowedMediaTypes}} +{{/responses}} +}.build() +}{{/hasHeaderParams}} \ No newline at end of file diff --git a/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/xap/room.mustache b/generator/src/main/resources/templates/room.mustache similarity index 99% rename from customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/xap/room.mustache rename to generator/src/main/resources/templates/room.mustache index 1d955cf99..0f03543b1 100644 --- a/customizations/generator/openapi/src/main/resources/templates/expediagroup-sdk/xap/room.mustache +++ b/generator/src/main/resources/templates/room.mustache @@ -24,4 +24,4 @@ data class Room( ) } } -} \ No newline at end of file +} diff --git a/gradle-tasks/publish.gradle.kts b/gradle-tasks/publish.gradle.kts new file mode 100644 index 000000000..555f4ff5c --- /dev/null +++ b/gradle-tasks/publish.gradle.kts @@ -0,0 +1,44 @@ +project.extensions.configure { + publications { + create("mavenJava") { + from(components["java"]) + artifactId = project.property("ARTIFACT_NAME") as String + groupId = project.property("GROUP_ID") as String + version = if (project.findProperty("SNAPSHOT_VERSION") != null) { + project.findProperty("SNAPSHOT_VERSION") as String + } else { + project.property("VERSION") as String + } + description = project.findProperty("DESCRIPTION") as String? + + pom { + name.set(project.property("ARTIFACT_NAME") as String) + description.set(project.findProperty("DESCRIPTION") as String?) + url.set(project.property("POM_URL") as String) + + licenses { + license { + name.set(project.property("LICENSE_NAME") as String) + url.set(project.property("LICENSE_URL") as String) + distribution.set(project.property("LICENSE_DISTRIBUTION") as String) + comments.set(project.property("LICENSE_COMMENTS") as String) + } + } + + developers { + developer { + name.set(project.property("DEVELOPER_NAME") as String) + organization.set(project.property("DEVELOPER_ORG") as String) + organizationUrl.set(project.property("DEVELOPER_ORG_URL") as String) + } + } + + scm { + url.set(project.property("POM_SCM_URL") as String) + connection.set(project.property("POM_SCM_CONNECTION") as String) + developerConnection.set(project.property("POM_SCM_DEVELOPER_CONNECTION") as String) + } + } + } + } +} diff --git a/gradle-tasks/sdk-properties.gradle.kts b/gradle-tasks/sdk-properties.gradle.kts new file mode 100644 index 000000000..074ea6ad2 --- /dev/null +++ b/gradle-tasks/sdk-properties.gradle.kts @@ -0,0 +1,20 @@ +import org.gradle.language.jvm.tasks.ProcessResources + +// Retrieve properties from the Gradle project +val artifactName = project.property("ARTIFACT_NAME") as String +val version = project.property("VERSION") as String +val groupId = project.property("GROUP_ID") as String + +// Prepare the content for sdk.properties +val sdkPropertiesContent = """ + artifactName=$artifactName + version=$version + groupId=$groupId +""".trimIndent() + +// Configure the processResources task to include sdk.properties +tasks.named("processResources") { + from(project.resources.text.fromString(sdkPropertiesContent)) { + rename { "sdk.properties" } + } +} \ No newline at end of file diff --git a/gradle-tasks/signing.gradle.kts b/gradle-tasks/signing.gradle.kts new file mode 100644 index 000000000..f388425f4 --- /dev/null +++ b/gradle-tasks/signing.gradle.kts @@ -0,0 +1,9 @@ +extensions.configure { + val signingKey = System.getenv("GPG_SECRET") + val signingPassword = System.getenv("GPG_PASSPHRASE") + + useInMemoryPgpKeys(signingKey, signingPassword) + + val publishing = project.extensions.getByType() + sign(publishing.publications) +} diff --git a/gradle-tasks/snapshot.gradle b/gradle-tasks/snapshot.gradle new file mode 100644 index 000000000..d74a0b2e9 --- /dev/null +++ b/gradle-tasks/snapshot.gradle @@ -0,0 +1,27 @@ +// Nexus publishing plugin relies on the root project version to determine which repository to use (releases | snapshots) +// We're setting the root project to a dummy version (1.0.0-SNAPSHOT) to instruct the plugin to use the snapshot repo. +// This version won't be published. The publishSnapshots task will publish submodules with the defined version in their gradle.properties +gradle.taskGraph.whenReady { taskGraph -> + if (taskGraph.hasTask(":publishSnapshots")) { + rootProject.version = "1.0.0-SNAPSHOT" + println "📌 Setting root project version to 1.0.0-SNAPSHOT for publishSnapshots task" + } +} + +tasks.register("publishSnapshots") { + def snapshotModules = rootProject.subprojects.findAll { project -> + project.version.toString().contains("-SNAPSHOT") && project.tasks.named("publish") != null + } + + if (!snapshotModules.isEmpty()) { + dependsOn snapshotModules.collect { ":${it.name}:publish" } + } + + doLast { + if (snapshotModules.isEmpty()) { + println "❌ No snapshot modules to publish." + } else { + println "📦 Successfully published snapshots for: ${snapshotModules*.name}" + } + } +} diff --git a/gradle-tasks/specs.gradle.kts b/gradle-tasks/specs.gradle.kts new file mode 100644 index 000000000..6b16f260c --- /dev/null +++ b/gradle-tasks/specs.gradle.kts @@ -0,0 +1,30 @@ +tasks.register("mergeSpecs") { + exec { + commandLine( + "npx openapi-merge-cli".split(" ") + ) + workingDir = File(rootDir, "specs") + } +} + +tasks.register("transformSpecs") { + dependsOn("mergeSpecs") + + exec { + commandLine( + "npx --yes -p @expediagroup/spec-transformer cli --headers --operationIdsToTags -i specs.yaml -o specs.yaml" + .split(" ") + ) + workingDir = File(rootDir, "specs") + } +} + +tasks.register("prepareSpecs") { + dependsOn("mergeSpecs", "transformSpecs") + + doLast { + File("$rootDir", "specs/specs.yaml").copyTo( + File("$rootDir", "generator/src/main/resources/specs-copied.yaml"), + ) + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..3f89b0550 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,28 @@ +kotlin.code.style=official + +# Publishing defaults +GROUP_ID=com.expediagroup + +# POM +POM_URL=https://github.com/ExpediaGroup/xap-java-sdk +POM_LICENCE_NAME=MIT +POM_LICENCE_DIST=repo + +# POM LICENSE +LICENSE_NAME=The Apache License, Version 2.0 +LICENSE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +LICENSE_DISTRIBUTION=repo +LICENSE_COMMENTS=A business-friendly OSS license + +# POM DEVELOPERS +DEVELOPER_NAME=Expedia Group Committers +DEVELOPER_ORG=Expedia Group +DEVELOPER_ORG_URL=https://www.expediagroup.com/ + +# SCM +POM_SCM_URL=https://github.com/ExpediaGroup/xap-java-sdk +POM_SCM_CONNECTION=scm:git:git://github.com/ExpediaGroup/xap-java-sdk.git +POM_SCM_DEVELOPER_CONNECTION=scm:git:ssh://github.com/ExpediaGroup/xap-java-sdk.git + +# JVM PARAMS +org.gradle.jvmargs=-Xmx2g diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000..a4b76b953 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..37f853b1c --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 000000000..f5feea6d6 --- /dev/null +++ b/gradlew @@ -0,0 +1,252 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# 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 +# +# https://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. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 000000000..9b42019c7 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..a2686a1f1 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,18 @@ +pluginManagement { + repositories { + mavenLocal() + gradlePluginPortal() + maven { + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + } + } +} + +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" +} + +rootProject.name = "xap-java-sdk" +include("xap-sdk") +include("generator") +include("examples") diff --git a/specs/openapi-merge.json b/specs/openapi-merge.json index 99d08b075..4961f19df 100644 --- a/specs/openapi-merge.json +++ b/specs/openapi-merge.json @@ -26,6 +26,24 @@ "dispute": { "prefix": "Activities" } + }, + { + "inputFile": "./xap-flight-v1.specs.yaml", + "dispute": { + "prefix": "FlightsV1" + } + }, + { + "inputFile": "./xap-flight-v2.specs.yaml", + "dispute": { + "prefix": "FlightsV2" + } + }, + { + "inputFile": "./xap-flight-v3.specs.yaml", + "dispute": { + "prefix": "FlightsV3" + } } ], "output": "./specs.yaml" diff --git a/specs/xap-flight-v1.specs.yaml b/specs/xap-flight-v1.specs.yaml new file mode 100644 index 000000000..cd6aa1f04 --- /dev/null +++ b/specs/xap-flight-v1.specs.yaml @@ -0,0 +1,773 @@ +openapi: 3.0.1 +info: + title: EWSAir V1 APIs + description: OpenAPI Spec for EWS Air V1 APIs + contact: + name: Partner APIs + url: 'https://confluence.expedia.biz/display/EWS/EWS+Air' + email: EWSTeam@expedia.com + version: v1 + x-eg-lifecycle: LIVE + x-eg-tags: ["EWS", "Flights", "Flight FareRules", "Flight BaggageFee"] +servers: + - url: 'https://apim.expedia.com' + description: Production Server +tags: + - name: Flight FareRules + - name: Flight BaggageFee +paths: + /flights/baggagefees/{offerToken}: + get: + tags: + - Flight BaggageFee + description: request for baggage fee information + operationId: get-flight-bagaggefee + parameters: + - name: offerToken + in: path + description: The offerToken from the Flight Listings API + required: true + schema: + type: string + example: ClsKAkFBGhcyMDIxLTA0LTIxVDE0OjU1OjAwLjAwMCIDU0VBKhcyMDIxLTA0LTIxVDE3OjUxOjAwLjAwMDIDUEhYOgFOQghOVkFIWlNONUoHRUNPTk9NWVIDNzEwClwKAkFBGhcyMDIxLTA0LTIxVDIxOjQxOjAwLjAwMCIDUEhYKhcyMDIxLTA0LTIxVDIyOjUwOjAwLjAwMDIDTEFTOgFOQghOVkFIWlNONUoHRUNPTk9NWVIEMjEwNhIDVVNEGgJLRw + - name: locale + in: query + description: |- + Locale information to provide airline name. + If this information is not provided, the locale corresponding for that partners default will be selected. + schema: + type: string + example: en_US + - name: currency + in: query + description: |- + Specifies currency code for baggage fees to be returned in. Format should be ISO 4217 currency code (3 letter). + If this information is not provided, the currency corresponding for that partners default will be selected. + schema: + type: string + example: en_US + - name: Key + in: header + description: |- + Unique identifier assigned to partner. + Required for all requests. + Obtained from Expedia Account Manager or representative. + required: true + schema: + type: string + example: X99X9X9-99XX-9XX9-X999-99XX99X9X999X + - name: Partner-Transaction-ID + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: 123456-798101112 + - name: Accept + in: header + description: Accept header for the request. + required: true + schema: + type: string + example: application/vnd.exp-flight.v1+json + - name: Accept-Encoding + in: header + description: Accept encoding for the request. + required: false + schema: + type: string + example: gzip + responses: + '400': + description: | + The locale provided in the request is not supported by API(INVALID_LOCALE). + The accept header provided is not as per the documentation(INVALID_ACCEPT_HEADER). + content: + application/vnd.exp-flight.v1+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: INVALID_ACCEPT_HEADER + Description: Please provide a valid Accept header + TransactionId: c38d0183-5c90-4db6-8c5e-31b7294cd06f + '200': + description: "Baggage fee information returned successfully (this can also\ + \ include Warnings in some cases).Possible warning codes are \nNO_RESULTS_FOUND\n\ + NO_FEE_INFO\n" + content: + application/vnd.exp-flight.v1+json: + schema: + $ref: '#/components/schemas/FlightBaggageFeesResponse' + example: + FlightBaggageFees: + - FlightSegment: + AirlineCode: AA + AirlineName: American Airlines + DepartureAirport: + Code: SEA + ArrivalAirport: + Code: LAS + Links: + WebBaggageFees: + Method: GET + Href: https://www.aa.com/i18n/travelInformation/baggage/baggageAllowance.jsp + BaggageFees: + - BagType: FIRST_BAG + WeightUnit: kg + Weight: "23" + Application: upto + FixedCharge: + Value: "30.0" + Currency: USD + - BagType: SECOND_BAG + WeightUnit: kg + Weight: "23" + Application: upto + FixedCharge: + Value: "40.0" + Currency: USD + - BagType: CARRY_ON + FixedCharge: + Value: "0.0" + Currency: USD + - BagType: PREPAID_CARRY_ON + FixedCharge: + Value: "0.0" + Currency: USD + TransactionId: 6e3c782e-54e4-4f48-a909-d4f2e4fd31c4 + '500': + description: | + Server side error like backend service has some issues or some issues in EWS Air service. The Error code is SERVER_ERROR + content: + application/vnd.exp-flight.v1+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: SERVER_ERROR + Description: An error has occurred while processing the request + TransactionId: 68bce810-5af7-40c1-bea7-07a823b6f1f0 + '404': + description: No Route matched + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + '429': + description: API rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + '401': + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + '403': + description: cannot consume this service + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + '503': + description: name resolution failed + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + '504': + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out + security: + - basicSchema: [] + /flights/farerules/{offerToken}: + get: + tags: + - Flight FareRules + description: request for farerule information + operationId: get-flight-farerules + parameters: + - name: offerToken + in: path + description: An offerToken from a Flight API responses. + required: true + schema: + type: string + example: 599be702-d354-4065-bd52-348af7c728d2 + - name: locale + in: query + description: |- + locale information + (Even though locale may be requested, the majority of the information in the response comes directly from the GDS systems and does NOT have any localization to languages other than English) + schema: + type: string + example: en_US + - name: Source + in: header + description: |- + Accepts any single-word value that describes the source from which the API is being called. + Example: 'Details', 'Book', 'Itin', etc. + schema: + type: string + example: Details + - name: Key + in: header + description: |- + Unique identifier assigned to partner. + Required for all requests. + Obtained from Expedia Account Manager or representative. + required: true + schema: + type: string + example: X99X9X9-99XX-9XX9-X999-99XX99X9X999X + - name: Partner-Transaction-ID + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: 123456-798101112 + - name: Accept + in: header + description: Accept header for the request. + required: true + schema: + type: string + example: application/vnd.exp-flight.v1+json + - name: Accept-Encoding + in: header + description: Accept encoding for the request. + required: false + schema: + type: string + example: gzip + responses: + '400': + description: | + Bad request from client.Possible error codes are: + INVALID_ACCEPT_HEADER + INVALID_FARE_RULES_KEY + content: + application/vnd.exp-flight.v1+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: INVALID_ACCEPT_HEADER + Description: Please provide a valid Accept header + TransactionId: aedfd328-797a-43c9-9584-e901ea1f589d + '500': + description: | + Server side error like backend service has some issues or some issues in EWS Air service.Possible error codes are: + SERVER_ERROR + NO_FARE_RULES_FOUND + content: + application/vnd.exp-flight.v1+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: SERVER_ERROR + Description: An error has occurred while processing the request + TransactionId: 68bce810-5af7-40c1-bea7-07a823b6f1f0 + '200': + description: | + FareRules information returned successfully (in some cases this can have warnings). + Warning messages are: + NO_FARE_RULES_FOUND + content: + application/vnd.exp-flight.v1+json: + schema: + $ref: '#/components/schemas/FlightFareRulesResponse' + example: + FlightFareRule: + - FlightSegment: + AirlineCode: AA + DepartureAirport: + Code: LAS + ArrivalAirport: + Code: LAX + FareRules: + - FareBasisCode: OUALZNN3 + Rules: + - Category: RULE APPLICATION AND OTHER CONDITIONS + Description: | + NOTE - THE FOLLOWING TEXT IS INFORMATIONAL AND NOT VALIDATED FOR AUTOPRICING. + NORMAL/EXCURSION FARES + APPLICATION + CLASS OF SERVICE + THESE FARES APPLY FOR FIRST/BUSINESS/ECONOMY/PREMIUM ECONOMY CLASS SERVICE. + CAPACITY LIMITATIONS + SEATS ARE LIMITED. + - Category: ELIGIBILITY + Description: | + NO ELIGIBILITY REQUIREMENTS APPLY. + - Category: DAY/TIME + Description: | + NO DAY/TIME TRAVEL RESTRICTIONS APPLY. + - Category: SEASONALITY + Description: | + NO SEASONAL TRAVEL RESTRICTIONS APPLY. + - Category: FLIGHT APPLICATION + Description: | + THE FARE COMPONENT MUST NOT BE ON ONE OR MORE OF THE FOLLOWING + ANY AA FLIGHT OPERATED BY AS. + AND + THE FARE COMPONENT MUST BE ON ONE OR MORE OF THE FOLLOWING + ANY AA FLIGHT. + TransactionId: 68bce810-5af7-40c1-bea7-07a823b6f1f0 + '404': + description: No Route matched + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + '429': + description: API rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + '401': + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + '403': + description: cannot consume this service + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + '503': + description: name resolution failed + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + '504': + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out + security: + - basicSchema: [] +components: + schemas: + Error: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Error code describing the issue + example: AMBIGUOUS_LOCATION + Description: + type: string + description: A simple description of what the error is. + example: 'Multiple pickup locations found. ' + description: Container for error list. + Errors: + required: + - Errors + - TransactionId + type: object + properties: + Errors: + type: array + description: Container for error list. + items: + $ref: '#/components/schemas/Error' + TransactionId: + type: string + description: A unique identifier for the transaction. + example: a9e371c4-89d9-4f9c-8df7-df105830e7fe + xml: + name: ErrorResponse + Airport: + required: + - Code + type: object + properties: + Code: + type: string + description: Three-letter IATA airport code for departure location + example: SFO + Name: + type: string + description: Name of departure airport + example: San Francisco International Airport + City: + type: string + description: City where departure airport resides + example: San Francisco + Province: + type: string + description: Province or State where departure airport resides + example: CA + Country: + type: string + description: Country where departure airport resides + example: USA + description: Container for arrival airport details. + xml: + name: Airport + BaggageFee: + required: + - BagType + type: object + properties: + BagType: + type: string + description: Specifies the type of baggage. + example: FIRST_BAG + enum: + - PREPAID_CARRY_ON + - PREPAID_FIRST_BAG + - PREPAID_SECOND_BAG + - CARRY_ON + - FIRST_BAG + - SECOND_BAG + WeightUnit: + type: string + description: Specifies weight unit for this bagType. This will always be kilograms. + example: kg + Weight: + type: string + description: Weight of the bag. + example: "23" + Application: + type: string + description: This element specifies descriptive text useful in displaying baggage fees. + example: per + enum: + - upto + - per + FixedCharge: + $ref: '#/components/schemas/Fee' + MaxCharge: + $ref: '#/components/schemas/Fee' + MinCharge: + $ref: '#/components/schemas/Fee' + description: |- + Container for baggage fee information of each bag type. + The baggage fee can vary for each bag type. The amount can be zero, fixed amount or will be in a range + xml: + name: BaggageFees + Fee: + required: + - Currency + - Value + type: object + properties: + Value: + type: string + description: The value of the element being defined. + example: "21.9" + Currency: + type: string + description: The ISO 4217 Currency Code that the value is expressed in. + example: USD + LocalCurrencyPrice: + $ref: '#/components/schemas/Money' + Name: + type: string + description: This is used when a fee range is returned. It specifies the highest value of bag fee. + FlightBaggageFee: + required: + - BaggageFees + - FlightSegment + type: object + properties: + FlightSegment: + $ref: '#/components/schemas/BaggageFeeFlightSegment' + BaggageFees: + type: array + description: |- + Container for baggage fee information of each bag type. + The baggage fee can vary for each bag type. The amount can be zero, fixed amount or will be in a range + items: + $ref: '#/components/schemas/BaggageFee' + description: Container for information on Baggage fee information of each Segment. + xml: + name: FlightBaggageFees + FlightBaggageFeesResponse: + required: + - FlightBaggageFees + - TransactionId + type: object + properties: + Warnings: + type: array + description: Container for Warning messages. + items: + $ref: '#/components/schemas/Warning' + FlightBaggageFees: + type: array + description: Container for information on Baggage fee information of each Segment. + items: + $ref: '#/components/schemas/FlightBaggageFee' + TransactionId: + type: string + description: Unique identifier for the transaction. + example: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + xml: + name: FlightBaggageFeesResponse + FareRule: + required: + - FareBasisCode + - Rules + type: object + properties: + FareBasisCode: + type: string + description: Fare Basis Code to which the rules are applied. + example: W7EB + Rules: + type: array + description: Container for fare rules. + items: + $ref: '#/components/schemas/Rule' + description: Contains the list of fare rule details + Rule: + required: + - Category + - Description + type: object + properties: + Category: + type: string + description: Category name of the rule. + example: ELIGIBILITY + Description: + type: string + description: Rule description. + example: NO ELIGIBILITY REQUIREMENTS APPLY + description: Container for fare rules. + FlightFareRuleItem: + required: + - FlightSegment + type: object + properties: + FlightSegment: + required: + - AirlineCode + - ArrivalAirport + - DepartureAirport + type: object + properties: + AirlineCode: + type: string + description: Specifies the 2 letter IATA airline code of the Most Significant Carrier for the flight. In the case of flights with multiple airlines involves this is the airline who will be charging for the baggage. + example: VX + DepartureAirport: + $ref: '#/components/schemas/Airport' + ArrivalAirport: + $ref: '#/components/schemas/Airport' + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + description: Contains the deeplink URLs of api services and websites + xml: + wrapped: true + FareRules: + type: array + description: Contains the list of fare rule details + xml: + wrapped: true + items: + $ref: '#/components/schemas/FareRule' + description: Container for flight segment information. + description: Container for segment and corresponding fare rules. + xml: + name: FlightFareRules + FlightFareRulesResponse: + required: + - FlightFareRule + - TransactionId + type: object + properties: + FlightFareRule: + type: array + description: Container for segment and corresponding fare rules. + items: + $ref: '#/components/schemas/FlightFareRuleItem' + TransactionId: + type: string + description: Unique identifier for the transaction. + example: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + BaggageFeeFlightSegment: + required: + - AirlineCode + - ArrivalAirport + - DepartureAirport + type: object + properties: + AirlineCode: + type: string + description: Specifies the 2 letter IATA airline code of the most significant carrier for the flight. In the case of flights with multiple airlines involves this is the airline who will be charging for the baggage. + example: VX + AirlineName: + type: string + description: Specifies the name of the airline. Where possible this is localized to the LangID supplied in the request. + example: Virgin America + DepartureAirport: + $ref: '#/components/schemas/Airport' + ArrivalAirport: + $ref: '#/components/schemas/Airport' + CabinClass: + type: string + description: Cabin class name of airline. + example: Economy + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + description: |- + Links to airline's baggage policies. + Where possible this is localized to the LangID supplied in the request. + It is possible that special characters will be present in the URL + xml: + wrapped: true + description: Container for information of Segment. + xml: + name: FlightSegment + Link: + required: + - Href + - Method + type: object + properties: + Accept: + type: string + description: Accept header. + Method: + type: string + description: HTTP method to connect. + example: GET + Href: + type: string + description: HATEOAS URL to fetch details. + description: Contains the deeplink URLs of api services and websites + Money: + required: + - Currency + - Value + type: object + properties: + Value: + type: string + description: The value of the element being defined. + example: "21.9" + Currency: + type: string + description: The ISO 4217 Currency Code that the value is expressed in. + example: USD + description: Container for showing price. + Warning: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Standardized warning code. + example: NO_FEE_INFO + Description: + type: string + description: Standardized warning description message. + example: Fee Information is not available. + description: Container for Warning messages. + APIMError: + title: APIMError + properties: + message: + type: string + securitySchemes: + basicSchema: + type: http + scheme: basic diff --git a/specs/xap-flight-v2.specs.yaml b/specs/xap-flight-v2.specs.yaml new file mode 100644 index 000000000..ee1695648 --- /dev/null +++ b/specs/xap-flight-v2.specs.yaml @@ -0,0 +1,566 @@ +openapi: 3.0.1 +info: + title: EWSAir V2 APIs + description: OpenAPI Spec for EWS Air V2 APIs + contact: + name: Partner APIs + url: 'https://confluence.expedia.biz/display/EWS/EWS+Air' + email: EWSTeam@expedia.com + version: v2 + x-eg-lifecycle: LIVE + x-eg-tags: ["EWS", "Flights", "Flight SeatMap"] +servers: + - url: 'https://apim.expedia.com' + description: Production Server +tags: + - name: Flight SeatMap +paths: + /flights/seatmaps/{offerToken}: + get: + tags: + - Flight SeatMap + description: request for seatmap information + operationId: get-flight-seatmap + parameters: + - name: offerToken + in: path + description: An Air offerToken from a Flight Search or Flight Details. + required: true + schema: + type: string + example: CgFOEgNTRUEaAkFBIhFBbWVyaWNhbiBBaXJsaW5lcyoOQm9laW5nIDczNy04MDAyAzczODodMjAyMS0wNC0yMVQxNzo1MTowMC4wMDAtMDc6MDBCHTIwMjEtMDQtMjFUMTQ6NTU6MDAuMDAwLTA3OjAwSgM3MTBSA1BIWFoHRUNPTk9NWQ + - name: locale + in: query + description: The language in which the response content should be displayed. + schema: + type: string + example: en_US + - name: loyaltyProgramNumber + in: query + description: A Traveler's Loyalty Program number for a specified carrier. + schema: + type: string + example: F263M74 + - name: travelerFirstName + in: query + description: Traveler's first name of whose loyalty information is passed (mandatory if you are entering a loyalty number). + schema: + type: string + example: SAM + - name: travelerLastName + in: query + description: Traveler's last name of whose loyalty information is passed (mandatory if you are entering a loyalty number). + schema: + type: string + example: JOHN + - name: Key + in: header + description: |- + Unique identifier assigned to partner. + Required for all requests. + Obtained from Expedia Account Manager or representative. + required: true + schema: + type: string + example: X99X9X9-99XX-9XX9-X999-99XX99X9X999X + - name: Partner-Transaction-ID + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: 123456-798101112 + - name: Accept + in: header + description: Accept header for the request. + required: true + schema: + type: string + example: application/vnd.exp-flight.v2+json + responses: + '200': + description: | + Seatmap information returned successfully (in some cases this can have warnings). + Warning messages are: + NO_RESULTS_FOUND + MISSING_LOYALTY_INFORMATION + content: + application/vnd.exp-flight.v2+json: + schema: + $ref: '#/components/schemas/SeatMapResponse' + example: + FlightNumber: "710" + DepartureDate: 2021-04-21 + MarketingAirLineCode: AA + MarketingAirLineName: American Airlines + EquipmentCode: "738" + EquipmentName: Boeing 737-800 + DepartureAirport: + Code: SEA + ArrivalAirport: + Code: PHX + SeatMap: + CabinClass: ECONOMY + Rows: + - RowNumber: 8 + Seats: + - SeatNumber: 8A + SeatToken: AQogCNOiARIEMTMyMRiSASCycSjs09sCMPDU2wI4S0AAWAESBRoDQURUGgMxOEE + SeatOccupancy: AVAILABLE + Column: A + SeatCharacteristics: + - Code: W + Name: WINDOW + - Code: M + Name: MAINCABINEXTRA + PaidSeat: true + SeatPrice: + Value: 38.55 + Currency: USD + - RowNumber: 33 + Seats: + - SeatNumber: 33A + SeatToken: AQogCNOiARIEMTMyMRiSASCycSjs09sCMPDU2wI4S0AAWAESBRoDQURUGgMxOEE + SeatOccupancy: OCCUPIED + Column: A + SeatCharacteristics: + - Code: W + Name: WINDOW + PaidSeat: true + SeatPrice: + Value: 38.55 + Currency: USD + - SeatNumber: 33B + SeatToken: AQogCNOiARIEMTMyMRiSASCycSjs09sCMPDU2wI4S0AAWAESBRoDQURUGgMxOEE + SeatOccupancy: OCCUPIED + Column: B + PaidSeat: true + SeatPrice: + Value: 35.20 + Currency: USD + Warnings: + - Code: MISSING_LOYALTY_INFORMATION + Description: travelerFirstName,travelerLastName missing in request + TransactionId: 7b8a36d9-c920-40da-999d-5eddd53318b2 + '400': + description: | + Error shown when accept header or partner transaction ID is missing or invalid. + Possible error codes are: + INVALID_ACCEPT_HEADER + INVALID_ARGUMENT + content: + application/vnd.exp-flight.v2+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: INVALID_ACCEPT_HEADER + Description: Please provide a valid Accept header + TransactionId: aedfd328-797a-43c9-9584-e901ea1f589d + '500': + description: | + There is either no seat map data available for the request or supply failed to provide seat map information due to internal failure. + Possible error codes are: + SEATMAP_NOT_AVAILABLE + SERVER_ERROR + content: + application/vnd.exp-flight.v2+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: SERVER_ERROR + Description: An error has occurred while processing the request + TransactionId: 68bce810-5af7-40c1-bea7-07a823b6f1f0 + '404': + description: No Route matched + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + '429': + description: API rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + '401': + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + '403': + description: cannot consume this service + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + '503': + description: name resolution failed + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + '504': + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out + security: + - basicSchema: [] +components: + schemas: + Airport: + required: + - Code + type: object + properties: + Code: + type: string + description: Three-letter IATA airport code for departure location + example: SFO + Name: + type: string + description: Name of departure airport + example: San Francisco International Airport + City: + type: string + description: City where departure airport resides + example: San Francisco + Province: + type: string + description: Province or State where departure airport resides + example: CA + Country: + type: string + description: Country where departure airport resides + example: USA + Latitude: + type: string + description: Latitude where departure airport resides + example: "33.641" + Longitude: + type: string + description: Longitude where departure airport resides + example: "84.4429" + description: Container for showing the arrival airport details + xml: + name: Airport + Row: + required: + - RowNumber + type: object + properties: + RowNumber: + type: integer + description: Specific row number. + format: int32 + example: 37 + RowCharacteristics: + type: array + description: Container for row characteristics. + items: + $ref: '#/components/schemas/RowCharacteristic' + Seats: + type: array + description: |- + Container for seat information in that particular row. + It can be null if it is empty row. + items: + $ref: '#/components/schemas/Seat' + description: Container for list of seat row information. + xml: + name: Row + RowCharacteristic: + required: + - Code + - Name + type: object + properties: + Code: + type: string + description: Code of Row + example: E + enum: + - E + - X + - S + - N + - U + - W + Name: + type: string + description: |- + Corresponding name for the row code + Same response will have upper deck and lower deck information if any + example: EMPTY + enum: + - EMPTY + - EXIT + - SMOKING + - NONSMOKING + - UPPERDECK + - OVERWING + description: Container for row characteristics. + xml: + name: RowCharacteristic + Seat: + type: object + properties: + SeatNumber: + type: string + description: |- + Seat Number + It can be null if there is no physical seat in the location + example: 37A + SeatToken: + type: string + description: Token used by the Booking service to reserve seats + example: AQogCNOiARIEMTMyMRiSASCycSjs09sCMPDU2wI4S0AAWAESBRoDQURUGgMxOEE + SeatOccupancy: + type: string + description: |- + Occupancy details whether it is available or not. + It can be null if there is no physical seat in that location. + AVAILABLE - Seat is currently available for selection. + OCCUPIED - Seat already occupied + example: OCCUPIED + enum: + - AVAILABLE + - OCCUPIED + Column: + type: string + description: It can be null if there is no physical seat in that location + example: A + SeatCharacteristics: + type: array + description: Container for seat characteristics information. + items: + $ref: '#/components/schemas/SeatCharacteristic' + PaidSeat: + type: boolean + description: A boolean object (true/false) to indicate whether the seat is paid or not. It can be null + SeatPrice: + type: object + description: Container for seat price to provide fee information associated with a paid seat. It can be null if it is not a paid seat. + required: + - Value + - Currency + properties: + Value: + type: string + example: "17.99" + Currency: + type: string + example: "USD" + description: |- + Container for seat information in that particular row. + It can be null if it is empty row. + xml: + name: Seat + SeatCharacteristic: + required: + - Code + - Name + type: object + properties: + Code: + type: string + description: Code of seat + example: W + enum: + - E + - H + - W + - A + - X + - M + - S + - P + Name: + type: string + description: Corresponding name for the seat code + example: WINDOW + enum: + - EMPTY + - ACCESSIBLE + - WINDOW + - AISLE + - EXIT + - MAINCABINEXTRA + - PREFERRED + - PREMIUM + description: Container for seat characteristics information. + xml: + name: SeatCharacteristic + SeatMap: + required: + - CabinClass + - Rows + type: object + properties: + CabinClass: + type: string + description: Cabin code for different class of service offered by the airline + example: ECONOMY + enum: + - ECONOMY + - FIRST + - BUSINESS + - PREMIUM_ECONOMY + Rows: + type: array + description: Container for list of seat row information. + items: + $ref: '#/components/schemas/Row' + description: Container for seatmap information. + xml: + name: SeatMap + SeatMapResponse: + required: + - ArrivalAirport + - DepartureAirport + - DepartureDate + - EquipmentCode + - FlightNumber + - MarketingAirLineCode + - SeatMap + - TransactionId + type: object + properties: + FlightNumber: + type: string + description: Specifies the requested flight number. + example: "0300" + DepartureDate: + type: string + description: Specifies the departure date of the requested flight + format: date + example: 2021-07-03 + MarketingAirLineCode: + type: string + description: The IATA or Expedia assigned airline codes of the carrier. IATA codes must contain at least one alphabetic character. + example: AS + MarketingAirLineName: + type: string + description: The airline name of the marketing airline + example: Alaska Airlines + EquipmentCode: + type: string + description: IATA Equipment type codes. + example: 73J + EquipmentName: + type: string + description: Equipment type name. + example: Airbus 123 + DepartureAirport: + $ref: '#/components/schemas/Airport' + ArrivalAirport: + $ref: '#/components/schemas/Airport' + SeatMap: + $ref: '#/components/schemas/SeatMap' + Warnings: + type: array + description: Container for Warning messages. + items: + $ref: '#/components/schemas/Warning' + TransactionId: + type: string + description: Unique identifier for the transaction. + example: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + xml: + name: SeatMapResponse + Warning: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Standardized warning code. + example: NO_RESULTS_FOUND + Description: + type: string + description: Standardized warning description message. + example: No results found for the request. + description: Container for Warning message. + Error: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Error code describing the issue + example: SERVER_ERROR + Description: + type: string + description: A simple description of what the error is. + example: An error has occurred while processing the request. + description: Container for error list. + Errors: + required: + - Errors + - TransactionId + type: object + properties: + Errors: + type: array + description: Container for error list. + items: + $ref: '#/components/schemas/Error' + TransactionId: + type: string + description: A unique identifier for the transaction. + example: a9e371c4-89d9-4f9c-8df7-df105830e7fe + xml: + name: ErrorResponse + APIMError: + title: APIMError + properties: + message: + type: string + securitySchemes: + basicSchema: + type: http + scheme: basic diff --git a/specs/xap-flight-v3.specs.yaml b/specs/xap-flight-v3.specs.yaml new file mode 100644 index 000000000..af6f61ab7 --- /dev/null +++ b/specs/xap-flight-v3.specs.yaml @@ -0,0 +1,4571 @@ +openapi: 3.0.1 +info: + title: EWSAir V3 APIs + description: OpenAPI Spec for EWS Air V3 APIs + contact: + name: Partner APIs + url: 'https://confluence.expedia.biz/display/EWS/EWS+Air' + email: EWSTeam@expedia.com + version: v3 + x-eg-lifecycle: LIVE + x-eg-api-tags: ["EWS", "XAP", "Flights", "EWSFlights", "Flight List", "Flight Details", "Flight Links", "Flight FlexSearch", + "Flight FareCalendar"] +tags: + - name: Flight Links + - name: Flight Listings + - name: Flight Details + - name: Flight FlexSearch + - name: Flight FareCalendar +servers: + - url: 'https://apim.expedia.com' + description: Production Server +paths: + '/flights/links': + post: + tags: + - Flight Links + parameters: + - name: Key + in: header + description: |- + Unique identifier assigned to partner. + Required for all requests. + Obtained from Expedia Account Manager or representative. + required: true + schema: + type: string + example: X99X9X9-99XX-9XX9-X999-99XX99X9X999X + - name: Partner-Transaction-ID + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: 123456-798101112 + - name: Accept + in: header + description: Accept header for the request. + required: true + schema: + type: string + example: application/vnd.exp-flight.v3+json + - name: Accept-Encoding + in: header + description: Accept encoding for the request. + required: false + schema: + type: string + example: gzip + summary: "Request for flight links" + operationId: "post-flight-links" + description: "The API inputs define a particular flight itinerary. The API response will include deeplinks to Expedia Flight Infosite and/or an API query for details for the selected flight." + requestBody: + content: + 'application/json': + schema: + "$ref": '#/components/schemas/FlightLinksRequest' + example: + Flights: + - FlightId: abc + SplitTicket: false + Segments: + - FareType: PUBLISHED + Provider: Amadeus + LowCost: false + Legs: + - DepartureAirport: + Code: COK + ArrivalAirport: + Code: DOH + DepartureDateTime: '2021-05-06T03:35:00+05:30' + ArrivalDateTime: '2021-05-06T05:35:00+03:00' + FlightNumber: '517' + MarketingAirlineCode: QR + BookingCode: W + CabinClass: ECONOMY + - DepartureAirport: + Code: DOH + ArrivalAirport: + Code: ORD + DepartureDateTime: '2021-05-06T08:50:00+03:00' + ArrivalDateTime: '2021-05-06T14:55:00-05:00' + FlightNumber: '725' + MarketingAirlineCode: QR + BookingCode: W + CabinClass: ECONOMY + TotalPrice: + Value: '2576.68' + Currency: USD + - FlightId: def + SplitTicket: false + Segments: + - FareType: PUBLISHED + Provider: Sabre + LowCost: false + Legs: + - DepartureAirport: + Code: COK + ArrivalAirport: + Code: AUH + DepartureDateTime: '2021-05-06T21:25:00+05:30' + ArrivalDateTime: '2021-05-06T23:55:00+04:00' + FlightNumber: '6528' + MarketingAirlineCode: 9W + BookingCode: H + CabinClass: ECONOMY + - DepartureAirport: + Code: AUH + ArrivalAirport: + Code: ORD + DepartureDateTime: '2021-05-07T03:20:00+04:00' + ArrivalDateTime: '2021-05-07T08:55:00-05:00' + FlightNumber: '6405' + MarketingAirlineCode: 9W + BookingCode: H + CabinClass: ECONOMY + TotalPrice: + Value: '3266.52' + Currency: USD + Passengers: + Adult: '1' + Senior: '1' + ChildrenAges: '2,14' + Links: + - WD + - AD + responses: + '200': + description: "Links returned successfully" + content: + 'application/vnd.exp-flight.v3+json': + schema: + $ref: "#/components/schemas/FlightLinksResponse" + '500': + description: "Internal Server Error" + content: + 'application/vnd.exp-flight.v3+json': + schema: + $ref: "#/components/schemas/ErrorResponse" + '400': + description: "Bad Request" + content: + 'application/vnd.exp-flight.v3+json': + schema: + $ref: "#/components/schemas/ErrorResponse" + '401': + description: "Unauthorized" + content: + 'application/json': + schema: + type: object + required: + - message + properties: + message: + type: string + example: "Invalid authentication credentials" + '403': + description: "Forbidden" + content: + 'application/json': + schema: + type: object + required: + - message + properties: + message: + type: string + example: "You cannot consume this service" + '404': + description: "Not Found" + content: + 'application/json': + schema: + type: object + required: + - message + properties: + message: + type: string + example: "The server can't find the requested resource" + '405': + description: "Method Not Allowed" + content: + 'application/json': + schema: + type: object + required: + - message + properties: + message: + type: string + example: "The request method is known by the server but is not supported by the target resource" + '429': + description: "Too Many Requests" + content: + 'application/json': + schema: + type: object + required: + - message + properties: + message: + type: string + example: "The user has sent too many requests in a given amount of time" + '503': + description: "Service Unavailable" + content: + 'application/json': + schema: + type: object + required: + - message + properties: + message: + type: string + example: "The server is not ready to handle the request" + '504': + description: "Gateway Timeout" + content: + 'application/json': + schema: + type: object + required: + - message + properties: + message: + type: string + example: "The server, while acting as a gateway or proxy, did not get a response in time from the upstream server that it needed in order to complete the request" + /flights/listings: + get: + tags: + - Flight Listings + description: search flight products + operationId: get-flight-listings + parameters: + - name: adult + in: query + description: |- + Number of Adult Travelers. + Either one adult or one senior per itinerary is mandatory + schema: + type: integer + example: 1 + - name: senior + in: query + description: Number of Senior (age > 65) Travelers + schema: + type: integer + example: 1 + - name: childrenAges + in: query + description: Comma-separated list of the ages of all child travelers (ages 2 - 17). + schema: + type: string + example: 4,5 + - name: infantInLap + in: query + description: |- + Number of Infant travelers without a reserved seat. + Age should be less than 2 + schema: + type: integer + example: 1 + - name: infantInSeat + in: query + description: |- + Number of Infant travelers with reserved seat. + Age should be less than 2 + schema: + type: integer + example: 1 + - name: segment1.origin + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is departing. + required: true + schema: + type: string + example: LAS + - name: segment1.destination + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is arriving. + required: true + schema: + type: string + example: LAX + - name: segment1.departureDate + in: query + description: Date, in ISO format [YYYY-MM-DD], on which customer wants to depart. + required: true + schema: + type: string + format: date + example: '2021-07-01' + - name: segment1.departureStartTime + in: query + description: Lower limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + example: 07:00:00 + - name: segment1.departureEndTime + in: query + description: Upper limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + example: 09:00:00 + - name: segment2.origin + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is departing. + schema: + type: string + - name: segment2.destination + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is arriving. + schema: + type: string + - name: segment2.departureDate + in: query + description: Date, in ISO format [YYYY-MM-DD], on which customer wants to depart. + schema: + type: string + - name: segment2.departureStartTime + in: query + description: Lower limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + - name: segment2.departureEndTime + in: query + description: Upper limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + - name: segment3.origin + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is departing. + schema: + type: string + - name: segment3.destination + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is arriving. + schema: + type: string + - name: segment3.departureDate + in: query + description: Date, in ISO format [YYYY-MM-DD], on which customer wants to depart. + schema: + type: string + - name: segment3.departureStartTime + in: query + description: Lower limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + - name: segment3.departureEndTime + in: query + description: Upper limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + - name: segment4.origin + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is departing. + schema: + type: string + - name: segment4.destination + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is arriving. + schema: + type: string + - name: segment4.departureDate + in: query + description: Date, in ISO format [YYYY-MM-DD], on which customer wants to depart. + schema: + type: string + - name: segment4.departureStartTime + in: query + description: Lower limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + - name: segment4.departureEndTime + in: query + description: Upper limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + - name: segment5.origin + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is departing. + schema: + type: string + - name: segment5.destination + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is arriving. + schema: + type: string + - name: segment5.departureDate + in: query + description: Date, in ISO format [YYYY-MM-DD], on which customer wants to depart. + schema: + type: string + - name: segment5.departureStartTime + in: query + description: Lower limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + - name: segment5.departureEndTime + in: query + description: Upper limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + - name: segment6.origin + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is departing. + schema: + type: string + - name: segment6.destination + in: query + description: 3-letter IATA Airport code/Location name from where the passenger is arriving. + schema: + type: string + - name: segment6.departureDate + in: query + description: Date, in ISO format [YYYY-MM-DD], on which customer wants to depart. + schema: + type: string + - name: segment6.departureStartTime + in: query + description: Lower limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + - name: segment6.departureEndTime + in: query + description: Upper limit of desired departure time window, expressed in the local time of the departure location, in standard ISO format. + schema: + type: string + - name: locale + in: query + description: Indicates the language and country with which the user would like to see any translated information. + schema: + type: string + example: en_US + - name: cabinClass + in: query + description: |- + The desired cabin classes that the user would like to see offers for. + Options can be: economy | first | business | premiumeconomy + schema: + type: string + example: economy + - name: numberOfStops + in: query + description: |- + Filter for the number of stops the user would like to see offers for. + A value of 0 returns only non-stop flights in the search response, and a value of 1 returns offers + schema: + type: integer + example: 0 + - name: sortType + in: query + description: |- + Sort the search results according to one selected category. + Only sort by price is supported at this time. + Note: default = Price + schema: + type: string + example: Price + - name: limit + in: query + description: |- + The maximum number of Flight offers returned in the response. + Must be an integer value greater than 0.Note: default = 1600 + schema: + type: integer + example: 100 + - name: selectedCarriers + in: query + description: Adding comma-separated list of IATA or Expedia airline codes will limit the search results to include flight offers only with the selected carriers. + schema: + type: string + example: AS + - name: accountCodes + in: query + description: AlphaNumeric characters. Different codes separated by comma + schema: + type: string + example: AXP01 + - name: agent + in: query + description: |- + Designates whether a telesales agent was involved in the transaction. + true = telesales agent involved + false = no telesales agent involved + schema: + type: boolean + example: true + - name: links + in: query + description: |- + Comma-separated list that indicates which HATEOAS links should be included in the response. + WD (Website Details Page - included by default) + AD (Details API link) + ABF (Baggage Fee API) + ASM (Seat Map API) + WPS (Web Package Search) + schema: + type: string + example: WD + - name: refundable + in: query + description: |- + Refundable solutions will be returned if and only if we pass refundable as true in the request.(refundable=true). + (Not Yet Supported in Production) + schema: + type: boolean + example: true + - name: filterNearByAirport + in: query + description: |- + Filters nearby airports ensuring only results from the requests airport code are returned. + This request param is valid only for AirportCode-based searches. + Note: default = false + schema: + type: boolean + example: true + - name: filterBasicEconomy + in: query + description: |- + Filters out all the Basic Economy fare solutions in the flight search response. + Note: default = false + schema: + type: boolean + example: true + - name: anchorBy + in: query + description: |- + Designates that the user is doing a Multi-step Search. + Possible values are: segment1 | segment2 | segment3 | segment4 | segment5 + schema: + type: string + example: segment1 + - name: selectedOffer + in: query + description: | + Captures the previously selected flight segments during a Multi-step Search. + schema: + type: string + example: AQojCiEIwYIBEgM1MDQYi5ABIIu4ASihu5wBMPa7nAE4QkAAWAESCggBEAEYASoCQUEYASIECAEQASgCKAMoBDAC%2BAQokCiIIxJgBEgQyOTkyGIu4ASCLkAEovNycATCG3ZwBOEVAAFgBEgoIARABGAEqAkRMGAEiBAgBEAEoAigDKAQwAQ + - name: filterNonFlightOffers + in: query + description: |- + If set to true, this parameter filters out all non-Flight Offers (offers with any of the legs comprising transit via Train, Bus or Boat) from flight search response. + If the parameter is not present or is set to false, then Flight Offers may contain travel legs via means other than flight (Train, Bus or Boat). + Default value is false + schema: + type: boolean + example: true + - name: enableSplitTicket + in: query + description: |- + if set to false, this parameter will filter out all the split ticket solutions from the Flight Offers. + If set to true (by default it will be true), API response will include split ticket solutions if split ticket is enabled at key configuration level as well. + schema: + type: boolean + example: true + - name: Key + in: header + description: |- + Unique identifier assigned to partner. + Required for all requests. + Obtained from Expedia Account Manager or representative. + required: true + schema: + type: string + example: X99X9X9-99XX-9XX9-X999-99XX99X9X999X + - name: Partner-Transaction-ID + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: 123456-798101112 + - name: Accept + in: header + description: Accept header for the request. + required: true + schema: + type: string + example: application/vnd.exp-flight.v3+json + - name: Accept-Encoding + in: header + description: Accept encoding for the request. + required: false + schema: + type: string + example: gzip + responses: + '400': + description: |- + Client side error while providing the request i.e bad / invalid input parameters. + Possible Error codes { MISSING_ADULT_OR_SENIOR + INFANT_IN_LAP_ACCOMPANIED_BY_ADULT_OR_SENIOR + INVALID_CHILD_AGE + INVALID_ACCEPT_HEADER + INVALID_PASSENGER_COUNT + ORIGIN_REQUIRED + INVALID_ORIGIN + DESTINATION_REQUIRED + INVALID_DESTINATION + INVALID_DEPARTURE_DATE + INVALID_DEPARTURE_TIME + DEPARTURE_TIME_DEPARTURE_TIMESPAN_NOT_ALLOWED_TOGETHER + DEPARTURE_DATE_OUT_OF_RANGE + DEPARTURE_DATE_OUT_OF_RANGE + INVALID_LOCALE + INVALID_ADULT_COUNT + INVALID_SENIOR_COUNT + INVALID_CHILD_COUNT + INVALID_INFANT_IN_LAP_COUNT + INVALID_INFANT_IN_SEAT_COUNT + INVALID_SELECTED_CARRIERS + INVALID_SELECTED_CARRIERS + INVALID_NUMBER_OF_STOPS + INVALID_SORT_TYPE + INVALID_NUMBER_OF_FLIGHTS + SELECTED_FLIGHT_DETAILS_NOT_AVAILABLE + INVALID_ANCHOR + INVALID_CABIN_CLASS + INVALID_DEPARTURE_TIMESPAN + MISSING_MANDATORY_SEGMENT_DETAILS + ORIGIN_DESTINATION_SAME + INVALID_DEPARTURE_DATE + INVALID_LINKS + INVALID_AGENT + } + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: INVALID_ACCEPT_HEADER + Description: Please provide a valid Accept header + TransactionId: c38d0183-5c90-4db6-8c5e-31b7294cd06f + '500': + description: | + Server side error like backend service has some issues or some issues in EWS Air service. The Error code is SERVER_ERROR + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: SERVER_ERROR + Description: An error has occurred while processing the request + TransactionId: 68bce810-5af7-40c1-bea7-07a823b6f1f0 + '409': + description: There are no flights for a requested criteria during flight search API + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: NO_RESULTS_FOUND + Description: No flights solutions found for the request. + TransactionId: 68bce810-5af7-40c1-bea7-07a823b6f1f0 + '200': + description: Success Response + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/FlightSearchResponse' + example: + Segments: + - SegmentId: MTRfUHVibGlzaGVk + FlightDuration: PT4H34M + TotalStops: 0 + DepartureArrivalDayDifference: 1 + AirportChange: false + SeatsLeft: 10 + FareType: PUBLISHED + Legs: + - DepartureAirport: + Code: LAS + Name: McCarran Intl. + City: Las Vegas + Province: NV + Country: USA + Latitude: "36.085393" + Longitude: "-115.150098" + ArrivalAirport: + Code: FLL + Name: Fort Lauderdale - Hollywood Intl. + City: Fort Lauderdale + Province: FL + Country: USA + Latitude: "26.071529" + Longitude: "-80.1449" + DepartureDateTime: 2021-11-01T22:40:00-07:00 + ArrivalDateTime: 2021-11-02T06:14:00-04:00 + FlightNumber: "954" + MarketingAirlineCode: NK + MarketingAirlineName: Spirit Airlines + EquipmentCode: 32A + FlightOnTimePercentage: "80" + EquipmentName: AIRBUS INDUSTRIE A320 SHARKLETS + FlightDuration: PT4H34M + SeatMapAvailable: false + FlightDistance: + Value: "2161" + Unit: MI + BookingCode: R + CabinClass: ECONOMY + FareBasisCode: R7XSNR + MealOptions: + - FOOD_FOR_PURCHASE + Amenities: + Entertaintment: + Available: YES + Wifi: + Available: YES + Power: + Available: YES + Offers: + - offerToken: v5-sos-42b700553889490c9e966329ac528b67-3-1~0.S~AQoCCAESBwjUBBABGAEgASAMIAcgDSAJKAJYAQ~AQoiCiAIzpYBEgM5NTQYi5ABIOVaKLSouwEwxqq7AThSQABYARIKCAEQARgBKgJOSxgEIgQIARABIgQIAhACIgQIAxABKAIoAygEMAI+AQoiCiAIzpYBEgM5NTQYi5ABIOVaKLSouwEwxqq7AThSQABYARIKCAEQARgBKgJOSxgEIgQIARABIgQIAhACIgQIAxABKAIoAygEMAI + SplitTicket: false + OpaqueFlight: false + Free24HourCancellation: false + Links: + WebDetails: + Method: GET + Href: https://www.expedia.com/go/udp?CCheck=1&NumAdult=1&NumSenior=1&NumChild=2&ChildrenAges=2|3&Class=3&Sort=10&TripType=OneWay&ProductType=air&eapid=0-1&ServiceVersion=V5&MessageGuid=80f50380-34fa-11e9-9415-0a6b914daa30&langid=1033&piid=v5-sos-42b700553889490c9e966329ac528b67-3-1~0.S~AQoCCAESBwjUBBABGAEgASAMIAcgDSAJKAJYAQ~AQoiCiAIzpYBEgM5NTQYi5ABIOVaKLSouwEwxqq7AThSQABYARIKCAEQARgBKgJOSxgEIgQIARABIgQIAhACIgQIAxABKAIoAygEMAI&Price=545.16&CurrencyCode=USD�cy=USD&DepartureTLA=L1:LAS&ArrivalTLA=L1:FLL&DepartureDate=L1:2021-11-01&ArrivalDate=L1:2021-11-02&RefundableFlightsOnly=N + SegmentIds: + - MTRfUHVibGlzaGVk + OfferPrice: + TotalPrice: + Value: "545.16" + Currency: USD + BasePrice: + Value: "453.92" + Currency: USD + TotalTaxes: + Value: "91.24" + Currency: USD + TotalTaxesAndFees: + Value: "91.24" + Currency: USD + AveragePricePerTicket: + Value: "136.29" + Currency: USD + Count: 4 + PricePerPassengerCategory: + - Category: ADULT + Count: 1 + TotalPrice: + Value: "136.29" + Currency: USD + BasePrice: + Value: "113.48" + Currency: USD + TotalTaxes: + Value: "22.81" + Currency: USD + - Category: CHILD + Count: 2 + TotalPrice: + Value: "136.29" + Currency: USD + BasePrice: + Value: "113.48" + Currency: USD + TotalTaxes: + Value: "22.81" + Currency: USD + - Category: SENIOR + Count: 1 + TotalPrice: + Value: "136.29" + Currency: USD + BasePrice: + Value: "113.48" + Currency: USD + TotalTaxes: + Value: "22.81" + Currency: USD + Refundable: false + RefundPenalty: + - SegmentIds: + - MTRfUHVibGlzaGVk + PreTripChange: + Allow: YES + International: false + TicketType: ETicket + SearchCities: + - Code: FLL + City: Fort Lauderdale + Province: FL + Country: USA + ValidFormsOfPayment: + UG9pbnRzRXhwZWRpYVJld2FyZHMwLjAw: + - PaymentMethod: CREDITCARD + Name: AMERICANEXPRESS + Fee: "0.00" + Currency: USD + TransactionId: 80f50380-34fa-11e9-9415-0a6b914daa30 + '404': + description: No Route matched + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + '429': + description: API rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + '401': + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + '403': + description: cannot consume this service + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + '503': + description: name resolution failed + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + '504': + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out + /flights/details/{offerToken}: + get: + tags: + - Flight Details + description: |- + The Flight Details API will return validated pricing on the itinerary passed in on the request. + It's a GET request with the transaction secured over HTTPS. + This message supports response in JSON and XML format. + operationId: get-flight-details + parameters: + - name: offerToken + in: path + description: a valid offerToken from the Flight Search API + required: true + schema: + type: string + example: v5-sos-41e0c0266d6b4329a76e5d04f82c200a-23-39-2~2.S~AQoECL-kBBIICNQEEAEYwB8gASAMIAcgDSgCWAJwAA~AQoqCigIwYIBEgQyNzg1GIu4ASCLkAEo383sATCmzuwBOFFAAFgBagRNQUlOCioKKAjBggESBDI0NzkYi5ABIIu4ASiBgu0BMNWC7QE4UUAAWAFqBE1BSU4SCggCEAEYAioCQUEYASIECAEQASgCKAwoAygEMAI + - name: price + in: query + description: Included to determine whether there is a price change between the original search and the details response. + schema: + type: string + example: "94.8" + - name: locale + in: query + description: Defines request language and country for response. + schema: + type: string + example: en_US + - name: agent + in: query + description: True means that a telesales agent is involved and the response should include a telesales fee. + schema: + type: boolean + - name: Key + in: header + description: |- + Unique identifier assigned to partner. + Required for all requests. + Obtained from Expedia Account Manager or representative. + required: true + schema: + type: string + example: X99X9X9-99XX-9XX9-X999-99XX99X9X999X + - name: Partner-Transaction-ID + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: 123456-798101112 + - name: Accept + in: header + description: Accept header for the request. + required: true + schema: + type: string + example: application/vnd.exp-flight.v3+json + - name: Accept-Encoding + in: header + description: Accept encoding for the request. + required: false + schema: + type: string + example: gzip + responses: + '409': + description: Flight not available. The request flight is not longer available + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: FLIGHT_NOT_AVAILABLE + Description: Requested flight is not available. + TransactionId: d15e3738-c4ce-436f-a1a5-7033856981c4 + '500': + description: 'Server side error, An error has occurred while processing + the request. There is a server-side issue that has resulted in a failure. ' + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: SERVER_ERROR + Description: No flights solutions found for the request. + TransactionId: cf4bc542-1f0f-4312-a20e-b99926e25946 + '400': + description: Invalid accept header. Please provide a valid Accept header, The accept header provided is not as per the documentation. + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: INVALID_ACCEPT_HEADER + Description: Please provide a valid Accept header + TransactionId: 5737a450-4a04-4b16-b803-54ca5f651093 + '200': + description: Successful response from server. Include warning in some cases like price change + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/FlightDetailsResponse' + example: + Warnings: + - Code: PRICE_DECREASE + Description: A price change was detected + OriginalPrice: + Value: "127.59" + Currency: USD + NewPrice: + Value: "120.60" + Currency: USD + ChangedAmount: + Value: "6.99" + Currency: USD + Segments: + - SegmentId: UFVCTElTSEVEU0VBUEhYMjAyMS0wNS0xNVQxNjoxMDowMC4wMDAtMDc6MDAyMDIxLTA1LTE1VDE5OjEwOjAwLjAwMC0wNzowMDcxMEFBUFQzSFFFQ09OT01ZUVZBSFpTTjVQSFhMQVMyMDIxLTA1LTE1VDE5OjQ2OjAwLjAwMC0wNzowMDIwMjEtMDUtMTVUMjA6NTk6MDAuMDAwLTA3OjAwMjEwNkFBUFQxSDEzTVFFQ09OT01ZUVZBSFpTTjU= + FlightDuration: PT4H49M + TotalStops: 1 + DepartureArrivalDayDifference: 0 + AirportChange: false + FareType: PUBLISHED + Links: + ApiBaggageFees: + Accept: application/vnd.exp-flight.v1+json + Method: GET + Href: https://apim.expedia.com/flights/baggagefees/Cl8KAkFBEgJBQRoXMjAyMS0wNS0xNVQxNjoxMDowMC4wMDAiA1NFQSoXMjAyMS0wNS0xNVQxOToxMDowMC4wMDAyA1BIWDoBUUIIUVZBSFpTTjVKB0VDT05PTVlSAzcxMApgCgJBQRICQUEaFzIwMjEtMDUtMTVUMTk6NDY6MDAuMDAwIgNQSFgqFzIwMjEtMDUtMTVUMjA6NTk6MDAuMDAwMgNMQVM6AVFCCFFWQUhaU041SgdFQ09OT01ZUgQyMTA2GgJLRw + Price: + TotalPrice: + Value: "57.20" + Currency: USD + BasePrice: + Value: "31.63" + Currency: USD + TotalTaxes: + Value: "25.57" + Currency: USD + TotalTaxesAndFees: + Value: "25.57" + Currency: USD + AveragePricePerTicket: + Value: "57.20" + Currency: USD + Count: 1 + PricePerPassengerCategory: + - Category: ADULT + Count: 1 + TotalPrice: + Value: "57.20" + Currency: USD + BasePrice: + Value: "31.63" + Currency: USD + TotalTaxes: + Value: "25.57" + Currency: USD + Legs: + - Links: + ApiSeatMap: + Accept: application/vnd.exp-flight.v2+json + Method: GET + Href: https://apim.expedia.com/flights/seatmaps/CgFREgNTRUEaAkFBIhFBbWVyaWNhbiBBaXJsaW5lcyoLQWlyYnVzIEEzMjEyAzMyMTodMjAyMS0wNS0xNVQxOToxMDowMC4wMDAtMDc6MDBCHTIwMjEtMDUtMTVUMTY6MTA6MDAuMDAwLTA3OjAwSgM3MTBSA1BIWFoHRUNPTk9NWWICQUE + DepartureAirport: + Code: SEA + Name: Seattle - Tacoma Intl. + City: Seattle + Province: WA + Country: USA + Latitude: "47.44363" + Longitude: "-122.30175" + ArrivalAirport: + Code: PHX + Name: Sky Harbor Intl. + City: Phoenix + Province: AZ + Country: USA + Latitude: "33.43512" + Longitude: "-112.01034" + DepartureDateTime: 2021-05-15T16:10:00-07:00 + ArrivalDateTime: 2021-05-15T19:10:00-07:00 + FlightNumber: "710" + MarketingAirlineCode: AA + MarketingAirlineName: American Airlines + OperatingAirlineCode: AA + OperatingAirlineName: American Airlines + EquipmentCode: "321" + EquipmentName: Airbus A321 + FlightDuration: PT3H + ConnectionTime: PT0H36M + SeatMapAvailable: false + FlightDistance: + Value: "1108" + Unit: MI + BookingCode: Q + CabinClass: ECONOMY + LoungeKeys: + - SEACENTURION + FareBasisCode: QVAHZSN5 + - Links: + ApiSeatMap: + Accept: application/vnd.exp-flight.v2+json + Method: GET + Href: https://apim.expedia.com/flights/seatmaps/CgFREgNQSFgaAkFBIhFBbWVyaWNhbiBBaXJsaW5lcyoOQm9laW5nIDczNy04MDAyAzczODodMjAyMS0wNS0xNVQyMDo1OTowMC4wMDAtMDc6MDBCHTIwMjEtMDUtMTVUMTk6NDY6MDAuMDAwLTA3OjAwSgQyMTA2UgNMQVNaB0VDT05PTVliAkFB + DepartureAirport: + Code: PHX + Name: Sky Harbor Intl. + City: Phoenix + Province: AZ + Country: USA + Latitude: "33.43512" + Longitude: "-112.01034" + ArrivalAirport: + Code: LAS + Name: McCarran Intl. + City: Las Vegas + Province: NV + Country: USA + Latitude: "36.085393" + Longitude: "-115.150098" + DepartureDateTime: 2021-05-15T19:46:00-07:00 + ArrivalDateTime: 2021-05-15T20:59:00-07:00 + FlightNumber: "2106" + MarketingAirlineCode: AA + MarketingAirlineName: American Airlines + OperatingAirlineCode: AA + OperatingAirlineName: American Airlines + EquipmentCode: "738" + EquipmentName: Boeing 737-800 + FlightDuration: PT1H13M + SeatMapAvailable: false + FlightDistance: + Value: "247" + Unit: MI + BookingCode: Q + CabinClass: ECONOMY + EquipmentChange: true + LoungeKeys: + - PHXCENTURION + FareBasisCode: QVAHZSN5 + - SegmentId: UFVCTElTSEVETEFTU0VBMjAyMS0wNS0yMFQxODoyNTowMC4wMDAtMDc6MDAyMDIxLTA1LTIwVDIxOjEwOjAwLjAwMC0wNzowMDQ3NURMUFQySDQ1TVZFQ09OT01ZVkFWU0EwTTE= + FlightDuration: PT2H45M + TotalStops: 0 + DepartureArrivalDayDifference: 0 + AirportChange: false + FareType: PUBLISHED + Links: + ApiBaggageFees: + Accept: application/vnd.exp-flight.v1+json + Method: GET + Href: https://apim.expedia.com/flights/baggagefees/Cl8KAkRMEgJETBoXMjAyMS0wNS0yMFQxODoyNTowMC4wMDAiA0xBUyoXMjAyMS0wNS0yMFQyMToxMDowMC4wMDAyA1NFQToBVkIIVkFWU0EwTTFKB0VDT05PTVlSAzQ3NRoCS0c + Price: + TotalPrice: + Value: "63.40" + Currency: USD + BasePrice: + Value: "45.58" + Currency: USD + TotalTaxes: + Value: "17.82" + Currency: USD + TotalTaxesAndFees: + Value: "17.82" + Currency: USD + AveragePricePerTicket: + Value: "63.40" + Currency: USD + Count: 1 + PricePerPassengerCategory: + - Category: ADULT + Count: 1 + TotalPrice: + Value: "63.40" + Currency: USD + BasePrice: + Value: "45.58" + Currency: USD + TotalTaxes: + Value: "17.82" + Currency: USD + Legs: + - Links: + ApiSeatMap: + Accept: application/vnd.exp-flight.v2+json + Method: GET + Href: https://apim.expedia.com/flights/seatmaps/CgFWEgNMQVMaAkRMIgVEZWx0YSoLQWlyYnVzIEEzMjAyAzMyMDodMjAyMS0wNS0yMFQyMToxMDowMC4wMDAtMDc6MDBCHTIwMjEtMDUtMjBUMTg6MjU6MDAuMDAwLTA3OjAwSgM0NzVSA1NFQVoHRUNPTk9NWWICREw + DepartureAirport: + Code: LAS + Name: McCarran Intl. + City: Las Vegas + Province: NV + Country: USA + Latitude: "36.085393" + Longitude: "-115.150098" + ArrivalAirport: + Code: SEA + Name: Seattle - Tacoma Intl. + City: Seattle + Province: WA + Country: USA + Latitude: "47.44363" + Longitude: "-122.30175" + DepartureDateTime: 2021-05-20T18:25:00-07:00 + ArrivalDateTime: 2021-05-20T21:10:00-07:00 + FlightNumber: "475" + MarketingAirlineCode: DL + MarketingAirlineName: Delta + OperatingAirlineCode: DL + OperatingAirlineName: Delta + EquipmentCode: "320" + FlightOnTimePercentage: "90" + EquipmentName: Airbus A320 + FlightDuration: PT2H45M + SeatMapAvailable: false + FlightDistance: + Value: "875" + Unit: MI + BookingCode: V + CabinClass: ECONOMY + LoungeKeys: + - LASCENTURION + FareBasisCode: VAVSA0M1 + Offer: + offerToken: 4c3d825f95074cbdbdf1daecc4fa3011-0-1-st-4309de795593486e99dfa6e3bc2e9280-0-1~2.D~AQoECL-kBBIICNQEEAEYwB8gASgCWAJwAHAA~AQpSCiYIwYIBEgM3MTAYkgEg77kBKM7M7AEwgs7sAThRQABYAWoETUFJTgooCMGCARIEMjEwNhjvuQEgi5ABKKbO7AEw787sAThRQAFYAWoETUFJThIKCAEQARgBKgJBQRgBIgQIARABKAIoAygEMAI.AQotCisIxJgBEgM0NzUYi5ABIJIBKPWF7QEwmoftAThWQABYAWoJTUFJTkNBQklOEgoIARABGAEqAkRMGAEiBAgBEAEoAigDKAQwAg + SplitTicket: true + OpaqueFlight: false + Free24HourCancellation: true + MerchantName: Delta*American Airlines + Links: + ApiFareRules: + Accept: application/vnd.exp-flight.v1+json + Method: GET + Href: https://apim.expedia.com/flights/farerules/CgVjb2FjaBoJUHVibGlzaGVkIgd1bmtub3duKgl1bml2ZXJzYWwyAkFBQksIARIZMjAyMS0wNS0xNVQxNjoxMDowMC0wNzowMBoDUEhYIgNTRUEqAkFBMghRVkFIWlNONUIGU0VBTEFTSgVTYWJyZWoFQURVTFRCSwgCEhkyMDIxLTA1LTE1VDE5OjQ2OjAwLTA3OjAwGgNMQVMiA1BIWCoCQUEyCFFWQUhaU041QgZTRUFMQVNKBVNhYnJlagVBRFVMVA+CgVjb2FjaBoJUHVibGlzaGVkIgd1bmtub3duKgl1bml2ZXJzYWwyAkRMQksIARIZMjAyMS0wNS0yMFQxODoyNTowMC0wNzowMBoDU0VBIgNMQVMqAkRMMghWQVZTQTBNMUIGTEFTU0VBSgVTYWJyZWoFQURVTFQ + ApiBooking: + Accept: application/vnd.exp-flight.v3+json + Method: POST + Href: https://apim.expedia.com/flights/bookings/4c3d825f95074cbdbdf1daecc4fa3011-0-1-st-4309de795593486e99dfa6e3bc2e9280-0-1~2.D~AQoECL-kBBIICNQEEAEYwB8gASgCWAJwAHAA~AQpSCiYIwYIBEgM3MTAYkgEg77kBKM7M7AEwgs7sAThRQABYAWoETUFJTgooCMGCARIEMjEwNhjvuQEgi5ABKKbO7AEw787sAThRQAFYAWoETUFJThIKCAEQARgBKgJBQRgBIgQIARABKAIoAygEMAI.AQotCisIxJgBEgM0NzUYi5ABIJIBKPWF7QEwmoftAThWQABYAWoJTUFJTkNBQklOEgoIARABGAEqAkRMGAEiBAgBEAEoAigDKAQwAg?price=120.60¤cy=USD + SegmentIds: + - UFVCTElTSEVEU0VBUEhYMjAyMS0wNS0xNVQxNjoxMDowMC4wMDAtMDc6MDAyMDIxLTA1LTE1VDE5OjEwOjAwLjAwMC0wNzowMDcxMEFBUFQzSFFFQ09OT01ZUVZBSFpTTjVQSFhMQVMyMDIxLTA1LTE1VDE5OjQ2OjAwLjAwMC0wNzowMDIwMjEtMDUtMTVUMjA6NTk6MDAuMDAwLTA3OjAwMjEwNkFBUFQxSDEzTVFFQ09OT01ZUVZBSFpTTjU= + - UFVCTElTSEVETEFTU0VBMjAyMS0wNS0yMFQxODoyNTowMC4wMDAtMDc6MDAyMDIxLTA1LTIwVDIxOjEwOjAwLjAwMC0wNzowMDQ3NURMUFQySDQ1TVZFQ09OT01ZVkFWU0EwTTE= + OfferPrice: + TotalPrice: + Value: "120.60" + Currency: USD + BasePrice: + Value: "77.21" + Currency: USD + Fees: + - Value: "0.00" + Currency: USD + Name: Service + TotalTaxes: + Value: "43.39" + Currency: USD + TotalTaxesAndFees: + Value: "43.39" + Currency: USD + AveragePricePerTicket: + Value: "120.60" + Currency: USD + Count: 1 + PricePerPassengerCategory: + - Category: ADULT + Count: 1 + TotalPrice: + Value: "120.60" + Currency: USD + BasePrice: + Value: "77.21" + Currency: USD + TotalTaxes: + Value: "43.39" + Currency: USD + Refundable: false + RefundPenalty: + - SegmentIds: + - UFVCTElTSEVEU0VBUEhYMjAyMS0wNS0xNVQxNjoxMDowMC4wMDAtMDc6MDAyMDIxLTA1LTE1VDE5OjEwOjAwLjAwMC0wNzowMDcxMEFBUFQzSFFFQ09OT01ZUVZBSFpTTjVQSFhMQVMyMDIxLTA1LTE1VDE5OjQ2OjAwLjAwMC0wNzowMDIwMjEtMDUtMTVUMjA6NTk6MDAuMDAwLTA3OjAwMjEwNkFBUFQxSDEzTVFFQ09OT01ZUVZBSFpTTjU= + PreTripChange: + Allow: YES + Penalty: + Value: "0.00" + Currency: USD + PreTripCancel: + Allow: NO + EnrouteChange: + Allow: YES + Penalty: + Value: "0.00" + Currency: USD + EnrouteCancel: + Allow: NO + Transferable: NO + NameChangeAllowed: NO + - SegmentIds: + - UFVCTElTSEVETEFTU0VBMjAyMS0wNS0yMFQxODoyNTowMC4wMDAtMDc6MDAyMDIxLTA1LTIwVDIxOjEwOjAwLjAwMC0wNzowMDQ3NURMUFQySDQ1TVZFQ09OT01ZVkFWU0EwTTE= + PreTripChange: + Allow: YES + Penalty: + Value: "0.00" + Currency: USD + PreTripCancel: + Allow: NO + EnrouteChange: + Allow: NO + EnrouteCancel: + Allow: NO + Transferable: NO + NameChangeAllowed: NO + International: false + TicketType: ETicket + UndisclosedGenderSupported: false + UnspecifiedGenderSupported: false + FareOptions: + - FareName: Comfort+ + SegmentIds: + - UFVCTElTSEVEU0VBUEhYMjAyMS0wNS0xNVQxNjoxMDowMC4wMDAtMDc6MDAyMDIxLTA1LTE1VDE5OjEwOjAwLjAwMC0wNzowMDcxMEFBUFQzSFFFQ09OT01ZUVZBSFpTTjVQSFhMQVMyMDIxLTA1LTE1VDE5OjQ2OjAwLjAwMC0wNzowMDIwMjEtMDUtMTVUMjA6NTk6MDAuMDAwLTA3OjAwMjEwNkFBUFQxSDEzTVFFQ09OT01ZUVZBSFpTTjU= + - UFVCTElTSEVETEFTU0VBMjAyMS0wNS0yMFQxODoyNTowMC4wMDAtMDc6MDAyMDIxLTA1LTIwVDIxOjEwOjAwLjAwMC0wNzowMDQ3NURMUFQySDQ1TVZFQ09OT01ZVkFWU0EwTTE= + Included: + - CARRY_ON_BAG + FeeApplied: + - Meals + ValidFormsOfPayment: + - PaymentMethod: DebitCard + Name: Visa + Fee: "0.00" + Currency: USD + - PaymentMethod: CreditCard + Name: AmericanExpress + Fee: "0.00" + Currency: USD + - PaymentMethod: CreditCard + Name: MasterCard + Fee: "0.00" + Currency: USD + - PaymentMethod: DebitCard + Name: MasterCard + Fee: "0.00" + Currency: USD + - PaymentMethod: DebitCard + Name: AmericanExpress + Fee: "0.00" + Currency: USD + - PaymentMethod: CreditCard + Name: Visa + Fee: "0.00" + Currency: USD + Lounges: + PHXCENTURION: + - Name: The Centurion Lounge + IsConferenceRoomAvailable: false + PhoneNumber: N/A + Description: Terminal 4, across from Gate B22 on the upper level, 9 am - 5 pm + SEACENTURION: + - Name: The Centurion Lounge + IsConferenceRoomAvailable: false + PhoneNumber: N/A + Description: Concourse B, opposite Gate B3 + LASCENTURION: + - Name: The Centurion Lounge + IsConferenceRoomAvailable: true + PhoneNumber: N/A + Description: Concourse D opposite Gate D1, 5am to 11pm + TransactionId: e883fc9a-2cfa-4b13-b7b1-4bcee3a5dea6 + '404': + description: No Route matched + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + '429': + description: API rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + '401': + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + '403': + description: cannot consume this service + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + '503': + description: name resolution failed + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + '504': + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out + /flights/flexsearch: + get: + tags: + - Flight FlexSearch + description: request for flexsearch information + operationId: get-flight-flexsearch + parameters: + - name: segment1.origin + in: query + description: 3-letter IATA Airport code or location name from where the passenger is departing. + required: true + schema: + type: string + example: LAS + - name: segment1.destination + in: query + description: 3-letter IATA Airport code or location name to where the passenger is arriving. + required: true + schema: + type: string + example: LAX + - name: segment1.departureDate + in: query + description: Date, in ISO format [YYYY-MM-DD], on which customer wants to depart. + required: true + schema: + type: string + format: date + example: '2021-07-01' + - name: segment2.origin + in: query + description: 3-letter IATA Airport code or location name from where the passenger is departing. + schema: + type: string + - name: segment2.destination + in: query + description: 3-letter IATA Airport code or location name to where the passenger is arriving. + schema: + type: string + - name: segment2.departureDate + in: query + description: Date, in ISO format [YYYY-MM-DD], on which customer wants to depart. + schema: + type: string + - name: includeSegmentDetails + in: query + description: |- + If included, the response will included all segment and leg details. + By default, the value of this parameter will be false. + schema: + type: boolean + example: true + - name: Key + in: header + description: |- + Unique identifier assigned to partner. + Required for all requests. + Obtained from Expedia Account Manager or representative. + required: true + schema: + type: string + example: X99X9X9-99XX-9XX9-X999-99XX99X9X999X + - name: Partner-Transaction-ID + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: 123456-798101112 + - name: Accept + in: header + description: Accept header for the request. + required: true + schema: + type: string + example: application/vnd.exp-flight.v3+json + - name: Accept-Encoding + in: header + description: Accept encoding for the request. + required: false + schema: + type: string + example: gzip + responses: + '200': + description: flexsearch information returned successfully + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/FlexSearchResponse' + example: + Offers: + - DepartureDates: + - 2021-03-31 + OfferPrice: + TotalPrice: + Value: "100.39" + Currency: USD + - DepartureDates: + - 2021-04-01 + OfferPrice: + TotalPrice: + Value: "100.39" + Currency: USD + - DepartureDates: + - 2021-04-02 + OfferPrice: + TotalPrice: + Value: "95.39" + Currency: USD + - DepartureDates: + - 2021-04-03 + OfferPrice: + TotalPrice: + Value: "95.39" + Currency: USD + - DepartureDates: + - 2021-04-04 + OfferPrice: + TotalPrice: + Value: "100.39" + Currency: USD + - DepartureDates: + - 2021-04-05 + OfferPrice: + TotalPrice: + Value: "105.39" + Currency: USD + - DepartureDates: + - 2021-04-06 + OfferPrice: + TotalPrice: + Value: "95.39" + Currency: USD + TransactionId: 75989c80-7299-11ea-81fa-aad83eab0074 + '500': + description: No flights solutions found for the request. + content: + application/vnd.exp-flight.v3+json: + schema: + type: object + required: + - Errors + - TransactionId + properties: + Errors: + type: array + description: Container for error list. + items: + type: object + properties: + Error: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Error code describing the issue + example: AMBIGUOUS_LOCATION + LocationOptions: + type: array + description: Container for list of matching locations corresponding to the value entered in the location keyword search. + items: + type: object + properties: + LocationOption: + required: + - Locations + - RequestedLocation + type: object + properties: + RequestedLocation: + type: string + description: Location used in partner request. + example: Paris + Locations: + type: array + description: Container for list of possible locations that could be used to disambiguate the query. + items: + type: object + properties: + Location: + required: + - LocationId + - Name + type: object + properties: + Type: + type: string + description: The type of location code (MULTICITY | METROCODE). + example: MULTICITY + Id: + type: string + description: Expedia Region ID of the specified airport. + example: "6139103" + Name: + type: string + description: Location Name + example: Seattle-Tacoma International Airport + Code: + type: string + description: Location Code + example: SEA + Address: + type: string + description: Street address of the location (if available) + example: Paris, France (PAR-All Airports) + GeoLocation: + $ref: '#/components/schemas/GeoLocation' + Country: + type: object + properties: + Country: + type: object + properties: + Code: + type: string + description: 3-letter code for the country + example: IRL + description: Container for disambiguation country information + description: Container for list of possible locations that could be used to disambiguate the query. + description: 'List for possible locations from which the customer must choose + the best one to be re-submitted in the request. ' + description: Container for error list. + TransactionId: + type: string + description: A unique identifier for the transaction. + example: a9e371c4-89d9-4f9c-8df7-df105830e7fe + xml: + name: ErrorResponse + example: + Errors: + - Code: SERVER_ERROR + Description: No flights solutions found for the request. + TransactionId: 68bce810-5af7-40c1-bea7-07a823b6f1f0 + '400': + description: Disambiguation Response + content: + application/vnd.exp-flight.v3+json: + schema: + type: object + required: + - Errors + - TransactionId + properties: + Errors: + type: array + description: Container for error list. + items: + type: object + properties: + Error: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Error code describing the issue + example: AMBIGUOUS_LOCATION + LocationOptions: + type: array + description: Container for list of matching locations corresponding to the value entered in the location keyword search. + items: + type: object + properties: + LocationOption: + required: + - Locations + - RequestedLocation + type: object + properties: + RequestedLocation: + type: string + description: Location used in partner request. + example: Paris + Locations: + type: array + description: Container for list of possible locations that could be used to disambiguate the query. + items: + type: object + properties: + Location: + required: + - LocationId + - Name + type: object + properties: + Type: + type: string + description: The type of location code (MULTICITY | METROCODE). + example: MULTICITY + Id: + type: string + description: Expedia Region ID of the specified airport. + example: "6139103" + Name: + type: string + description: Location Name + example: Seattle-Tacoma International Airport + Code: + type: string + description: Location Code + example: SEA + Address: + type: string + description: Street address of the location (if available) + example: Paris, France (PAR-All Airports) + GeoLocation: + $ref: '#/components/schemas/GeoLocation' + Country: + type: object + properties: + Country: + type: object + properties: + Code: + type: string + description: 3-letter code for the country + example: IRL + description: Container for disambiguation country information + description: Container for list of possible locations that could be used to disambiguate the query. + description: 'List for possible locations from which the customer must choose + the best one to be re-submitted in the request. ' + description: Container for error list. + TransactionId: + type: string + description: A unique identifier for the transaction. + example: a9e371c4-89d9-4f9c-8df7-df105830e7fe + xml: + name: ErrorResponse + example: + Errors: + - Code: MULTIPLE_AMBIGUOUS_LOCATION + Description: No or multiple available airport(s) was found which match your city name, please check the details. + TransactionId: aedfd328-797a-43c9-9584-e901ea1f589d + '404': + description: No Route matched + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + '429': + description: API rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + '401': + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + '403': + description: cannot consume this service + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + '503': + description: name resolution failed + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + '504': + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out + /flights/farecalendar: + get: + tags: + - Flight FareCalendar + description: API that will return the lowest fares for multiple days so that the same can be displayed as a booking widget calendar. + operationId: get-flights-farecalendar + parameters: + - name: segment1.origin + in: query + description: 3-letter IATA Airport code or location name from where the passenger is departing. + required: true + schema: + type: string + example: LAS + - name: segment1.destination + in: query + description: 3-letter IATA Airport code or location name from where the passenger is arriving. + required: true + schema: + type: string + example: LAX + - name: segment2.origin + in: query + description: 3-letter IATA Airport code or location name from where the passenger is departing in the second segment. + schema: + type: string + - name: segment2.destination + in: query + description: 3-letter IATA Airport code or location name from where the passenger is arriving in the second segment. + schema: + type: string + - name: departureDate + in: query + description: |- + Designates the date which decides the fare calendar response. + For One Way trips, the response shows offers with price from departureDate till departureDate + 60 days + For RoundTrip, + If the trip=outbound, then the response shows offers with price from departureDate of outbound segment till departureDate + 60 days. + If the trip=inbound, then the response shows offers with price from departureDate of inbound segment till departureDate + 14 days. + required: true + schema: + type: string + format: date + example: '2021-10-01' + - name: trip + in: query + description: | + Required for RoundTrip for identifying whether we are requesting for inbound or outbound. + Possible values : + inbound + outbound + schema: + type: string + - name: includeSegmentDetails + in: query + description: If the user wants to know the segment details of the offer then they can send this param as true and will get the segment and leg level details in the response. By default this will be set as false. + schema: + type: boolean + - name: Key + in: header + description: |- + Unique identifier assigned to partner. + Required for all requests. + Obtained from Expedia Account Manager or representative. + required: true + schema: + type: string + example: X99X9X9-99XX-9XX9-X999-99XX99X9X999X + - name: Partner-Transaction-ID + in: header + description: Partner-generated identifier. + required: true + schema: + type: string + example: 123456-798101112 + - name: Accept + in: header + description: Accept header for the request. + required: true + schema: + type: string + example: application/vnd.exp-flight.v3+json + - name: Accept-Encoding + in: header + description: Accept encoding for the request. + required: false + schema: + type: string + example: gzip + responses: + '400': + description: Bad request from client. + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: ORIGIN_REQUIRED + Description: Origin Airport is not set properly + TransactionId: 05d400eb-3601-418c-9830-591014e39182 + '500': + description: Either supply or EWSAir failed to provide fare calendar response due to internal failure. + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/Errors' + example: + Errors: + - Code: AMBIGUOUS_LOCATION + DetailCode: NO_AIRPORT_RETURNED + Description: No or multiple available airport(s) was found which match your city name, please check the details. + LocationOptions: + - RequestedLocation: BLGQW + TransactionId: d7203acc-b124-438d-9948-9ea95d81bb1d + '200': + description: Farecalendar response returned successfully. + content: + application/vnd.exp-flight.v3+json: + schema: + $ref: '#/components/schemas/FareCalendarResponse' + example: + Offers: + - DepartureDate: 2021-05-24T09:12:28Z + OfferPrice: + TotalPrice: + Value: "128.39" + Currency: USD + - DepartureDate: 2021-05-25T09:12:28Z + OfferPrice: + TotalPrice: + Value: "202.19" + Currency: USD + - DepartureDate: 2021-05-26T09:12:28Z + OfferPrice: + TotalPrice: + Value: "137.19" + Currency: USD + - DepartureDate: 2021-05-27T09:12:28Z + OfferPrice: + TotalPrice: + Value: "123.41" + Currency: USD + TransactionId: 0f2bc850-62bd-11ea-9e71-0aae9a66c99a + '404': + description: No Route matched + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + no Route matched: + value: |- + { + "message": "no Route matched with those values" + } + '429': + description: API rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + API rate limit exceeded: + value: |- + { + "message": "API rate limit exceeded" + } + '401': + description: Unauthorized or Invalid authentication credentials + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + unauthorized: + value: |- + { + "message": "Unauthorized" + } + Invalid authentication credentials: + value: |- + { + "message": "Invalid authentication credentials" + } + '403': + description: cannot consume this service + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + cannot consume this service: + value: |- + { + "message": "You cannot consume this service" + } + '503': + description: name resolution failed + content: + application/json: + schema: + $ref: '#/components/schemas/APIMError' + examples: + name resolution failed: + value: |- + { + "message": "name resolution failed" + } + '504': + description: upstream server is timing out + content: + text/plain: + examples: + upstream server is timing out: + value: The upstream server is timing out +components: + securitySchemes: + basicAuth: + type: http + scheme: basic + schemas: + Country: + required: + - Name + type: object + properties: + Name: + type: string + description: country name + example: Ireland + Code: + type: string + description: 3-letter code for the country + example: IRL + description: Container for disambiguation country information + Error: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Error code describing the issue + example: AMBIGUOUS_LOCATION + DetailCode: + type: string + description: Detailed error code describing the issue. + example: MULTIPLE_AMBIGUOUS_LOCATION + Description: + type: string + description: A simple description of what the error is. + example: 'Multiple pickup locations found. ' + LocationOptions: + type: array + description: 'List for possible locations from which the customer must choose + the best one to be re-submitted in the request. ' + items: + $ref: '#/components/schemas/LocationOption' + description: Container for error list. + Errors: + required: + - Errors + - TransactionId + type: object + properties: + Errors: + type: array + description: Container for error list. + items: + $ref: '#/components/schemas/Error' + TransactionId: + type: string + description: A unique identifier for the transaction. + example: a9e371c4-89d9-4f9c-8df7-df105830e7fe + xml: + name: ErrorResponse + GeoLocation: + required: + - Latitude + - Longitude + type: object + properties: + Latitude: + type: string + description: Latitude of the location. + example: "38.184978" + Longitude: + type: string + description: Longitude of the location. + example: "85.7412" + description: Container for Geo location. + Location: + type: object + properties: + Type: + type: string + description: The type of location code (MULTICITY | METROCODE). + example: MULTICITY + Id: + type: string + description: Expedia Region ID of the specified airport. + example: "6139103" + Name: + type: string + description: Location Name + example: Seattle-Tacoma International Airport + Code: + type: string + description: Location Code + example: SEA + Address: + type: string + description: Street address of the location (if available) + example: Paris, France (PAR-All Airports) + GeoLocation: + $ref: '#/components/schemas/GeoLocation' + Country: + $ref: '#/components/schemas/Country' + description: Container for list of possible locations that could be used to disambiguate the query. + LocationOption: + required: + - Locations + - RequestedLocation + type: object + properties: + RequestedLocation: + type: string + description: Location used in partner request. + example: Paris + Locations: + type: array + description: Container for list of possible locations that could be used to disambiguate the query. + items: + $ref: '#/components/schemas/Location' + description: 'List for possible locations from which the customer must choose + the best one to be re-submitted in the request. ' + AirValidFormsOfPayment: + required: + - Currency + - Fee + - Name + - PaymentMethod + type: object + properties: + PaymentMethod: + type: string + description: Method of payment + example: CreditCard + Name: + type: string + description: Name of Payment Method. + example: AmericanExpress + Fee: + type: string + description: The amount of the payment fee. + example: "4.25" + Currency: + type: string + description: Currency of the fee in ISO 4217 format + example: USD + description: Container for fees that are charged for using certain payment methods. Since the method of payment is not known until time of booking, these fees are returned separately and not included in the total price + Airport: + required: + - Code + type: object + properties: + Code: + type: string + description: Three-letter IATA airport code for departure location + example: SFO + Name: + type: string + description: Name of departure airport + example: San Francisco International Airport + City: + type: string + description: City where departure airport resides + example: San Francisco + Province: + type: string + description: Province or State where departure airport resides + example: CA + Country: + type: string + description: Country where departure airport resides + example: USA + Latitude: + type: string + description: Latitude where departure airport resides + example: "33.641" + Longitude: + type: string + description: Longitude where departure airport resides + example: "84.4429" + description: Container for list of Information about each search locations + xml: + name: Airport + Amenities: + type: object + properties: + Entertainment: + $ref: '#/components/schemas/Entertainment' + Wifi: + $ref: '#/components/schemas/Wifi' + Power: + $ref: '#/components/schemas/Power' + description: List of specific amenities available for each flight leg. + AveragePricePerTicket: + required: + - Count + - Currency + - Value + type: object + properties: + Value: + type: string + description: Average price per ticket, excluding infant + example: "100.0" + Currency: + type: string + description: Currency in ISO 4217 format + example: USD + Count: + type: integer + description: Indicates how many tickets were used to determine the average + format: int32 + example: 1 + description: |- + Container for average pricing information per ticket. + If any passenger type (such as Infant in Lap or Seat) has a $0 total price there will be no ticket, so those passengers would not be included in the count. + BaggageFee: + required: + - BagType + type: object + properties: + BagType: + type: string + description: Specifies the type of baggage. + example: FIRST_BAG + enum: + - PREPAID_CARRY_ON + - PREPAID_FIRST_BAG + - PREPAID_SECOND_BAG + - CARRY_ON + - FIRST_BAG + - SECOND_BAG + WeightUnit: + type: string + description: Specifies weight unit for this bagType. This will always be kilograms. + example: kg + Weight: + type: string + description: Weight of the bag. + example: "23" + Application: + type: string + description: This element specifies descriptive text useful in displaying baggage fees. + example: per + enum: + - upto + - per + FixedCharge: + $ref: '#/components/schemas/Fee' + MaxCharge: + $ref: '#/components/schemas/Fee' + MinCharge: + $ref: '#/components/schemas/Fee' + description: Container for baggage fee information of each bag type. The baggage fee can vary for each bag type. The amount can be zero, fixed amount or will be in a range. + xml: + name: BaggageFees + Distance: + required: + - Unit + - Value + type: object + properties: + Value: + type: string + description: The number of miles/kilometers of the distance (specified by the Unit). + example: "75" + Unit: + type: string + description: The unit (KM or MI) for the distance. + example: KM + Direction: + type: string + description: 'The direction of the location from the search ''center''.Possible + values are: N,S,W,E,NW,NE,SW,SE' + example: N + description: Container for distance of flight. + Entertainment: + type: object + properties: + Available: + type: string + description: Indication of whether this amenity is available. + example: YES + enum: + - YES + - NO + - UNKNOWN + Types: + type: array + description: Type of entertainment + example: [LIVE_TV] + items: + type: string + description: Type of entertainment + example: LIVE_TV + xml: + name: Types + enum: + - LIVE_TV + - ON_DEMAND + - STREAMING + description: Container for entertainment amenities available in this flight leg + Fee: + required: + - Currency + - Value + type: object + properties: + Value: + type: string + description: The value of the element being defined. + example: "21.9" + Currency: + type: string + description: The ISO 4217 Currency Code that the value is expressed in. + example: USD + LocalCurrencyPrice: + $ref: '#/components/schemas/Money' + Name: + type: string + description: This is used when a fee range is returned. It specifies the highest value of bag fee. + FlightSearchResponse: + required: + - Offers + - SearchCities + - TransactionId + type: object + properties: + Insights: + $ref: '#/components/schemas/Insights' + Warnings: + type: array + description: Container for warning messages. + items: + $ref: '#/components/schemas/Warning' + Segments: + type: array + description: |- + Container of information about each flight offer + (Less information shown if the offer is and opaque flight offer) + Flights (the complete journey to your final destination by air) are made up of: + Segments (the trip from one stopping place to another) are made up of: + Legs (take off at one airport and land at another) + items: + $ref: '#/components/schemas/Segment' + Offers: + type: array + description: Container for list of air offers. An offer gives total trip details including flight and pricing information. + items: + $ref: '#/components/schemas/Offer' + SearchCities: + type: array + description: Container for list of Information about each search locations + items: + $ref: '#/components/schemas/Airport' + ValidFormsOfPayment: + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/AirValidFormsOfPayment' + description: Container for fees that are charged for using certain payment methods. Since the method of payment is not known until time of booking, these fees are returned separately and not included in the total price + Lounges: + type: object + additionalProperties: + type: array + items: + $ref: '#/components/schemas/Lounge' + description: List of lounges + TransactionId: + type: string + description: Unique Id to identify one individual API response. + example: a9e371c4-89d9-4f9c-8df7-df105830e7fe + xml: + name: FlightSearchResponse + Insights: + required: + - AverageCheapestPrice + - CheapestOfferId + - MedianCheapestPrice + - PercentageOfFaresHigher + - SearchComparisonCount + type: object + properties: + CheapestOfferId: + type: string + description: Container for insights response. + example: v5-d58bdd504a70495078a796b218315815-1-1-2~0.S~AQoGCAEQ9LsCEgcI1AQQARgBIAEgDCAHIA0oAlgCcAA + AverageCheapestPrice: + $ref: '#/components/schemas/Money' + MedianCheapestPrice: + $ref: '#/components/schemas/Money' + SearchComparisonCount: + type: integer + description: Number of searches compared to build the insights information for the given search. + format: int32 + example: 1200 + PercentageOfFaresHigher: + type: integer + description: Percentage value that defines where the cheapest fare of the current search result stand comparing the prices for similar searches for nearby dates. + format: int32 + example: 70 + PriceTrend: + type: string + description: Shows how the price trends + enum: + - TRENDING_UP + - TRENDING_DOWN + - NEUTRAL + PastPerDayMedianCheapestPrices: + type: array + description: List of median of cheapest prices for the specifc search criteria for last 21 days. List will be in the order starting from 21 days ago till yesterday. + example: ['120.9', '121.8', '122.7'] + items: + type: string + xml: + name: PastPerDayMedianCheapestPrices + Message: + type: string + description: Shows a custom message in the respective language corresponding to the locale requested. + example: Expedia searched 3,415 results and this fare is cheaper than 70% of the prices seen + description: Container for insights response. + xml: + name: Insights + Leg: + required: + - ArrivalAirport + - ArrivalDateTime + - BookingCode + - CabinClass + - DepartureAirport + - DepartureDateTime + - FlightDuration + - FlightNumber + - MarketingAirlineCode + - SeatMapAvailable + type: object + properties: + StatusCode: + type: string + description: Air segment status. + example: HX + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + description: Container for deeplink URL information. + DepartureAirport: + $ref: '#/components/schemas/Airport' + ArrivalAirport: + $ref: '#/components/schemas/Airport' + DepartureDateTime: + type: string + description: Flight departure date and time in ISO 8601 format + format: date-time + example: 2021-07-05T07:15:00-06:00 + ArrivalDateTime: + type: string + description: Flight landing date and time in ISO 8601 format + format: date-time + example: 2021-07-05T10:15:00-06:00 + FlightNumber: + type: string + description: Flight Number assigned by Carrier. + example: "2537" + MarketingAirlineCode: + type: string + description: The two-letter code of the Airline that is marketing the flight. + example: AA + MarketingAirlineName: + type: string + description: The display name of the Airline that is marketing the flight. + example: American Airlines + OperatingAirlineCode: + type: string + description: The two-letter code of the Airline actually operating the plane. + example: UA + OperatingAirlineName: + type: string + description: The display name of the airline actually operating the plane. + example: United Airlines + EquipmentCode: + type: string + description: IATA Equipment type codes. + example: 73J + FlightOnTimePercentage: + type: string + description: Percentage of time that this flight on time. + example: "100" + EquipmentName: + type: string + description: The name of equipment that is scheduled for the flight. + example: Airbus 123 + FlightDuration: + type: string + description: The total travel duration for this leg, expressed in ISO 8601 standard. + example: PT3H58M + ConnectionTime: + type: string + description: Connection time between current leg flight landed time to next flight departure time, expressed in ISO 8601 standard. + example: PT1H4M + SeatMapAvailable: + type: boolean + description: If True seat map is available + OperationalDisclosure: + type: string + description: OperationalDisclosure. + FlightDistance: + $ref: '#/components/schemas/Distance' + BookingCode: + type: string + description: Carrier-specific code used for booking (class of service). + example: Y + CabinClass: + type: string + description: Class of service for the air leg. + example: ECONOMY + enum: + - ECONOMY + - FIRST + - BUSINESS + - PREMIUM_ECONOMY + EquipmentChange: + type: boolean + description: True if the upcoming travel Leg will have different equipment (airplane) compared to the previous Leg. + LoungeKeys: + type: array + description: List of keys referring to lounge details for the particular leg. + items: + type: string + description: List of keys referring to lounge details for the particular leg. + xml: + name: LoungeKeys + FareBasisCode: + type: string + description: Fare Basis Code for the corresponding Leg of Flight Offer. + example: T21DVN5 + MealOptions: + type: array + description: Different meal options available in this particular Leg. + example: [FOOD_FOR_PURCHASE] + items: + type: string + description: Different meal options available in this particular Leg. + example: FOOD_FOR_PURCHASE + xml: + name: MealOptions + Amenities: + $ref: '#/components/schemas/Amenities' + description: Container information on each flight leg. + xml: + name: Leg + Link: + required: + - Href + - Method + type: object + properties: + Accept: + type: string + description: Accept header. + Method: + type: string + description: HTTP method to connect. + example: GET + Href: + type: string + description: HATEOAS URL to fetch details. + description: Container for deeplink URL information. + Lounge: + required: + - Name + type: object + properties: + Name: + type: string + description: Name of the lounge corresponding to a lounge key + example: The Centurion Lounge + IsConferenceRoomAvailable: + type: boolean + description: Indicates whether the lounge has a conference room. + PhoneNumber: + type: string + description: Phone number of the lounge (if available) + example: NA + Description: + type: string + description: Free text field with any extra information about the lounge + example: Terminal B on the third level, pre-security, 5:30 am ? 8 pm (Sunday ? Friday), 5:30 am ? 6:30 pm (Saturday) + description: List of lounges + xml: + name: Lounge + Money: + required: + - Currency + - Value + type: object + properties: + Value: + type: string + description: The value of the element being defined. + example: "21.9" + Currency: + type: string + description: The ISO 4217 Currency Code that the value is expressed in. + example: USD + description: Container for price information. + Offer: + required: + - International + - Links + - offerToken + - OfferPrice + - Refundable + - SegmentIds + - SplitTicket + type: object + properties: + offerToken: + type: string + description: Unique key to identify each offer. + example: v5-21c33c9b411f87e895f9dfa8df82b535-38-1-st-v5-7b789d5a41dd7490c9ffbeaead2aa37a-3 + ReferenceId: + type: string + description: Unique key to identify matching private fares. + example: Flight_Reference_key_67890 + SplitTicket: + type: boolean + description: |- + True if more that one ticket will be issued for this offer per passenger. + False if only one ticket will be issued per passenger. + MetaApiBook: + type: boolean + description: To indicate meta partners whether the air product is available for TAAS instant book. + OpaqueFlight: + type: boolean + description: |- + Indicate whether the air product is a opaque flight product or not. + If true, then there will be no Segments node for this air product. + Free24HourCancellation: + type: boolean + description: True if Booking can be cancelled within 24 hours of booking. + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + description: Container for deeplink URL information. + SegmentIds: + type: array + description: |- + Container for list of segment ids in a particular offer. + For Opaque flight, no segment will be present. + example: + - 2816ed613aedd7513c953c33367df2e4 + - MjNfUHVibGlzaGVk + items: + type: string + xml: + name: SegmentIds + OfferPrice: + $ref: '#/components/schemas/OfferPrice' + VfopKey: + type: string + description: Key generated for Valid form of payment + example: VFOP-AA + Refundable: + type: boolean + description: |- + True if flight is refundable, + False if it's not refundable. + RefundPenalty: + type: array + description: Contains refund penalty information + items: + type: object + properties: + RefundPenalty: + required: + - SegmentIds + type: object + properties: + SegmentIds: + type: array + description: Contains a list of segment Ids + example: [2816ed613aedd7513c953c33367df2e4] + items: + type: string + description: Contains a list of segment Ids + example: 2816ed613aedd7513c953c33367df2e4 + xml: + name: SegmentIds + PreTripChange: + $ref: '#/components/schemas/RefundPenaltyDetail' + description: Contains refund penalty information + International: + type: boolean + description: |- + True, if flight is international. + False, if flight departs and arrives within the same country + TicketType: + type: string + description: Type of ticket being issued + example: E-Ticket + description: Container for list of air offers. An offer gives total trip details including flight and pricing information. + xml: + name: Offer + OfferPrice: + required: + - AveragePricePerTicket + - BasePrice + - PricePerPassengerCategory + - TotalPrice + - TotalTaxesAndFees + type: object + properties: + TotalPrice: + $ref: '#/components/schemas/Money' + TotalRefund: + $ref: '#/components/schemas/Money' + BasePrice: + $ref: '#/components/schemas/Money' + TotalFees: + $ref: '#/components/schemas/Money' + Fees: + type: array + description: Container for list of fees charged + items: + $ref: '#/components/schemas/Fee' + TotalTaxes: + $ref: '#/components/schemas/Money' + TotalTaxesAndFees: + $ref: '#/components/schemas/Money' + Discount: + $ref: '#/components/schemas/Money' + AveragePricePerTicket: + $ref: '#/components/schemas/AveragePricePerTicket' + PricePerPassengerCategory: + type: array + description: |- + Container for pricing information for each passenger category. + (note that passengers are grouped into standard categories based on the age ranges standardized by the airlines) + items: + $ref: '#/components/schemas/PricePerPassengerCategory' + description: |- + The total price of the package if purchased as a standalone hotel and a standalone flight. + (base price + taxes and fees) + xml: + name: OfferPrice + Power: + type: object + properties: + Available: + type: string + description: Indication of the availability of Power amenity. + enum: + - YES + - NO + - UNKNOWN + description: Container for power amenities available in this flight leg + PricePerPassengerCategory: + required: + - BasePrice + - Count + - Category + type: object + properties: + Category: + type: string + description: Passenger category + example: ADULT + enum: + - ADULT + - SENIOR + - ADULT_CHILD + - CHILD + - INFANT_IN_SEAT + - INFANT_IN_LAP + Count: + type: integer + description: Total number of travelers of the same passenger category + format: int32 + example: 2 + TotalPrice: + $ref: '#/components/schemas/Money' + BasePrice: + $ref: '#/components/schemas/Money' + TotalTaxes: + $ref: '#/components/schemas/Money' + Fees: + type: array + description: List of fees per passenger category + items: + $ref: '#/components/schemas/Fee' + description: |- + Container for pricing information for each passenger category. + (note that passengers are grouped into standard categories based on the age ranges standardized by the airlines) + xml: + name: PricePerPassengerCategory + RefundPenaltyDetail: + required: + - Allow + type: object + properties: + Allow: + type: string + description: Status of penalty information + example: YES + enum: + - YES + - NO + - UNKNOWN + Penalty: + $ref: '#/components/schemas/Money' + description: Container for en route change/cancellations and pre-trip change/cancellations + Segment: + required: + - DepartureArrivalDayDifference + - SegmentId + type: object + properties: + SegmentId: + type: string + description: |- + Unique identifier for a single flight segment. + Shown in case of opaque flight offer as well. + Can be alphanumeric or numeric. + example: 2816ed613aedd7513c953c33367df2e4 + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + description: Container for deeplink URL information. + Price: + $ref: '#/components/schemas/OfferPrice' + IncludesNonFlightLeg: + type: boolean + description: True if any Leg associated with this Segment is via a non-flight type of transit (Bus, Train or Boat) + Legs: + type: array + description: Container information on each flight leg. + items: + $ref: '#/components/schemas/Leg' + BaggageFees: + type: array + description: Container for baggage fee information of each bag type. The baggage fee can vary for each bag type. The amount can be zero, fixed amount or will be in a range. + items: + $ref: '#/components/schemas/BaggageFee' + AccountCode: + type: string + description: Lists any Account Code that has been applied to this segment. + example: RRR11 + BasicEconomy: + type: boolean + description: True if the corresponding fare ticket type associated with the segment is Basic Economy + example: false + SeatsLeft: + type: integer + description: Remaining number of seats available for this segment offer. + format: int32 + example: 9 + FareType: + type: string + description: Type of fare. + example: PUBLISHED + enum: + - NET + - PUBLISHED + - WEB + DepartureArrivalDayDifference: + type: integer + description: This is an indicator (can have values of -1, 0, 1, 2, etc.) which depends on the relative difference between the arrival and departure dates. + format: int32 + example: 0 + AirportChange: + type: boolean + description: True if there the Segment is having a different Departure airport compared to the Arrival airport of previous Segment. + TotalStops: + type: integer + description: The total number of stops in this segment(Nullable in case of Opaque Flights) + format: int32 + example: 1 + FlightDuration: + type: string + description: |- + Total duration of the flight segment + (Nullable in case of Opaque Flights) + example: PT9H0M + OpaqueDepartureTime: + type: string + description: Contains the name of the Fare tagged against the specific fare options. + example: Comfort+ + OpaqueNumberOfStops: + type: string + description: Departure time range will be shown only for opaque flight offers. + example: 12AM_TO_7:59AM + description: |- + Container of information about each flight offer + (Less information shown if the offer is and opaque flight offer) + Flights (the complete journey to your final destination by air) are made up of: + Segments (the trip from one stopping place to another) are made up of: + Legs (take off at one airport and land at another) + xml: + name: Segment + Warning: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Warning message code. + example: NO_RESULTS_FOUND + Description: + type: string + description: Warning message description + example: No flights solutions found for the request. + description: Container for warning messages. + Wifi: + type: object + properties: + Available: + type: string + description: Indication of the availability of WIFI amenity. + enum: + - YES + - NO + - UNKNOWN + description: Container for WiFi amenities available in this flight leg + APIMError: + title: APIMError + description: Container for error responses from APIM + properties: + message: + type: string + FlightLinksRequest: + type: object + required: + - Flights + - Passengers + properties: + Flights: + type: array + items: + $ref: "#/components/schemas/Flight" + Passengers: + type: object + items: + $ref: "#/components/schemas/PassengerDetails" + Links: + type: array + items: + type: string + Flight: + type: object + required: + - FlightId + - Segments + properties: + FlightId: + type: string + example: "abc" + Segments: + type: array + items: + type: object + properties: + Segment: + type: object + required: + - FareType + - Provider + - Legs + properties: + FareType: + type: string + enum: + - PUBLISHED + - NET + - WEB + Provider: + type: string + example: "Sabre" + LowCost: + type: boolean + Legs: + type: array + items: + type: object + required: + - DepartureAirport + - ArrivalAirport + - DepartureDateTime + - ArrivalDateTime + - FlightNumber + - MarketingAirlineCode + - BookingCode + - CabinClass + properties: + DepartureAirport: + type: object + properties: + Airport: + type: object + required: + - Code + properties: + Code: + type: string + example: "LAS" + ArrivalAirport: + type: object + properties: + Airport: + type: object + required: + - Code + properties: + Code: + type: string + example: "SEA" + DepartureDateTime: + type: string + format: date-time + example: "2021-07-05T07:15:00.000-06:00" + ArrivalDateTime: + type: string + format: date-time + example: "2021-07-05T09:13:00.000-08:00" + FlightNumber: + type: string + example: "2537" + MarketingAirlineCode: + type: string + example: "AA" + BookingCode: + type: string + example: "Y" + CabinClass: + type: string + enum: + - ECONOMY + - FIRST + - BUSINESS + - PREMIUM_ECONOMY + TotalPrice: + type: object + required: + - Value + - Currency + properties: + Value: + type: string + example: "300.00" + Currency: + type: string + example: "USD" + PassengerDetails: + type: object + required: + - Adult + - Senior + properties: + Adult: + type: string + example: "1" + Senior: + type: string + example: "1" + ChildrenAges: + type: string + example: "4,5" + InfantInSeat: + type: string + example: "1" + InfantInLap: + type: string + example: "1" + FlightLinksResponse: + type: object + required: + - TransactionId + properties: + Warnings: + type: array + items: + type: object + required: + - Code + - Description + properties: + Code: + type: string + example: "FLIGHT_LINKS_MISSING" + Description: + type: string + example: "1 of the link(s) requested found missing in the response" + Links: + type: array + items: + type: object + required: + - FlightId + properties: + FlightId: + type: string + example: "abc" + WebDetails: + type: object + required: + - Method + - Href + properties: + Method: + type: string + example: "GET" + Href: + type: string + example: "https://www.expedia.com/go/udp?CCheck=1&piid=~null.S~AQoCCAESBwjUBBABGAEgASAMIAcgDSgC~AQpCCh8I0aQBEgM1MTcYwlMgwzsozdvrATDb3esBOFdAAFgBCh8I0aQBEgM3MjUYwzsgrhwont_rATDr5esBOFdAAFgBEgYIARABGAEYBCIECAMQASIECAIQASIECAEQAigCMAE&Price=2576.68&CurrencyCode=USD¤cy=USD&DepartureTLA=L1:COK&ArrivalTLA=L1:ORD&DepartureDate=L1:2021-05-06&ArrivalDate=L1:2021-05-06&NumAdult=1&NumSenior=1&NumChild=2&ChildrenAges=2|14&Sort=10&TripType=OneWay&ProductType=air&eapid=0-1&ServiceVersion=V5&MessageGuid=c8912c1f-269b-4ca0-97d3-2ab4a62ea14a&langid=1033" + ApiDetails: + type: object + required: + - Accept + - Method + - Href + properties: + Accept: + type: string + example: "application/vnd.exp-flight.v3+json" + Method: + type: string + example: "GET" + Href: + type: string + example: "https://apim.expedia.com/flights/details/~null.S~AQoCCAESBwjUBBABGAEgASAMIAcgDSgC~AQpCCh8I0aQBEgM1MTcYwlMgwzsozdvrATDb3esBOFdAAFgBCh8I0aQBEgM3MjUYwzsgrhwont_rATDr5esBOFdAAFgBEgYIARABGAEYBCIECAMQASIECAIQASIECAEQAigCMAE?price=2576.68&childrenAges=2%2C14" + TransactionId: + type: string + example: "a9e371c4-89d9-4f9c-8df7-df105830e7fe" + ErrorResponse: + type: object + required: + - TransactionId + - Errors + properties: + TransactionId: + type: string + example: "a9e371c4-89d9-4f9c-8df7-df105830e7fe" + Errors: + type: array + items: + type: object + required: + - Code + - Description + properties: + Code: + type: string + example: "ERROR_CODE" + Description: + type: string + example: "Error Description" + Address: + required: + - Address1 + - City + - Country + type: object + properties: + Address1: + type: string + description: Street Number, Street Name, or PO Box + example: 724 Pine St + Address2: + type: string + description: 'Apartment, Floor, Suite, Bldg # or more specific information + about Address1.' + example: Second Floor + City: + type: string + description: The city + example: New York + Province: + type: string + description: The state or province + example: NY + Country: + type: string + description: 3-letter code for the country + example: USA + PostalCode: + type: string + description: Zip/postal code + example: "98004" + AgeClassRestriction: + type: object + properties: + AgeClass: + type: string + description: Categories for hotel guests, based on age. + example: Senior + enum: + - All Ages + - Senior + - Adult + - Child + - Infant + - Other + AgeMinimum: + type: integer + description: The minimum age defined in a particular AgeClass. + format: int32 + example: 2 + AgeMaximum: + type: integer + description: |- + The maximum age defined in a particular AgeClass. + If not specified, the AgeClass has no upper bound. + format: int32 + example: 17 + MaxGuestCount: + type: integer + description: The max guest count allowed in a particular AgeClass. + format: int32 + example: 3 + description: Container for room occupancy rules based on the age of the guests. + Amenity: + type: object + properties: + SeatChoice: + $ref: '#/components/schemas/SeatChoice' + CarryOnBag: + $ref: '#/components/schemas/Bag' + CheckedBag: + type: array + description: List of Checked Bag Amenity. + items: + $ref: '#/components/schemas/Bag' + Change: + $ref: '#/components/schemas/AmenityInfo' + Free24HrCancellation: + type: boolean + description: True if booking can be cancelled with in 24 hours after booking. + Refund: + $ref: '#/components/schemas/AmenityInfo' + PersonalItem: + $ref: '#/components/schemas/AmenityInfo' + Upgrade: + $ref: '#/components/schemas/AmenityInfo' + BoardingGroup: + type: array + description: List of available BoardingGroup Amenity. + example: [BASED_ON_SEAT_LOCATION] + items: + type: string + description: List of available BoardingGroup Amenity. + example: BASED_ON_SEAT_LOCATION + xml: + name: BoardingGroup + enum: + - LAST + - PRIORITY + - BASED_ON_SEAT_LOCATION + - PAY_TO_UPGRADE + description: Container for various amenities included in a particular segment. + xml: + name: Amenities + AmenityInfo: + type: object + properties: + Availability: + type: string + description: Availability of Amenity + example: INCLUDED + enum: + - INCLUDED + - NOT_AVAILABLE + - AVAILABLE_FOR_FEE + description: |- + Availability of Passenger Temperature Check. + Possible values: INCLUDED, NOT_AVAILABLE + xml: + name: AmenityInfo + Bag: + type: object + properties: + BagNumber: + type: integer + description: Bag number of CarryOnBag amenity for which the Availability applies. + format: int32 + example: 1 + Availability: + type: string + description: Availability of Amenity + example: INCLUDED + enum: + - INCLUDED + - NOT_AVAILABLE + - AVAILABLE_FOR_FEE + description: List of Checked Bag Amenity. + xml: + name: Bag + CrossSell: + required: + - HotelCount + - Hotels + - NumberOfNights + - NumberOfRooms + - Occupants + - Offers + - StayDates + type: object + properties: + HotelCount: + type: integer + description: | + Number of hotels available. + format: int32 + StayDates: + $ref: '#/components/schemas/StayDates' + NumberOfRooms: + type: integer + description: | + Number of rooms requested. + format: int32 + default: 1 + NumberOfNights: + type: integer + description: | + Number of nights guest staying in the hotel. + format: int32 + Occupants: + type: array + description: | + Container for occupants list. + items: + $ref: '#/components/schemas/Occupant' + Hotels: + type: array + description: | + Container for information on each hotel offer. + items: + $ref: '#/components/schemas/Hotel' + Offers: + type: array + description: | + Container for information about the hotel used in this package offer. + items: + $ref: '#/components/schemas/PackageOffers' + description: Container for cross sell information + xml: + name: CrossSell + Description: + type: object + properties: + LocationTeaser: + type: string + description: A description of the property's location. + example: Built on the original site of the University of Washington + HotelTeaser: + type: string + description: A description of the features and amenities of the property itself. + example: A top-notch fitness club and spa features a pool + RoomTeaser: + type: string + description: The common description for all of the rooms in the property. + example: Renovated in May 2016, guest rooms feature upholstered chairs + description: Container for information of the descriptions of the hotel. + FareOptions: + required: + - FareName + - FeeApplied + - Included + - SegmentIds + type: object + properties: + FareName: + type: string + description: Contains the name of the Fare tagged against the specific fare options. + example: Comfort+ + SegmentIds: + type: array + description: Contains list of segment Ids to which these FareOptions are provided. + example: [MTEx] + items: + type: string + description: Contains list of segment Ids to which these FareOptions are provided. + example: MTEx + xml: + name: SegmentIds + Included: + type: array + description: Contains list of options that are already included. + example: [CARRY_ON_BAG] + items: + type: string + description: Contains list of options that are already included. + example: CARRY_ON_BAG + xml: + name: Included + FeeApplied: + type: array + description: Contains list of options that are fee applied. + example: [Meals] + items: + type: string + description: Contains list of options that are fee applied. + example: Meals + xml: + name: FeeApplied + NotAvailable: + type: array + description: Contains list of options that are unavailable. + example: [CANCELLATION] + items: + type: string + description: Contains list of options that are unavailable. + example: CANCELLATION + xml: + name: NotAvailable + Amenities: + $ref: '#/components/schemas/Amenity' + description: Contains list of fare options + xml: + name: FareOptions + FlightDetailsResponse: + required: + - Lounges + - Offer + - TransactionId + type: object + properties: + Warnings: + type: array + description: Container for Warning Codes. + items: + $ref: '#/components/schemas/FlightDetailsWarning' + Segments: + type: array + description: Container for flight segments. + items: + $ref: '#/components/schemas/Segment' + Offer: + $ref: '#/components/schemas/FlightDetailsOffer' + AllOffers: + type: array + description: Contains list of all the available alternate fare upsell/downsell offers. + items: + $ref: '#/components/schemas/FlightDetailsOffer' + ValidFormsOfPayment: + type: array + description: Container for fees that are charged for using certain payment methods. + items: + $ref: '#/components/schemas/AirValidFormsOfPayment' + Lounges: + type: object + additionalProperties: + type: array + description: Container showing list of keys and its related lounge information. This key name can change based on the keys defined. + items: + $ref: '#/components/schemas/Lounge' + CrossSell: + $ref: '#/components/schemas/CrossSell' + TransactionId: + type: string + description: Unique identifier for the transaction. + example: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + xml: + name: FlightDetailsResponse + Hotel: + required: + - Id + - Name + - LocalCurrencyCode + - Location + - Distance + - Description + - Status + - ThumbnailUrl + - StarRating + - IsOfficialRating + - GuestRating + - GuestReviewCount + - Links + - RoomTypes + - Policies + - HotelAmenities + - RoomAmenities + type: object + properties: + Id: + type: string + description: The unique, Expedia-specific hotel property identifier used to designate a single hotel. + example: "14747" + Name: + type: string + description: The common name of the hotel + example: Four Seasons Hotel Seattle + LocalCurrencyCode: + type: string + description: The Local Currency Code for Hotel (which will be used for any fees that must be paid at the hotel) + example: USD + Location: + required: + - Address + - PointOfInterest + - GeoLocation + type: object + properties: + Address: + $ref: '#/components/schemas/Address' + PointOfInterest: + type: string + GeoLocation: + $ref: '#/components/schemas/GeoLocation' + description: Hotel address information + Distance: + $ref: '#/components/schemas/Distance' + Description: + $ref: '#/components/schemas/Description' + Status: + type: string + description: "\t\nIndicates whether there are available offers at the property\ + \ during the dates requested, as well as information as to why.\nNote\ + \ that pricing will only be present in the API response for a status of\ + \ 'AVAILABLE'.\nIf there are no rooms available at the property for the\ + \ dates requested, then 'NOT_AVAILABLE' will be returned.\nIf there are\ + \ available rooms, but none that meet the specific parameters of the search\ + \ request, then one of the other messages will be returned" + example: AVAILABLE + enum: + - 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 + ThumbnailUrl: + type: string + description: 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 the Related Links section at the bottom of the page + example: https://images.trvl-media.com/hotels/3000000/2170000/2163100/2163007/2163007_15_t.jpg + StarRating: + type: string + description: Star rating value of the hotel property. + example: "5.0" + enum: + - "1.0" + - "1.5" + - "2.0" + - "2.5" + - "3.0" + - "3.5" + - "4.0" + - "4.5" + - "5.0" + IsOfficialRating: + type: boolean + description: |- + Official rating value indicates if the hotel is certified or official. + (Required in Australia Point of Sale) + example: true + GuestRating: + type: string + description: |- + Average overall guest rating of the hotel. + The value is between 1.0 and 5.0 in 0.1 increments. + Higher is better. + example: "4.5" + GuestReviewCount: + type: integer + description: The total count of guest reviews used to create the average GuestRating above. + format: int32 + example: 240 + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + description: Container for list of HATEOAS links to Expedia/partner website to complete booking. + Policies: + $ref: '#/components/schemas/HotelPolicies' + Media: + type: array + description: Container for hotel images + items: + $ref: '#/components/schemas/Media' + HotelAmenities: + type: array + description: Container for all hotel amenities. + items: + $ref: '#/components/schemas/LodgingAmenity' + RoomAmenities: + type: array + description: Container for all room amenities. + items: + $ref: '#/components/schemas/LodgingAmenity' + Accessibility: + type: array + description: The accessibility options available for the room. + example: ['Accessible path of travel', 'Accessible bathroom', 'Roll-in shower', 'Handicapped parking', 'In-room accessibility', 'Accessibility equipment for the deaf', 'Braille or raised signage'] + items: + type: string + description: The accessibility options available for the room. + example: Handicapped parking + xml: + name: Accessibility + RoomTypes: + type: array + description: Container for all of available room types. + items: + $ref: '#/components/schemas/RoomType' + description: Container for information on each offered hotel. + HotelPolicies: + type: object + properties: + CheckInStartTime: + type: string + description: Beginning of the standard check-in window on the check in date, stated in the local time of the property. + example: 3 PM + CheckInEndTime: + type: string + description: End of the standard check-in window on the check in date, stated in the local time of the property. + example: 5 PM + CheckOutTime: + type: string + description: Customers must check out before this time on the check out date, expressed in the local time of the property. + example: noon + PetPolicies: + type: array + description: The policy of the property toward having pets stay with guests. + example: + - Pets allowed, Up to 20 lb + items: + type: string + description: The policy of the property toward having pets stay with guests. + example: '["Pets allowed, Up to 20 lb"]' + xml: + name: PetPolicies + ChildrenAndExtraBedsPolicies: + type: array + description: The policy of the property for having children stay at the property, as well as for including extra beds in the room. + example: [Children are welcome, Cribs/infant beds (surcharge)] + items: + type: string + description: The policy of the property for having children stay at the property, as well as for including extra beds in the room. + example: Children are welcome, Cribs/infant beds (surcharge) + xml: + name: ChildrenAndExtraBedsPolicies + description: Container for Hotel policy information. + HotelReference: + required: + - HotelId + - RoomKey + type: object + properties: + HotelId: + type: string + description: Unique id to represent a hotel + example: "2163007" + RoomKey: + type: string + description: Unique id to represent Room + example: CgUyMDIzMBIuCgkyMDEzMDQ1OTcSCTIwNjMyNzYwMRoCMjQqCDIwMTcwNzI1MggyMDE3MDcyNioDCgEy + description: Container for Hotel Reference information + LodgingAmenity: + required: + - Id + - Name + type: object + properties: + Id: + type: string + description: The identification of a property amenity. + example: "2065" + Name: + type: string + description: The description of a property amenity. + example: Business center + description: The amenities of the rateplan. + Media: + type: object + properties: + Type: + type: string + description: |- + type of the media. So far there is only one option: + 1: Image + example: "1" + Title: + type: string + description: Image title + example: Guestroom + Size: + type: string + description: |- + 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. + example: t + Url: + type: string + description: Image URL + example: https://images.trvl-media.com/hotels/1000000/30000/20300/20230/20230_159_t.jpg + description: Container for hotel images + Occupant: + type: object + properties: + Adults: + type: integer + description: | + The number of adults in a room. + format: int32 + example: 1 + ChildAges: + type: array + description: | + The ages of children in a room. + example: + - 2 + - 3 + - 5 + items: + type: integer + description: | + The ages of children in a room. + format: int32 + xml: + name: ChildAges + description: Container of occupants. It is an array including occupants of each room. + FlightDetailsOffer: + required: + - International + - Links + - MerchantName + - offerToken + - FareOptions + - OpaqueFlight + - OfferPrice + - Refundable + - SplitTicket + - TicketType + - UndisclosedGenderSupported + - UnspecifiedGenderSupported + type: object + properties: + offerToken: + type: string + description: Unique key to identify each offer. + example: v5-21c33c9b411f87e895f9dfa8df82b535-38-1-st-v5-7b789d5a41dd7490c9ffbeaead2aa37a-3 + ReferenceId: + type: string + description: Key that allows the user to create a package using this flight. + example: Flight_Reference_key_67890 + SplitTicket: + type: boolean + description: |- + True if more that one ticket will be issued for this offer per passenger. + False if only one ticket will be issued per passenger. + MetaApiBook: + type: boolean + description: To indicate meta partners whether the air product is available for TAAS instant book. + OpaqueFlight: + type: boolean + description: |- + Indicate whether the air product is a opaque flight product or not. + If true, then there will be no Segments node for this air product. + Free24HourCancellation: + type: boolean + description: True if Booking can be cancelled within 24 hours of booking. + MerchantName: + type: string + description: All Merchant name appending them together with a ?*? + example: Spirit Airlines*Frontier Airlines + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + description: Container for deeplink URL information. + SegmentIds: + type: array + description: |- + Container for list of segment ids in a particular offer. + For Opaque flight, no segment will be present. + example: + - 2816ed613aedd7513c953c33367df2e4 + - MjNfUHVibGlzaGVk + items: + type: string + description: |- + Container for list of segment ids in a particular offer. + For Opaque flight, no segment will be present. + example: 2816ed613aedd7513c953c33367df2e4 + xml: + name: SegmentIds + OfferPrice: + $ref: '#/components/schemas/OfferPrice' + VfopKey: + type: string + description: Key generated for Valid form of payment + example: VFOP-AA + Refundable: + type: boolean + description: |- + True if flight is refundable, + False if it's not refundable. + RefundPenalty: + type: array + description: Contains refund penalty information + items: + $ref: '#/components/schemas/FlightDetailsRefundPenalty' + International: + type: boolean + description: |- + True, if flight is international. + False, if flight departs and arrives within the same country + TicketType: + type: string + description: Type of ticket being issued + example: E-Ticket + FareOptions: + type: array + description: Contains list of fare options + items: + $ref: '#/components/schemas/FareOptions' + UndisclosedGenderSupported: + type: boolean + description: |- + Whether to support undisclosed gender? + True = support + False = not support + UnspecifiedGenderSupported: + type: boolean + description: |- + Whether to support unspecified gender? + True = support + False = not support + description: Contains list of all the available alternate fare upsell/downsell offers. + xml: + name: Offer + PackageOffers: + required: + - Links + - PackagedOffer + - Price + type: object + properties: + Price: + $ref: '#/components/schemas/PackagePrice' + Links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + description: Container for HATEOAS links to websites and/or API's. + PackagedOffer: + $ref: '#/components/schemas/PackagedOffer' + description: | + Container for information about the hotel used in this package offer. + PackagePrice: + required: + - AverageCostPerPerson + - Fees + - PackageBasePrice + - PackageTaxesAndFees + - PackageTotalPrice + - Savings + - StandAloneTotalPrice + type: object + properties: + PackageBasePrice: + $ref: '#/components/schemas/Money' + PackageTotalPrice: + $ref: '#/components/schemas/Money' + PackageTaxesAndFees: + $ref: '#/components/schemas/Money' + StandAloneTotalPrice: + $ref: '#/components/schemas/Money' + Fees: + type: array + description: |- + Special fees attached to the package (for example, Air Service Fees). + This amount is not included in PackageTaxesAndFees. + items: + $ref: '#/components/schemas/Fee' + TotalHotelMandatoryFees: + $ref: '#/components/schemas/Fee' + Savings: + $ref: '#/components/schemas/PackageSavings' + AverageCostPerPerson: + $ref: '#/components/schemas/Money' + description: Container for package price information + PackageSavings: + required: + - Currency + - Value + type: object + description: The amount of money that the traveler is saving by booking a package over booking the same offers as standalone products. + allOf: + - $ref: '#/components/schemas/Money' + - type: object + properties: + Value: + type: string + description: The value of the element being defined. + example: "21.9" + Currency: + type: string + description: The ISO 4217 Currency Code that the value is expressed in. + example: USD + LocalCurrencyPrice: + $ref: '#/components/schemas/Money' + Type: + type: string + description: Savings type + example: HotelDeal + Description: + type: string + description: Description of savings + example: Book this and save $55 (7%) + PackagedOffer: + required: + - FlightReferenceId + - HotelReference + type: object + properties: + HotelReference: + type: array + description: Container for Hotel Reference information + items: + $ref: '#/components/schemas/HotelReference' + FlightReferenceId: + type: string + description: Flight offer id + example: v587889e324c42342ec2ab7a8ecddc8a88 + StayDates: + $ref: '#/components/schemas/StayDates' + NumberOfNights: + type: integer + description: Number of nights guest staying in the hotel + format: int32 + example: 4 + description: Container for Package Offer + Promotion: + type: object + properties: + Type: + type: string + description: 'Promotion type, possible values: PO | FN' + example: PO + Description: + type: string + description: The description of the promotion. + example: 20%Off + Value: + type: number + format: double + RatePlan: + required: + - InventorySourceId + - RatePlanId + - RoomTypeId + type: object + properties: + RoomTypeId: + type: string + description: The room type identifier. + example: "200287452" + RatePlanId: + type: string + description: The rate plan identifier. + example: "201714191" + RateRuleId: + type: string + description: The identifier of rate rule. + example: "213544817" + InventorySourceId: + type: string + description: The identification number of the source that provides the rate plan. + example: "24" + InventorySourceCode: + type: string + description: The source name that provided the rate plan. + example: JT + StayDates: + $ref: '#/components/schemas/StayDates' + RemainingCount: + type: integer + description: |- + 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. + 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. + format: int32 + example: 3 + FreeInternet: + type: boolean + description: |- + Indicates whether the price of the room includes free Internet. + (either wireless or wired) + example: true + FreeWiFi: + type: boolean + description: Indicates whether the price of the room includes free wireless Internet access. + example: true + FreeInternetDetails: + type: array + description: The localized details for the free internet amenity (only shown when FreeInternet = true). + example: + - Free Wireless Internet, Wired high-speed Internet-comp + items: + type: string + description: The localized details for the free internet amenity (only shown when FreeInternet = true). + example: '["Free Wireless Internet, Wired high-speed Internet-comp"]' + xml: + name: FreeInternetDetails + FreeParking: + type: boolean + description: Indicates whether the price of the room includes free parking. + example: true + FreeBreakfast: + type: boolean + description: Indicates whether the price of the room includes free breakfast. + example: true + FreeBreakfastDetails: + type: array + description: The localized details for the free breakfast amenity (only shown when FreeBreakfast = true). + example: + - Full Breakfast + - Full Board + items: + type: string + description: The localized details for the free breakfast amenity (only shown when FreeBreakfast = true). + example: '["Full Breakfast","Full Board"]' + xml: + name: FreeBreakfastDetails + Amenities: + type: array + description: The amenities of the rateplan. + items: + $ref: '#/components/schemas/LodgingAmenity' + description: Container for rate plan information. + FlightDetailsRefundPenalty: + required: + - SegmentIds + type: object + properties: + SegmentIds: + type: array + description: Contains a list of segment Ids + example: [2816ed613aedd7513c953c33367df2e4] + items: + type: string + description: Contains a list of segment Ids + example: 2816ed613aedd7513c953c33367df2e4 + xml: + name: SegmentIds + PreTripChange: + $ref: '#/components/schemas/RefundPenaltyDetail' + PreTripCancel: + $ref: '#/components/schemas/RefundPenaltyDetail' + EnrouteChange: + $ref: '#/components/schemas/RefundPenaltyDetail' + EnrouteCancel: + $ref: '#/components/schemas/RefundPenaltyDetail' + Transferable: + type: string + enum: + - YES + - NO + - UNKNOWN + NameChangeAllowed: + type: string + enum: + - YES + - NO + - UNKNOWN + description: Contains refund penalty information + RoomOccupancyPolicy: + required: + - MaxGuestCount + - MinCheckInAge + type: object + properties: + MaxGuestCount: + type: integer + description: The maximum number of guests allowed to stay in a room. + format: int32 + example: 3 + AgeClassRestrictions: + type: array + description: Container for room occupancy rules based on the age of the guests. + items: + $ref: '#/components/schemas/AgeClassRestriction' + description: Room occupancy policy. + RoomType: + required: + - offerToken + - RatePlanType + - RatePlans + - Traveler + type: object + properties: + Description: + type: string + description: Text description of the room type. + example: Room, 1 King Bed, City View (Seattle V) + RatePlans: + type: array + description: Container for rate plan information. + items: + $ref: '#/components/schemas/RatePlan' + Promotions: + type: array + items: + $ref: '#/components/schemas/Promotion' + SmokingOption: + type: string + description: |- + The smoking options available for the room type. + Options could be: + SmokingOrNonSmoking + Smoking + NonSmoking + example: SmokingOrNonSmoking + enum: + - SmokingOrNonSmoking + - Smoking + - NonSmoking + RoomOccupancyPolicy: + $ref: '#/components/schemas/RoomOccupancyPolicy' + Amenities: + type: array + description: Container for all room amenities. + items: + $ref: '#/components/schemas/LodgingAmenity' + Media: + type: array + description: Container for hotel images + items: + $ref: '#/components/schemas/Media' + SeatChoice: + type: object + properties: + Availability: + type: string + description: Availability of Amenity + example: INCLUDED + enum: + - INCLUDED + - NOT_AVAILABLE + - AVAILABLE_FOR_FEE + Restriction: + type: string + description: Restriction if any on SeatChoice Amenity. + example: ONLY_AT_CHECKIN + enum: + - ONLY_AT_CHECKIN + description: Contains seat choice information. + xml: + name: SeatChoice + StayDates: + required: + - CheckInDate + - CheckOutDate + type: object + properties: + CheckInDate: + type: string + description: The initial day of the hotel stay in an ISO 8601 Date format [YYYY-MM-DD]. + format: date + CheckOutDate: + type: string + description: The final day of the hotel stay in an ISO 8601 Date format [YYYY-MM-DD]. + format: date + description: Container for Dates of Stay information + FlightDetailsWarning: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Standardized warning code. + example: PRICE_INCREASE + Description: + type: string + description: Standardized warning description message. + example: A price change was detected. + OriginalPrice: + $ref: '#/components/schemas/Money' + NewPrice: + $ref: '#/components/schemas/Money' + ChangedAmount: + $ref: '#/components/schemas/Money' + FlexSearchResponse: + required: + - Offers + - TransactionId + type: object + properties: + Warnings: + type: array + description: Container for Warning Codes. + items: + type: object + properties: + Warning: + required: + - Code + - Description + type: object + properties: + Code: + type: string + description: Warning message code. + example: NO_RESULTS_FOUND + Description: + type: string + description: Warning message description. + example: No flights solutions found for the request. + description: Container for Warning Codes. + Offers: + type: array + description: |- + Container for list of air offers. + An offer gives trip details including flight and pricing information. + items: + type: object + properties: + Offer: + required: + - DepartureDates + - OfferPrice + type: object + properties: + DepartureDates: + type: array + description: Container for the list of departure dates for the first Leg in each segment in chronological order. + example: [2021-02-19T09:12:28Z] + items: + type: string + description: Container for the list of departure dates for the first Leg in each segment in chronological order. + format: date-time + xml: + name: DepartureDates + OfferPrice: + required: + - TotalPrice + - TotalTaxesAndFees + type: object + properties: + TotalPrice: + type: object + properties: + Money: + required: + - Currency + - Value + type: object + properties: + Value: + type: string + description: The value of the element being defined. + example: "21.9" + Currency: + type: string + description: The ISO 4217 Currency Code that the value is expressed in. + example: USD + description: Container for Taxes per passenger category + description: |- + Container for price information corresponding to a particular segment + (Nullable in case of Opaque Flights) + xml: + name: OfferPrice + Segments: + type: array + description: |- + Container of information about each flight offer + Segments (the trip from one stopping place to another) are made up of Legs. + This will be given back in response if includeSegmentDetails=true + items: + type: object + properties: + Segment: + required: + - DepartureArrivalDayDifference + - Legs + type: object + properties: + DepartureArrivalDayDifference: + type: integer + description: This is an indicator (can have values of -1, 0, 1, 2, etc.) which depends on the relative difference between the arrival and departure dates. + format: int32 + example: 0 + AirportChange: + type: boolean + description: True if there the Segment is having a different Departure airport compared to the Arrival airport of previous Segment. + Legs: + type: array + description: Container information on each flight leg. + items: + type: object + properties: + Leg: + required: + - ArrivalAirport + - ArrivalDateTime + - BookingCode + - CabinClass + - DepartureAirport + - DepartureDateTime + - FlightDuration + - FlightNumber + - MarketingAirlineCode + - SeatMapAvailable + type: object + properties: + DepartureAirport: + type: object + properties: + Airport: + required: + - Code + type: object + properties: + Code: + type: string + description: Three-letter IATA airport code for departure location + example: SFO + description: Container for information on the arrival airport. + xml: + name: Airport + ArrivalAirport: + type: object + properties: + Airport: + required: + - Code + type: object + properties: + Code: + type: string + description: Three-letter IATA airport code for departure location + example: SFO + description: Container for information on the arrival airport. + xml: + name: Airport + DepartureDateTime: + type: string + description: Flight departure date and time in ISO 8601 format + format: date-time + example: 2021-07-05T07:15:00-06:00 + ArrivalDateTime: + type: string + description: Flight landing date and time in ISO 8601 format + format: date-time + example: 2021-07-05T10:15:00-06:00 + FlightNumber: + type: string + description: Flight Number assigned by Carrier. + example: "2537" + MarketingAirlineCode: + type: string + description: The two-letter code of the Airline that is marketing the flight. + example: AA + OperatingAirlineCode: + type: string + description: The two-letter code of the Airline actually operating the plane. + example: UA + FlightDuration: + type: string + description: The total travel duration for this leg, expressed in ISO 8601 standard. + example: PT3H58M + CabinClass: + type: string + description: Class of service for the air leg. + example: ECONOMY + enum: + - ECONOMY + - FIRST + - BUSINESS + - PREMIUM_ECONOMY + description: Container information on each flight leg. + xml: + name: Leg + description: |- + Container of information about each flight offer + Segments (the trip from one stopping place to another) are made up of Legs. + This will be given back in response if includeSegmentDetails=true + xml: + name: Segment + description: |- + Container for list of air offers. + An offer gives trip details including flight and pricing information. + xml: + name: Offer + TransactionId: + type: string + description: Unique identifier for the transaction. + example: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 + xml: + name: FlexSearchResponse + FareCalendarResponse: + required: + - Offers + - TransactionId + type: object + properties: + Warnings: + type: array + description: Container for Warning Codes. + items: + $ref: '#/components/schemas/Warning' + Offers: + type: array + description: |- + Container for list of air offers. + An offer gives total trip details including flight and pricing information. + items: + required: + - DepartureDate + - OfferPrice + type: object + properties: + DepartureDate: + type: string + description: Flight departure date in ISO 8601 format. + format: date-time + OfferPrice: + required: + - TotalPrice + type: object + properties: + TotalPrice: + $ref: '#/components/schemas/Money' + description: |- + Container for offer price information. + Segments: + type: array + description: |- + Container of information about each flight offer + Segments (the trip from one stopping place to another) are made up of Legs + This will be given back in response if includeSegmentDetails=true + items: + required: + - Legs + type: object + properties: + Legs: + type: array + description: Container information on each flight leg. + items: + required: + - ArrivalAirport + - ArrivalDateTime + - CabinClass + - DepartureAirport + - DepartureDateTime + - FlightNumber + type: object + properties: + DepartureAirport: + required: + - Code + type: object + properties: + Code: + type: string + description: Three-letter IATA airport code for departure location + example: SFO + description: Container for information on the arrival airport. + ArrivalAirport: + required: + - Code + type: object + properties: + Code: + type: string + description: Three-letter IATA airport code for departure location + example: SFO + description: Container for information on the arrival airport. + DepartureDateTime: + type: string + description: Flight departure date and time in ISO 8601 format + format: date-time + example: 2021-07-05T07:15:00-06:00 + ArrivalDateTime: + type: string + description: Flight landing date and time in ISO 8601 format + format: date-time + example: 2021-07-05T10:15:00-06:00 + FlightNumber: + type: string + description: Flight Number assigned by Carrier. + example: "2537" + MarketingAirlineCode: + type: string + description: The two-letter code of the Airline that is marketing the flight. + example: AA + OperatingAirlineCode: + type: string + description: The two-letter code of the Airline actually operating the plane. + example: UA + CabinClass: + type: string + description: Class of service for the air leg. + example: ECONOMY + enum: + - ECONOMY + - FIRST + - BUSINESS + - PREMIUM_ECONOMY + description: Container information on each flight leg. + description: |- + Container of information about each flight offer + Segments (the trip from one stopping place to another) are made up of Legs + This will be given back in response if includeSegmentDetails=true + description: |- + Container for list of air offers. + An offer gives total trip details including flight and pricing information. + TransactionId: + type: string + description: Unique identifier for the transaction. + example: f06edfa3-27f4-44e6-838c-b8dd3d0a3210 +security: + - basicAuth: [] diff --git a/specs/xap-sdp-v1.specs.yaml b/specs/xap-sdp-v1.specs.yaml index 6e7e881d3..d53498ad8 100644 --- a/specs/xap-sdp-v1.specs.yaml +++ b/specs/xap-sdp-v1.specs.yaml @@ -144,7 +144,7 @@ paths: downloadUrl: https://lpdp-data-test.s3.us-west-2.amazonaws.com/hotels/common/summary/filtered/expedia-lodging-summary_filtered_by_canada_en_us.jsonl.zip?X-Client-Key=DD0CFD5B-4CE6-474C-934C-C2ABC250D72B&X-Amz-Security-Token=FwoGZXIvYXdzEJD%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDDgCq3hfh2uzzkVrdiL0AbJ2Mr51BioDJbfW66%2F7QGFKQ5PPAcq3TprAoBGMBJVeafZ%2BvsrkKOdAUrxDGnheLNwmRBlE%2B2HS7f3pK6rE3XnnY6rEJKLe1EE2DmmNe3qIarJVVogurZumYcZ9SDPBvWwX4IGsNolFS5Qu8vtyur93xqg5%2BHnoPxLEJsP1yztRMGAiWKz9O1V79C6ZiFI5HtVOt4jYXSXdvtPKz9E6DA0ebXTpbAsm4T8PIvl30I5nNBdesXv8ap4Uie2fE6ALtUgWyJrKs%2Fy333aT6iV8Kau%2BNX3V3NW3LHh7rECgTtr5nySSxMJ2UFfQx8w7e9K8aAm098covbOPoQYyK5UIm%2BjPE%2FMbJqmroHqhzbKwbn7JFK5NnkXRmpPuGxn%2Bxmt%2Fe8Bg327adJ0%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230329T063549Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=ASIASWURL3BTL5JH6TPD%2F20230329%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=ac4389b81d4b9e6563fd234b16dafceaab5fcbe2931454da2fe9956b1e3f5919 filterConditions: pointOfSupply: CA - bestMatchedLink: + bestMatchedLink: href: https://localhost:8443/feed/v1/download-url?type=SUMMARY&pointOfSupply=CA method: GET - fileContentType: Summary @@ -158,7 +158,7 @@ paths: downloadUrlExpires: Wed Mar 29 07:35:49 UTC 2023 filterConditions: structureType: CONVENTIONAL - bestMatchedLink: + bestMatchedLink: href: https://localhost:8443/feed/v1/download-url?type=SUMMARY&loadgingType=CL method: GET VendorLogo: @@ -181,8 +181,8 @@ paths: example: transactionId: 38dc7269-12b1-58c9-a381-4963c274cdfe error: - code: INVALID_TYPE_ATTR - description: Invalid type provided. + code: INVALID_TYPE_ATTR + description: Invalid type provided. description: Invalid request from the client. '401': content: @@ -235,8 +235,8 @@ paths: example: transactionId: 38dc7269-12b1-58c9-a381-4963c274cdfe error: - code: SERVER_ERROR - description: An error has occurred while processing the request. + code: SERVER_ERROR + description: An error has occurred while processing the request. description: >- Server side error like backend service has some issues or some issues in EWS Feed service. The Error code is SERVER_ERROR. @@ -389,4 +389,4 @@ components: security: - BasicAuth: [] tags: - - name: download-url \ No newline at end of file + - name: download-url diff --git a/tests/integration/README.md b/tests/integration/README.md deleted file mode 100644 index 87117d931..000000000 --- a/tests/integration/README.md +++ /dev/null @@ -1,87 +0,0 @@ -# XAP Java SDK Integrations - -This repository contains integration tests of the Expedia Group XAP Java SDK. - -_**The following instructions apply if you want to run the integration tests locally.**_ - -## Requirements - -- Ensure you have a valid API key and secret from Expedia Group. - Check [Getting started with XAP](https://developers.expediagroup.com/xap/products/xap/set-up/getting-started) - for more info. -- Java 1.8 or higher -- Maven - -## Setup - -1. Clone the repository. -2. Navigate to the project directory `integrations`. -3. Run `mvn clean install` to build the project and install the dependencies including the XAP SDK. - -## Running the Integration Tests - -### Run with IntelliJ IDEA - -1. Navigate to the test class you want to run -2. Right-click on the class name and select `More Run/Debug` -> `Modify Run Configuration` -3. Check the `Modify options` -> `Add VM options` and add the following VM options: - ``` - -Dcom.expediagroup.xapjavasdk.apikey="{API_KEY}" - -Dcom.expediagroup.xapjavasdk.apisecret="{API_SECRET}" - ``` - Replace `{API_KEY}` and `{API_SECRET}` with your actual API key and secret. - > **Note:** If you are running the tests for Vrbo, you would need the following VM options - instead: - > ``` - > -Dcom.expediagroup.xapjavasdk.vrbokey="{VRBO_KEY}" - > -Dcom.expediagroup.xapjavasdk.vrbosecret="{VRBO_SECRET}" - > ``` - > The key you use must be enabled for Vrbo brand. If you are not sure, please reach out to your - account manager. -4. Click `OK` and then run the test class. - -### Run with Command Line - -Run the following command to run all integration tests: - -``` -mvn failsafe:integration-test \ - -Dcom.expediagroup.xapjavasdk.apikey="{API_KEY}" \ - -Dcom.expediagroup.xapjavasdk.apisecret="{API_SECRET}" \ - -Dcom.expediagroup.xapjavasdk.vrbokey="{VRBO_KEY}" \ - -Dcom.expediagroup.xapjavasdk.vrbosecret="{VRBO_SECRET}" \ - -f pom.xml -``` - -If your key is enabled for both Expedia and Vrbo brands, you may use the same key and secret -pair for the placeholders. Otherwise, you may run the tests separately by providing only the -required key and secret. For example: - -``` -mvn failsafe:integration-test \ - -Dit.test=TestClassName#testMethodName \ - -Dcom.expediagroup.xapjavasdk.apikey="{API_KEY}" \ - -Dcom.expediagroup.xapjavasdk.apisecret="{API_SECRET}" \ - -f pom.xml -``` - -Replace `TestClassName` and `testMethodName` with the actual test class name and method name, -and `{API_KEY}` and `{API_SECRET}` with your actual API key and secret. -> If `#testMethodName` is omitted, all test methods in the class will be executed. - -If you are running the tests for Vrbo, you should use the following command instead: - -``` -mvn failsafe:integration-test \ - -Dit.test=TestClassName#testMethodName \ - -Dcom.expediagroup.xapjavasdk.vrbokey="{VRBO_KEY}" \ - -Dcom.expediagroup.xapjavasdk.vrbosecret="{VRBO_SECRET}" - -f pom.xml -``` - -The key you use must be enabled for Vrbo brand. If you are not sure, please reach out to your -account manager. - -## License - -This project is licensed under the Apache License v2.0 - see the [LICENSE](../../LICENSE) for details. diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml deleted file mode 100644 index 3e50578d4..000000000 --- a/tests/integration/pom.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - 4.0.0 - - com.expediagroup - xap-java-sdk-integrations - 1.0-SNAPSHOT - - - 1.8 - 1.8 - 1.8 - UTF-8 - 1.1.0 - - - - - oss.sonatype.org-snapshot - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - - - - - - com.expediagroup - xap-sdk - ${xap-java-sdk.sdk.version} - - - org.apache.logging.log4j - log4j-api - 2.24.3 - - - org.apache.logging.log4j - log4j-slf4j2-impl - 2.24.3 - - - org.junit.jupiter - junit-jupiter - 5.12.0 - test - - - com.squareup.okhttp3 - mockwebserver - 4.12.0 - test - - - io.hosuaby - inject-resources-junit-jupiter - 1.0.0 - test - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.6.0 - - google_checks.xml - true - error - true - - - - - check - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 3.5.2 - - - integration-tests - - integration-test - verify - - - - **/*IT.java - - - - - - - org.apache.maven.plugins - maven-surefire-report-plugin - 3.5.2 - - - report - integration-test - - failsafe-report-only - - - - - - - diff --git a/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/Constant.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/Constant.java deleted file mode 100644 index f55c68988..000000000 --- a/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/Constant.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.expediagroup.sdk.xap.integrations.common; - -import java.util.Base64; -import java.util.UUID; - -/** - * Constants used in the integration tests. - */ -public class Constant { - public static final String PARTNER_TRANSACTION_ID = "xap-sdk-integration-test"; - public static final String MOCK_KEY = UUID.randomUUID().toString(); - public static final String MOCK_SECRET = "mock"; - public static final String AUTHORIZATION = "Basic " + Base64.getEncoder() - .encodeToString((MOCK_KEY + ":" + MOCK_SECRET).getBytes()); - public static final String ACCEPT_HOTEL = "application/vnd.exp-hotel.v3+json"; - public static final String ACCEPT_LODGING = "application/vnd.exp-lodging.v3+json"; -} diff --git a/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIntegrationTests.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIntegrationTests.java deleted file mode 100644 index 26669c01c..000000000 --- a/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/common/XapIntegrationTests.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.expediagroup.sdk.xap.integrations.common; - -import static com.expediagroup.sdk.xap.integrations.common.Constant.MOCK_KEY; -import static com.expediagroup.sdk.xap.integrations.common.Constant.MOCK_SECRET; - -import com.expediagroup.sdk.xap.client.XapClient; -import okhttp3.mockwebserver.MockWebServer; -import org.apache.commons.lang3.StringUtils; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.TestInstance; - - -/** - * Extension for setting up the required components for testing. - */ -@TestInstance(TestInstance.Lifecycle.PER_CLASS) -public abstract class XapIntegrationTests { - - protected XapClient xapClient; - protected MockWebServer mockWebServer; - - @BeforeEach - void setup() { - mockWebServer = new MockWebServer(); - - xapClient = XapClient.builder() - .key(MOCK_KEY) - .secret(MOCK_SECRET) - .endpoint(mockWebServer.url("/").toString()) - .build(); - } - - @AfterEach - void tearDown() throws Exception { - // Clean everything after each test to ensure clear state - if (mockWebServer != null) { - mockWebServer.shutdown(); - mockWebServer = null; - } - xapClient = null; - } -} diff --git a/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIntegrationTests.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIntegrationTests.java deleted file mode 100644 index c11907f1e..000000000 --- a/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/AvailabilityCalendarsIntegrationTests.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.expediagroup.sdk.xap.integrations.lodging; - -import static com.expediagroup.sdk.xap.integrations.common.Constant.ACCEPT_HOTEL; -import static com.expediagroup.sdk.xap.integrations.common.Constant.ACCEPT_LODGING; -import static com.expediagroup.sdk.xap.integrations.common.Constant.AUTHORIZATION; -import static com.expediagroup.sdk.xap.integrations.common.Constant.MOCK_KEY; -import static com.expediagroup.sdk.xap.integrations.common.Constant.PARTNER_TRANSACTION_ID; - -import com.expediagroup.sdk.core.model.Response; -import com.expediagroup.sdk.xap.integrations.common.XapIntegrationTests; -import com.expediagroup.sdk.xap.models.AvailabilityCalendar; -import com.expediagroup.sdk.xap.models.AvailabilityCalendarResponse; -import com.expediagroup.sdk.xap.models.DateRange; -import com.expediagroup.sdk.xap.operations.GetLodgingAvailabilityCalendarsOperation; -import com.expediagroup.sdk.xap.operations.GetLodgingAvailabilityCalendarsOperationParams; -import io.hosuaby.inject.resources.junit.jupiter.GivenTextResource; -import io.hosuaby.inject.resources.junit.jupiter.TestWithResources; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import okhttp3.Headers; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.RecordedRequest; -import org.apache.commons.lang3.StringUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - - -/** - * This class is used to test the integration of the Lodging Availability Calendars API. - */ -@TestWithResources -public class AvailabilityCalendarsIntegrationTests extends XapIntegrationTests { - @Test - public void testRequest() { - GetLodgingAvailabilityCalendarsOperationParams availabilityCalendarsOperationParams = - GetLodgingAvailabilityCalendarsOperationParams.builder() - .partnerTransactionId(UUID.randomUUID().toString()) - .propertyIds(new HashSet<>(Arrays.asList("123", "456", "789"))) - .build(); - - mockWebServer.enqueue( - new MockResponse() - .setHeader("Content-Type", ACCEPT_LODGING) - .setResponseCode(200) - .setBody("{}")); - - xapClient.execute( - new GetLodgingAvailabilityCalendarsOperation(availabilityCalendarsOperationParams)); - try { - RecordedRequest recordedRequest = mockWebServer.takeRequest(); - // method - Assertions.assertEquals("GET", recordedRequest.getMethod()); - // headers - Headers headers = recordedRequest.getHeaders(); - Assertions.assertEquals(availabilityCalendarsOperationParams.getPartnerTransactionId(), - headers.get("Partner-Transaction-Id")); - Assertions.assertEquals(ACCEPT_LODGING, headers.get("Accept")); - Assertions.assertEquals(MOCK_KEY, headers.get("key")); - Assertions.assertEquals(AUTHORIZATION, headers.get("Authorization")); - // path and query - String path = recordedRequest.getPath(); - Assertions.assertNotNull(path); - Assertions.assertTrue(path.startsWith("/lodging/availabilityCalendars")); - String query = path.substring(path.indexOf("?") + 1); - Assertions.assertTrue(query.contains("propertyIds=123%2C456%2C789")); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } - - @Test - public void testResponse(@GivenTextResource("GetLodgingAvailabilityCalendarsResponse.json") String mockedResponse) { - GetLodgingAvailabilityCalendarsOperationParams params = - GetLodgingAvailabilityCalendarsOperationParams.builder() - .partnerTransactionId(PARTNER_TRANSACTION_ID) - .propertyIds(new HashSet<>(Arrays.asList("87704892", "83418323", "75028284", - "75030107", "91799474"))) - .build(); - - mockWebServer.enqueue( - new MockResponse() - .setHeader("Content-Type", ACCEPT_HOTEL) - .setHeader("partner-transaction-id", PARTNER_TRANSACTION_ID) - .setResponseCode(200) - .setBody(mockedResponse)); - - Response response = - xapClient.execute(new GetLodgingAvailabilityCalendarsOperation(params)); - verifyResponse(response); - } - - private void verifyResponse(Response response) { - Assertions.assertNotNull(response); - Assertions.assertEquals(200, response.getStatusCode()); - Map> headers = response.getHeaders(); - Assertions.assertNotNull(headers); - Assertions.assertEquals(PARTNER_TRANSACTION_ID, headers.get("partner-transaction-id") - .get(0)); - verifyAvailabilityCalendarResponse(response.getData()); - } - - private void verifyAvailabilityCalendarResponse( - AvailabilityCalendarResponse availabilityCalendarResponse) { - Assertions.assertNotNull(availabilityCalendarResponse); - Assertions.assertNull(availabilityCalendarResponse.getWarnings()); - Assertions.assertNotNull(availabilityCalendarResponse.getTransactionId()); - List availabilityCalendars = - availabilityCalendarResponse.getAvailabilityCalendars(); - Assertions.assertNotNull(availabilityCalendars); - if (availabilityCalendars.isEmpty()) { - Assertions.fail("No availability calendars found."); - } - availabilityCalendars.forEach(this::verifyAvailabilityCalendar); - } - - private void verifyAvailabilityCalendar(AvailabilityCalendar availabilityCalendar) { - Assertions.assertNotNull(availabilityCalendar); - Assertions.assertNotNull(availabilityCalendar.getPropertyId()); - DateRange dateRange = availabilityCalendar.getDateRange(); - Assertions.assertNotNull(dateRange); - Assertions.assertNotNull(dateRange.getStartDate()); - Assertions.assertNotNull(dateRange.getEndDate()); - Assertions.assertTrue(StringUtils.isNotBlank(availabilityCalendar.getAvailability())); - Assertions.assertTrue(StringUtils.isNotBlank(availabilityCalendar.getChangeOver())); - Assertions.assertTrue(StringUtils.isNotBlank(availabilityCalendar.getMinPriorNotify())); - Assertions.assertTrue(StringUtils.isNotBlank(availabilityCalendar.getMinStay())); - Assertions.assertTrue(StringUtils.isNotBlank(availabilityCalendar.getMaxStay())); - } -} diff --git a/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIntegrationTests.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIntegrationTests.java deleted file mode 100644 index 26c832e0c..000000000 --- a/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/ListingsIntegrationTests.java +++ /dev/null @@ -1,501 +0,0 @@ -package com.expediagroup.sdk.xap.integrations.lodging; - -import static com.expediagroup.sdk.xap.integrations.common.Constant.ACCEPT_HOTEL; -import static com.expediagroup.sdk.xap.integrations.common.Constant.AUTHORIZATION; -import static com.expediagroup.sdk.xap.integrations.common.Constant.MOCK_KEY; - -import com.expediagroup.sdk.core.model.Response; -import com.expediagroup.sdk.xap.integrations.common.Constant; -import com.expediagroup.sdk.xap.integrations.common.XapIntegrationTests; -import com.expediagroup.sdk.xap.models.AgeClassRestriction; -import com.expediagroup.sdk.xap.models.BedType; -import com.expediagroup.sdk.xap.models.CancellationPolicy; -import com.expediagroup.sdk.xap.models.Distance; -import com.expediagroup.sdk.xap.models.Hotel; -import com.expediagroup.sdk.xap.models.HotelHotelAmenitiesInner; -import com.expediagroup.sdk.xap.models.HotelLinks; -import com.expediagroup.sdk.xap.models.HotelLinksApiRateCalendar; -import com.expediagroup.sdk.xap.models.HotelLinksWebSearchResult; -import com.expediagroup.sdk.xap.models.HotelListingsResponse; -import com.expediagroup.sdk.xap.models.HotelLocation; -import com.expediagroup.sdk.xap.models.HotelPropertyType; -import com.expediagroup.sdk.xap.models.HotelRoomAmenitiesInner; -import com.expediagroup.sdk.xap.models.LocationGeoLocation; -import com.expediagroup.sdk.xap.models.Media; -import com.expediagroup.sdk.xap.models.Neighborhood; -import com.expediagroup.sdk.xap.models.NonRefundableDateRange; -import com.expediagroup.sdk.xap.models.PaymentSchedule; -import com.expediagroup.sdk.xap.models.RatePlan; -import com.expediagroup.sdk.xap.models.RatePlanAmenitiesInner; -import com.expediagroup.sdk.xap.models.RatePlanPrice; -import com.expediagroup.sdk.xap.models.RatePlanPriceNightlyRatesInner; -import com.expediagroup.sdk.xap.models.RatePlanPriceTaxesAndFeesDetailsInner; -import com.expediagroup.sdk.xap.models.RatePlanStandalonePrice; -import com.expediagroup.sdk.xap.models.Room; -import com.expediagroup.sdk.xap.models.RoomOccupancyPolicy; -import com.expediagroup.sdk.xap.models.RoomType; -import com.expediagroup.sdk.xap.models.RoomTypeAmenitiesInner; -import com.expediagroup.sdk.xap.models.RoomTypeLinks; -import com.expediagroup.sdk.xap.models.RoomTypeLinksApiDetails; -import com.expediagroup.sdk.xap.models.RoomTypeLinksWebDetails; -import com.expediagroup.sdk.xap.models.RoomTypeMediaInner; -import com.expediagroup.sdk.xap.models.RoomTypePrice; -import com.expediagroup.sdk.xap.models.RoomTypeStandalonePrice; -import com.expediagroup.sdk.xap.models.StayDates; -import com.expediagroup.sdk.xap.operations.GetLodgingListingsOperation; -import com.expediagroup.sdk.xap.operations.GetLodgingListingsOperationParams; -import io.hosuaby.inject.resources.junit.jupiter.GivenTextResource; -import io.hosuaby.inject.resources.junit.jupiter.TestWithResources; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import okhttp3.Headers; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - - -/** - * This class is used to test the integration of the Lodging Listings API. - */ -@TestWithResources -public class ListingsIntegrationTests extends XapIntegrationTests { - - @Test - public void testRequest() { - ArrayList rooms = new ArrayList<>(); - rooms.add(Room.builder().adults(1L).build()); - rooms.add(Room.builder().adults(2L).childAges(Arrays.asList(10L, 12L)).build()); - rooms.add(Room.builder().adults(1L).childAges(Collections.singletonList(5L)).build()); - rooms.add(Room.builder().adults(6L).build()); - rooms.add(Room.builder().adults(2L).childAges(Arrays.asList(3L, 4L)).build()); - rooms.add(Room.builder().adults(3L).childAges(Arrays.asList(1L, 2L, 3L, 4L, 5L)).build()); - rooms.add(Room.builder().adults(2L).childAges(Arrays.asList(1L, 2L, 3L, 4L)).build()); - rooms.add(Room.builder().adults(1L).build()); - - GetLodgingListingsOperationParams getLodgingListingsOperationParams = - GetLodgingListingsOperationParams.builder() - .partnerTransactionId(UUID.randomUUID().toString()) - // hotel selection - .ecomHotelIds(new HashSet<>(Arrays.asList("123", "456"))) - .hcomHotelIds(new HashSet<>(Arrays.asList("135", "246"))) - .geoLocation("47.6062,-122.3321") - .regionIds(new HashSet<>(Collections.singletonList("1001"))) - .locationKeyword("Space Needle, Seattle") - .radius(10) - .unit(GetLodgingListingsOperationParams.Unit.KM) - // search - .checkIn(LocalDate.now().plusDays(5)) - .checkOut(LocalDate.now().plusDays(10)) - .locale("en_US") - .currency("USD") - .rooms(rooms) - .source(GetLodgingListingsOperationParams.Source.BROWSER) - .travelWithPets(true) - // content detail - .contentDetails(GetLodgingListingsOperationParams.ContentDetails.HIGH) - .allRoomTypes(true) - .links(Arrays.asList(GetLodgingListingsOperationParams.Links.WEB, - GetLodgingListingsOperationParams.Links.API)) - // filtering - .minStarRating(GetLodgingListingsOperationParams.MinStarRating._1_PERIOD5) - .maxStarRating(GetLodgingListingsOperationParams.MaxStarRating._5_PERIOD0) - .limit(5) - .queryText("Seattle") - .availOnly(true) - .smokingPreference(GetLodgingListingsOperationParams.SmokingPreference.BOTH) - .rateType(GetLodgingListingsOperationParams.RateType.ALL) - .imageSizes(GetLodgingListingsOperationParams.ImageSizes.S) - .thumbnailImageSize(GetLodgingListingsOperationParams.ThumbnailImageSize.T) - .includedPropertyTypeIds(new HashSet<>(Arrays.asList("1", "2"))) - .excludedPropertyTypeIds(new HashSet<>(Arrays.asList("3", "4"))) - .includedInventorySourceIds(new HashSet<>(Arrays.asList("5", "6"))) - .freeCancellation(true) - .groupedAmenities(true) - .blockFullDepositRateplan(true) - // package pricing - .ratePlanType(GetLodgingListingsOperationParams.RatePlanType.PACKAGE) - // sorting - .sortType(GetLodgingListingsOperationParams.SortType.PRICE) - .sortOrder(GetLodgingListingsOperationParams.SortOrder.ASC) - .build(); - - mockWebServer.enqueue( - new MockResponse() - .setHeader("Content-Type", ACCEPT_HOTEL) - .setResponseCode(200) - .setBody("{}")); - - xapClient.execute(new GetLodgingListingsOperation(getLodgingListingsOperationParams)); - try { - RecordedRequest recordedRequest = mockWebServer.takeRequest(); - // method - Assertions.assertEquals("GET", recordedRequest.getMethod()); - // headers - Headers headers = recordedRequest.getHeaders(); - Assertions.assertEquals(getLodgingListingsOperationParams.getPartnerTransactionId(), - headers.get("Partner-Transaction-Id")); - Assertions.assertEquals(ACCEPT_HOTEL, headers.get("Accept")); - Assertions.assertEquals(MOCK_KEY, headers.get("key")); - Assertions.assertEquals(AUTHORIZATION, headers.get("Authorization")); - // path and query - String path = recordedRequest.getPath(); - Assertions.assertNotNull(path); - Assertions.assertTrue(path.startsWith("/hotels/listings")); - String query = path.substring(path.indexOf("?") + 1); - // hotel selection - Assertions.assertTrue(query.contains("ecomHotelIds=123%2C456")); - Assertions.assertTrue(query.contains("hcomHotelIds=135%2C246")); - Assertions.assertTrue(query.contains("geoLocation=47.6062%2C-122.3321")); - Assertions.assertTrue(query.contains("regionIds=1001")); - Assertions.assertTrue(query.contains("locationKeyword=Space+Needle%2C+Seattle")); - Assertions.assertTrue(query.contains("radius=10")); - Assertions.assertTrue(query.contains("unit=km")); - // search - Assertions.assertTrue( - query.contains("checkIn=" + getLodgingListingsOperationParams.getCheckIn())); - Assertions.assertTrue( - query.contains("checkOut=" + getLodgingListingsOperationParams.getCheckOut())); - Assertions.assertTrue(query.contains("locale=en_US")); - Assertions.assertTrue(query.contains("currency=USD")); - Assertions.assertTrue(query.contains("room1.adults=1")); - Assertions.assertTrue(query.contains("room2.adults=2")); - Assertions.assertTrue(query.contains("room2.childAges=10%2C12")); - Assertions.assertTrue(query.contains("room3.adults=1")); - Assertions.assertTrue(query.contains("room3.childAges=5")); - Assertions.assertTrue(query.contains("room4.adults=6")); - Assertions.assertTrue(query.contains("room5.adults=2")); - Assertions.assertTrue(query.contains("room5.childAges=3%2C4")); - Assertions.assertTrue(query.contains("room6.adults=3")); - Assertions.assertTrue(query.contains("room6.childAges=1%2C2%2C3%2C4%2C5")); - Assertions.assertTrue(query.contains("room7.adults=2")); - Assertions.assertTrue(query.contains("room7.childAges=1%2C2%2C3%2C4")); - Assertions.assertTrue(query.contains("room8.adults=1")); - Assertions.assertFalse(query.contains("room9")); - Assertions.assertTrue(query.contains("source=browser")); - Assertions.assertTrue(query.contains("travelWithPets=true")); - // content detail - Assertions.assertTrue(query.contains("contentDetails=high")); - Assertions.assertTrue(query.contains("allRoomTypes=true")); - Assertions.assertTrue(query.contains("links=WEB%2CAPI")); - // filtering - Assertions.assertTrue(query.contains("minStarRating=1.5")); - Assertions.assertTrue(query.contains("maxStarRating=5.0")); - Assertions.assertTrue(query.contains("limit=5")); - Assertions.assertTrue(query.contains("queryText=Seattle")); - Assertions.assertTrue(query.contains("availOnly=true")); - Assertions.assertTrue(query.contains("smokingPreference=both")); - Assertions.assertTrue(query.contains("rateType=all")); - Assertions.assertTrue(query.contains("imageSizes=s")); - Assertions.assertTrue(query.contains("thumbnailImageSize=t")); - Assertions.assertTrue(query.contains("includedPropertyTypeIds=1%2C2")); - Assertions.assertTrue(query.contains("excludedPropertyTypeIds=3%2C4")); - Assertions.assertTrue(query.contains("includedInventorySourceIds=5%2C6")); - Assertions.assertTrue(query.contains("freeCancellation=true")); - Assertions.assertTrue(query.contains("groupedAmenities=true")); - Assertions.assertTrue(query.contains("blockFullDepositRateplan=true")); - // package pricing - Assertions.assertTrue(query.contains("ratePlanType=package")); - // sorting - Assertions.assertTrue(query.contains("sortType=price")); - Assertions.assertTrue(query.contains("sortOrder=asc")); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - - } - - @Test - public void testResponse(@GivenTextResource("GetLodgingListingsResponse.json") String mockedResponse) { - GetLodgingListingsOperationParams operationParams = GetLodgingListingsOperationParams.builder() - .partnerTransactionId(Constant.PARTNER_TRANSACTION_ID) - .locationKeyword("Seattle") - .checkIn(LocalDate.now().plusDays(5)) - .checkOut(LocalDate.now().plusDays(10)) - .links(Arrays.asList(GetLodgingListingsOperationParams.Links.WEB, - GetLodgingListingsOperationParams.Links.API)) - .contentDetails(GetLodgingListingsOperationParams.ContentDetails.HIGH) - .availOnly(true) - .build(); - - mockWebServer.enqueue( - new MockResponse() - .setHeader("Content-Type", ACCEPT_HOTEL) - .setHeader("Partner-Transaction-Id", Constant.PARTNER_TRANSACTION_ID) - .setResponseCode(200) - .setBody(mockedResponse)); - - Response response = xapClient.execute( - new GetLodgingListingsOperation(operationParams) - ); - - verifyResponse(response); - } - - private void verifyResponse(Response response) { - Assertions.assertNotNull(response); - Assertions.assertEquals(200, response.getStatusCode()); - Map> headers = response.getHeaders(); - Assertions.assertNotNull(headers); - Assertions.assertEquals(Constant.PARTNER_TRANSACTION_ID, headers.get("partner-transaction-id") - .get(0)); - verifyHotelListingsResponse(response.getData()); - } - - private void verifyHotelListingsResponse( - HotelListingsResponse hotelListingsResponse) { - Assertions.assertNotNull(hotelListingsResponse); - Assertions.assertNull(hotelListingsResponse.getWarnings()); - Assertions.assertNotNull(hotelListingsResponse.getCount()); - Assertions.assertTrue(hotelListingsResponse.getCount() > 0); - Assertions.assertNotNull(hotelListingsResponse.getTotalHotelCount()); - Assertions.assertTrue(hotelListingsResponse.getTotalHotelCount() > 0); - Assertions.assertNotNull(hotelListingsResponse.getTransactionId()); - Assertions.assertNotNull(hotelListingsResponse.getStayDates()); - Assertions.assertNotNull(hotelListingsResponse.getLengthOfStay()); - Assertions.assertTrue(hotelListingsResponse.getLengthOfStay() > 0); - Assertions.assertNotNull(hotelListingsResponse.getNumberOfRooms()); - Assertions.assertTrue(hotelListingsResponse.getNumberOfRooms() > 0); - Assertions.assertNotNull(hotelListingsResponse.getOccupants()); - Assertions.assertFalse(hotelListingsResponse.getOccupants().isEmpty()); - Assertions.assertNotNull(hotelListingsResponse.getHotels()); - Assertions.assertFalse(hotelListingsResponse.getHotels().isEmpty()); - hotelListingsResponse.getHotels().forEach(this::verifyHotel); - } - - private void verifyHotel(Hotel hotel) { - Assertions.assertNotNull(hotel); - Assertions.assertNotNull(hotel.getId()); - Assertions.assertNotNull(hotel.getName()); - - HotelPropertyType propertyType = hotel.getPropertyType(); - if (propertyType != null) { - Assertions.assertNotNull(propertyType.getId()); - Assertions.assertNotNull(propertyType.getName()); - } - - HotelLocation location = hotel.getLocation(); - if (location != null) { - Assertions.assertNotNull(location.getAddress()); - - LocationGeoLocation geoLocation = location.getGeoLocation(); - if (geoLocation != null) { - Assertions.assertNotNull(geoLocation.getLatitude()); - Assertions.assertNotNull(geoLocation.getLongitude()); - Assertions.assertNotNull(geoLocation.getObfuscated()); - } - - Neighborhood neighborhood = location.getNeighborhood(); - if (neighborhood != null) { - Assertions.assertNotNull(neighborhood.getId()); - Assertions.assertNotNull(neighborhood.getName()); - } - } - - Distance distance = hotel.getDistance(); - if (distance != null) { - Assertions.assertNotNull(distance.getValue()); - Assertions.assertNotNull(distance.getUnit()); - Assertions.assertNotNull(distance.getDirection()); - } - - HotelLinks links = hotel.getLinks(); - Assertions.assertNotNull(links); - HotelLinksWebSearchResult webSearchResult = links.getWebSearchResult(); - Assertions.assertNotNull(webSearchResult); - Assertions.assertNotNull(webSearchResult.getMethod()); - Assertions.assertNotNull(webSearchResult.getHref()); - HotelLinksApiRateCalendar apiRateCalendar = links.getApiRateCalendar(); - Assertions.assertNotNull(apiRateCalendar); - Assertions.assertNotNull(apiRateCalendar.getAccept()); - Assertions.assertNotNull(apiRateCalendar.getMethod()); - Assertions.assertNotNull(apiRateCalendar.getHref()); - - List media = hotel.getMedia(); - if (media != null && !media.isEmpty()) { - media.forEach(item -> { - Assertions.assertNotNull(item.getType()); - Assertions.assertNotNull(item.getPropertySize()); - Assertions.assertNotNull(item.getUrl()); - }); - } - - List hotelAmenities = hotel.getHotelAmenities(); - if (hotelAmenities != null && !hotelAmenities.isEmpty()) { - hotelAmenities.forEach(item -> { - Assertions.assertNotNull(item.getId()); - Assertions.assertNotNull(item.getName()); - }); - } - - List roomAmenities = hotel.getRoomAmenities(); - if (roomAmenities != null && !roomAmenities.isEmpty()) { - roomAmenities.forEach(item -> { - Assertions.assertNotNull(item.getId()); - Assertions.assertNotNull(item.getName()); - }); - } - - List roomTypes = hotel.getRoomTypes(); - if (roomTypes != null && !roomTypes.isEmpty()) { - roomTypes.forEach(this::verifyRoomType); - } - } - - private void verifyRoomType(RoomType roomType) { - Assertions.assertNotNull(roomType); - Assertions.assertNotNull(roomType.getOfferId()); - Assertions.assertNotNull(roomType.getRatePlanType()); - - RoomTypePrice roomTypePrice = roomType.getPrice(); - if (roomTypePrice != null) { - Assertions.assertNotNull(roomTypePrice.getTotalPrice()); - Assertions.assertNotNull(roomTypePrice.getAvgNightlyRate()); - Assertions.assertNotNull(roomTypePrice.getTotalPriceWithHotelFees()); - } - - RoomTypeStandalonePrice standalonePrice = roomType.getStandalonePrice(); - if (standalonePrice != null) { - Assertions.assertNotNull(standalonePrice.getTotalPrice()); - Assertions.assertNotNull(standalonePrice.getAvgNightlyRate()); - } - - List bedTypeOptions = roomType.getBedTypeOptions(); - if (bedTypeOptions != null && !bedTypeOptions.isEmpty()) { - bedTypeOptions.forEach(item -> { - Assertions.assertNotNull(item.getId()); - Assertions.assertNotNull(item.getDescription()); - }); - } - - RoomOccupancyPolicy roomOccupancyPolicy = roomType.getRoomOccupancyPolicy(); - if (roomOccupancyPolicy != null) { - Assertions.assertNotNull(roomOccupancyPolicy.getMaxGuestCount()); - List ageClassRestrictions = - roomOccupancyPolicy.getAgeClassRestrictions(); - if (ageClassRestrictions != null && !ageClassRestrictions.isEmpty()) { - ageClassRestrictions.forEach(item -> { - Assertions.assertNotNull(item.getAgeClass()); - Assertions.assertNotNull(item.getAgeMinimum()); - }); - } - } - - List amenities = roomType.getAmenities(); - if (amenities != null && !amenities.isEmpty()) { - amenities.forEach(item -> { - Assertions.assertNotNull(item.getId()); - Assertions.assertNotNull(item.getName()); - }); - } - - List media = roomType.getMedia(); - if (media != null && !media.isEmpty()) { - media.forEach(item -> { - Assertions.assertNotNull(item.getType()); - Assertions.assertNotNull(item.getPropertySize()); - Assertions.assertNotNull(item.getUrl()); - }); - } - - RoomTypeLinks links = roomType.getLinks(); - Assertions.assertNotNull(links); - HotelLinksWebSearchResult webSearchResult = links.getWebSearchResult(); - Assertions.assertNotNull(webSearchResult); - Assertions.assertNotNull(webSearchResult.getMethod()); - Assertions.assertNotNull(webSearchResult.getHref()); - RoomTypeLinksWebDetails webDetails = links.getWebDetails(); - Assertions.assertNotNull(webDetails); - Assertions.assertNotNull(webDetails.getMethod()); - Assertions.assertNotNull(webDetails.getHref()); - RoomTypeLinksApiDetails apiDetails = links.getApiDetails(); - Assertions.assertNotNull(apiDetails); - Assertions.assertNotNull(apiDetails.getAccept()); - Assertions.assertNotNull(apiDetails.getMethod()); - Assertions.assertNotNull(apiDetails.getHref()); - - List ratePlans = roomType.getRatePlans(); - Assertions.assertNotNull(ratePlans); - Assertions.assertFalse(ratePlans.isEmpty()); - ratePlans.forEach(this::verifyRatePlan); - } - - private void verifyRatePlan(RatePlan ratePlan) { - Assertions.assertNotNull(ratePlan); - Assertions.assertNotNull(ratePlan.getRoomTypeId()); - Assertions.assertNotNull(ratePlan.getRatePlanId()); - Assertions.assertNotNull(ratePlan.getInventorySourceId()); - - StayDates stayDates = ratePlan.getStayDates(); - Assertions.assertNotNull(stayDates); - Assertions.assertNotNull(stayDates.getCheckInDate()); - Assertions.assertNotNull(stayDates.getCheckOutDate()); - - Assertions.assertNotNull(ratePlan.getRemainingCount()); - - RatePlanPrice ratePlanPrice = ratePlan.getPrice(); - if (ratePlanPrice != null) { - Assertions.assertNotNull(ratePlanPrice.getTotalPrice()); - Assertions.assertNotNull(ratePlanPrice.getAvgNightlyRate()); - - List nightlyRates = ratePlanPrice.getNightlyRates(); - if (nightlyRates != null && !nightlyRates.isEmpty()) { - nightlyRates.forEach(item -> { - Assertions.assertNotNull(item.getStayDate()); - Assertions.assertNotNull(item.getBaseRate()); - }); - } - - List taxesAndFeesDetails = - ratePlanPrice.getTaxesAndFeesDetails(); - if (taxesAndFeesDetails != null && !taxesAndFeesDetails.isEmpty()) { - taxesAndFeesDetails.forEach(item -> { - Assertions.assertNotNull(item.getCategoryCode()); - Assertions.assertNotNull(item.getAmount()); - }); - } - } - - RatePlanStandalonePrice standalonePrice = ratePlan.getStandalonePrice(); - if (standalonePrice != null) { - Assertions.assertNotNull(standalonePrice.getTotalPrice()); - Assertions.assertNotNull(standalonePrice.getAvgNightlyRate()); - } - - Assertions.assertNotNull(ratePlan.getPaymentMethod()); - - List paymentSchedule = ratePlan.getPaymentSchedule(); - if (paymentSchedule != null && !paymentSchedule.isEmpty()) { - paymentSchedule.forEach(item -> { - Assertions.assertNotNull(item.getDue()); - Assertions.assertNotNull(item.getPrice()); - }); - } - - CancellationPolicy cancellationPolicy = ratePlan.getCancellationPolicy(); - if (cancellationPolicy != null) { - List nonRefundableDateRanges = - cancellationPolicy.getNonRefundableDateRanges(); - if (nonRefundableDateRanges != null && !nonRefundableDateRanges.isEmpty()) { - nonRefundableDateRanges.forEach(item -> { - Assertions.assertNotNull(item.getStartDate()); - Assertions.assertNotNull(item.getEndDate()); - }); - } - } - - List amenities = ratePlan.getAmenities(); - if (amenities != null && !amenities.isEmpty()) { - amenities.forEach(item -> { - Assertions.assertNotNull(item.getId()); - Assertions.assertNotNull(item.getName()); - }); - } - } -} diff --git a/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIntegrationTests.java b/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIntegrationTests.java deleted file mode 100644 index adffd2d9e..000000000 --- a/tests/integration/src/test/java/com/expediagroup/sdk/xap/integrations/lodging/QuotesIntegrationTests.java +++ /dev/null @@ -1,205 +0,0 @@ -package com.expediagroup.sdk.xap.integrations.lodging; - -import static com.expediagroup.sdk.xap.integrations.common.Constant.ACCEPT_HOTEL; -import static com.expediagroup.sdk.xap.integrations.common.Constant.ACCEPT_LODGING; -import static com.expediagroup.sdk.xap.integrations.common.Constant.AUTHORIZATION; -import static com.expediagroup.sdk.xap.integrations.common.Constant.MOCK_KEY; -import static com.expediagroup.sdk.xap.integrations.common.Constant.PARTNER_TRANSACTION_ID; - -import com.expediagroup.sdk.core.model.Response; -import com.expediagroup.sdk.xap.integrations.common.Constant; -import com.expediagroup.sdk.xap.integrations.common.XapIntegrationTests; -import com.expediagroup.sdk.xap.models.LodgingCancellationPolicy; -import com.expediagroup.sdk.xap.models.LodgingQuotesResponse; -import com.expediagroup.sdk.xap.models.LodgingRatePlan; -import com.expediagroup.sdk.xap.models.LodgingRoomType; -import com.expediagroup.sdk.xap.models.LodgingRoomTypePrice; -import com.expediagroup.sdk.xap.models.Property; -import com.expediagroup.sdk.xap.models.Room; -import com.expediagroup.sdk.xap.operations.GetLodgingQuotesOperation; -import com.expediagroup.sdk.xap.operations.GetLodgingQuotesOperationParams; -import io.hosuaby.inject.resources.junit.jupiter.GivenTextResource; -import io.hosuaby.inject.resources.junit.jupiter.TestWithResources; -import java.time.LocalDate; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import java.util.stream.Collectors; -import okhttp3.Headers; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - - -/** - * This class is used to test the integration of the Lodging Quotes API. - */ -@TestWithResources -public class QuotesIntegrationTests extends XapIntegrationTests { - @Test - public void testRequest() { - ArrayList rooms = new ArrayList<>(); - rooms.add(Room.builder().adults(1L).build()); - rooms.add(Room.builder().adults(2L).childAges(Arrays.asList(10L, 12L)).build()); - rooms.add(Room.builder().adults(1L).childAges(Collections.singletonList(5L)).build()); - rooms.add(Room.builder().adults(6L).build()); - rooms.add(Room.builder().adults(2L).childAges(Arrays.asList(3L, 4L)).build()); - rooms.add(Room.builder().adults(3L).childAges(Arrays.asList(1L, 2L, 3L, 4L, 5L)).build()); - rooms.add(Room.builder().adults(2L).childAges(Arrays.asList(1L, 2L, 3L, 4L)).build()); - rooms.add(Room.builder().adults(1L).build()); - - GetLodgingQuotesOperationParams getLodgingQuotesOperationParams = - GetLodgingQuotesOperationParams.builder() - .partnerTransactionId(UUID.randomUUID().toString()) - .propertyIds(new HashSet<>(Arrays.asList("123", "456", "789"))) - .checkIn(LocalDate.now().plusDays(5)) - .checkOut(LocalDate.now().plusDays(10)) - .currency("USD") - .links(Collections.singletonList(GetLodgingQuotesOperationParams.Links.WEB)) - .rooms(rooms) - .travelWithPets(true) - .build(); - - mockWebServer.enqueue( - new MockResponse() - .setHeader("Content-Type", ACCEPT_LODGING) - .setResponseCode(200) - .setBody("{}")); - - xapClient.execute(new GetLodgingQuotesOperation(getLodgingQuotesOperationParams)); - try { - RecordedRequest recordedRequest = mockWebServer.takeRequest(); - // method - Assertions.assertEquals("GET", recordedRequest.getMethod()); - // headers - Headers headers = recordedRequest.getHeaders(); - Assertions.assertEquals(getLodgingQuotesOperationParams.getPartnerTransactionId(), - headers.get("Partner-Transaction-Id")); - Assertions.assertEquals(ACCEPT_LODGING, headers.get("Accept")); - Assertions.assertEquals(MOCK_KEY, headers.get("key")); - Assertions.assertEquals(AUTHORIZATION, headers.get("Authorization")); - // path and query - String path = recordedRequest.getPath(); - Assertions.assertNotNull(path); - Assertions.assertTrue(path.startsWith("/lodging/quotes")); - String query = path.substring(path.indexOf("?") + 1); - Assertions.assertTrue(query.contains("propertyIds=123%2C456%2C789")); - Assertions.assertTrue(query.contains( - "checkIn=" + getLodgingQuotesOperationParams.getCheckIn())); - Assertions.assertTrue(query.contains( - "checkOut=" + getLodgingQuotesOperationParams.getCheckOut())); - Assertions.assertTrue(query.contains("currency=USD")); - Assertions.assertTrue(query.contains("links=WEB")); - Assertions.assertTrue(query.contains("room1.adults=1")); - Assertions.assertTrue(query.contains("room2.adults=2")); - Assertions.assertTrue(query.contains("room2.childAges=10%2C12")); - Assertions.assertTrue(query.contains("room3.adults=1")); - Assertions.assertTrue(query.contains("room3.childAges=5")); - Assertions.assertTrue(query.contains("room4.adults=6")); - Assertions.assertTrue(query.contains("room5.adults=2")); - Assertions.assertTrue(query.contains("room5.childAges=3%2C4")); - Assertions.assertTrue(query.contains("room6.adults=3")); - Assertions.assertTrue(query.contains("room6.childAges=1%2C2%2C3%2C4%2C5")); - Assertions.assertTrue(query.contains("room7.adults=2")); - Assertions.assertTrue(query.contains("room7.childAges=1%2C2%2C3%2C4")); - Assertions.assertTrue(query.contains("room8.adults=1")); - Assertions.assertFalse(query.contains("room9")); - Assertions.assertTrue(query.contains("travelWithPets=true")); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } - - @Test - public void testResponse(@GivenTextResource("GetLodgingQuotesResponse.json") String mockedResponse) { - GetLodgingQuotesOperationParams getLodgingQuotesOperationParams = - GetLodgingQuotesOperationParams.builder() - .partnerTransactionId(PARTNER_TRANSACTION_ID) - .propertyIds(new HashSet<>(Arrays.asList("87704892", "83418323", "75028284", "75030107", - "91799474"))) - .checkIn(LocalDate.now().plusDays(10)) - .checkOut(LocalDate.now().plusDays(15)) - .links(Collections.singletonList(GetLodgingQuotesOperationParams.Links.WEB)) - .build(); - - mockWebServer.enqueue( - new MockResponse() - .setHeader("Content-Type", ACCEPT_HOTEL) - .setHeader("partner-transaction-id", Constant.PARTNER_TRANSACTION_ID) - .setResponseCode(200) - .setBody(mockedResponse)); - - Response response = - xapClient.execute(new GetLodgingQuotesOperation(getLodgingQuotesOperationParams)); - verifyResponse(response); - } - - private void verifyResponse(Response response) { - Assertions.assertNotNull(response); - Assertions.assertEquals(200, response.getStatusCode()); - Map> headers = response.getHeaders(); - Assertions.assertNotNull(headers); - Assertions.assertEquals(Constant.PARTNER_TRANSACTION_ID, headers.get("partner-transaction-id") - .get(0)); - verifyLodgingQuotesResponse(response.getData()); - } - - private void verifyLodgingQuotesResponse(LodgingQuotesResponse lodgingQuotesResponse) { - Assertions.assertNotNull(lodgingQuotesResponse); - Assertions.assertNull(lodgingQuotesResponse.getWarnings()); - Assertions.assertNotNull(lodgingQuotesResponse.getCount()); - Assertions.assertTrue(lodgingQuotesResponse.getCount() > 0); - Assertions.assertNotNull(lodgingQuotesResponse.getTotalPropertyCount()); - Assertions.assertTrue(lodgingQuotesResponse.getTotalPropertyCount() > 0); - Assertions.assertNotNull(lodgingQuotesResponse.getTransactionId()); - Assertions.assertNotNull(lodgingQuotesResponse.getStayDates()); - Assertions.assertNotNull(lodgingQuotesResponse.getLengthOfStay()); - Assertions.assertTrue(lodgingQuotesResponse.getLengthOfStay() > 0); - Assertions.assertNotNull(lodgingQuotesResponse.getOccupants()); - Assertions.assertFalse(lodgingQuotesResponse.getOccupants().isEmpty()); - Assertions.assertNotNull(lodgingQuotesResponse.getProperties()); - Assertions.assertFalse(lodgingQuotesResponse.getProperties().isEmpty()); - List availProperties = lodgingQuotesResponse.getProperties() - .stream() - .filter(property -> Property.Status.AVAILABLE.equals(property.getStatus())) - .collect(Collectors.toList()); - if (availProperties.isEmpty()) { - Assertions.fail("No available properties found"); - } - availProperties.forEach(this::verifyProperty); - } - - private void verifyProperty(Property property) { - Assertions.assertNotNull(property); - Assertions.assertNotNull(property.getId()); - Assertions.assertNotNull(property.getStatus()); - Assertions.assertNotNull(property.getRoomTypes()); - Assertions.assertFalse(property.getRoomTypes().isEmpty()); - property.getRoomTypes().forEach(this::verifyRoomType); - } - - private void verifyRoomType(LodgingRoomType roomType) { - Assertions.assertNotNull(roomType); - LodgingRoomTypePrice price = roomType.getPrice(); - Assertions.assertNotNull(price); - Assertions.assertNotNull(price.getTotalPrice()); - Assertions.assertNotNull(price.getAvgNightlyRate()); - Assertions.assertNotNull(price.getTotalPriceWithPropertyFees()); - List ratePlans = roomType.getRatePlans(); - Assertions.assertNotNull(ratePlans); - Assertions.assertFalse(ratePlans.isEmpty()); - ratePlans.forEach(this::verifyRatePlan); - } - - private void verifyRatePlan(LodgingRatePlan ratePlan) { - LodgingCancellationPolicy cancellationPolicy = ratePlan.getCancellationPolicy(); - Assertions.assertNotNull(cancellationPolicy); - Assertions.assertNotNull(cancellationPolicy.getFreeCancellation()); - Assertions.assertNotNull(cancellationPolicy.getRefundable()); - } -} diff --git a/tests/integration/src/test/resources/GetLodgingAvailabilityCalendarsResponse.json b/tests/integration/src/test/resources/GetLodgingAvailabilityCalendarsResponse.json deleted file mode 100644 index b7b30d17f..000000000 --- a/tests/integration/src/test/resources/GetLodgingAvailabilityCalendarsResponse.json +++ /dev/null @@ -1 +0,0 @@ -{"TransactionId":"a3174b77-2aee-4e8a-83c4-2f70a4f0ba59","AvailabilityCalendars":[{"PropertyId":"75030107","DateRange":{"StartDate":"2025-02-05","EndDate":"2026-02-28"},"Availability":"NNNNNNNNNNNNNNNNNNNNNNNNYYYYYYYYYYYYYYYYYYYYYNNNNNNYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYNNNNNNNYYYYNNNNNNNNNNNNYYYYYYYYYYYYYYYYYNNNNNNNYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYNNNNNNNYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY","ChangeOver":"XXXXXXXXXXXXXXXXXXXXXXXXICCCCCCCCCCCCCCCCCCCCOXXXXXICCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOXXXXXXICCCOXXXXXXXXXXXICCCCCCCCCCCCCCCCOXXXXXXICCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOXXXXXXICCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC","MinStay":"3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3","MaxStay":"365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365,365","MinPriorNotify":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"PropertyId":"87704892","DateRange":{"StartDate":"2025-02-06","EndDate":"2028-02-05"},"Availability":"YYYYYYYNNNNNNNNNNNNNNNNNNNYYYYYYYYYYYYYYYYYNNYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN","ChangeOver":"CCCCCCOOXXXXXXXXXXXXXXXXXXICCCCCCCCCCCCCCCOOXICCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXC","MinStay":"2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,30,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,30,5,30,30,30,5,5,5,30,30,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2","MaxStay":"695,694,693,692,691,690,689,688,687,686,685,684,683,682,681,680,679,678,677,676,675,674,673,672,671,670,669,668,667,666,665,664,663,662,661,660,659,658,657,656,655,654,653,652,651,650,649,648,647,646,645,644,643,642,641,640,639,638,637,636,635,634,633,632,631,630,629,628,627,626,625,624,623,622,621,620,619,618,617,616,615,614,613,612,611,610,609,608,607,606,605,604,603,602,601,600,599,598,597,596,595,594,593,592,591,590,589,588,587,586,585,584,583,582,581,580,579,578,577,576,575,574,573,572,571,570,569,568,567,566,565,564,563,562,561,560,559,558,557,556,555,554,553,552,551,550,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,532,531,530,529,528,527,526,525,524,523,522,521,520,519,518,517,516,515,514,513,512,511,510,509,508,507,506,505,504,503,502,501,500,499,498,497,496,495,494,493,492,491,490,489,488,487,486,485,484,483,482,481,480,479,478,477,476,475,474,473,472,471,470,469,468,467,466,465,464,463,462,461,460,459,458,457,456,455,454,453,452,451,450,449,448,447,446,445,444,443,442,441,440,439,438,437,436,435,434,433,432,431,430,429,428,427,426,425,424,423,422,421,420,419,418,417,416,415,414,413,412,411,410,409,408,407,406,405,404,403,402,401,400,399,398,397,396,395,394,393,392,391,390,389,388,387,386,385,384,383,382,381,380,379,378,377,376,375,374,373,372,371,370,369,368,367,731,730,729,728,727,726,725,724,723,722,721,720,719,718,717,716,715,714,713,712,711,710,709,708,707,706,705,704,703,702,701,700,699,698,697,696,695,694,693,692,691,690,689,688,687,686,685,684,683,682,681,680,679,678,677,676,675,674,673,672,671,670,669,668,667,666,665,664,663,662,661,660,659,658,657,656,655,654,653,652,651,650,649,648,647,646,645,644,643,642,641,640,639,638,637,636,635,634,633,632,631,630,629,628,627,626,625,624,623,622,621,620,619,618,617,616,615,614,613,612,611,610,609,608,607,606,605,604,603,602,601,600,599,598,597,596,595,594,593,592,591,590,589,588,587,586,585,584,583,582,581,580,579,578,577,576,575,574,573,572,571,570,569,568,567,566,565,564,563,562,561,560,559,558,557,556,555,554,553,552,551,550,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,532,531,530,529,528,527,526,525,524,523,522,521,520,519,518,517,516,515,514,513,512,511,510,509,508,507,506,505,504,503,502,501,500,499,498,497,496,495,494,493,492,491,490,489,488,487,486,485,484,483,482,481,480,479,478,477,476,475,474,473,472,471,470,469,468,467,466,465,464,463,462,461,460,459,458,457,456,455,454,453,452,451,450,449,448,447,446,445,444,443,442,441,440,439,438,437,436,435,434,433,432,431,430,429,428,427,426,425,424,423,422,421,420,419,418,417,416,415,414,413,412,411,410,409,408,407,406,405,404,403,402,401,400,399,398,397,396,395,394,393,392,391,390,389,388,387,386,385,384,383,382,381,380,379,378,377,376,375,374,373,372,371,370,369,368,367,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0","MinPriorNotify":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"PropertyId":"83418323","DateRange":{"StartDate":"2025-02-06","EndDate":"2027-02-06"},"Availability":"YYYYYYYNNYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN","ChangeOver":"CCCCCCCOXICCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCIIIIICCIIIIICCIIIIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","MinStay":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1","MaxStay":"27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27","MinPriorNotify":"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"},{"PropertyId":"91799474","DateRange":{"StartDate":"2025-02-06","EndDate":"2028-02-05"},"Availability":"NNNNNNNNNNNNNNNNNNNNNNYYYNNNNYYYNNNNYYYNNNNYYYNNNNYYYNNNNYYYNNNNYYYNNNNYYYNNNNYYYNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNYYYYYYYYYYYYYYNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN","ChangeOver":"OXXXXXXXXXXXXXXXXXXXXXICCOXXXICCOXXXICCOXXXICCOXXXICCOXXXICCOXXXICCOXXXICCOXXXICCOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXICCCCCCCCCCCCCOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXC","MinStay":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1","MaxStay":"695,694,693,692,691,690,689,688,687,686,685,684,683,682,681,680,679,678,677,676,675,674,673,672,671,670,669,668,667,666,665,664,663,662,661,660,659,658,657,656,655,654,653,652,651,650,649,648,647,646,645,644,643,642,641,640,639,638,637,636,635,634,633,632,631,630,629,628,627,626,625,624,623,622,621,620,619,618,617,616,615,614,613,612,611,610,609,608,607,606,605,604,603,602,601,600,599,598,597,596,595,594,593,592,591,590,589,588,587,586,585,584,583,582,581,580,579,578,577,576,575,574,573,572,571,570,569,568,567,566,565,564,563,562,561,560,559,558,557,556,555,554,553,552,551,550,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,532,531,530,529,528,527,526,525,524,523,522,521,520,519,518,517,516,515,514,513,512,511,510,509,508,507,506,505,504,503,502,501,500,499,498,497,496,495,494,493,492,491,490,489,488,487,486,485,484,483,482,481,480,479,478,477,476,475,474,473,472,471,470,469,468,467,466,465,464,463,462,461,460,459,458,457,456,455,454,453,452,451,450,449,448,447,446,445,444,443,442,441,440,439,438,437,436,435,434,433,432,431,430,429,428,427,426,425,424,423,422,421,420,419,418,417,416,415,414,413,412,411,410,409,408,407,406,405,404,403,402,401,400,399,398,397,396,395,394,393,392,391,390,389,388,387,386,385,384,383,382,381,380,379,378,377,376,375,374,373,372,371,370,369,368,367,731,730,729,728,727,726,725,724,723,722,721,720,719,718,717,716,715,714,713,712,711,710,709,708,707,706,705,704,703,702,701,700,699,698,697,696,695,694,693,692,691,690,689,688,687,686,685,684,683,682,681,680,679,678,677,676,675,674,673,672,671,670,669,668,667,666,665,664,663,662,661,660,659,658,657,656,655,654,653,652,651,650,649,648,647,646,645,644,643,642,641,640,639,638,637,636,635,634,633,632,631,630,629,628,627,626,625,624,623,622,621,620,619,618,617,616,615,614,613,612,611,610,609,608,607,606,605,604,603,602,601,600,599,598,597,596,595,594,593,592,591,590,589,588,587,586,585,584,583,582,581,580,579,578,577,576,575,574,573,572,571,570,569,568,567,566,565,564,563,562,561,560,559,558,557,556,555,554,553,552,551,550,549,548,547,546,545,544,543,542,541,540,539,538,537,536,535,534,533,532,531,530,529,528,527,526,525,524,523,522,521,520,519,518,517,516,515,514,513,512,511,510,509,508,507,506,505,504,503,502,501,500,499,498,497,496,495,494,493,492,491,490,489,488,487,486,485,484,483,482,481,480,479,478,477,476,475,474,473,472,471,470,469,468,467,466,465,464,463,462,461,460,459,458,457,456,455,454,453,452,451,450,449,448,447,446,445,444,443,442,441,440,439,438,437,436,435,434,433,432,431,430,429,428,427,426,425,424,423,422,421,420,419,418,417,416,415,414,413,412,411,410,409,408,407,406,405,404,403,402,401,400,399,398,397,396,395,394,393,392,391,390,389,388,387,386,385,384,383,382,381,380,379,378,377,376,375,374,373,372,371,370,369,368,367,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0","MinPriorNotify":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"}]} \ No newline at end of file diff --git a/tests/integration/src/test/resources/GetLodgingListingsResponse.json b/tests/integration/src/test/resources/GetLodgingListingsResponse.json deleted file mode 100644 index 6aa0c8c25..000000000 --- a/tests/integration/src/test/resources/GetLodgingListingsResponse.json +++ /dev/null @@ -1 +0,0 @@ -{"Count":4,"TotalHotelCount":5,"TransactionId":"59033fce-a679-44b7-a356-aac9db7e5168","StayDates":{"CheckInDate":"2025-02-11","CheckOutDate":"2025-02-16"},"LengthOfStay":5,"NumberOfRooms":1,"Occupants":[{"Adults":2}],"Hotels":[{"Id":"73460112","Name":"citizenM Seattle Pioneer Square","PropertyType":{"Id":1,"Name":"Hotel"},"LocalCurrencyCode":"USD","Location":{"Address":{"Address1":"60 Yesler Way","City":"Seattle","Province":"WA","Country":"USA","PostalCode":"98104"},"GeoLocation":{"Latitude":"47.602143","Longitude":"-122.33494","Obfuscated":false},"Neighborhood":{"Id":"800130","Name":"Downtown Seattle"}},"Distance":{"Value":"1.03","Unit":"km","Direction":"S"},"Description":{"LocationTeaser":"Located in Downtown Seattle, this hotel is steps from Pioneer Square and Seattle Waterfront. Lumen Field and Pike Place Market are also within 15 minutes. Pioneer Square Station is only a 5-minute walk and Occidental Mall Stop is 6 minutes. ","HotelTeaser":"This smoke-free hotel features a restaurant, a coffee shop/cafe, and coffee/tea in a common area. WiFi in public areas is free. Other amenities include a microwave in a common area, a 24-hour front desk, and express check-in. ","RoomTeaser":"Housekeeping is available on request. "},"Status":"AVAILABLE","ThumbnailUrl":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/85167557_t.jpg","StarRating":"4.0","GuestRating":"4.6","GuestReviewCount":2818,"PetFriendly":false,"LgbtqiaFriendly":true,"Links":{"WebSearchResult":{"Method":"GET","Href":"https://www.expedia.com/Hotel-Search?mpd=USD&tpid=1&mpe=1738841635&endDate=2025-02-16&adults=2&mpn=315880777&mpm=24&locale=en_US&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0¤cy=USD&rateplanid=393316100&selected=73460112&startDate=2025-02-11&mpb=147.57&mpa=819.85"},"ApiRateCalendar":{"Accept":"application/vnd.exp-hotel.v3+json","Method":"GET","Href":"https://apim.expedia.com/hotels/rateCalendar?ecomHotelId=73460112¤cy=USD&startDate=2025-02-06&endDate=2025-08-05&lengthOfStay=5"}},"Policies":{"CheckInStartTime":"2:00 PM","CheckInEndTime":"midnight","SpecialCheckInInstructions":["Front desk staff will greet guests on arrival at the property. Guests are recommended to download the property's CitizenM mobile app before check-in. "],"CheckOutTime":"11:00 AM","PetPolicies":["Pets not allowed (service animals welcome)"],"ChildrenAndExtraBedsPolicies":["Children are welcome.","Kids stay free! Children 10 years old and younger stay free when using existing bedding. ","Rollaway/extra beds are not available.","Cribs (infant beds) are not available."]},"OptionalExtras":["
  • Fee for buffet breakfast: approximately USD 19 per person
  • Late check-out fee: USD 39 (subject to availability)
","

The above list may not be comprehensive. Fees and deposits may not include tax and are subject to change.

"],"Media":[{"Type":"1","Title":"Primary image","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/85167557_t.jpg"},{"Type":"1","Title":"Lobby sitting area","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/372b6aeb_t.jpg"},{"Type":"1","Title":"Lobby sitting area","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/b36a1c9e_t.jpg"},{"Type":"1","Title":"Check-in/check-out kiosk","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/940ffd14_t.jpg"},{"Type":"1","Title":"Lobby lounge","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/8e851afe_t.jpg"},{"Type":"1","Title":"Lobby lounge","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/abd5d321_t.jpg"},{"Type":"1","Title":"Lobby lounge","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/ce78a52b_t.jpg"},{"Type":"1","Title":"Lobby lounge","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/w8654h6087x0y0-870e1566_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/ba6f2635_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/4d085105_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/7188515e_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/77ef4525_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/b714633c_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/ab42268e_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/1c6ea7af_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/d4794102_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/5603e085_t.jpg"},{"Type":"1","Title":"Restaurant","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/f4912fe3_t.jpg"},{"Type":"1","Title":"Restaurant","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/1793b778_t.jpg"},{"Type":"1","Title":"Restaurant","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/7a4e39f8_t.jpg"},{"Type":"1","Title":"Restaurant","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/af9d571b_t.jpg"},{"Type":"1","Title":"Breakfast buffet","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/w4925h5904x353y366-736f19a8_t.jpg"},{"Type":"1","Title":"Breakfast buffet","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/w7515h6601x0y0-8e5ceb97_t.jpg"},{"Type":"1","Title":"Bar (on property)","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/c92741c0_t.jpg"},{"Type":"1","Title":"Interior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/a53634bd_t.jpg"},{"Type":"1","Title":"Interior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/7589256a_t.jpg"},{"Type":"1","Title":"Interior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/fc4afd21_t.jpg"},{"Type":"1","Title":"Interior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/d29d315a_t.jpg"},{"Type":"1","Title":"Interior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/0c8beed1_t.jpg"},{"Type":"1","Title":"Interior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/4ba2c557_t.jpg"},{"Type":"1","Title":"Interior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/35aeebef_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/bf693950_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/95df0a15_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/17e89b5b_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/6479d720_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/d14c7395_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/b1d32fc2_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/d848a5d2_t.jpg"},{"Type":"1","Title":"Property entrance","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/af5a503a_t.jpg"},{"Type":"1","Title":"Property entrance","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/2e67a572_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/0b65a16e_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/293fde6f_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/5e7b0d38_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/c7e2fd57_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/0f3d2b5a_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/46cde8a4_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/2b69ecba_t.jpg"},{"Type":"1","Title":"Building design","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/158e4f72_t.jpg"},{"Type":"1","Title":"Point of interest","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/293a9d66_t.jpg"},{"Type":"1","Title":"Point of interest","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/4deda8a3_t.jpg"},{"Type":"1","Title":"Point of interest","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/9a5f9142_t.jpg"},{"Type":"1","Title":"Point of interest","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/874dd7df_t.jpg"},{"Type":"1","Title":"Point of interest","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/3678f72f_t.jpg"}],"HotelAmenities":[{"Id":"2177","Name":"Express check-in"},{"Id":"2050","Name":"Pets not allowed"},{"Id":"5058","Name":"Service animals are allowed"},{"Id":"1073744898","Name":"Coworking spaces"},{"Id":"5059","Name":"Service animals are exempt from fees/restrictions"},{"Id":"324","Name":"Coffee/tea in common areas"},{"Id":"8","Name":"Elevator"},{"Id":"1073745288","Name":"Locally-owned & organized tours & activities"},{"Id":"1073745352","Name":"Elevator door width (inches) - 35"},{"Id":"1073745289","Name":"Showcase for local artists"},{"Id":"1073745353","Name":"Elevator door width (centimeters) - 90"},{"Id":"2063","Name":"24-hour front desk"},{"Id":"1073745295","Name":"At least 80% of all lighting comes from LEDs"},{"Id":"2067","Name":"Express check-out"},{"Id":"2515","Name":"Year Built - 2022"},{"Id":"1073745301","Name":"Bulk dispenser for toiletries"},{"Id":"2390","Name":"Free WiFi"},{"Id":"1073745302","Name":"No single-use plastic soda bottles"},{"Id":"1073745303","Name":"No single-use plastic stirrers"},{"Id":"2137","Name":"Smoke-free property"},{"Id":"3929","Name":"Number of coffee shops/cafes - 1"},{"Id":"1073745305","Name":"No single-use plastic straws"},{"Id":"1073745307","Name":"No single-use plastic water bottles"},{"Id":"1073745308","Name":"Reusable cups only"},{"Id":"1073745310","Name":"Water-efficient showers only"},{"Id":"1073745311","Name":"Water-efficient toilets only"},{"Id":"2016","Name":"Safe-deposit box at front desk"},{"Id":"4003","Name":"Luggage storage"},{"Id":"1073744422","Name":"Coin laundry on site"},{"Id":"361","Name":"Breakfast available (surcharge)"},{"Id":"2537","Name":"Number of restaurants - 1"},{"Id":"1073743404","Name":"Shared microwave"},{"Id":"52","Name":"Total number of rooms - 216"},{"Id":"372","Name":"Television in common areas"},{"Id":"1073745332","Name":"No accessible shuttle"},{"Id":"54","Name":"Number of floors - 8"},{"Id":"55","Name":"Number of buildings/towers - 1"},{"Id":"2043","Name":"Multilingual staff"},{"Id":"1073744255","Name":"Eco-friendly cleaning products used"}],"RoomAmenities":[{"Id":"130","Name":"Refrigerator"},{"Id":"136","Name":"Phone"},{"Id":"1073744201","Name":"Soap"},{"Id":"1073743370","Name":"Towels provided"},{"Id":"1073744202","Name":"Shampoo"},{"Id":"2571","Name":"Pillowtop mattress"},{"Id":"1073743371","Name":"Bedsheets provided"},{"Id":"1073744203","Name":"Toilet paper"},{"Id":"1073744651","Name":"Hand-held showerhead"},{"Id":"141","Name":"Private bathroom"},{"Id":"1073744653","Name":"Closed captioned TV"},{"Id":"1073745294","Name":"Energy-saving switches"},{"Id":"144","Name":"Hair dryer"},{"Id":"145","Name":"Iron/ironing board"},{"Id":"146","Name":"In-room safe"},{"Id":"1073744658","Name":"Portable shower seat"},{"Id":"4947","Name":"Hydromassage showerhead"},{"Id":"1073743379","Name":"Number of bathrooms - 1"},{"Id":"1073744661","Name":"Lowered electrical outlets in bathroom"},{"Id":"1073744663","Name":"Lowered peephole/view port in door"},{"Id":"1073744665","Name":"Lowered locks/deadbolt"},{"Id":"2396","Name":"Satellite TV service"},{"Id":"2399","Name":"Flat-panel TV"},{"Id":"1073744673","Name":"Height-adjustable showerhead"},{"Id":"2026","Name":"Desk"},{"Id":"1073744684","Name":"Transfer shower"},{"Id":"1073744237","Name":"Laptop-friendly workspace"},{"Id":"2030","Name":"In-room climate control (air conditioning)"},{"Id":"3502","Name":"Rainfall showerhead"},{"Id":"1073744240","Name":"Eco-friendly cleaning products provided"},{"Id":"5105","Name":"iPad"},{"Id":"1073744241","Name":"Eco-friendly toiletries"},{"Id":"1073744689","Name":"Lever door handles"},{"Id":"2034","Name":"Premium bedding"},{"Id":"1073743285","Name":"In-room climate control (heating)"},{"Id":"2166","Name":"Shower only"},{"Id":"1073743926","Name":"Housekeeping on request"},{"Id":"2807","Name":"iPod docking station"},{"Id":"121","Name":"Wheelchair accessible"},{"Id":"1073744826","Name":"Number of days between towel changes: 3"},{"Id":"1073744829","Name":"Number of days between bed sheet changes: 3"},{"Id":"2559","Name":"Down comforter"}],"Accessibility":["Wheelchair-accessible on-site restaurant","Wheelchair-accessible lounge","Wheelchair accessible path of travel","Wheelchair-accessible public washroom","Well-lit path to entrance","Stair-free path to entrance","Wheelchair accessible (may have limitations)"],"RoomTypes":[{"Description":"Room, 1 King Bed","RoomKey":"Cgg3MzQ2MDExMhI0CgkzMTU4ODA3NzcSCTM5MzMxNjEwMBoCMjQgASoKMjAyNS0wMi0xMTIKMjAyNS0wMi0xNioDCgEyUgoIr9cBEK_XARgCWgJVUw","OfferId":"Cgg3MzQ2MDExMhI0CgkzMTU4ODA3NzcSCTM5MzMxNjEwMBoCMjQgASoKMjAyNS0wMi0xMTIKMjAyNS0wMi0xNioDCgEyUgoIr9cBEK_XARgCWgJVUw","RatePlanType":"standalone","RatePlans":[{"RoomTypeId":"315880777","RatePlanId":"393316100","RateRuleId":"802813980","InventorySourceId":"24","InventorySourceCode":"Expedia","StayDates":{"CheckInDate":"2025-02-11","CheckOutDate":"2025-02-16"},"RemainingCount":40,"Price":{"BaseRate":{"Value":"819.85","Currency":"USD"},"TaxesAndFees":{"Value":"147.57","Currency":"USD"},"TotalPrice":{"Value":"967.42","Currency":"USD"},"TotalStrikeOutPrice":{"Value":"1058.52","Currency":"USD"},"AvgNightlyRate":{"Value":"163.97","Currency":"USD"},"AvgNightlyStrikeOutRate":{"Value":"182.19","Currency":"USD"},"NightlyRates":[{"StayDate":"2025-02-11","BaseRate":{"Value":"143.99","Currency":"USD"}},{"StayDate":"2025-02-12","BaseRate":{"Value":"143.99","Currency":"USD"}},{"StayDate":"2025-02-13","BaseRate":{"Value":"129.59","Currency":"USD"}},{"StayDate":"2025-02-14","BaseRate":{"Value":"201.59","Currency":"USD"}},{"StayDate":"2025-02-15","BaseRate":{"Value":"200.69","Currency":"USD"}}]},"Promotions":[{"Description":"Save 10%","Amount":{"Value":"91.10","Currency":"USD"}}],"PaymentMethod":"Hotel","PaymentTime":"PayLater","FreeInternet":false,"FreeWiFi":false,"FreeParking":false,"FreeBreakfast":false,"CancellationPolicy":{"Refundable":true,"FreeCancellation":true,"FreeCancellationEndDateTime":"2025-02-09T23:59:00-08:00","CancellationPenaltyRules":[{"PenaltyPercentOfStay":"100","PenaltyStartDateTime":"2025-02-09T23:59:00-08:00","PenaltyEndDateTime":"2025-02-11T23:59:00-08:00"}],"CancelPolicyDescription":"There is no charge for cancellations made before 23:59 (property local time) on February 9, 2025.Cancellations or changes made after 23:59 (property local time) on February 9, 2025 or no-shows are subject to a property fee equal to 100% of the total amount paid for the reservation."}}],"Price":{"BaseRate":{"Value":"819.85","Currency":"USD"},"TaxesAndFees":{"Value":"147.57","Currency":"USD"},"TotalPrice":{"Value":"967.42","Currency":"USD"},"TotalStrikeOutPrice":{"Value":"1058.52","Currency":"USD"},"AvgNightlyRate":{"Value":"163.97","Currency":"USD"},"AvgNightlyStrikeOutRate":{"Value":"182.19","Currency":"USD"},"AvgNightlyRateWithFees":{"Value":"163.97","Currency":"USD"},"AvgNightlyStrikeOutRateWithFees":{"Value":"182.19","Currency":"USD"},"TotalPriceWithHotelFees":{"Value":"967.42","Currency":"USD"}},"Promotions":[{"Description":"Save 10%","Amount":{"Value":"91.10","Currency":"USD"}}],"Links":{"WebSearchResult":{"Method":"GET","Href":"https://www.expedia.com/Hotel-Search?mpd=USD&tpid=1&mpe=1738841635&endDate=2025-02-16&adults=2&mpn=315880777&mpm=24&mpp=1&locale=en_US&mpo=HC&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0¤cy=USD&rateplanid=393316100&selected=73460112&startDate=2025-02-11&mpb=147.57&mpa=819.85"},"WebDetails":{"Method":"GET","Href":"https://www.expedia.com/Hotel.h73460112.Hotel-Information?mpd=USD&tpid=1&mpe=1738841635&chkin=2025-02-11&mpm=24&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0&chkout=2025-02-16®ionId=800130¤cy=USD&rateplanid=393316100&rm1=a2&langid=1033&mpb=147.57&mpa=819.85"},"ApiDetails":{"Accept":"application/vnd.exp-hotel.v3+json","Method":"GET","Href":"https://apim.expedia.com/hotels/details/Cgg3MzQ2MDExMhI0CgkzMTU4ODA3NzcSCTM5MzMxNjEwMBoCMjQgASoKMjAyNS0wMi0xMTIKMjAyNS0wMi0xNioDCgEyUgoIr9cBEK_XARgCWgJVUw?price=967.42¤cy=USD&locale=en_US"}},"SmokingOption":"NonSmoking","BedTypeOptions":[{"Id":"37321","Description":"1 King Bed"}],"RoomOccupancyPolicy":{"MaxGuestCount":2,"MinCheckInAge":18,"AgeClassRestrictions":[{"AgeClass":"Adult","AgeMinimum":11,"MaxGuestCount":2},{"AgeClass":"Child","AgeMinimum":0,"AgeMaximum":10,"MaxGuestCount":1}]},"Amenities":[{"Id":"4097","Name":"Number of living rooms 0"},{"Id":"1073744801","Name":"Location - ground floor"},{"Id":"4953","Name":"Number of bedrooms - 0"},{"Id":"4092","Name":"Square meters - 14"},{"Id":"4093","Name":"Square feet - 151"},{"Id":"1073744318","Name":"Ping - 4"}],"Media":[{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/1c6ea7af_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/ab42268e_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/b714633c_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/4d085105_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/77ef4525_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/ba6f2635_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/d4794102_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/5603e085_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/b1d32fc2_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/17e89b5b_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/6479d720_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/74000000/73470000/73460200/73460112/d14c7395_t.jpg"}]}]},{"Id":"546475","Name":"Grand Hyatt Seattle","PropertyType":{"Id":1,"Name":"Hotel"},"LocalCurrencyCode":"USD","Location":{"Address":{"Address1":"721 Pine St","City":"Seattle","Province":"WA","Country":"USA","PostalCode":"98101"},"GeoLocation":{"Latitude":"47.61271","Longitude":"-122.33407","Obfuscated":false},"Neighborhood":{"Id":"800130","Name":"Downtown Seattle"}},"Distance":{"Value":"0.31","Unit":"km","Direction":"NE"},"Description":{"LocationTeaser":"Located in Downtown Seattle, this luxury hotel is within a 10-minute walk of Seattle Convention Center Arch Building and Pike Place Market. Space Needle and Seattle Center are also within 1 mi (2 km). Westlake Station and Westlake Ave Hub Station are within a 5-minute walk. ","HotelTeaser":"Along with 4 restaurants, this hotel has a full-service spa and a 24-hour fitness center. WiFi in public areas is free. Additionally, a bar/lounge, a sauna, and a conference center are onsite. ","RoomTeaser":"Housekeeping is available on request. "},"Status":"AVAILABLE","ThumbnailUrl":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/a82db52a_t.jpg","StarRating":"4.5","GuestRating":"4.8","GuestReviewCount":1611,"PetFriendly":true,"LgbtqiaFriendly":true,"Links":{"WebSearchResult":{"Method":"GET","Href":"https://www.expedia.com/Hotel-Search?tpid=1&mpe=1738841635&endDate=2025-02-16&adults=2&locale=en_US&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0&startDate=2025-02-11&mpd=USD&mpn=200672561¤cy=USD&rateplanid=397385363&mpm=24&selected=546475&mpb=280.05&mpa=1556.00"},"ApiRateCalendar":{"Accept":"application/vnd.exp-hotel.v3+json","Method":"GET","Href":"https://apim.expedia.com/hotels/rateCalendar?ecomHotelId=546475¤cy=USD&startDate=2025-02-06&endDate=2025-08-05&lengthOfStay=5"}},"Policies":{"CheckInStartTime":"4 PM","CheckInEndTime":"midnight","SpecialCheckInInstructions":["Front desk staff will greet guests on arrival at the property. "],"CheckOutTime":"noon","PetPolicies":["Pets allowed for an extra charge of USD 100.00 per accommodation, per stay","Dogs only","2 total (up to 75 lbs per pet)","Service animals are welcome, and are exempt from fees"],"ChildrenAndExtraBedsPolicies":["Children are welcome.","Kids stay free! Children 17 years old and younger stay free when using existing bedding. ","Rollaway/extra beds are available for USD 25 per night.","Free cribs (infant beds)!"]},"OptionalExtras":["
  • Fee for full breakfast: approximately USD 15 to 50 per person
  • Valet parking fee: USD 68.00 per night (in/out privileges)
  • Pet fee: USD 100.00 per accommodation, per stay
  • Service animals are exempt from fees
  • In-room microwave fee: USD 25 per stay
  • Rollaway bed fee: USD 25 per night
","

The above list may not be comprehensive. Fees and deposits may not include tax and are subject to change.

"],"Media":[{"Type":"1","Title":"Primary image","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/a82db52a_t.jpg"},{"Type":"1","Title":"Lobby","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/acc9a638_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/12b01fc0_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/41816cc5_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/d9cebb04_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/7d2fe4e7_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/3dd2eb56_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/8a291b1b_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/18e37ed0_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3837h2557x0y0-d7e0ca72_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3837h2558x0y0-4473e95d_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3840h2557x0y0-5462615b_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/01431637_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3748h3829x0y6-17b12404_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/0f8fd5ae_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/79ca6770_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/c02c7e5a_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/4ba03d74_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/ab70f6bd_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/17aca102_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/074648b5_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3836h2557x0y0-6ec80451_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3836h2558x0y0-369178f6_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3840h2556x0y0-8b6bc5ad_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3840h2557x0y0-d6d863df_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3834h2557x0y0-67c7d558_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/5e56a1bd_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3837h2557x0y0-f5ee441f_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/489a4814_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/34170d3e_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/0e328ff8_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/139a7d5a_t.jpg"},{"Type":"1","Title":"Fitness facility","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/a85b7c44_t.jpg"},{"Type":"1","Title":"Fitness facility","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/d57d6617_t.jpg"},{"Type":"1","Title":"Spa treatment","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/3bab9bb2_t.jpg"},{"Type":"1","Title":"Sports facility","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/98f89d13_t.jpg"},{"Type":"1","Title":"Restaurant","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/c1abf301_t.jpg"},{"Type":"1","Title":"Delicatessen","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/ace1ff9b_t.jpg"},{"Type":"1","Title":"Coffee shop","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/f734254c_t.jpg"},{"Type":"1","Title":"Coffee shop","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/31f4f74c_t.jpg"},{"Type":"1","Title":"Breakfast meal","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/04a7af5b_t.jpg"},{"Type":"1","Title":"Bar (on property)","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/3ddf606d_t.jpg"},{"Type":"1","Title":"Bar (on property)","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/d51e90a7_t.jpg"},{"Type":"1","Title":"Bar (on property)","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/d565fe3e_t.jpg"},{"Type":"1","Title":"Business center","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/3050cc39_t.jpg"}],"HotelAmenities":[{"Id":"2177","Name":"Express check-in"},{"Id":"2822","Name":"Number of hot tubs - 1"},{"Id":"8","Name":"Elevator"},{"Id":"2063","Name":"24-hour front desk"},{"Id":"2065","Name":"Business center"},{"Id":"2066","Name":"Porter/bellhop"},{"Id":"2067","Name":"Express check-out"},{"Id":"2070","Name":"Dry cleaning/laundry service"},{"Id":"3864","Name":"Valet parking (surcharge)"},{"Id":"3865","Name":"Computer station"},{"Id":"2592","Name":"Conference space size (meters) - 2323"},{"Id":"2593","Name":"Number of meeting rooms - 1"},{"Id":"4003","Name":"Luggage storage"},{"Id":"40","Name":"Hair salon"},{"Id":"41","Name":"ATM/banking"},{"Id":"43","Name":"Concierge services"},{"Id":"44","Name":"Gift shops or newsstand"},{"Id":"3372","Name":"Conference center"},{"Id":"45","Name":"Shopping on site"},{"Id":"2349","Name":"Designated smoking areas"},{"Id":"51","Name":"Pets allowed"},{"Id":"52","Name":"Total number of rooms - 457"},{"Id":"54","Name":"Number of floors - 29"},{"Id":"55","Name":"Number of buildings/towers - 1"},{"Id":"5058","Name":"Service animals are allowed"},{"Id":"5059","Name":"Service animals are exempt from fees/restrictions"},{"Id":"3913","Name":"Number of bars/lounges - 1"},{"Id":"2123","Name":"Full-service spa"},{"Id":"81","Name":"Conference space"},{"Id":"2386","Name":"Grocery/convenience store"},{"Id":"2387","Name":"Tours/ticket assistance"},{"Id":"2515","Name":"Year Built - 2001"},{"Id":"1073743315","Name":"Electric car charging station"},{"Id":"2644","Name":"Pet max weight (per pet) in kg is 34"},{"Id":"2646","Name":"Pet max weight (per pet) in lb is 75"},{"Id":"2134","Name":"Steam room"},{"Id":"2390","Name":"Free WiFi"},{"Id":"2135","Name":"Sauna"},{"Id":"2392","Name":"Free wired internet"},{"Id":"3929","Name":"Number of coffee shops/cafes - 1"},{"Id":"2016","Name":"Safe-deposit box at front desk"},{"Id":"361","Name":"Breakfast available (surcharge)"},{"Id":"2537","Name":"Number of restaurants - 4"},{"Id":"2539","Name":"Conference space size (feet) - 25005"},{"Id":"1073744110","Name":"Ballroom"},{"Id":"1073744111","Name":"Banquet hall"},{"Id":"369","Name":"Laundry facilities"},{"Id":"4468","Name":"24-hour fitness facilities"},{"Id":"2809","Name":"Only dogs are allowed"},{"Id":"2811","Name":"Maximum number of pets per room 2"},{"Id":"2043","Name":"Multilingual staff"},{"Id":"2047","Name":"Free newspapers in lobby"}],"RoomAmenities":[{"Id":"130","Name":"Refrigerator"},{"Id":"132","Name":"Coffee/tea maker"},{"Id":"4420","Name":"Connecting/adjoining rooms available"},{"Id":"135","Name":"Hypo-allergenic bedding available"},{"Id":"136","Name":"Phone"},{"Id":"1073743370","Name":"Towels provided"},{"Id":"2571","Name":"Pillowtop mattress"},{"Id":"1073743371","Name":"Bedsheets provided"},{"Id":"142","Name":"Bathrobes"},{"Id":"143","Name":"Free toiletries"},{"Id":"144","Name":"Hair dryer"},{"Id":"145","Name":"Iron/ironing board"},{"Id":"2130","Name":"Microwave (on request)"},{"Id":"2579","Name":"TV size: 47"},{"Id":"2580","Name":"TV size measurement: inch"},{"Id":"2389","Name":"In-room safe (laptop compatible)"},{"Id":"4951","Name":"Free cribs/infant beds"},{"Id":"26","Name":"Television"},{"Id":"2396","Name":"Satellite TV service"},{"Id":"2015","Name":"Room service (24 hours)"},{"Id":"2399","Name":"Flat-panel TV"},{"Id":"2081","Name":"Premium TV channels"},{"Id":"2403","Name":"Free WiFi"},{"Id":"2405","Name":"Free wired internet"},{"Id":"2150","Name":"Blackout drapes/curtains"},{"Id":"2025","Name":"Designer toiletries"},{"Id":"2026","Name":"Desk"},{"Id":"2030","Name":"In-room climate control (air conditioning)"},{"Id":"2160","Name":"In-room massage available"},{"Id":"2034","Name":"Premium bedding"},{"Id":"2100","Name":"Wireless internet access"},{"Id":"1073742773","Name":"Microwave (surcharge)"},{"Id":"1073743926","Name":"Housekeeping on request"},{"Id":"2039","Name":"Pay movies"},{"Id":"2807","Name":"iPod docking station"}],"Accessibility":["Assistive listening devices available","Braille or raised signage","Wheelchair accessible path of travel","Wheelchair accessible (may have limitations)"],"RoomTypes":[{"Description":"Room, 1 King Bed, City View","RoomKey":"CgY1NDY0NzUSMgoJMjAwNjcyNTYxEgkzOTczODUzNjMaAjI0KgoyMDI1LTAyLTExMgoyMDI1LTAyLTE2KgMKATJSCgiv1wEQr9cBGAJaAlVT","OfferId":"CgY1NDY0NzUSMgoJMjAwNjcyNTYxEgkzOTczODUzNjMaAjI0KgoyMDI1LTAyLTExMgoyMDI1LTAyLTE2KgMKATJSCgiv1wEQr9cBGAJaAlVT","RatePlanType":"standalone","RatePlans":[{"RoomTypeId":"200672561","RatePlanId":"397385363","RateRuleId":"825250051","InventorySourceId":"24","InventorySourceCode":"Expedia","StayDates":{"CheckInDate":"2025-02-11","CheckOutDate":"2025-02-16"},"RemainingCount":1,"Price":{"BaseRate":{"Value":"1556.00","Currency":"USD"},"TaxesAndFees":{"Value":"280.05","Currency":"USD"},"TotalPrice":{"Value":"1836.05","Currency":"USD"},"AvgNightlyRate":{"Value":"311.20","Currency":"USD"},"NightlyRates":[{"StayDate":"2025-02-11","BaseRate":{"Value":"311.20","Currency":"USD"}},{"StayDate":"2025-02-12","BaseRate":{"Value":"311.20","Currency":"USD"}},{"StayDate":"2025-02-13","BaseRate":{"Value":"311.20","Currency":"USD"}},{"StayDate":"2025-02-14","BaseRate":{"Value":"311.20","Currency":"USD"}},{"StayDate":"2025-02-15","BaseRate":{"Value":"311.20","Currency":"USD"}}]},"PaymentMethod":"Online","FreeInternet":true,"FreeWiFi":true,"FreeInternetDetails":["Free WiFi","Free wired internet"],"FreeParking":false,"FreeBreakfast":false,"CancellationPolicy":{"Refundable":true,"FreeCancellation":true,"FreeCancellationEndDateTime":"2025-02-10T23:59:00-08:00","CancellationPenaltyRules":[{"PenaltyNightCount":1,"PenaltyStartDateTime":"2025-02-10T23:59:00-08:00","PenaltyEndDateTime":"2025-02-11T23:59:00-08:00"}],"CancelPolicyDescription":"There is no charge for cancellations made before 23:59 (property local time) on February 10, 2025.Cancellations or changes made after 23:59 (property local time) on February 10, 2025 or no-shows are subject to a property fee equal to the first nights rate plus taxes and fees."}}],"Price":{"BaseRate":{"Value":"1556.00","Currency":"USD"},"TaxesAndFees":{"Value":"280.05","Currency":"USD"},"TotalPrice":{"Value":"1836.05","Currency":"USD"},"AvgNightlyRate":{"Value":"311.20","Currency":"USD"},"AvgNightlyRateWithFees":{"Value":"311.20","Currency":"USD"},"TotalPriceWithHotelFees":{"Value":"1836.05","Currency":"USD"}},"Links":{"WebSearchResult":{"Method":"GET","Href":"https://www.expedia.com/Hotel-Search?tpid=1&mpe=1738841635&endDate=2025-02-16&adults=2&locale=en_US&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0&startDate=2025-02-11&mpd=USD&mpn=200672561¤cy=USD&rateplanid=397385363&mpm=24&mpp=1&mpo=EC&selected=546475&mpb=280.05&mpa=1556.00"},"WebDetails":{"Method":"GET","Href":"https://www.expedia.com/Hotel.h546475.Hotel-Information?tpid=1&mpe=1738841635&chkin=2025-02-11&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0&chkout=2025-02-16&rm1=a2&langid=1033&mpd=USD®ionId=800130¤cy=USD&rateplanid=397385363&mpm=24&mpb=280.05&mpa=1556.00"},"ApiDetails":{"Accept":"application/vnd.exp-hotel.v3+json","Method":"GET","Href":"https://apim.expedia.com/hotels/details/CgY1NDY0NzUSMgoJMjAwNjcyNTYxEgkzOTczODUzNjMaAjI0KgoyMDI1LTAyLTExMgoyMDI1LTAyLTE2KgMKATJSCgiv1wEQr9cBGAJaAlVT?price=1836.05¤cy=USD&locale=en_US"}},"SmokingOption":"NonSmoking","BedTypeOptions":[{"Id":"37321","Description":"1 King Bed"}],"RoomOccupancyPolicy":{"MaxGuestCount":3,"MinCheckInAge":21,"AgeClassRestrictions":[{"AgeClass":"Adult","AgeMinimum":21,"MaxGuestCount":2},{"AgeClass":"Child","AgeMinimum":1,"AgeMaximum":20,"MaxGuestCount":2},{"AgeClass":"Infant","AgeMinimum":0,"AgeMaximum":0,"MaxGuestCount":2}]},"Amenities":[{"Id":"4097","Name":"Number of living rooms 0"},{"Id":"1073744707","Name":"Wardrobe or closet"},{"Id":"1073743908","Name":"Pets not allowed"},{"Id":"4134","Name":"City view"},{"Id":"4310","Name":"Number of bathrooms - 1"},{"Id":"4311","Name":"Separate bathtub and shower"},{"Id":"4233","Name":"Private bathroom"},{"Id":"4953","Name":"Number of bedrooms - 0"},{"Id":"1073742841","Name":"Rollaway/extra beds (surcharge)"},{"Id":"4092","Name":"Square meters - 35"},{"Id":"4093","Name":"Square feet - 380"},{"Id":"1073744318","Name":"Ping - 10.68"}],"Media":[{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3834h2557x0y0-67c7d558_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/0f8fd5ae_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/c02c7e5a_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3836h2557x0y0-6ec80451_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/w3837h2557x0y0-f5ee441f_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/550000/546500/546475/139a7d5a_t.jpg"}]}]},{"Id":"7910","Name":"Coast Seattle Downtown Hotel by APA","PropertyType":{"Id":1,"Name":"Hotel"},"LocalCurrencyCode":"USD","Location":{"Address":{"Address1":"1301 6th Avenue","City":"Seattle","Province":"WA","Country":"USA","PostalCode":"98101"},"GeoLocation":{"Latitude":"47.609193","Longitude":"-122.332775","Obfuscated":false},"Neighborhood":{"Id":"800130","Name":"Downtown Seattle"}},"Distance":{"Value":"0.42","Unit":"km","Direction":"SE"},"Description":{"LocationTeaser":"Located in Downtown Seattle, this hotel is within a 10-minute walk of Seattle Convention Center Arch Building and Pike Place Market. Seattle Waterfront and Lumen Field are also within 1 mi (2 km). University Street Station is only a 4-minute walk and Westlake Station is 6 minutes. ","HotelTeaser":"Along with a restaurant, this hotel has a fitness center and a bar/lounge. Additionally, a microwave in a common area, a business center, and conference space are onsite. "},"Status":"AVAILABLE","ThumbnailUrl":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/f83ee252_t.jpg","StarRating":"4.0","GuestRating":"4.3","GuestReviewCount":1070,"PetFriendly":true,"LgbtqiaFriendly":true,"Links":{"WebSearchResult":{"Method":"GET","Href":"https://www.expedia.com/Hotel-Search?tpid=1&mpe=1738841635&endDate=2025-02-16&adults=2&locale=en_US&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0&startDate=2025-02-11&mpd=USD&mpn=324954442¤cy=USD&rateplanid=396265793&mpm=24&selected=7910&mpb=233.45&mpa=1296.90"},"ApiRateCalendar":{"Accept":"application/vnd.exp-hotel.v3+json","Method":"GET","Href":"https://apim.expedia.com/hotels/rateCalendar?ecomHotelId=7910¤cy=USD&startDate=2025-02-06&endDate=2025-08-05&lengthOfStay=5"}},"Policies":{"CheckInStartTime":"4 PM","CheckInEndTime":"11:30 PM","SpecialCheckInInstructions":["The check-in location differs from the property location. Check-in location: [Hilton Honors App]. If you are planning to arrive after 11:30 PM please contact the property in advance using the information on the booking confirmation. Front desk staff will greet guests on arrival at the property. "],"CheckOutTime":"noon","PetPolicies":["Pets allowed for an extra charge of USD 50 per pet, per stay","Dogs only","2 total (up to 40 lbs per pet)","Service animals are welcome, and are exempt from fees"],"ChildrenAndExtraBedsPolicies":["Children are welcome.","Free rollaway/extra beds!","Free cribs (infant beds)!"]},"OptionalExtras":["
  • Fee for cooked-to-order breakfast: approximately USD 5.00 to 25.00 for adults, and USD 5.00 to 15.00 for children
  • Self parking fee: USD 49.00 per day
  • Pet fee: USD 50 per pet, per stay
  • Service animals are exempt from fees
  • Early check-in is available for a fee (subject to availability)
  • Late check-out is available for a fee (subject to availability)
","

The above list may not be comprehensive. Fees and deposits may not include tax and are subject to change.

"],"Media":[{"Type":"1","Title":"Primary image","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/f83ee252_t.jpg"},{"Type":"1","Title":"Lobby","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/c8c2fa75_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/b47859fb_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/5376e1fc_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/fe358753_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/90483241_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/1e5dd63b_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/2dd8fb4a_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/7d48b7f7_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/7738bd54_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/3828dd4f_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/a9844410_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/54b076c9_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/7cd1057d_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/9dfad776_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/02ca2d12_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/2d14e572_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/b3589c14_t.jpg"},{"Type":"1","Title":"Room amenity","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/f7f0ba73_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/5f88308a_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/ff9d2dac_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/5d83c477_t.jpg"},{"Type":"1","Title":"Fitness facility","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/5ea1e987_t.jpg"},{"Type":"1","Title":"Accessible bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/6f7e1587_t.jpg"},{"Type":"1","Title":"Restaurant","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/8fae8056_t.jpg"},{"Type":"1","Title":"Breakfast meal","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/907890fa_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/88576a04_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/79642e16_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/7cd9f0f9_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/97e5b31b_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/48deb8c8_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/9c4e4ca4_t.jpg"},{"Type":"1","Title":"Point of interest","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/820791f3_t.jpg"}],"HotelAmenities":[{"Id":"2177","Name":"Express check-in"},{"Id":"5058","Name":"Service animals are allowed"},{"Id":"5059","Name":"Service animals are exempt from fees/restrictions"},{"Id":"1073743877","Name":"Water dispenser"},{"Id":"8","Name":"Elevator"},{"Id":"9","Name":"Fitness facilities"},{"Id":"3913","Name":"Number of bars/lounges - 1"},{"Id":"2125","Name":"Internet access in public areas - high speed"},{"Id":"2063","Name":"24-hour front desk"},{"Id":"81","Name":"Conference space"},{"Id":"2065","Name":"Business center"},{"Id":"2066","Name":"Porter/bellhop"},{"Id":"2386","Name":"Grocery/convenience store"},{"Id":"2067","Name":"Express check-out"},{"Id":"2515","Name":"Year Built - 1970"},{"Id":"2644","Name":"Pet max weight (per pet) in kg is 18"},{"Id":"2646","Name":"Pet max weight (per pet) in lb is 40"},{"Id":"2070","Name":"Dry cleaning/laundry service"},{"Id":"3862","Name":"Self parking (surcharge)"},{"Id":"2016","Name":"Safe-deposit box at front desk"},{"Id":"2592","Name":"Conference space size (meters) - 372"},{"Id":"2593","Name":"Number of meeting rooms - 4"},{"Id":"4003","Name":"Luggage storage"},{"Id":"41","Name":"ATM/banking"},{"Id":"361","Name":"Breakfast available (surcharge)"},{"Id":"2537","Name":"Number of restaurants - 1"},{"Id":"43","Name":"Concierge services"},{"Id":"2539","Name":"Conference space size (feet) - 4004"},{"Id":"44","Name":"Gift shops or newsstand"},{"Id":"1073743404","Name":"Shared microwave"},{"Id":"45","Name":"Shopping on site"},{"Id":"2349","Name":"Designated smoking areas"},{"Id":"1073744111","Name":"Banquet hall"},{"Id":"369","Name":"Laundry facilities"},{"Id":"51","Name":"Pets allowed"},{"Id":"52","Name":"Total number of rooms - 256"},{"Id":"372","Name":"Television in common areas"},{"Id":"54","Name":"Number of floors - 29"},{"Id":"55","Name":"Number of buildings/towers - 1"},{"Id":"2809","Name":"Only dogs are allowed"},{"Id":"2811","Name":"Maximum number of pets per room 2"},{"Id":"2043","Name":"Multilingual staff"},{"Id":"317","Name":"Fireplace in lobby"}],"RoomAmenities":[{"Id":"132","Name":"Coffee/tea maker"},{"Id":"4420","Name":"Connecting/adjoining rooms available"},{"Id":"133","Name":"Daily housekeeping"},{"Id":"2053","Name":"Room service"},{"Id":"136","Name":"Phone"},{"Id":"1073743370","Name":"Towels provided"},{"Id":"139","Name":"Free local calls"},{"Id":"1073743371","Name":"Bedsheets provided"},{"Id":"141","Name":"Private bathroom"},{"Id":"1073744653","Name":"Closed captioned TV"},{"Id":"143","Name":"Free toiletries"},{"Id":"144","Name":"Hair dryer"},{"Id":"146","Name":"In-room safe"},{"Id":"2130","Name":"Microwave (on request)"},{"Id":"3858","Name":"Bathtub or shower"},{"Id":"1073743379","Name":"Number of bathrooms - 1"},{"Id":"2389","Name":"In-room safe (laptop compatible)"},{"Id":"4951","Name":"Free cribs/infant beds"},{"Id":"1073745175","Name":"WiFi speed 25+ Mbps"},{"Id":"2398","Name":"Cable TV service"},{"Id":"2399","Name":"Flat-panel TV"},{"Id":"1073742815","Name":"Rollaway/extra beds (free)"},{"Id":"2081","Name":"Premium TV channels"},{"Id":"2403","Name":"Free WiFi"},{"Id":"2150","Name":"Blackout drapes/curtains"},{"Id":"2157","Name":"Internet access (surcharge)"},{"Id":"2030","Name":"In-room climate control (air conditioning)"},{"Id":"1073744241","Name":"Eco-friendly toiletries"},{"Id":"1073744243","Name":"Recycling"},{"Id":"1073744691","Name":"Telephone accessibility kit"},{"Id":"2100","Name":"Wireless internet access"},{"Id":"2039","Name":"Pay movies"},{"Id":"1073744443","Name":"Mini-fridge"},{"Id":"1073744765","Name":"Toothbrush and toothpaste available on request"},{"Id":"2046","Name":"High-speed internet access"}],"Accessibility":["Wheelchair-accessible on-site restaurant","Visual alarms in hallways","Handrails in stairways","Well-lit path to entrance","Stair-free path to entrance","Wheelchair accessible (may have limitations)","Wheelchair accessible path of travel","Wheelchair-accessible public washroom","Wheelchair accessible parking","Wheelchair-accessible concierge desk","Assistive listening devices available","Wheelchair-accessible path to elevator","Wheelchair-accessible registration desk","Wheelchair-accessible fitness center","Wheelchair-accessible meeting spaces/business center"],"RoomTypes":[{"Description":"Room, 2 Double Beds, Club Lounge Access, City View","RoomKey":"CgQ3OTEwEjQKCTMyNDk1NDQ0MhIJMzk2MjY1NzkzGgIyNCABKgoyMDI1LTAyLTExMgoyMDI1LTAyLTE2KgMKATJSCgiv1wEQr9cBGAJaAlVT","OfferId":"CgQ3OTEwEjQKCTMyNDk1NDQ0MhIJMzk2MjY1NzkzGgIyNCABKgoyMDI1LTAyLTExMgoyMDI1LTAyLTE2KgMKATJSCgiv1wEQr9cBGAJaAlVT","RatePlanType":"standalone","RatePlans":[{"RoomTypeId":"324954442","RatePlanId":"396265793","RateRuleId":"839739515","InventorySourceId":"24","InventorySourceCode":"Expedia","StayDates":{"CheckInDate":"2025-02-11","CheckOutDate":"2025-02-16"},"RemainingCount":4,"Price":{"BaseRate":{"Value":"1296.90","Currency":"USD"},"TaxesAndFees":{"Value":"233.45","Currency":"USD"},"TotalPrice":{"Value":"1530.35","Currency":"USD"},"TotalStrikeOutPrice":{"Value":"1674.45","Currency":"USD"},"AvgNightlyRate":{"Value":"259.38","Currency":"USD"},"AvgNightlyStrikeOutRate":{"Value":"288.20","Currency":"USD"},"NightlyRates":[{"StayDate":"2025-02-11","BaseRate":{"Value":"283.50","Currency":"USD"}},{"StayDate":"2025-02-12","BaseRate":{"Value":"291.60","Currency":"USD"}},{"StayDate":"2025-02-13","BaseRate":{"Value":"291.60","Currency":"USD"}},{"StayDate":"2025-02-14","BaseRate":{"Value":"215.10","Currency":"USD"}},{"StayDate":"2025-02-15","BaseRate":{"Value":"215.10","Currency":"USD"}}]},"Promotions":[{"Description":"Save 10%","Amount":{"Value":"144.10","Currency":"USD"}}],"PaymentMethod":"Hotel","PaymentTime":"PayLater","FreeInternet":true,"FreeWiFi":true,"FreeInternetDetails":["Free WiFi"],"FreeParking":false,"FreeBreakfast":true,"FreeBreakfastDetails":["Continental breakfast"],"CancellationPolicy":{"Refundable":true,"FreeCancellation":true,"FreeCancellationEndDateTime":"2025-02-10T16:00:00-08:00","CancellationPenaltyRules":[{"PenaltyNightCount":1,"PenaltyStartDateTime":"2025-02-10T16:00:00-08:00","PenaltyEndDateTime":"2025-02-11T16:00:00-08:00"}],"CancelPolicyDescription":"There is no charge for cancellations made before 16:00 (property local time) on February 10, 2025.Cancellations or changes made after 16:00 (property local time) on February 10, 2025 or no-shows are subject to a property fee equal to the first nights rate plus taxes and fees."},"Amenities":[{"Id":"2103","Name":"Continental breakfast"}]}],"Price":{"BaseRate":{"Value":"1296.90","Currency":"USD"},"TaxesAndFees":{"Value":"233.45","Currency":"USD"},"TotalPrice":{"Value":"1530.35","Currency":"USD"},"TotalStrikeOutPrice":{"Value":"1674.45","Currency":"USD"},"AvgNightlyRate":{"Value":"259.38","Currency":"USD"},"AvgNightlyStrikeOutRate":{"Value":"288.20","Currency":"USD"},"AvgNightlyRateWithFees":{"Value":"259.38","Currency":"USD"},"AvgNightlyStrikeOutRateWithFees":{"Value":"288.20","Currency":"USD"},"TotalPriceWithHotelFees":{"Value":"1530.35","Currency":"USD"}},"Promotions":[{"Description":"Save 10%","Amount":{"Value":"144.10","Currency":"USD"}}],"Links":{"WebSearchResult":{"Method":"GET","Href":"https://www.expedia.com/Hotel-Search?tpid=1&mpe=1738841635&endDate=2025-02-16&adults=2&locale=en_US&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0&startDate=2025-02-11&mpd=USD&mpn=324954442¤cy=USD&rateplanid=396265793&mpm=24&mpp=1&mpo=HC&selected=7910&mpb=233.45&mpa=1296.90"},"WebDetails":{"Method":"GET","Href":"https://www.expedia.com/Hotel.h7910.Hotel-Information?tpid=1&mpe=1738841635&chkin=2025-02-11&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0&chkout=2025-02-16&rm1=a2&langid=1033&mpd=USD®ionId=800130¤cy=USD&rateplanid=396265793&mpm=24&mpb=233.45&mpa=1296.90"},"ApiDetails":{"Accept":"application/vnd.exp-hotel.v3+json","Method":"GET","Href":"https://apim.expedia.com/hotels/details/CgQ3OTEwEjQKCTMyNDk1NDQ0MhIJMzk2MjY1NzkzGgIyNCABKgoyMDI1LTAyLTExMgoyMDI1LTAyLTE2KgMKATJSCgiv1wEQr9cBGAJaAlVT?price=1530.35¤cy=USD&locale=en_US"}},"SmokingOption":"NonSmoking","BedTypeOptions":[{"Id":"37365","Description":"2 Double Beds"}],"RoomOccupancyPolicy":{"MaxGuestCount":4,"MinCheckInAge":21,"AgeClassRestrictions":[{"AgeClass":"Adult","AgeMinimum":18,"MaxGuestCount":4},{"AgeClass":"Child","AgeMinimum":0,"AgeMaximum":17,"MaxGuestCount":3}]},"Amenities":[{"Id":"4310","Name":"Number of bathrooms - 1"},{"Id":"4121","Name":"Bathrobes"}],"Media":[{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/2dd8fb4a_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/3828dd4f_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/a9844410_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/54b076c9_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/5f88308a_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/10000/8000/7910/ff9d2dac_t.jpg"}]}]},{"Id":"26893","Name":"Mayflower Park Hotel","PropertyType":{"Id":1,"Name":"Hotel"},"LocalCurrencyCode":"USD","Location":{"Address":{"Address1":"405 Olive Way","City":"Seattle","Province":"WA","Country":"USA","PostalCode":"98101"},"GeoLocation":{"Latitude":"47.61223","Longitude":"-122.33853","Obfuscated":false},"Neighborhood":{"Id":"800130","Name":"Downtown Seattle"}},"Distance":{"Value":"0.13","Unit":"km","Direction":"NW"},"Description":{"LocationTeaser":"Located in Downtown Seattle, this historic hotel is within a 10-minute walk of Seattle Central Business District, Pike Place Market, and Paramount Theatre. Bell Street Cruise Terminal at Pier 66 and Seattle Convention Center Arch Building are also within 15 minutes. Westlake Ave Hub Station is only a 2-minute walk and Westlake Station is 2 minutes. ","HotelTeaser":"Along with a restaurant, this smoke-free hotel has a fitness center and a bar/lounge. WiFi in public areas is free. Additionally, valet parking, 24-hour room service, and a business center are onsite. ","RoomTeaser":"Housekeeping is available on request. "},"Status":"AVAILABLE","RenovationsAndClosures":["The following facilities are closed seasonally each year. They will be closed from January 1 to March 1:
  • Bar/Lounge
","The following facilities are closed on Sunday and Monday:
  • Bar/lounge
"],"ThumbnailUrl":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/3e2a8bbc_t.jpg","StarRating":"4.0","GuestRating":"4.7","GuestReviewCount":2134,"PetFriendly":false,"LgbtqiaFriendly":true,"Links":{"WebSearchResult":{"Method":"GET","Href":"https://www.expedia.com/Hotel-Search?tpid=1&mpe=1738841635&endDate=2025-02-16&adults=2&locale=en_US&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0&startDate=2025-02-11&mpd=USD&mpn=212406505¤cy=USD&rateplanid=236111176&mpm=24&selected=26893&mpb=171.79&mpa=954.40"},"ApiRateCalendar":{"Accept":"application/vnd.exp-hotel.v3+json","Method":"GET","Href":"https://apim.expedia.com/hotels/rateCalendar?ecomHotelId=26893¤cy=USD&startDate=2025-02-06&endDate=2025-08-05&lengthOfStay=5"}},"Policies":{"CheckInStartTime":"4 PM","CheckInEndTime":"midnight","SpecialCheckInInstructions":["Front desk staff will greet guests on arrival at the property. "],"CheckOutTime":"noon","PetPolicies":["Pets not allowed"],"ChildrenAndExtraBedsPolicies":["Children are welcome.","Kids stay free! Children 17 years old and younger stay free when using existing bedding. "]},"OptionalExtras":["
  • Fee for cooked-to-order breakfast: approximately USD 12 to 30 per person
  • Valet parking fee: USD 50 per night (in/out privileges)
","

The above list may not be comprehensive. Fees and deposits may not include tax and are subject to change.

"],"Media":[{"Type":"1","Title":"Primary image","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/3e2a8bbc_t.jpg"},{"Type":"1","Title":"Lobby sitting area","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/4412ee7a_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/1aa66578_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/c82fd218_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/bd8ee5d1_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/3e0f9534_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/e02beb6c_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/f8b76d7c_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/e897f517_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/7e3a1dc0_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/d4855566_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/bfb35e25_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/0e97b70a_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/2eb8afe2_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/8e80af7a_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/f2c26024_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/53333c32_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/102212b0_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/f16e5c47_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/bfa94ba2_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/af4b63bf_t.jpg"},{"Type":"1","Title":"Living area","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/ffdee45e_t.jpg"},{"Type":"1","Title":"Living area","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/d06857f4_t.jpg"},{"Type":"1","Title":"Living area","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/9ab932e8_t.jpg"},{"Type":"1","Title":"Living area","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/b80384cf_t.jpg"},{"Type":"1","Title":"Living area","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/70873620_t.jpg"},{"Type":"1","Title":"Living area","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/4ac349fa_t.jpg"},{"Type":"1","Title":"Living room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/b3b2ae25_t.jpg"},{"Type":"1","Title":"Room amenity","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/4687e1f0_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/a7b9efcd_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/c361fdb8_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/341173bf_t.jpg"},{"Type":"1","Title":"Gym","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/db9aa87e_t.jpg"},{"Type":"1","Title":"Restaurant","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/79dc9643_t.jpg"},{"Type":"1","Title":"Restaurant","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/6ebb24c8_t.jpg"},{"Type":"1","Title":"Restaurant","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/95762b25_t.jpg"},{"Type":"1","Title":"Food and drink","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/2146e488_t.jpg"},{"Type":"1","Title":"Food and drink","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/c624a5b1_t.jpg"},{"Type":"1","Title":"Food and drink","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/df0b80e6_t.jpg"},{"Type":"1","Title":"Food and drink","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/f5035fb1_t.jpg"},{"Type":"1","Title":"Food and drink","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/dc0cbc6b_t.jpg"},{"Type":"1","Title":"Breakfast meal","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/65ced277_t.jpg"},{"Type":"1","Title":"Bar (on property)","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/8e98c72b_t.jpg"},{"Type":"1","Title":"Lounge","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/02a974a2_t.jpg"},{"Type":"1","Title":"Lounge","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/32db0821_t.jpg"},{"Type":"1","Title":"Interior","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/385c5a01_t.jpg"},{"Type":"1","Title":"Meeting facility","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/4c636168_t.jpg"},{"Type":"1","Title":"Meeting facility","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/f0de97f2_t.jpg"},{"Type":"1","Title":"Meeting facility","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/2822824d_t.jpg"},{"Type":"1","Title":"Meeting facility","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/f0e06809_t.jpg"},{"Type":"1","Title":"Interior detail","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/7e7ebbd0_t.jpg"},{"Type":"1","Title":"Front of property","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/59e34552_t.jpg"},{"Type":"1","Title":"Property entrance","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/7cde4f72_t.jpg"},{"Type":"1","Title":"Front of property - evening/night","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/d39ab7d3_t.jpg"},{"Type":"1","Title":"Front of property - evening/night","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/7f7f50da_t.jpg"},{"Type":"1","Title":"Exterior","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/9f08a510_t.jpg"},{"Type":"1","Title":"City view","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/04f82fd7_t.jpg"},{"Type":"1","Title":"City view","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/16d4b00d_t.jpg"}],"HotelAmenities":[{"Id":"2050","Name":"Pets not allowed"},{"Id":"8","Name":"Elevator"},{"Id":"1073745352","Name":"Elevator door width (inches) - 35"},{"Id":"9","Name":"Fitness facilities"},{"Id":"3913","Name":"Number of bars/lounges - 1"},{"Id":"1073745353","Name":"Elevator door width (centimeters) - 89"},{"Id":"2063","Name":"24-hour front desk"},{"Id":"2065","Name":"Business center"},{"Id":"2066","Name":"Porter/bellhop"},{"Id":"2515","Name":"Year Built - 1927"},{"Id":"2070","Name":"Dry cleaning/laundry service"},{"Id":"2390","Name":"Free WiFi"},{"Id":"3864","Name":"Valet parking (surcharge)"},{"Id":"2137","Name":"Smoke-free property"},{"Id":"2016","Name":"Safe-deposit box at front desk"},{"Id":"2593","Name":"Number of meeting rooms - 1"},{"Id":"4003","Name":"Luggage storage"},{"Id":"361","Name":"Breakfast available (surcharge)"},{"Id":"2537","Name":"Number of restaurants - 1"},{"Id":"43","Name":"Concierge services"},{"Id":"1073744111","Name":"Banquet hall"},{"Id":"369","Name":"Laundry facilities"},{"Id":"52","Name":"Total number of rooms - 160"},{"Id":"1073745332","Name":"No accessible shuttle"},{"Id":"54","Name":"Number of floors - 12"},{"Id":"2167","Name":"Wedding services"},{"Id":"2043","Name":"Multilingual staff"},{"Id":"317","Name":"Fireplace in lobby"},{"Id":"2047","Name":"Free newspapers in lobby"}],"RoomAmenities":[{"Id":"130","Name":"Refrigerator"},{"Id":"132","Name":"Coffee/tea maker"},{"Id":"135","Name":"Hypo-allergenic bedding available"},{"Id":"136","Name":"Phone"},{"Id":"2057","Name":"Free bottled water"},{"Id":"1073743370","Name":"Towels provided"},{"Id":"1073743371","Name":"Bedsheets provided"},{"Id":"141","Name":"Private bathroom"},{"Id":"1073744653","Name":"Closed captioned TV"},{"Id":"142","Name":"Bathrobes"},{"Id":"143","Name":"Free toiletries"},{"Id":"2575","Name":"LCD TV"},{"Id":"144","Name":"Hair dryer"},{"Id":"1073745360","Name":"Magnifying mirror"},{"Id":"145","Name":"Iron/ironing board"},{"Id":"146","Name":"In-room safe"},{"Id":"1073743379","Name":"Number of bathrooms - 1"},{"Id":"2580","Name":"TV size measurement: inch"},{"Id":"1073744661","Name":"Lowered electrical outlets in bathroom"},{"Id":"26","Name":"Television"},{"Id":"2398","Name":"Cable TV service"},{"Id":"2015","Name":"Room service (24 hours)"},{"Id":"2399","Name":"Flat-panel TV"},{"Id":"2081","Name":"Premium TV channels"},{"Id":"2402","Name":"HDTV"},{"Id":"2403","Name":"Free WiFi"},{"Id":"2150","Name":"Blackout drapes/curtains"},{"Id":"2025","Name":"Designer toiletries"},{"Id":"2026","Name":"Desk"},{"Id":"2030","Name":"In-room climate control (air conditioning)"},{"Id":"1073744686","Name":"Visual fire alarm"},{"Id":"1073744689","Name":"Lever door handles"},{"Id":"1073743285","Name":"In-room climate control (heating)"},{"Id":"2166","Name":"Shower only"},{"Id":"1073743926","Name":"Housekeeping on request"}],"Accessibility":["Wheelchair-accessible lounge","Visual alarms in hallways","Wheelchair accessible path of travel","Wheelchair-accessible public washroom","Wheelchairs available on site","Wheelchair-accessible path to elevator","Well-lit path to entrance","Stair-free path to entrance","Wheelchair accessible (may have limitations)"],"RoomTypes":[{"Description":"City Room, 1 Queen Bed","RoomKey":"CgUyNjg5MxI0CgkyMTI0MDY1MDUSCTIzNjExMTE3NhoCMjQgASoKMjAyNS0wMi0xMTIKMjAyNS0wMi0xNioDCgEyUgoIr9cBEK_XARgCWgJVUw","OfferId":"CgUyNjg5MxI0CgkyMTI0MDY1MDUSCTIzNjExMTE3NhoCMjQgASoKMjAyNS0wMi0xMTIKMjAyNS0wMi0xNioDCgEyUgoIr9cBEK_XARgCWgJVUw","RatePlanType":"standalone","RatePlans":[{"RoomTypeId":"212406505","RatePlanId":"236111176","RateRuleId":"743878424","InventorySourceId":"24","InventorySourceCode":"Expedia","StayDates":{"CheckInDate":"2025-02-11","CheckOutDate":"2025-02-16"},"RemainingCount":15,"Price":{"BaseRate":{"Value":"954.40","Currency":"USD"},"TaxesAndFees":{"Value":"171.79","Currency":"USD"},"TotalPrice":{"Value":"1126.19","Currency":"USD"},"TotalStrikeOutPrice":{"Value":"1364.79","Currency":"USD"},"AvgNightlyRate":{"Value":"190.88","Currency":"USD"},"AvgNightlyStrikeOutRate":{"Value":"238.60","Currency":"USD"},"NightlyRates":[{"StayDate":"2025-02-11","BaseRate":{"Value":"175.20","Currency":"USD"}},{"StayDate":"2025-02-12","BaseRate":{"Value":"180.00","Currency":"USD"}},{"StayDate":"2025-02-13","BaseRate":{"Value":"172.00","Currency":"USD"}},{"StayDate":"2025-02-14","BaseRate":{"Value":"156.00","Currency":"USD"}},{"StayDate":"2025-02-15","BaseRate":{"Value":"271.20","Currency":"USD"}}]},"Promotions":[{"Description":"Save 20%","Amount":{"Value":"238.60","Currency":"USD"}}],"PaymentMethod":"Hotel","PaymentTime":"PayLater","FreeInternet":true,"FreeWiFi":true,"FreeInternetDetails":["Free WiFi"],"FreeParking":false,"FreeBreakfast":false,"CancellationPolicy":{"Refundable":true,"FreeCancellation":true,"FreeCancellationEndDateTime":"2025-02-10T16:00:00-08:00","CancellationPenaltyRules":[{"PenaltyNightCount":1,"PenaltyStartDateTime":"2025-02-10T16:00:00-08:00","PenaltyEndDateTime":"2025-02-11T16:00:00-08:00"}],"CancelPolicyDescription":"There is no charge for cancellations made before 16:00 (property local time) on February 10, 2025.Cancellations or changes made after 16:00 (property local time) on February 10, 2025 or no-shows are subject to a property fee equal to the first nights rate plus taxes and fees."}}],"Price":{"BaseRate":{"Value":"954.40","Currency":"USD"},"TaxesAndFees":{"Value":"171.79","Currency":"USD"},"TotalPrice":{"Value":"1126.19","Currency":"USD"},"TotalStrikeOutPrice":{"Value":"1364.79","Currency":"USD"},"AvgNightlyRate":{"Value":"190.88","Currency":"USD"},"AvgNightlyStrikeOutRate":{"Value":"238.60","Currency":"USD"},"AvgNightlyRateWithFees":{"Value":"190.88","Currency":"USD"},"AvgNightlyStrikeOutRateWithFees":{"Value":"238.60","Currency":"USD"},"TotalPriceWithHotelFees":{"Value":"1126.19","Currency":"USD"}},"Promotions":[{"Description":"Save 20%","Amount":{"Value":"238.60","Currency":"USD"}}],"Links":{"WebSearchResult":{"Method":"GET","Href":"https://www.expedia.com/Hotel-Search?tpid=1&mpe=1738841635&endDate=2025-02-16&adults=2&locale=en_US&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0&startDate=2025-02-11&mpd=USD&mpn=212406505¤cy=USD&rateplanid=236111176&mpm=24&mpp=1&mpo=HC&selected=26893&mpb=171.79&mpa=954.40"},"WebDetails":{"Method":"GET","Href":"https://www.expedia.com/Hotel.h26893.Hotel-Information?tpid=1&mpe=1738841635&chkin=2025-02-11&chid=59033fce-a679-44b7-a356-aac9db7e5168&eapid=0&chkout=2025-02-16&rm1=a2&langid=1033&mpd=USD®ionId=800130¤cy=USD&rateplanid=236111176&mpm=24&mpb=171.79&mpa=954.40"},"ApiDetails":{"Accept":"application/vnd.exp-hotel.v3+json","Method":"GET","Href":"https://apim.expedia.com/hotels/details/CgUyNjg5MxI0CgkyMTI0MDY1MDUSCTIzNjExMTE3NhoCMjQgASoKMjAyNS0wMi0xMTIKMjAyNS0wMi0xNioDCgEyUgoIr9cBEK_XARgCWgJVUw?price=1126.19¤cy=USD&locale=en_US"}},"SmokingOption":"NonSmoking","BedTypeOptions":[{"Id":"37310","Description":"1 Queen Bed"}],"RoomOccupancyPolicy":{"MaxGuestCount":2,"MinCheckInAge":18,"AgeClassRestrictions":[{"AgeClass":"Adult","AgeMinimum":18,"MaxGuestCount":2},{"AgeClass":"Child","AgeMinimum":0,"AgeMaximum":17,"MaxGuestCount":1}]},"Amenities":[{"Id":"4097","Name":"Number of living rooms 0"},{"Id":"4642","Name":"No rollaway/extra beds"},{"Id":"4643","Name":"No cribs (infant beds)"},{"Id":"1073744707","Name":"Wardrobe or closet"},{"Id":"4134","Name":"City view"},{"Id":"4953","Name":"Number of bedrooms - 0"},{"Id":"4092","Name":"Square meters - 15"},{"Id":"4093","Name":"Square feet - 161"},{"Id":"1073744318","Name":"Ping - 4.52"}],"Media":[{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/bd8ee5d1_t.jpg"},{"Type":"1","Title":"Room","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/bfb35e25_t.jpg"},{"Type":"1","Title":"Living area","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/ffdee45e_t.jpg"},{"Type":"1","Title":"Bathroom","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/c361fdb8_t.jpg"},{"Type":"1","Title":"City view","Size":"t","Url":"https://images.trvl-media.com/lodging/1000000/30000/26900/26893/16d4b00d_t.jpg"}]}]}]} \ No newline at end of file diff --git a/tests/integration/src/test/resources/GetLodgingQuotesResponse.json b/tests/integration/src/test/resources/GetLodgingQuotesResponse.json deleted file mode 100644 index 7f4441a1f..000000000 --- a/tests/integration/src/test/resources/GetLodgingQuotesResponse.json +++ /dev/null @@ -1 +0,0 @@ -{"Count":4,"TotalPropertyCount":5,"TransactionId":"5da99559-b548-49e5-840f-5ec749b00881","StayDates":{"CheckInDate":"2025-02-16","CheckOutDate":"2025-02-21"},"LengthOfStay":5,"Occupants":[{"Adults":2}],"Properties":[{"Id":"75030107","Status":"NOT_AVAILABLE"},{"Id":"87704892","Status":"NOT_AVAILABLE"},{"Id":"83418323","Status":"AVAILABLE","RoomTypes":[{"RatePlans":[{"CancellationPolicy":{"Refundable":true,"FreeCancellation":false,"CancellationPenaltyRules":[{"PenaltyPercentOfStay":"50.00","PenaltyStartDateTime":"2025-02-05T15:59:00-08:00","PenaltyEndDateTime":"2025-02-09T23:59:00-08:00"},{"PenaltyPercentOfStay":"100","PenaltyStartDateTime":"2025-02-09T23:59:00-08:00","PenaltyEndDateTime":"2025-02-16T00:00:00-08:00"}]}}],"Price":{"BaseRate":{"Value":"338.10","Currency":"USD"},"TaxesAndFees":{"Value":"218.86","Currency":"USD"},"TotalPrice":{"Value":"556.96","Currency":"USD"},"AvgNightlyRate":{"Value":"67.62","Currency":"USD"},"AvgNightlyRateWithFees":{"Value":"111.39","Currency":"USD"},"TotalPriceWithPropertyFees":{"Value":"556.96","Currency":"USD"}},"Links":{"WebSearchResult":{"Method":"GET","Href":"https://www.vrbo.com/search?mpd=USD&tpid=9001&endDate=2025-02-21&adults=2&eapid=1&selected=83418323&startDate=2025-02-16&mpb=218.86&mpa=338.10"},"WebDetails":{"Method":"GET","Href":"https://www.vrbo.com/2930936?mpd=USD&mpe=1738846806&endDate=2025-02-21&adults=2&startDate=2025-02-16&mpb=218.86&mpa=338.10"}}}]},{"Id":"91799474","Status":"NOT_AVAILABLE"}]} diff --git a/xap-sdk/build.gradle.kts b/xap-sdk/build.gradle.kts new file mode 100644 index 000000000..83f99e529 --- /dev/null +++ b/xap-sdk/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("signing") + id("maven-publish") + id("org.jetbrains.dokka") version "2.0.0" +} + +group = property("GROUP_ID") as String +version = property("VERSION") as String + +dependencies { + api("com.expediagroup:expediagroup-sdk-rest:0.0.6-alpha") + + implementation("com.fasterxml.jackson.core:jackson-databind:2.18.2") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2") + runtimeOnly("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2") + + implementation("org.slf4j:slf4j-api:2.0.17") + + dokkaHtmlPlugin("org.jetbrains.dokka:versioning-plugin:2.0.0") +} + +dokka { + moduleName = "XAP SDK" + + pluginsConfiguration { + html { + val dokkaAssets = File(project.findProperty("dokka-assets.location").toString()) + + customAssets.from(File(dokkaAssets, "logo-icon.svg")) + customStyleSheets.from(File(dokkaAssets, "custom-styles.css")) + } + + versioning { + version = project.property("VERSION") as String + + olderVersionsDir.set(File(project.findProperty("dokka-old-versions.location").toString())) + + renderVersionsNavigationOnAllPages = true + } + } +} + +apply("$rootDir/gradle-tasks/publish.gradle.kts") +apply("$rootDir/gradle-tasks/signing.gradle.kts") +apply("$rootDir/gradle-tasks/sdk-properties.gradle.kts") diff --git a/xap-sdk/gradle.properties b/xap-sdk/gradle.properties new file mode 100644 index 000000000..f9f75e9eb --- /dev/null +++ b/xap-sdk/gradle.properties @@ -0,0 +1,6 @@ +ARTIFACT_NAME=xap-sdk +DESCRIPTION=The Expedia API Platform (XAP) SDK + +VERSION=2.0.0-SNAPSHOT + +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled diff --git a/xap-sdk/src/main/kotlin/.openapi-generator/FILES b/xap-sdk/src/main/kotlin/.openapi-generator/FILES new file mode 100644 index 000000000..1f7f98b14 --- /dev/null +++ b/xap-sdk/src/main/kotlin/.openapi-generator/FILES @@ -0,0 +1,211 @@ +com/expediagroup/sdk/xap/models/APIGatewayError.kt +com/expediagroup/sdk/xap/models/APIMError.kt +com/expediagroup/sdk/xap/models/ActivitiesAddress.kt +com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt +com/expediagroup/sdk/xap/models/ActivitiesCountry.kt +com/expediagroup/sdk/xap/models/ActivitiesError.kt +com/expediagroup/sdk/xap/models/ActivitiesErrors.kt +com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt +com/expediagroup/sdk/xap/models/ActivitiesLink.kt +com/expediagroup/sdk/xap/models/ActivitiesLocation.kt +com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt +com/expediagroup/sdk/xap/models/ActivitiesMedia.kt +com/expediagroup/sdk/xap/models/ActivitiesMoney.kt +com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt +com/expediagroup/sdk/xap/models/ActivitiesPhone.kt +com/expediagroup/sdk/xap/models/ActivitiesPrice.kt +com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt +com/expediagroup/sdk/xap/models/ActivitiesWarning.kt +com/expediagroup/sdk/xap/models/Activity.kt +com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt +com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt +com/expediagroup/sdk/xap/models/AdditionalFee.kt +com/expediagroup/sdk/xap/models/Address.kt +com/expediagroup/sdk/xap/models/AgeClassRestriction.kt +com/expediagroup/sdk/xap/models/AvailabilityCalendar.kt +com/expediagroup/sdk/xap/models/AvailabilityCalendarResponse.kt +com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt +com/expediagroup/sdk/xap/models/BedType.kt +com/expediagroup/sdk/xap/models/CancellationPenaltyRule.kt +com/expediagroup/sdk/xap/models/CancellationPenaltyRulePenaltyPrice.kt +com/expediagroup/sdk/xap/models/CancellationPolicy.kt +com/expediagroup/sdk/xap/models/Capacity.kt +com/expediagroup/sdk/xap/models/Car.kt +com/expediagroup/sdk/xap/models/CarCategory.kt +com/expediagroup/sdk/xap/models/CarDetails.kt +com/expediagroup/sdk/xap/models/CarDetailsResponse.kt +com/expediagroup/sdk/xap/models/CarListingsResponse.kt +com/expediagroup/sdk/xap/models/CarPolicy.kt +com/expediagroup/sdk/xap/models/CarType.kt +com/expediagroup/sdk/xap/models/CarsAddress.kt +com/expediagroup/sdk/xap/models/CarsCancellationPolicy.kt +com/expediagroup/sdk/xap/models/CarsCountry.kt +com/expediagroup/sdk/xap/models/CarsDateRange.kt +com/expediagroup/sdk/xap/models/CarsDistance.kt +com/expediagroup/sdk/xap/models/CarsError.kt +com/expediagroup/sdk/xap/models/CarsErrors.kt +com/expediagroup/sdk/xap/models/CarsGeoLocation.kt +com/expediagroup/sdk/xap/models/CarsLink.kt +com/expediagroup/sdk/xap/models/CarsLocation.kt +com/expediagroup/sdk/xap/models/CarsLocationOption.kt +com/expediagroup/sdk/xap/models/CarsMoney.kt +com/expediagroup/sdk/xap/models/CarsNeighborhood.kt +com/expediagroup/sdk/xap/models/CarsValidFormsOfPayment.kt +com/expediagroup/sdk/xap/models/CarsWarning.kt +com/expediagroup/sdk/xap/models/CategoryGroup.kt +com/expediagroup/sdk/xap/models/ChainAndBrandInfo.kt +com/expediagroup/sdk/xap/models/Country.kt +com/expediagroup/sdk/xap/models/DateRange.kt +com/expediagroup/sdk/xap/models/DateTimePeriod.kt +com/expediagroup/sdk/xap/models/Deductible.kt +com/expediagroup/sdk/xap/models/DepositDetail.kt +com/expediagroup/sdk/xap/models/DepositPolicy.kt +com/expediagroup/sdk/xap/models/Description.kt +com/expediagroup/sdk/xap/models/DisambiguationResponse.kt +com/expediagroup/sdk/xap/models/Discount.kt +com/expediagroup/sdk/xap/models/Distance.kt +com/expediagroup/sdk/xap/models/Duration.kt +com/expediagroup/sdk/xap/models/Equipment.kt +com/expediagroup/sdk/xap/models/Error.kt +com/expediagroup/sdk/xap/models/Errors.kt +com/expediagroup/sdk/xap/models/ExtraCostPerDistance.kt +com/expediagroup/sdk/xap/models/ExtraFees.kt +com/expediagroup/sdk/xap/models/Fault.kt +com/expediagroup/sdk/xap/models/FileInfo.kt +com/expediagroup/sdk/xap/models/FileSize.kt +com/expediagroup/sdk/xap/models/FilterConditions.kt +com/expediagroup/sdk/xap/models/FuelAC.kt +com/expediagroup/sdk/xap/models/GeoLocation.kt +com/expediagroup/sdk/xap/models/Hotel.kt +com/expediagroup/sdk/xap/models/HotelDetailsResponse.kt +com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInner.kt +com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDates.kt +com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInner.kt +com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInner.kt +com/expediagroup/sdk/xap/models/HotelLinks.kt +com/expediagroup/sdk/xap/models/HotelLinksApiRateCalendar.kt +com/expediagroup/sdk/xap/models/HotelLinksWebSearchResult.kt +com/expediagroup/sdk/xap/models/HotelListingsResponse.kt +com/expediagroup/sdk/xap/models/HotelListingsResponseStayDates.kt +com/expediagroup/sdk/xap/models/HotelLocation.kt +com/expediagroup/sdk/xap/models/HotelPolicies.kt +com/expediagroup/sdk/xap/models/HotelPropertyType.kt +com/expediagroup/sdk/xap/models/HotelRateCalendar.kt +com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInner.kt +com/expediagroup/sdk/xap/models/Image.kt +com/expediagroup/sdk/xap/models/Link.kt +com/expediagroup/sdk/xap/models/Location.kt +com/expediagroup/sdk/xap/models/LocationGeoLocation.kt +com/expediagroup/sdk/xap/models/LocationOption.kt +com/expediagroup/sdk/xap/models/LodgingAmenity.kt +com/expediagroup/sdk/xap/models/LodgingCancellationPenaltyRule.kt +com/expediagroup/sdk/xap/models/LodgingCancellationPolicy.kt +com/expediagroup/sdk/xap/models/LodgingError.kt +com/expediagroup/sdk/xap/models/LodgingErrors.kt +com/expediagroup/sdk/xap/models/LodgingLink.kt +com/expediagroup/sdk/xap/models/LodgingMoney.kt +com/expediagroup/sdk/xap/models/LodgingOccupant.kt +com/expediagroup/sdk/xap/models/LodgingPromotion.kt +com/expediagroup/sdk/xap/models/LodgingQuotesResponse.kt +com/expediagroup/sdk/xap/models/LodgingRatePlan.kt +com/expediagroup/sdk/xap/models/LodgingRoomType.kt +com/expediagroup/sdk/xap/models/LodgingRoomTypeLinks.kt +com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebDetails.kt +com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebSearchResult.kt +com/expediagroup/sdk/xap/models/LodgingRoomTypePrice.kt +com/expediagroup/sdk/xap/models/LodgingStayDates.kt +com/expediagroup/sdk/xap/models/LodgingWarning.kt +com/expediagroup/sdk/xap/models/MandatoryFeesDetail.kt +com/expediagroup/sdk/xap/models/MandatoryFeesDetailAmount.kt +com/expediagroup/sdk/xap/models/Media.kt +com/expediagroup/sdk/xap/models/Mileage.kt +com/expediagroup/sdk/xap/models/Money.kt +com/expediagroup/sdk/xap/models/Neighborhood.kt +com/expediagroup/sdk/xap/models/NightlyRates.kt +com/expediagroup/sdk/xap/models/NonCancellableDateTimeRange.kt +com/expediagroup/sdk/xap/models/NonRefundableDateRange.kt +com/expediagroup/sdk/xap/models/Occupant.kt +com/expediagroup/sdk/xap/models/Offer.kt +com/expediagroup/sdk/xap/models/PaymentSchedule.kt +com/expediagroup/sdk/xap/models/PaymentSchedulePrice.kt +com/expediagroup/sdk/xap/models/PenaltyRule.kt +com/expediagroup/sdk/xap/models/PenaltyType.kt +com/expediagroup/sdk/xap/models/Phone.kt +com/expediagroup/sdk/xap/models/PresignedUrlResponse.kt +com/expediagroup/sdk/xap/models/Price.kt +com/expediagroup/sdk/xap/models/Promotion.kt +com/expediagroup/sdk/xap/models/PromotionAmount.kt +com/expediagroup/sdk/xap/models/Property.kt +com/expediagroup/sdk/xap/models/PropertyDetails.kt +com/expediagroup/sdk/xap/models/PropertyManager.kt +com/expediagroup/sdk/xap/models/RateCalendar.kt +com/expediagroup/sdk/xap/models/RateCalendarPrice.kt +com/expediagroup/sdk/xap/models/RateCalendarResponse.kt +com/expediagroup/sdk/xap/models/RateDetails.kt +com/expediagroup/sdk/xap/models/RatePlan.kt +com/expediagroup/sdk/xap/models/RatePlanAmenitiesInner.kt +com/expediagroup/sdk/xap/models/RatePlanPrice.kt +com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInner.kt +com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInner.kt +com/expediagroup/sdk/xap/models/RatePlanStandalonePrice.kt +com/expediagroup/sdk/xap/models/Rating.kt +com/expediagroup/sdk/xap/models/RatingDetails.kt +com/expediagroup/sdk/xap/models/RatingWithoutDetails.kt +com/expediagroup/sdk/xap/models/Redemption.kt +com/expediagroup/sdk/xap/models/ReferencePrice.kt +com/expediagroup/sdk/xap/models/RentalLimits.kt +com/expediagroup/sdk/xap/models/Restrictions.kt +com/expediagroup/sdk/xap/models/Room.kt +com/expediagroup/sdk/xap/models/RoomOccupancyPolicy.kt +com/expediagroup/sdk/xap/models/RoomPreference.kt +com/expediagroup/sdk/xap/models/RoomRates.kt +com/expediagroup/sdk/xap/models/RoomRatesBaseRate.kt +com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInner.kt +com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFees.kt +com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInner.kt +com/expediagroup/sdk/xap/models/RoomRatesTotalPrice.kt +com/expediagroup/sdk/xap/models/RoomRatesTotalStrikeOutPrice.kt +com/expediagroup/sdk/xap/models/RoomType.kt +com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInner.kt +com/expediagroup/sdk/xap/models/RoomTypeLinks.kt +com/expediagroup/sdk/xap/models/RoomTypeLinksApiDetails.kt +com/expediagroup/sdk/xap/models/RoomTypeLinksWebDetails.kt +com/expediagroup/sdk/xap/models/RoomTypeMediaInner.kt +com/expediagroup/sdk/xap/models/RoomTypePrice.kt +com/expediagroup/sdk/xap/models/RoomTypeStandalonePrice.kt +com/expediagroup/sdk/xap/models/Savings.kt +com/expediagroup/sdk/xap/models/SdpAPIMError.kt +com/expediagroup/sdk/xap/models/SdpLink.kt +com/expediagroup/sdk/xap/models/StayDates.kt +com/expediagroup/sdk/xap/models/Supplier.kt +com/expediagroup/sdk/xap/models/TaxesAndFees.kt +com/expediagroup/sdk/xap/models/TaxesAndFeesDetail.kt +com/expediagroup/sdk/xap/models/Ticket.kt +com/expediagroup/sdk/xap/models/TimeRange.kt +com/expediagroup/sdk/xap/models/TransmissionDrive.kt +com/expediagroup/sdk/xap/models/ValidFormsOfPayment.kt +com/expediagroup/sdk/xap/models/VehicleDetails.kt +com/expediagroup/sdk/xap/models/VendorLocationDetails.kt +com/expediagroup/sdk/xap/models/WaiverPolicy.kt +com/expediagroup/sdk/xap/models/Warning.kt +com/expediagroup/sdk/xap/models/When.kt +com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt +com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt +com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt +com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt +com/expediagroup/sdk/xap/operations/GetCarDetailsOperation.kt +com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt +com/expediagroup/sdk/xap/operations/GetCarsListingsOperation.kt +com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt +com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperation.kt +com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt +com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperation.kt +com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt +com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperation.kt +com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt +com/expediagroup/sdk/xap/operations/GetLodgingListingsOperation.kt +com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt +com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperation.kt +com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt +com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperation.kt +com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt diff --git a/xap-sdk/src/main/kotlin/.openapi-generator/VERSION b/xap-sdk/src/main/kotlin/.openapi-generator/VERSION new file mode 100644 index 000000000..b23eb2752 --- /dev/null +++ b/xap-sdk/src/main/kotlin/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.11.0 diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/client/AsyncXapClient.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/client/AsyncXapClient.kt new file mode 100644 index 000000000..55c563947 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/client/AsyncXapClient.kt @@ -0,0 +1,79 @@ +/* + * 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. + * 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. + */ + +package com.expediagroup.sdk.xap.client + +import com.expediagroup.sdk.rest.AsyncRestClient +import com.expediagroup.sdk.rest.AsyncRestExecutor +import com.expediagroup.sdk.rest.model.Response +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationNoResponseBodyTrait +import com.expediagroup.sdk.xap.configuration.AsyncClientBuilder +import com.expediagroup.sdk.xap.configuration.AsyncXapClientConfiguration +import com.expediagroup.sdk.xap.configuration.Constant.ENDPOINT +import com.expediagroup.sdk.xap.configuration.XAP_OBJECT_MAPPER +import com.expediagroup.sdk.xap.core.AsyncRequestExecutor +import java.util.concurrent.CompletableFuture + +/** + * Asynchronous client for XAP API. + * + * @property restExecutor The executor for handling REST operations. + */ +class AsyncXapClient private constructor( + config: AsyncXapClientConfiguration, +) : AsyncRestClient() { + override val restExecutor: AsyncRestExecutor = + AsyncRestExecutor( + mapper = XAP_OBJECT_MAPPER, + serverUrl = ENDPOINT, + requestExecutor = AsyncRequestExecutor(configuration = config), + ) + + /** + * Executes an operation that does not expect a response body. + * + * @param operation The operation to execute. + * @return A CompletableFuture containing the response. + */ + fun execute(operation: OperationNoResponseBodyTrait): CompletableFuture> = restExecutor.execute(operation) + + /** + * Executes an operation that expects a response body. + * + * @param T The type of the response body. + * @param operation The operation to execute. + * @return A CompletableFuture containing the response. + */ + fun execute(operation: JacksonModelOperationResponseBodyTrait): CompletableFuture> = restExecutor.execute(operation) + + companion object { + /** + * Builder for creating an instance of [AsyncXapClient]. + */ + class Builder : AsyncClientBuilder() { + override fun build(): AsyncXapClient = AsyncXapClient(buildConfig()) + } + + /** + * Creates a new builder for [AsyncXapClient]. + * + * @return A new [Builder] instance. + */ + @JvmStatic + fun builder() = Builder() + } +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt new file mode 100644 index 000000000..be8bbecae --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt @@ -0,0 +1,78 @@ +/* + * 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. + * 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. + */ + +package com.expediagroup.sdk.xap.client + +import com.expediagroup.sdk.rest.RestClient +import com.expediagroup.sdk.rest.RestExecutor +import com.expediagroup.sdk.rest.model.Response +import com.expediagroup.sdk.rest.trait.operation.JacksonModelOperationResponseBodyTrait +import com.expediagroup.sdk.rest.trait.operation.OperationNoResponseBodyTrait +import com.expediagroup.sdk.xap.configuration.ClientBuilder +import com.expediagroup.sdk.xap.configuration.Constant.ENDPOINT +import com.expediagroup.sdk.xap.configuration.XAP_OBJECT_MAPPER +import com.expediagroup.sdk.xap.configuration.XapClientConfiguration +import com.expediagroup.sdk.xap.core.RequestExecutor + +/** + * Synchronous client for XAP API. + * + * @property restExecutor The executor for handling REST operations. + */ +class XapClient private constructor( + config: XapClientConfiguration, +) : RestClient() { + override val restExecutor: RestExecutor = + RestExecutor( + mapper = XAP_OBJECT_MAPPER, + serverUrl = ENDPOINT, + requestExecutor = RequestExecutor(config), + ) + + /** + * Executes an operation that does not expect a response body. + * + * @param operation The operation to execute. + * @return The response of the operation. + */ + fun execute(operation: OperationNoResponseBodyTrait): Response = restExecutor.execute(operation) + + /** + * Executes an operation that expects a response body. + * + * @param T The type of the response body. + * @param operation The operation to execute. + * @return The response of the operation. + */ + fun execute(operation: JacksonModelOperationResponseBodyTrait): Response = restExecutor.execute(operation) + + companion object { + /** + * Builder for creating an instance of [XapClient]. + */ + class Builder : ClientBuilder() { + override fun build(): XapClient = XapClient(buildConfig()) + } + + /** + * Creates a new builder for [XapClient]. + * + * @return A new [Builder] instance. + */ + @JvmStatic + fun builder() = Builder() + } +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LoggerName.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/configuration/Constant.kt similarity index 69% rename from code/src/main/kotlin/com/expediagroup/sdk/core/constant/LoggerName.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/configuration/Constant.kt index 749fcd3fe..f70e720d8 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/core/constant/LoggerName.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/configuration/Constant.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. @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.expediagroup.sdk.core.constant -internal object LoggerName { - const val REQUEST_BODY_LOGGER: String = "RequestBodyLogger" - const val RESPONSE_BODY_LOGGER: String = "ResponseBodyLogger" +package com.expediagroup.sdk.xap.configuration + +internal object Constant { + const val ENDPOINT = "https://apim.expedia.com" + const val AUTH_ENDPOINT = "https://api.expediagroup.com/identity/oauth2/v3/token" } diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/configuration/XapClientConfiguration.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/configuration/XapClientConfiguration.kt new file mode 100644 index 000000000..91ca93aea --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/configuration/XapClientConfiguration.kt @@ -0,0 +1,143 @@ +/* + * 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. + * 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. + */ + +package com.expediagroup.sdk.xap.configuration + +import com.expediagroup.sdk.core.auth.common.Credentials +import com.expediagroup.sdk.core.transport.AsyncTransport +import com.expediagroup.sdk.core.transport.Transport +import com.expediagroup.sdk.rest.AsyncRestClient +import com.expediagroup.sdk.rest.RestClient + +/** + * Configuration data class for XAP client. + * + * @property transport The transport mechanism. Defaults to null. + */ +data class XapClientConfiguration( + val credentials: Credentials, + val transport: Transport? = null, +) + +/** + * Configuration data class for asynchronous XAP client. + * + * @property asyncTransport The asynchronous transport mechanism. Defaults to null. + */ +data class AsyncXapClientConfiguration( + val credentials: Credentials, + val asyncTransport: AsyncTransport? = null, +) + +/** + * Abstract builder class for creating instances of [RestClient]. + * + * @param T The type of [RestClient] to build. + */ +abstract class ClientBuilder { + private var credentials: Credentials? = null + private var transport: Transport? = null + + /** + * Sets the credentials used to authenticate with the API. + * + * @param credentials + * @return The builder instance. + */ + fun credentials(credentials: Credentials) = apply { this.credentials = credentials } + + /** + * Sets the transport mechanism. + * + * @param transport The transport mechanism. + * @return The builder instance. + */ + fun transport(transport: Transport) = apply { this.transport = transport } + + /** + * Builds the [RestClient] instance. + * + * @return The built [RestClient] instance. + */ + abstract fun build(): T + + /** + * Builds the configuration for the XAP client. + * + * @return The built [XapClientConfiguration] instance. + * @throws IllegalArgumentException If the credentials type is unsupported + */ + protected fun buildConfig(): XapClientConfiguration { + require(credentials != null) { + "credentials is required" + } + + return XapClientConfiguration( + credentials = credentials!!, + transport = transport, + ) + } +} + +/** + * Abstract builder class for creating instances of [AsyncRestClient]. + * + * @param T The type of [AsyncRestClient] to build. + */ +abstract class AsyncClientBuilder { + private var credentials: Credentials? = null + private var asyncTransport: AsyncTransport? = null + + /** + * Sets the credentials used to authenticate with the API. + * + * @param credentials + * @return The builder instance. + */ + fun credentials(credentials: Credentials) = apply { this.credentials = credentials } + + /** + * Sets the asynchronous transport mechanism. + * + * @param asyncTransport The asynchronous transport mechanism. + * @return The builder instance. + */ + fun asyncTransport(asyncTransport: AsyncTransport) = apply { this.asyncTransport = asyncTransport } + + /** + * Builds the [AsyncRestClient] instance. + * + * @return The built [AsyncRestClient] instance. + */ + abstract fun build(): T + + /** + * Builds the configuration for the asynchronous XAP client. + * + * @return The built [AsyncXapClientConfiguration] instance. + * @throws IllegalArgumentException If the credentials type is unsupported + */ + protected fun buildConfig(): AsyncXapClientConfiguration { + require(credentials != null) { + "credentials is required" + } + + return AsyncXapClientConfiguration( + credentials = credentials!!, + asyncTransport = asyncTransport, + ) + } +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/configuration/XapJacksonObjectMapper.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/configuration/XapJacksonObjectMapper.kt new file mode 100644 index 000000000..467ad4016 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/configuration/XapJacksonObjectMapper.kt @@ -0,0 +1,33 @@ +/* + * 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. + * 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. + */ + +package com.expediagroup.sdk.xap.configuration + +import com.fasterxml.jackson.databind.DeserializationFeature +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.module.kotlin.jacksonMapperBuilder + +/** + * Singleton instance of [ObjectMapper] configured for XAP. + * + * This instance is built using `jacksonMapperBuilder` and automatically registers all available modules. + */ +val XAP_OBJECT_MAPPER: ObjectMapper = + jacksonMapperBuilder() + .enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS) + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .build() + .findAndRegisterModules() diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/core/ApiKeyHeaderStep.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/core/ApiKeyHeaderStep.kt new file mode 100644 index 000000000..58326ff93 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/core/ApiKeyHeaderStep.kt @@ -0,0 +1,41 @@ +/* + * 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. + * 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. + */ + +package com.expediagroup.sdk.xap.core + +import com.expediagroup.sdk.core.http.Request +import com.expediagroup.sdk.core.pipeline.RequestPipelineStep + +/** + * A pipeline step that adds an API key header to the request. + * + * @property apiKey The API key to be added to the request header. + */ +class ApiKeyHeaderStep( + private val apiKey: String, +) : RequestPipelineStep { + /** + * Adds the API key header to the request. + * + * @param request The original request. + * @return The modified request with the API key header added. + */ + override fun invoke(request: Request): Request = + request + .newBuilder() + .addHeader("key", apiKey) + .build() +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/core/AsyncRequestExecutor.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/core/AsyncRequestExecutor.kt new file mode 100644 index 000000000..5c809bc1d --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/core/AsyncRequestExecutor.kt @@ -0,0 +1,96 @@ +/* + * 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. + * 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. + */ + +package com.expediagroup.sdk.xap.core + +import com.expediagroup.sdk.core.auth.basic.BasicAuthCredentials +import com.expediagroup.sdk.core.auth.basic.BasicAuthManager +import com.expediagroup.sdk.core.auth.oauth.OAuthAsyncManager +import com.expediagroup.sdk.core.auth.oauth.OAuthCredentials +import com.expediagroup.sdk.core.exception.client.ExpediaGroupConfigurationException +import com.expediagroup.sdk.core.logging.LoggerDecorator +import com.expediagroup.sdk.core.logging.masking.MaskHeaders +import com.expediagroup.sdk.core.pipeline.ExecutionPipeline +import com.expediagroup.sdk.core.pipeline.RequestPipelineStep +import com.expediagroup.sdk.core.pipeline.ResponsePipelineStep +import com.expediagroup.sdk.core.pipeline.step.BasicAuthStep +import com.expediagroup.sdk.core.pipeline.step.OAuthStep +import com.expediagroup.sdk.core.pipeline.step.RequestHeadersStep +import com.expediagroup.sdk.core.pipeline.step.RequestLoggingStep +import com.expediagroup.sdk.core.pipeline.step.ResponseLoggingStep +import com.expediagroup.sdk.core.transport.AbstractAsyncRequestExecutor +import com.expediagroup.sdk.xap.configuration.AsyncXapClientConfiguration +import com.expediagroup.sdk.xap.configuration.Constant.AUTH_ENDPOINT +import org.slf4j.LoggerFactory + +/** + * Executor for handling asynchronous requests with XAP client configuration. + * + * @param configuration The configuration for the asynchronous XAP client. + */ +class AsyncRequestExecutor( + private val configuration: AsyncXapClientConfiguration, +) : AbstractAsyncRequestExecutor(configuration.asyncTransport) { + private val headersMask = MaskHeaders(listOf("authorization")) + + override val executionPipeline = + ExecutionPipeline( + requestPipeline = getRequestPipeline(), + responsePipeline = getResponsePipeline(), + ) + + private fun getRequestPipeline(): List = + when (configuration.credentials) { + is BasicAuthCredentials -> + listOf( + RequestHeadersStep(), + ApiKeyHeaderStep(configuration.credentials.username), + BasicAuthStep(BasicAuthManager(configuration.credentials)), + RequestLoggingStep( + logger = logger, + maskHeaders = headersMask, + ), + ) + + is OAuthCredentials -> + listOf( + RequestHeadersStep(), + ApiKeyHeaderStep(configuration.credentials.key), + OAuthStep( + OAuthAsyncManager( + credentials = configuration.credentials, + asyncTransport = asyncTransport, + authUrl = AUTH_ENDPOINT, + ), + ), + RequestLoggingStep( + logger = logger, + maskHeaders = headersMask, + ), + ) + + else -> throw ExpediaGroupConfigurationException("Unsupported credentials type: ${configuration.credentials.javaClass.name}") + } + + private fun getResponsePipeline(): List = + listOf( + ResponseLoggingStep(logger), + ) + + companion object { + private val logger = LoggerDecorator(LoggerFactory.getLogger(this::class.java.enclosingClass)) + } +} diff --git a/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/core/RequestExecutor.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/core/RequestExecutor.kt new file mode 100644 index 000000000..0d989ebc6 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/core/RequestExecutor.kt @@ -0,0 +1,96 @@ +/* + * 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. + * 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. + */ + +package com.expediagroup.sdk.xap.core + +import com.expediagroup.sdk.core.auth.basic.BasicAuthCredentials +import com.expediagroup.sdk.core.auth.basic.BasicAuthManager +import com.expediagroup.sdk.core.auth.oauth.OAuthCredentials +import com.expediagroup.sdk.core.auth.oauth.OAuthManager +import com.expediagroup.sdk.core.exception.client.ExpediaGroupConfigurationException +import com.expediagroup.sdk.core.logging.LoggerDecorator +import com.expediagroup.sdk.core.logging.masking.MaskHeaders +import com.expediagroup.sdk.core.pipeline.ExecutionPipeline +import com.expediagroup.sdk.core.pipeline.RequestPipelineStep +import com.expediagroup.sdk.core.pipeline.ResponsePipelineStep +import com.expediagroup.sdk.core.pipeline.step.BasicAuthStep +import com.expediagroup.sdk.core.pipeline.step.OAuthStep +import com.expediagroup.sdk.core.pipeline.step.RequestHeadersStep +import com.expediagroup.sdk.core.pipeline.step.RequestLoggingStep +import com.expediagroup.sdk.core.pipeline.step.ResponseLoggingStep +import com.expediagroup.sdk.core.transport.AbstractRequestExecutor +import com.expediagroup.sdk.xap.configuration.Constant.AUTH_ENDPOINT +import com.expediagroup.sdk.xap.configuration.XapClientConfiguration +import org.slf4j.LoggerFactory + +/** + * Executor for handling synchronous requests with XAP client configuration. + * + * @param configuration The configuration for the XAP client. + */ +class RequestExecutor( + private val configuration: XapClientConfiguration, +) : AbstractRequestExecutor(configuration.transport) { + private val headersMask = MaskHeaders(listOf("authorization")) + + override val executionPipeline = + ExecutionPipeline( + requestPipeline = getRequestPipeline(), + responsePipeline = getResponsePipeline(), + ) + + private fun getRequestPipeline(): List = + when (configuration.credentials) { + is BasicAuthCredentials -> + listOf( + RequestHeadersStep(), + ApiKeyHeaderStep(configuration.credentials.username), + BasicAuthStep(BasicAuthManager(configuration.credentials)), + RequestLoggingStep( + logger = logger, + maskHeaders = headersMask, + ), + ) + + is OAuthCredentials -> + listOf( + RequestHeadersStep(), + ApiKeyHeaderStep(configuration.credentials.key), + OAuthStep( + OAuthManager( + credentials = configuration.credentials, + transport = transport, + authUrl = AUTH_ENDPOINT, + ), + ), + RequestLoggingStep( + logger = logger, + maskHeaders = headersMask, + ), + ) + + else -> throw ExpediaGroupConfigurationException("Unsupported credentials type: ${configuration.credentials.javaClass.name}") + } + + private fun getResponsePipeline(): List = + listOf( + ResponseLoggingStep(logger), + ) + + companion object { + private val logger = LoggerDecorator(LoggerFactory.getLogger(this::class.java.enclosingClass)) + } +} 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 new file mode 100644 index 000000000..b630c862a --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIGatewayError.kt @@ -0,0 +1,55 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* + * @param message +*/ +data class APIGatewayError( + @JsonProperty("message") + val message: kotlin.String? = null, +) { + init { + } + + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var message: kotlin.String? = null, + ) { + fun message(message: kotlin.String?) = apply { this.message = message } + + fun build(): APIGatewayError { + val instance = + APIGatewayError( + message = message, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + message = message, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Room.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIMError.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Room.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIMError.kt index 3b86043e9..3892da8ce 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Room.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/APIMError.kt @@ -15,27 +15,41 @@ */ package com.expediagroup.sdk.xap.models -data class Room( - val adults: Long?, - val childAges: List? +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* + * @param message +*/ +data class APIMError( + @JsonProperty("message") + val message: kotlin.String? = null, ) { + init { + } + companion object { @JvmStatic fun builder() = Builder() } class Builder( - private var adults: Long? = null, - private var childAges: List? = null + private var message: kotlin.String? = null, ) { - fun adults(adults: Long?) = apply { this.adults = adults } + fun message(message: kotlin.String?) = apply { this.message = message } - fun childAges(childAges: List?) = apply { this.childAges = childAges } + fun build(): APIMError { + val instance = + APIMError( + message = message, + ) - fun build(): Room = - Room( - adults = this.adults, - childAges = this.childAges - ) + return instance + } } + + fun toBuilder() = + Builder( + message = message, + ) } diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt similarity index 68% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesAddress.kt index f159e2b55..388d70e35 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt similarity index 72% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt index 79657c6a7..6871c127b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCountry.kt index c8b05c7fa..a06a0a08b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt similarity index 68% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesError.kt index af0401354..057077a20 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesErrors.kt index 1295fed19..5a91094f5 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesGeoLocation.kt index e14ba3684..66a7ed867 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt similarity index 55% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLink.kt index f34efbe35..46d50af49 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt similarity index 75% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocation.kt index 3c3cb2fe0..a70802764 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt similarity index 72% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesLocationOption.kt index 88e54b697..b3783b542 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt similarity index 61% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMedia.kt index b8ffe6ae0..3e8ca71b1 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesMoney.kt index 524a014e2..d612641a1 100644 --- a/code/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 new file mode 100644 index 000000000..a6fefde69 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesNeighborhood.kt @@ -0,0 +1,68 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val id: kotlin.String, + // Neighborhood name. + @JsonProperty("Name") + 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() + } + + class Builder( + private var id: kotlin.String? = null, + private var name: kotlin.String? = null, + ) { + fun id(id: kotlin.String) = apply { this.id = id } + + fun name(name: kotlin.String) = apply { this.name = name } + + fun build(): ActivitiesNeighborhood { + val instance = + ActivitiesNeighborhood( + id = id!!, + name = name!!, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + id = id!!, + name = name!!, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt similarity index 61% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPhone.kt index 8af792ad6..dab6fe50b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt similarity index 67% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesPrice.kt index 7e469e3ce..88a0cde5c 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt similarity index 51% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesSupplier.kt index 2a5297ce5..c0ce2c3c8 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt similarity index 71% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesWarning.kt index 71c3fae09..9d35ecfc9 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt similarity index 86% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Activity.kt index 420114d70..80f22080a 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt similarity index 70% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityDetailsResponse.kt index 337bba6f7..8397d0405 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt similarity index 77% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivityListingsResponse.kt index 79cbaf463..ed8d5b8a5 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/AdditionalFee.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AdditionalFee.kt similarity index 66% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/AdditionalFee.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AdditionalFee.kt index 30241211d..68cdc2732 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Address.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Address.kt similarity index 67% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Address.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Address.kt index d10f7d59c..84feff4d6 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/AgeClassRestriction.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AgeClassRestriction.kt similarity index 68% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/AgeClassRestriction.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AgeClassRestriction.kt index a3c948d70..4f20e32f6 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendar.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendar.kt similarity index 83% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendar.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendar.kt index 9e0076e00..9cbda940c 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendarResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendarResponse.kt similarity index 67% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendarResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailabilityCalendarResponse.kt index 1539de6b9..5d105f2ea 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt similarity index 65% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt index 31d96f56d..70a55cf16 100644 --- a/code/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 new file mode 100644 index 000000000..576476d3c --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/BedType.kt @@ -0,0 +1,65 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val id: kotlin.String? = null, + // The bed type description. + @JsonProperty("Description") + val description: kotlin.String? = null, +) { + init { + } + + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var id: kotlin.String? = null, + private var description: kotlin.String? = null, + ) { + fun id(id: kotlin.String?) = apply { this.id = id } + + fun description(description: kotlin.String?) = apply { this.description = description } + + fun build(): BedType { + val instance = + BedType( + id = id, + description = description, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + id = id, + description = description, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRule.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRule.kt similarity index 76% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRule.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRule.kt index 813dd4764..2ff18c011 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRulePenaltyPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRulePenaltyPrice.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRulePenaltyPrice.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPenaltyRulePenaltyPrice.kt index 448d38b1f..b4c7cd623 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPolicy.kt similarity index 80% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPolicy.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CancellationPolicy.kt index 5a12667ea..e1d667006 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Capacity.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Capacity.kt similarity index 67% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Capacity.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Capacity.kt index 17fbeb6c1..9b7489776 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Car.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Car.kt similarity index 82% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Car.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Car.kt index 2e806cdb7..94b1d693e 100644 --- a/code/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 new file mode 100644 index 000000000..d57f96356 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarCategory.kt @@ -0,0 +1,68 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val code: kotlin.String, + // Car category value. + @JsonProperty("Value") + 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() + } + + class Builder( + private var code: kotlin.String? = null, + private var `value`: kotlin.String? = null, + ) { + fun code(code: kotlin.String) = apply { this.code = code } + + fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } + + fun build(): CarCategory { + val instance = + CarCategory( + code = code!!, + `value` = `value`!!, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + code = code!!, + `value` = `value`!!, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetails.kt similarity index 84% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetails.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetails.kt index e2047620e..32fc904d1 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetailsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetailsResponse.kt similarity index 71% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetailsResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarDetailsResponse.kt index 3649d3c5d..bb2837c94 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarListingsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarListingsResponse.kt similarity index 64% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarListingsResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarListingsResponse.kt index c98eeed36..a86f1a5d4 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarPolicy.kt similarity index 57% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarPolicy.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarPolicy.kt index 4e181742b..f46c53f83 100644 --- a/code/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 new file mode 100644 index 000000000..cf1e9d517 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarType.kt @@ -0,0 +1,68 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val code: kotlin.String, + // Car type value. + @JsonProperty("Value") + 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() + } + + class Builder( + private var code: kotlin.String? = null, + private var `value`: kotlin.String? = null, + ) { + fun code(code: kotlin.String) = apply { this.code = code } + + fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } + + fun build(): CarType { + val instance = + CarType( + code = code!!, + `value` = `value`!!, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + code = code!!, + `value` = `value`!!, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsAddress.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsAddress.kt similarity index 67% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsAddress.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsAddress.kt index 55c39e7d0..ceafb96fd 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCancellationPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCancellationPolicy.kt similarity index 74% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCancellationPolicy.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCancellationPolicy.kt index 5b98a5167..8612c6a72 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCountry.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCountry.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCountry.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCountry.kt index a77c1f2d7..598296bca 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDateRange.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDateRange.kt similarity index 55% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDateRange.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDateRange.kt index 175d2ab4c..6c5e42c47 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDistance.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDistance.kt similarity index 58% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDistance.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsDistance.kt index 9ddab12f4..922af4f58 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsError.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsError.kt similarity index 68% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsError.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsError.kt index dee35fba4..56b829f75 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsErrors.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsErrors.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsErrors.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsErrors.kt index 31d0e6c13..0f52c4f60 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsGeoLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsGeoLocation.kt similarity index 55% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsGeoLocation.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsGeoLocation.kt index 8f4854918..d0890edd6 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLink.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLink.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLink.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLink.kt index 620b2083b..7919e90d1 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocation.kt similarity index 74% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocation.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocation.kt index 2c3a77fae..f8a7bc1dd 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocationOption.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocationOption.kt similarity index 72% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocationOption.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsLocationOption.kt index 129b2c18a..6a0a20e62 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsMoney.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsMoney.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsMoney.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsMoney.kt index 8cc209bff..e7d364809 100644 --- a/code/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 new file mode 100644 index 000000000..a88577f29 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsNeighborhood.kt @@ -0,0 +1,68 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val id: kotlin.String, + // Neighborhood name. + @JsonProperty("Name") + 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() + } + + class Builder( + private var id: kotlin.String? = null, + private var name: kotlin.String? = null, + ) { + fun id(id: kotlin.String) = apply { this.id = id } + + fun name(name: kotlin.String) = apply { this.name = name } + + fun build(): CarsNeighborhood { + val instance = + CarsNeighborhood( + id = id!!, + name = name!!, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + id = id!!, + name = name!!, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsValidFormsOfPayment.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsValidFormsOfPayment.kt similarity index 60% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsValidFormsOfPayment.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsValidFormsOfPayment.kt index 96d0a0194..fbf75a987 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsWarning.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsWarning.kt similarity index 71% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsWarning.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsWarning.kt index e94f77176..2e2f01e48 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt similarity index 64% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CategoryGroup.kt index ec433a734..d208f112a 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ChainAndBrandInfo.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ChainAndBrandInfo.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ChainAndBrandInfo.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ChainAndBrandInfo.kt index 96f6032f4..496a4755b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Country.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Country.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Country.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Country.kt index debe86224..d6aa82193 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/DateRange.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateRange.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/DateRange.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateRange.kt index fa031697f..9eb4866b8 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/DateTimePeriod.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateTimePeriod.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/DateTimePeriod.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DateTimePeriod.kt index 5a8ccf07e..a05b12db1 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Deductible.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Deductible.kt similarity index 57% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Deductible.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Deductible.kt index 65516b64c..0e616c9de 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositDetail.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositDetail.kt similarity index 68% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositDetail.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositDetail.kt index 456f33481..9908fe4bc 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositPolicy.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositPolicy.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DepositPolicy.kt index e9100a633..7bcd4b10a 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Description.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Description.kt similarity index 60% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Description.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Description.kt index 56080fb2f..c9741d227 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/DisambiguationResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DisambiguationResponse.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/DisambiguationResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/DisambiguationResponse.kt index 9dccf2592..34d0e2c68 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Discount.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Discount.kt similarity index 51% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Discount.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Discount.kt index 24e75d55e..3755cfa75 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Distance.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Distance.kt similarity index 61% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Distance.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Distance.kt index 9230cbaf3..d60450471 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Duration.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Duration.kt similarity index 52% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Duration.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Duration.kt index aa3cffc68..a4d0aca8f 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Equipment.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Equipment.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Equipment.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Equipment.kt index 35d65f84c..ce7a573b6 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Error.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Error.kt similarity index 69% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Error.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Error.kt index de9e1b406..7f0a68a32 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Errors.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Errors.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Errors.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Errors.kt index 41e530928..49b2fcb5d 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraCostPerDistance.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraCostPerDistance.kt similarity index 51% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraCostPerDistance.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraCostPerDistance.kt index 541d9b2af..d398e97a8 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraFees.kt similarity index 57% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraFees.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ExtraFees.kt index e98dcdc20..5b0c0cb1a 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Fault.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Fault.kt similarity index 51% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Fault.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Fault.kt index cef192a49..95ad9958f 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/FileInfo.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileInfo.kt similarity index 80% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/FileInfo.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileInfo.kt index fe1a11f85..1acfaf25f 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/FileSize.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileSize.kt similarity index 55% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/FileSize.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FileSize.kt index 877fffe0a..f26268d99 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/FilterConditions.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FilterConditions.kt similarity index 58% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/FilterConditions.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FilterConditions.kt index a9359a600..d5171fc34 100644 --- a/code/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 new file mode 100644 index 000000000..48ae5d7b1 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/FuelAC.kt @@ -0,0 +1,68 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val code: kotlin.String, + // Car FuelAC value. + @JsonProperty("Value") + 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() + } + + class Builder( + private var code: kotlin.String? = null, + private var `value`: kotlin.String? = null, + ) { + fun code(code: kotlin.String) = apply { this.code = code } + + fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } + + fun build(): FuelAC { + val instance = + FuelAC( + code = code!!, + `value` = `value`!!, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + code = code!!, + `value` = `value`!!, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/GeoLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/GeoLocation.kt similarity index 57% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/GeoLocation.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/GeoLocation.kt index 279c90827..745ec5e72 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Hotel.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Hotel.kt similarity index 92% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Hotel.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Hotel.kt index 6856ffcf5..412f9acf8 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponse.kt similarity index 77% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponse.kt index 909eca952..f48658156 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInner.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseOccupantsInner.kt index a2fef6c22..fb0d01f98 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDates.kt similarity index 64% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDates.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseStayDates.kt index 7b5b89bfb..1c086ad04 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInner.kt similarity index 71% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelDetailsResponseWarningsInner.kt index 09db60810..af67cc130 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInner.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelHotelAmenitiesInner.kt index 1efdca550..4765a03b3 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinks.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinks.kt similarity index 51% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinks.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinks.kt index 747228435..e7abe2e66 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksApiRateCalendar.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksApiRateCalendar.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksApiRateCalendar.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksApiRateCalendar.kt index 9e046cb5a..a5f015a35 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksWebSearchResult.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksWebSearchResult.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksWebSearchResult.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLinksWebSearchResult.kt index f39b5e4e8..b2c105756 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponse.kt similarity index 78% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponse.kt index 098fbc5e5..1df832a92 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponseStayDates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponseStayDates.kt similarity index 58% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponseStayDates.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelListingsResponseStayDates.kt index d01cb1c2d..7f030f4fe 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLocation.kt similarity index 58% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLocation.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelLocation.kt index 2e66d5ac5..7a69fd9fb 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPolicies.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPolicies.kt similarity index 77% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPolicies.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPolicies.kt index 2b71be3d4..7f9a4caf7 100644 --- a/code/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 new file mode 100644 index 000000000..b50a94128 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelPropertyType.kt @@ -0,0 +1,65 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val name: kotlin.String? = null, +) { + init { + } + + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var id: kotlin.Int? = null, + private var name: kotlin.String? = null, + ) { + fun id(id: kotlin.Int?) = apply { this.id = id } + + fun name(name: kotlin.String?) = apply { this.name = name } + + fun build(): HotelPropertyType { + val instance = + HotelPropertyType( + id = id, + name = name, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + id = id, + name = name, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRateCalendar.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRateCalendar.kt similarity index 66% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRateCalendar.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRateCalendar.kt index bc634ac91..ed7689f8c 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInner.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/HotelRoomAmenitiesInner.kt index 632f3b125..71007d0b5 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Image.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Image.kt similarity index 58% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Image.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Image.kt index 6d3a24ba2..1495b0553 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Link.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Link.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Link.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Link.kt index 0d1a271ca..d29d12742 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Location.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Location.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Location.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Location.kt index b10b28b93..bb55e5ec1 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocation.kt similarity index 72% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocation.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationGeoLocation.kt index 2f75e9973..c0f9b0d36 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationOption.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationOption.kt similarity index 69% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationOption.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LocationOption.kt index fe3af0eab..24c4d3e37 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingAmenity.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingAmenity.kt similarity index 50% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingAmenity.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingAmenity.kt index 7c31b4b32..6f896ce0b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPenaltyRule.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPenaltyRule.kt similarity index 69% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPenaltyRule.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPenaltyRule.kt index 687fe84c2..fb124cd4a 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPolicy.kt similarity index 70% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPolicy.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingCancellationPolicy.kt index 6ca1f264d..d044642a5 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingError.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingError.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingError.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingError.kt index 09cb9a147..4e504f76f 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingErrors.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingErrors.kt similarity index 55% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingErrors.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingErrors.kt index a9eba2d8e..01831a0a2 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingLink.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingLink.kt similarity index 61% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingLink.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingLink.kt index 88b173658..dd905910f 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingMoney.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingMoney.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingMoney.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingMoney.kt index 890f2c1f2..bd7b009d9 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingOccupant.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingOccupant.kt similarity index 55% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingOccupant.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingOccupant.kt index d0bd6ce52..7d2c2df73 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingPromotion.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingPromotion.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingPromotion.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingPromotion.kt index e5bd5b15f..f865e660b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingQuotesResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingQuotesResponse.kt similarity index 76% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingQuotesResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingQuotesResponse.kt index 4d59f99a7..d5b900015 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRatePlan.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRatePlan.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRatePlan.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRatePlan.kt index e06c7748b..5dd8312d0 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomType.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomType.kt similarity index 60% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomType.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomType.kt index 8e46f1a6d..5dbbebbc0 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinks.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinks.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinks.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinks.kt index e1f92ed21..78f017bd3 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebDetails.kt similarity index 61% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebDetails.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebDetails.kt index 0c86902f4..8794eda6a 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebSearchResult.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebSearchResult.kt similarity index 61% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebSearchResult.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypeLinksWebSearchResult.kt index 95df79e67..1cbb75cd4 100644 --- a/code/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 new file mode 100644 index 000000000..8fe3f8eaa --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingRoomTypePrice.kt @@ -0,0 +1,120 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.xap.models.LodgingMoney +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val baseRate: LodgingMoney? = null, + // The total amount of taxes and fees of the rate plan for all occupants. + @JsonProperty("TaxesAndFees") + 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") + 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") + 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") + val avgNightlyRateWithFees: LodgingMoney? = null, + // The total mandatory fees which will be charged at the property for the rate plan. + @JsonProperty("PropertyMandatoryFees") + 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") + val totalPriceWithPropertyFees: LodgingMoney? = null, + // The refundable damage deposit. + @JsonProperty("RefundableDamageDeposit") + val refundableDamageDeposit: LodgingMoney? = null, +) { + init { + } + + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + 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: LodgingMoney?) = apply { this.baseRate = baseRate } + + fun taxesAndFees(taxesAndFees: LodgingMoney?) = apply { this.taxesAndFees = taxesAndFees } + + fun totalPrice(totalPrice: LodgingMoney?) = apply { this.totalPrice = totalPrice } + + fun avgNightlyRate(avgNightlyRate: LodgingMoney?) = apply { this.avgNightlyRate = avgNightlyRate } + + fun avgNightlyRateWithFees(avgNightlyRateWithFees: LodgingMoney?) = apply { this.avgNightlyRateWithFees = avgNightlyRateWithFees } + + fun propertyMandatoryFees(propertyMandatoryFees: LodgingMoney?) = apply { this.propertyMandatoryFees = propertyMandatoryFees } + + fun totalPriceWithPropertyFees(totalPriceWithPropertyFees: LodgingMoney?) = apply { this.totalPriceWithPropertyFees = totalPriceWithPropertyFees } + + fun refundableDamageDeposit(refundableDamageDeposit: LodgingMoney?) = apply { this.refundableDamageDeposit = refundableDamageDeposit } + + fun build(): LodgingRoomTypePrice { + val instance = + LodgingRoomTypePrice( + baseRate = baseRate, + taxesAndFees = taxesAndFees, + totalPrice = totalPrice, + avgNightlyRate = avgNightlyRate, + avgNightlyRateWithFees = avgNightlyRateWithFees, + propertyMandatoryFees = propertyMandatoryFees, + totalPriceWithPropertyFees = totalPriceWithPropertyFees, + refundableDamageDeposit = refundableDamageDeposit, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + baseRate = baseRate, + taxesAndFees = taxesAndFees, + totalPrice = totalPrice, + avgNightlyRate = avgNightlyRate, + avgNightlyRateWithFees = avgNightlyRateWithFees, + propertyMandatoryFees = propertyMandatoryFees, + totalPriceWithPropertyFees = totalPriceWithPropertyFees, + refundableDamageDeposit = refundableDamageDeposit, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingStayDates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingStayDates.kt similarity index 57% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingStayDates.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingStayDates.kt index 87bea51dd..2546348cc 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingWarning.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingWarning.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingWarning.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/LodgingWarning.kt index 9a7b84983..439606e28 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetail.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetail.kt similarity index 77% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetail.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetail.kt index b33bcc200..272200072 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetailAmount.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetailAmount.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetailAmount.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/MandatoryFeesDetailAmount.kt index 4263b0be2..5c5401c08 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Media.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Media.kt similarity index 65% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Media.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Media.kt index f04faf656..92073f54d 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Mileage.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Mileage.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Mileage.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Mileage.kt index dcd643dec..5625b0429 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Money.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Money.kt similarity index 57% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Money.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Money.kt index ca5a04bd5..63ffdf3ee 100644 --- a/code/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 new file mode 100644 index 000000000..8ff27eca1 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Neighborhood.kt @@ -0,0 +1,65 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val id: kotlin.String? = null, + // Neighborhood name. + @JsonProperty("Name") + val name: kotlin.String? = null, +) { + init { + } + + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var id: kotlin.String? = null, + private var name: kotlin.String? = null, + ) { + fun id(id: kotlin.String?) = apply { this.id = id } + + fun name(name: kotlin.String?) = apply { this.name = name } + + fun build(): Neighborhood { + val instance = + Neighborhood( + id = id, + name = name, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + id = id, + name = name, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/NightlyRates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NightlyRates.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/NightlyRates.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NightlyRates.kt index 3d9cdfe50..199b02791 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/NonCancellableDateTimeRange.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonCancellableDateTimeRange.kt similarity index 58% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/NonCancellableDateTimeRange.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonCancellableDateTimeRange.kt index 40acb6691..605c5401a 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/NonRefundableDateRange.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonRefundableDateRange.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/NonRefundableDateRange.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonRefundableDateRange.kt index 80f7c2bd6..5f6bb2812 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Occupant.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Occupant.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Occupant.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Occupant.kt index 37b9ba019..0e89710c7 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt similarity index 72% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Offer.kt index eb1e00553..ff749c878 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedule.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedule.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedule.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedule.kt index 025044cdd..dc9f523c9 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedulePrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedulePrice.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedulePrice.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PaymentSchedulePrice.kt index 84106a19e..6f591291b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyRule.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyRule.kt similarity index 60% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyRule.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyRule.kt index 19c7a22ce..8323846fb 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyType.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyType.kt similarity index 64% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyType.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyType.kt index 5896c61fc..e5736c58c 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Phone.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Phone.kt similarity index 62% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Phone.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Phone.kt index 34966455d..5001877b0 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/PresignedUrlResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PresignedUrlResponse.kt similarity index 67% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/PresignedUrlResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PresignedUrlResponse.kt index 7b09f4df8..258c51c8e 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Price.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Price.kt similarity index 63% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Price.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Price.kt index a756e2b3a..8fc5ca7eb 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Promotion.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Promotion.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Promotion.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Promotion.kt index 0939d422c..367851e3c 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/PromotionAmount.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PromotionAmount.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/PromotionAmount.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PromotionAmount.kt index 58152aba5..a05e7bcd8 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Property.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Property.kt similarity index 69% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Property.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Property.kt index b5f444a48..98734baca 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyDetails.kt similarity index 72% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyDetails.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyDetails.kt index 9d3c6b357..fd8c2b682 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyManager.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyManager.kt similarity index 58% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyManager.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PropertyManager.kt index 7ea7695e4..edbddd768 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendar.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendar.kt similarity index 70% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendar.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendar.kt index 6d569d02b..f4f6ba807 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPrice.kt similarity index 62% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPrice.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarPrice.kt index 6b55c8a57..6a009c1d3 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarResponse.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarResponse.kt similarity index 66% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarResponse.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateCalendarResponse.kt index 978111dab..41222ce07 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RateDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateDetails.kt similarity index 72% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RateDetails.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RateDetails.kt index efca8821d..b75ebb0e7 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlan.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlan.kt similarity index 90% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlan.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlan.kt index f644328f8..95999640a 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInner.kt similarity index 51% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanAmenitiesInner.kt index e573e018d..ddad85122 100644 --- a/code/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/RatePlanPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPrice.kt new file mode 100644 index 000000000..75b8d7207 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPrice.kt @@ -0,0 +1,150 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.xap.models.Money +import com.expediagroup.sdk.xap.models.RatePlanPriceNightlyRatesInner +import com.expediagroup.sdk.xap.models.RatePlanPriceTaxesAndFeesDetailsInner +import com.expediagroup.sdk.xap.models.RoomRates +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val baseRate: Money? = null, + // The total rate of taxes and fees of the rate plan for all occupants. + @JsonProperty("TaxesAndFees") + 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") + 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") + 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") + 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") + val avgNightlyStrikeOutRate: Money? = null, + // The total mandatory fees which will be charged at the hotel for the rate plan. + @JsonProperty("HotelMandatoryFees") + val hotelMandatoryFees: Money? = null, + // The refundable damage deposit. + @JsonProperty("RefundableDamageDeposit") + val refundableDamageDeposit: Money? = null, + // Nightly base rate of the rate plan. + @JsonProperty("NightlyRates") + 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") + val taxesAndFeesDetails: kotlin.collections.List? = null, + // Container for the rate information of all rooms. This is only returned in Lodging Details API. + @JsonProperty("RoomRates") + val roomRates: kotlin.collections.List? = null, +) { + init { + } + + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + 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, + ) { + fun baseRate(baseRate: Money?) = apply { this.baseRate = baseRate } + + fun taxesAndFees(taxesAndFees: Money?) = apply { this.taxesAndFees = taxesAndFees } + + fun totalPrice(totalPrice: Money?) = apply { this.totalPrice = totalPrice } + + fun totalStrikeOutPrice(totalStrikeOutPrice: Money?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } + + fun avgNightlyRate(avgNightlyRate: Money?) = apply { this.avgNightlyRate = avgNightlyRate } + + fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: Money?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } + + fun hotelMandatoryFees(hotelMandatoryFees: Money?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } + + 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 build(): RatePlanPrice { + val instance = + RatePlanPrice( + baseRate = baseRate, + taxesAndFees = taxesAndFees, + totalPrice = totalPrice, + totalStrikeOutPrice = totalStrikeOutPrice, + avgNightlyRate = avgNightlyRate, + avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, + hotelMandatoryFees = hotelMandatoryFees, + refundableDamageDeposit = refundableDamageDeposit, + nightlyRates = nightlyRates, + taxesAndFeesDetails = taxesAndFeesDetails, + roomRates = roomRates, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + baseRate = baseRate, + taxesAndFees = taxesAndFees, + totalPrice = totalPrice, + totalStrikeOutPrice = totalStrikeOutPrice, + avgNightlyRate = avgNightlyRate, + avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, + hotelMandatoryFees = hotelMandatoryFees, + refundableDamageDeposit = refundableDamageDeposit, + nightlyRates = nightlyRates, + taxesAndFeesDetails = taxesAndFeesDetails, + roomRates = roomRates, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInner.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceNightlyRatesInner.kt index 2149da0c4..fba98dd70 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInner.kt similarity index 55% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanPriceTaxesAndFeesDetailsInner.kt index 39cdae6df..755f8c5a7 100644 --- a/code/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/RatePlanStandalonePrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePrice.kt new file mode 100644 index 000000000..eee768f83 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatePlanStandalonePrice.kt @@ -0,0 +1,138 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.xap.models.Money +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val baseRate: Money? = null, + // The base rate strikeout in the standalone shopping path. + @JsonProperty("StrikeOutBaseRate") + val strikeOutBaseRate: Money? = null, + // The total standalone rate of taxes and fees of the rate plan for all occupants. + @JsonProperty("TaxesAndFees") + val taxesAndFees: Money? = null, + // The taxes and fees strikeout in the standalone shopping path. + @JsonProperty("StrikeOutTaxesAndFees") + 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") + val totalPrice: Money? = null, + // The total strikeout in the standalone shopping path, which is equal to the sum of `StrikeOutBaseRate` and `StrikeOutTaxesAndFees`. + @JsonProperty("TotalStrikeOutPrice") + 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") + 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") + val avgNightlyStrikeOutRate: Money? = null, + // The total standalone mandatory fees. + @JsonProperty("HotelMandatoryFees") + val hotelMandatoryFees: Money? = null, + // The strikeout of the mandatory fees in the standalone shopping path. + @JsonProperty("StrikeOutHotelMandatoryFees") + val strikeOutHotelMandatoryFees: Money? = null, +) { + init { + } + + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + 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: Money?) = apply { this.baseRate = baseRate } + + fun strikeOutBaseRate(strikeOutBaseRate: Money?) = apply { this.strikeOutBaseRate = strikeOutBaseRate } + + fun taxesAndFees(taxesAndFees: Money?) = apply { this.taxesAndFees = taxesAndFees } + + fun strikeOutTaxesAndFees(strikeOutTaxesAndFees: Money?) = apply { this.strikeOutTaxesAndFees = strikeOutTaxesAndFees } + + fun totalPrice(totalPrice: Money?) = apply { this.totalPrice = totalPrice } + + fun totalStrikeOutPrice(totalStrikeOutPrice: Money?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } + + fun avgNightlyRate(avgNightlyRate: Money?) = apply { this.avgNightlyRate = avgNightlyRate } + + fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: Money?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } + + fun hotelMandatoryFees(hotelMandatoryFees: Money?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } + + fun strikeOutHotelMandatoryFees(strikeOutHotelMandatoryFees: Money?) = apply { this.strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees } + + fun build(): RatePlanStandalonePrice { + val instance = + RatePlanStandalonePrice( + baseRate = baseRate, + strikeOutBaseRate = strikeOutBaseRate, + taxesAndFees = taxesAndFees, + strikeOutTaxesAndFees = strikeOutTaxesAndFees, + totalPrice = totalPrice, + totalStrikeOutPrice = totalStrikeOutPrice, + avgNightlyRate = avgNightlyRate, + avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, + hotelMandatoryFees = hotelMandatoryFees, + strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + baseRate = baseRate, + strikeOutBaseRate = strikeOutBaseRate, + taxesAndFees = taxesAndFees, + strikeOutTaxesAndFees = strikeOutTaxesAndFees, + totalPrice = totalPrice, + totalStrikeOutPrice = totalStrikeOutPrice, + avgNightlyRate = avgNightlyRate, + avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, + hotelMandatoryFees = hotelMandatoryFees, + strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Rating.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Rating.kt similarity index 61% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Rating.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Rating.kt index 561c4766b..29636cd34 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingDetails.kt similarity index 52% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingDetails.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingDetails.kt index 28e075cb8..c1f7c3dd6 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingWithoutDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingWithoutDetails.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingWithoutDetails.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RatingWithoutDetails.kt index 184f6d22a..e1ced55ef 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Redemption.kt index 32a02d013..b6d3a9fda 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ReferencePrice.kt index 8657fc46b..1979f7f5b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RentalLimits.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RentalLimits.kt similarity index 50% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RentalLimits.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RentalLimits.kt index 2764c1589..f3218e201 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt similarity index 58% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Restrictions.kt index e442400b4..53e338b91 100644 --- a/code/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 new file mode 100644 index 000000000..fa5c73b6f --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Room.kt @@ -0,0 +1,26 @@ +package com.expediagroup.sdk.xap.models + +data class Room( + val adults: Long?, + val childAges: List?, +) { + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var adults: Long? = null, + private var childAges: List? = null, + ) { + fun adults(adults: Long?) = apply { this.adults = adults } + + fun childAges(childAges: List?) = apply { this.childAges = childAges } + + fun build(): Room = + Room( + adults = this.adults, + childAges = this.childAges, + ) + } +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomOccupancyPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomOccupancyPolicy.kt similarity index 71% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomOccupancyPolicy.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomOccupancyPolicy.kt index 784bbeea1..86a4e7ac8 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomPreference.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomPreference.kt similarity index 60% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomPreference.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomPreference.kt index 1ff685628..a06d74961 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRates.kt similarity index 79% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRates.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRates.kt index 4c7b21ab3..7b6e4af4b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesBaseRate.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesBaseRate.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesBaseRate.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesBaseRate.kt index d394ff996..37edb9215 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInner.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesNightlyRatesInner.kt index 343dd3abc..992c412b4 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFees.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFees.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFees.kt index c954065d2..cdef69c74 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInner.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTaxesAndFeesDetailsInner.kt index e7f4b0ae5..a777bca7b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalPrice.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalPrice.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalPrice.kt index 1505b956c..5433314b6 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalStrikeOutPrice.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalStrikeOutPrice.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalStrikeOutPrice.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomRatesTotalStrikeOutPrice.kt index 536d30cbd..3b4abb91b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomType.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomType.kt similarity index 86% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomType.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomType.kt index 5b42f0176..9becbe6a6 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInner.kt similarity index 51% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeAmenitiesInner.kt index 7e419fa50..33dfe06d4 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinks.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinks.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinks.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinks.kt index 20e424b4b..a88c91238 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksApiDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksApiDetails.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksApiDetails.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksApiDetails.kt index 510b729bc..5f9f1397a 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksWebDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksWebDetails.kt similarity index 59% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksWebDetails.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeLinksWebDetails.kt index 90367647f..279b7426b 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeMediaInner.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeMediaInner.kt similarity index 66% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeMediaInner.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeMediaInner.kt index c70093121..ed41738d6 100644 --- a/code/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 new file mode 100644 index 000000000..112356417 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypePrice.kt @@ -0,0 +1,147 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.xap.models.Money +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val baseRate: Money? = null, + // The total rate of taxes and fees of the rate plan for all occupants. + @JsonProperty("TaxesAndFees") + 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") + 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") + 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") + 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") + 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") + 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") + val avgNightlyStrikeoutRateWithFees: Money? = null, + // The total mandatory fees which will be charged at the hotel for the rate plan. + @JsonProperty("HotelMandatoryFees") + 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") + val totalPriceWithHotelFees: Money? = null, + // The refundable damage deposit for the rate plan. + @JsonProperty("RefundableDamageDeposit") + val refundableDamageDeposit: Money? = null, +) { + init { + } + + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + 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: Money?) = apply { this.baseRate = baseRate } + + fun taxesAndFees(taxesAndFees: Money?) = apply { this.taxesAndFees = taxesAndFees } + + fun totalPrice(totalPrice: Money?) = apply { this.totalPrice = totalPrice } + + fun totalStrikeOutPrice(totalStrikeOutPrice: Money?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } + + fun avgNightlyRate(avgNightlyRate: Money?) = apply { this.avgNightlyRate = avgNightlyRate } + + fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: Money?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } + + fun avgNightlyRateWithFees(avgNightlyRateWithFees: Money?) = apply { this.avgNightlyRateWithFees = avgNightlyRateWithFees } + + fun avgNightlyStrikeoutRateWithFees(avgNightlyStrikeoutRateWithFees: Money?) = apply { this.avgNightlyStrikeoutRateWithFees = avgNightlyStrikeoutRateWithFees } + + fun hotelMandatoryFees(hotelMandatoryFees: Money?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } + + fun totalPriceWithHotelFees(totalPriceWithHotelFees: Money?) = apply { this.totalPriceWithHotelFees = totalPriceWithHotelFees } + + fun refundableDamageDeposit(refundableDamageDeposit: Money?) = apply { this.refundableDamageDeposit = refundableDamageDeposit } + + fun build(): RoomTypePrice { + val instance = + RoomTypePrice( + baseRate = baseRate, + taxesAndFees = taxesAndFees, + totalPrice = totalPrice, + totalStrikeOutPrice = totalStrikeOutPrice, + avgNightlyRate = avgNightlyRate, + avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, + avgNightlyRateWithFees = avgNightlyRateWithFees, + avgNightlyStrikeoutRateWithFees = avgNightlyStrikeoutRateWithFees, + hotelMandatoryFees = hotelMandatoryFees, + totalPriceWithHotelFees = totalPriceWithHotelFees, + refundableDamageDeposit = refundableDamageDeposit, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + baseRate = baseRate, + taxesAndFees = taxesAndFees, + totalPrice = totalPrice, + totalStrikeOutPrice = totalStrikeOutPrice, + avgNightlyRate = avgNightlyRate, + avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, + avgNightlyRateWithFees = avgNightlyRateWithFees, + avgNightlyStrikeoutRateWithFees = avgNightlyStrikeoutRateWithFees, + hotelMandatoryFees = hotelMandatoryFees, + totalPriceWithHotelFees = totalPriceWithHotelFees, + refundableDamageDeposit = refundableDamageDeposit, + ) +} 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 new file mode 100644 index 000000000..7bf77f6da --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/RoomTypeStandalonePrice.kt @@ -0,0 +1,138 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.expediagroup.sdk.xap.models.Money +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val baseRate: Money? = null, + // The base rate strikeout in the standalone shopping path. + @JsonProperty("StrikeOutBaseRate") + val strikeOutBaseRate: Money? = null, + // The total standalone rate of taxes and fees of the rate plan for all occupants. + @JsonProperty("TaxesAndFees") + val taxesAndFees: Money? = null, + // The taxes and fees strikeout in the standalone shopping path. + @JsonProperty("StrikeOutTaxesAndFees") + 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") + val totalPrice: Money? = null, + // The total strikeout in the standalone shopping path, which is equal to the sum of `StrikeOutBaseRate` and `StrikeOutTaxesAndFees`. + @JsonProperty("TotalStrikeOutPrice") + 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") + 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") + val avgNightlyStrikeOutRate: Money? = null, + // The total standalone mandatory fees. + @JsonProperty("HotelMandatoryFees") + val hotelMandatoryFees: Money? = null, + // The strikeout of the mandatory fees in the standalone shopping path. + @JsonProperty("StrikeOutHotelMandatoryFees") + val strikeOutHotelMandatoryFees: Money? = null, +) { + init { + } + + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + 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: Money?) = apply { this.baseRate = baseRate } + + fun strikeOutBaseRate(strikeOutBaseRate: Money?) = apply { this.strikeOutBaseRate = strikeOutBaseRate } + + fun taxesAndFees(taxesAndFees: Money?) = apply { this.taxesAndFees = taxesAndFees } + + fun strikeOutTaxesAndFees(strikeOutTaxesAndFees: Money?) = apply { this.strikeOutTaxesAndFees = strikeOutTaxesAndFees } + + fun totalPrice(totalPrice: Money?) = apply { this.totalPrice = totalPrice } + + fun totalStrikeOutPrice(totalStrikeOutPrice: Money?) = apply { this.totalStrikeOutPrice = totalStrikeOutPrice } + + fun avgNightlyRate(avgNightlyRate: Money?) = apply { this.avgNightlyRate = avgNightlyRate } + + fun avgNightlyStrikeOutRate(avgNightlyStrikeOutRate: Money?) = apply { this.avgNightlyStrikeOutRate = avgNightlyStrikeOutRate } + + fun hotelMandatoryFees(hotelMandatoryFees: Money?) = apply { this.hotelMandatoryFees = hotelMandatoryFees } + + fun strikeOutHotelMandatoryFees(strikeOutHotelMandatoryFees: Money?) = apply { this.strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees } + + fun build(): RoomTypeStandalonePrice { + val instance = + RoomTypeStandalonePrice( + baseRate = baseRate, + strikeOutBaseRate = strikeOutBaseRate, + taxesAndFees = taxesAndFees, + strikeOutTaxesAndFees = strikeOutTaxesAndFees, + totalPrice = totalPrice, + totalStrikeOutPrice = totalStrikeOutPrice, + avgNightlyRate = avgNightlyRate, + avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, + hotelMandatoryFees = hotelMandatoryFees, + strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + baseRate = baseRate, + strikeOutBaseRate = strikeOutBaseRate, + taxesAndFees = taxesAndFees, + strikeOutTaxesAndFees = strikeOutTaxesAndFees, + totalPrice = totalPrice, + totalStrikeOutPrice = totalStrikeOutPrice, + avgNightlyRate = avgNightlyRate, + avgNightlyStrikeOutRate = avgNightlyStrikeOutRate, + hotelMandatoryFees = hotelMandatoryFees, + strikeOutHotelMandatoryFees = strikeOutHotelMandatoryFees, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Savings.kt index 9282cb674..bee2be476 100644 --- a/code/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 new file mode 100644 index 000000000..74d7b4d98 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpAPIMError.kt @@ -0,0 +1,56 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* Error from the APIM. + * @param message Error from the APIM. +*/ +data class SdpAPIMError( + // Error from the APIM. + @JsonProperty("message") + val message: kotlin.String? = null, +) { + init { + } + + companion object { + @JvmStatic + fun builder() = Builder() + } + + class Builder( + private var message: kotlin.String? = null, + ) { + fun message(message: kotlin.String?) = apply { this.message = message } + + fun build(): SdpAPIMError { + val instance = + SdpAPIMError( + message = message, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + message = message, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpLink.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpLink.kt similarity index 51% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpLink.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/SdpLink.kt index ff2c3747a..a8e106893 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/StayDates.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/StayDates.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/StayDates.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/StayDates.kt index c999f33de..a223495f2 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Supplier.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Supplier.kt similarity index 56% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Supplier.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Supplier.kt index 74f9bba8e..28a082b57 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFees.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFees.kt similarity index 52% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFees.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFees.kt index 37d1118a7..57a3f03d6 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFeesDetail.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFeesDetail.kt similarity index 53% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFeesDetail.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TaxesAndFeesDetail.kt index e1b99baf7..526b786b5 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt similarity index 64% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Ticket.kt index 741c82f28..87ffad3fa 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/TimeRange.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TimeRange.kt similarity index 52% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/TimeRange.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TimeRange.kt index 9366c8573..0cedf5189 100644 --- a/code/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 new file mode 100644 index 000000000..be384206a --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/TransmissionDrive.kt @@ -0,0 +1,68 @@ +/* + * 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. + */ +package com.expediagroup.sdk.xap.models + +import com.fasterxml.jackson.annotation.JsonProperty + +/** +* 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") + val code: kotlin.String, + // Car transmission and drive value. + @JsonProperty("Value") + 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() + } + + class Builder( + private var code: kotlin.String? = null, + private var `value`: kotlin.String? = null, + ) { + fun code(code: kotlin.String) = apply { this.code = code } + + fun `value`(`value`: kotlin.String) = apply { this.`value` = `value` } + + fun build(): TransmissionDrive { + val instance = + TransmissionDrive( + code = code!!, + `value` = `value`!!, + ) + + return instance + } + } + + fun toBuilder() = + Builder( + code = code!!, + `value` = `value`!!, + ) +} diff --git a/code/src/main/kotlin/com/expediagroup/sdk/xap/models/ValidFormsOfPayment.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ValidFormsOfPayment.kt similarity index 67% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/ValidFormsOfPayment.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ValidFormsOfPayment.kt index 6310bb6fb..804c8b015 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/VehicleDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VehicleDetails.kt similarity index 72% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/VehicleDetails.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VehicleDetails.kt index 8c3675c28..c3908291e 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/VendorLocationDetails.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VendorLocationDetails.kt similarity index 69% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/VendorLocationDetails.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VendorLocationDetails.kt index 2a05c1f50..98a6da5ee 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/WaiverPolicy.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/WaiverPolicy.kt similarity index 55% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/WaiverPolicy.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/WaiverPolicy.kt index 4d0bb5d15..3b230b249 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/Warning.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Warning.kt similarity index 65% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/Warning.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/Warning.kt index 86b7d77b1..7df4ee20f 100644 --- a/code/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/code/src/main/kotlin/com/expediagroup/sdk/xap/models/When.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/When.kt similarity index 66% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/models/When.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/When.kt index f1a5224c1..01d2fad9c 100644 --- a/code/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/operations/GetActivityDetailsOperation.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt new file mode 100644 index 000000000..0cd20730e --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperation.kt @@ -0,0 +1,46 @@ +package com.expediagroup.sdk.xap.operations + +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( + 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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt similarity index 54% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt index 03f1b89b1..48bc4dc38 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityDetailsOperationParams.kt @@ -1,31 +1,11 @@ -/* - * 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. - */ 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 +14,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 +33,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 +55,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 new file mode 100644 index 000000000..4018b6324 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperation.kt @@ -0,0 +1,39 @@ +package com.expediagroup.sdk.xap.operations + +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( + 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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt similarity index 63% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt index 55bf59454..1ebd1d8c2 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetActivityListingsOperationParams.kt @@ -1,31 +1,11 @@ -/* - * 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. - */ 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 +18,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 +58,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 +96,8 @@ data class GetActivityListingsOperationParams( */ fun links( links: kotlin.collections.List< - GetActivityListingsOperationParams.Links - > + GetActivityListingsOperationParams.Links, + >, ) = apply { this.links = links } fun build(): GetActivityListingsOperationParams { @@ -132,31 +109,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 +124,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 new file mode 100644 index 000000000..162a839b0 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperation.kt @@ -0,0 +1,46 @@ +package com.expediagroup.sdk.xap.operations + +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( + 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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt similarity index 55% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt index e7d897da3..1817791dc 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarDetailsOperationParams.kt @@ -1,31 +1,11 @@ -/* - * 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. - */ 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 +16,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 +43,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 +77,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 +90,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 new file mode 100644 index 000000000..2cc3ba5e8 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperation.kt @@ -0,0 +1,39 @@ +package com.expediagroup.sdk.xap.operations + +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( + 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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt similarity index 66% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt index e2d314963..6494b3e79 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt @@ -1,32 +1,11 @@ -/* - * 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. - */ 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 +39,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 +177,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 +284,8 @@ data class GetCarsListingsOperationParams( */ fun suppliers( suppliers: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.suppliers = suppliers } /** @@ -331,8 +293,8 @@ data class GetCarsListingsOperationParams( */ fun carClasses( carClasses: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.carClasses = carClasses } /** @@ -355,8 +317,8 @@ data class GetCarsListingsOperationParams( */ fun transmissions( transmissions: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.transmissions = transmissions } /** @@ -369,8 +331,8 @@ data class GetCarsListingsOperationParams( */ fun carTypes( carTypes: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.carTypes = carTypes } /** @@ -388,8 +350,8 @@ data class GetCarsListingsOperationParams( */ fun links( links: kotlin.collections.List< - GetCarsListingsOperationParams.Links - > + GetCarsListingsOperationParams.Links, + >, ) = apply { this.links = links } /** @@ -427,31 +389,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 +425,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 new file mode 100644 index 000000000..5ab427857 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperation.kt @@ -0,0 +1,34 @@ +package com.expediagroup.sdk.xap.operations + +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( + 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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt similarity index 67% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt index 6d9b971a2..1335db0e3 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetFeedDownloadUrlOperationParams.kt @@ -1,31 +1,10 @@ -/* - * 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. - */ 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 +15,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 +23,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 +51,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 +72,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 +93,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 +127,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 +140,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 new file mode 100644 index 000000000..aa2a05f52 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperation.kt @@ -0,0 +1,39 @@ +package com.expediagroup.sdk.xap.operations + +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( + 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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt similarity index 50% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt index 08363b387..702152cee 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingAvailabilityCalendarsOperationParams.kt @@ -1,31 +1,11 @@ -/* - * 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. - */ 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 +13,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 +31,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 +44,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 new file mode 100644 index 000000000..1bade7bf1 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperation.kt @@ -0,0 +1,46 @@ +package com.expediagroup.sdk.xap.operations + +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( + 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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt similarity index 71% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt index 44403bb61..232adb6d1 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingDetailsOperationParams.kt @@ -1,31 +1,11 @@ -/* - * 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. - */ 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 +18,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 +59,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 +105,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 +120,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 new file mode 100644 index 000000000..f96cdfed9 --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperation.kt @@ -0,0 +1,39 @@ +package com.expediagroup.sdk.xap.operations + +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( + 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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt similarity index 71% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt index e8661f32f..aa7a37249 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt @@ -1,32 +1,11 @@ -/* - * 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. - */ 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 +62,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 +121,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 +145,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 +248,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 +262,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 +318,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 +352,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 +364,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 +380,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 +421,8 @@ data class GetLodgingListingsOperationParams( */ fun ecomHotelIds( ecomHotelIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.ecomHotelIds = ecomHotelIds } /** @@ -486,8 +430,8 @@ data class GetLodgingListingsOperationParams( */ fun hcomHotelIds( hcomHotelIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.hcomHotelIds = hcomHotelIds } /** @@ -515,8 +459,8 @@ data class GetLodgingListingsOperationParams( */ fun regionIds( regionIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.regionIds = regionIds } /** @@ -564,8 +508,8 @@ data class GetLodgingListingsOperationParams( */ fun links( links: kotlin.collections.List< - GetLodgingListingsOperationParams.Links - > + GetLodgingListingsOperationParams.Links, + >, ) = apply { this.links = links } /** @@ -618,8 +562,8 @@ data class GetLodgingListingsOperationParams( */ fun includedPropertyTypeIds( includedPropertyTypeIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.includedPropertyTypeIds = includedPropertyTypeIds } /** @@ -627,8 +571,8 @@ data class GetLodgingListingsOperationParams( */ fun excludedPropertyTypeIds( excludedPropertyTypeIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.excludedPropertyTypeIds = excludedPropertyTypeIds } /** @@ -636,8 +580,8 @@ data class GetLodgingListingsOperationParams( */ fun includedInventorySourceIds( includedInventorySourceIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.includedInventorySourceIds = includedInventorySourceIds } /** @@ -670,11 +614,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 +716,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 +775,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 new file mode 100644 index 000000000..09d31bcfa --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperation.kt @@ -0,0 +1,39 @@ +package com.expediagroup.sdk.xap.operations + +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( + 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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt similarity index 58% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt index ecf9284fe..d87668e83 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingQuotesOperationParams.kt @@ -1,32 +1,11 @@ -/* - * 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. - */ 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 +34,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 +172,8 @@ data class GetLodgingQuotesOperationParams( */ fun propertyIds( propertyIds: kotlin.collections.Set< - kotlin.String - > + kotlin.String, + >, ) = apply { this.propertyIds = propertyIds } /** @@ -236,8 +196,8 @@ data class GetLodgingQuotesOperationParams( */ fun links( links: kotlin.collections.List< - GetLodgingQuotesOperationParams.Links - > + GetLodgingQuotesOperationParams.Links, + >, ) = apply { this.links = links } /** @@ -245,11 +205,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 +279,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 +310,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 new file mode 100644 index 000000000..223ed63db --- /dev/null +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperation.kt @@ -0,0 +1,39 @@ +package com.expediagroup.sdk.xap.operations + +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( + 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/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt similarity index 62% rename from code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt rename to xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt index c3f4b290a..c7aba6fbe 100644 --- a/code/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt +++ b/xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingRateCalendarOperationParams.kt @@ -1,31 +1,11 @@ -/* - * 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. - */ 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 +18,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 +50,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 +96,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 +111,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 { - } }