Skip to content

Commit

Permalink
chore: Publish v1.1.0-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
anssari1 authored and github-actions[bot] committed Dec 11, 2024
1 parent a122f28 commit 7d954f5
Show file tree
Hide file tree
Showing 36 changed files with 5,652 additions and 9 deletions.
2 changes: 1 addition & 1 deletion code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<dependency>
<groupId>com.expediagroup</groupId>
<artifactId>xap-sdk</artifactId>
<version>1.0.0</version>
<version>1.1.0-SNAPSHOT</version>
</dependency>
```

Expand Down
14 changes: 7 additions & 7 deletions code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.expediagroup</groupId>
<artifactId>xap-sdk</artifactId>
<version>1.0.0</version>
<version>1.1.0-SNAPSHOT</version>
<name>EG xap-sdk for Java</name>
<description>EG xap-sdk v1.0.0</description>
<description>EG xap-sdk v1.1.0-SNAPSHOT</description>
<url>https://github.com/ExpediaGroup/test-sdk</url>
<inceptionYear>2022</inceptionYear>
<packaging>jar</packaging>
Expand Down Expand Up @@ -82,7 +82,7 @@
<kotlin.version>2.0.21</kotlin.version>
<kotlinx.coroutines.version>1.9.0</kotlinx.coroutines.version>
<ktor.version>2.3.13</ktor.version>
<kotlin-atomic.version>0.26.0</kotlin-atomic.version>
<kotlin-atomic.version>0.26.1</kotlin-atomic.version>
<slf4j.version>2.0.16</slf4j.version>
<maven.nexus-staging.plugin.version>1.7.0</maven.nexus-staging.plugin.version>
<maven.gpg.plugin.version>3.2.7</maven.gpg.plugin.version>
Expand Down Expand Up @@ -131,7 +131,7 @@
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.18.1</version>
<version>2.18.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -153,7 +153,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.18.1</version>
<version>2.18.2</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -744,13 +744,13 @@
<dependency>
<groupId>com.ebay.ejmask</groupId>
<artifactId>ejmask-api</artifactId>
<version>1.0.3</version>
<version>1.2.1</version>
</dependency>

<dependency>
<groupId>com.ebay.ejmask</groupId>
<artifactId>ejmask-extensions</artifactId>
<version>1.0.3</version>
<version>1.2.1</version>
</dependency>
</dependencies>

Expand Down
47 changes: 47 additions & 0 deletions code/src/main/kotlin/com/expediagroup/sdk/xap/client/XapClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ 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
Expand Down Expand Up @@ -154,6 +157,50 @@ class XapClient private constructor(clientConfiguration: XapClientConfiguration)
}
}

/**
*
* 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<ActivityDetailsResponse> = execute<Nothing, ActivityDetailsResponse>(operation)

/**
*
* The Activity Details API provides detailed information about one selected activity.
* @param operation [GetActivityDetailsOperation]
* @throws ExpediaGroupApiActivitiesErrorsException
* @throws ExpediaGroupApiAPIMErrorException
* @throws ExpediaGroupApiException
* @return a [CompletableFuture<Response>] object with a body of type ActivityDetailsResponse
*/
fun executeAsync(operation: GetActivityDetailsOperation): CompletableFuture<Response<ActivityDetailsResponse>> = executeAsync<Nothing, ActivityDetailsResponse>(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<ActivityListingsResponse> = execute<Nothing, ActivityListingsResponse>(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<Response>] object with a body of type ActivityListingsResponse
*/
fun executeAsync(operation: GetActivityListingsOperation): CompletableFuture<Response<ActivityListingsResponse>> = executeAsync<Nothing, ActivityListingsResponse>(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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
/*
* 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

/**
* Address information
* @param address1 Street Number, Street Name, or PO Box.
* @param city The city
* @param country 3-letter code for the country.
* @param address2 Apartment, Floor, Suite, Bldg
* @param suite Suite/apartment number
* @param province The state or province.
* @param postalCode Zip/postal code.
*/
data class ActivitiesAddress(
// 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
@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
) {
companion object {
@JvmStatic
fun builder() = Builder()
}

class Builder(
private var address1: kotlin.String? = null,
private var city: kotlin.String? = null,
private var country: kotlin.String? = null,
private var address2: kotlin.String? = null,
private var suite: kotlin.String? = null,
private var province: kotlin.String? = null,
private var postalCode: kotlin.String? = null
) {
fun address1(address1: kotlin.String) = apply { this.address1 = address1 }

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

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

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

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

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

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

fun build(): ActivitiesAddress {
val instance =
ActivitiesAddress(
address1 = address1!!,
city = city!!,
country = country!!,
address2 = address2,
suite = suite,
province = province,
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() =
Builder(
address1 = address1!!,
city = city!!,
country = country!!,
address2 = address2,
suite = suite,
province = province,
postalCode = postalCode
)
}
Loading

0 comments on commit 7d954f5

Please sign in to comment.