Skip to content

Commit afb1bae

Browse files
committed
chore: update build configuration and add publishing tasks
1 parent 458ba01 commit afb1bae

File tree

11 files changed

+247
-117
lines changed

11 files changed

+247
-117
lines changed

generator/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,14 @@ openApiGenerate {
5050

5151
globalProperties.put("supportingFiles", "Room.kt")
5252
}
53+
54+
tasks.named("openApiGenerate").configure {
55+
doLast {
56+
exec {
57+
commandLine(
58+
"../gradlew ktlintFormat".split(" ")
59+
)
60+
workingDir = File("$rootDir/xap-sdk").absoluteFile
61+
}
62+
}
63+
}

xap-sdk/build.gradle.kts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ repositories {
1515
}
1616
}
1717

18-
1918
dependencies {
2019
testImplementation(kotlin("test"))
2120
api("com.expediagroup:expediagroup-sdk-rest:0.0.1-beta-SNAPSHOT")
@@ -79,9 +78,3 @@ tasks.register("publishSnapshots") {
7978
apply("$rootDir/gradle-tasks/publish.gradle.kts")
8079
apply("$rootDir/gradle-tasks/signing.gradle.kts")
8180
apply("$rootDir/gradle-tasks/snapshot.gradle.kts")
82-
tasks.register("testVersion") {
83-
println("Version: ${project.version}")
84-
println(project.version)
85-
println("Version: ${project.property("VERSION")}")
86-
println("Version: ${project.findProperty("SNAPSHOT_VERSION")}")
87-
}

xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/ActivitiesCancellationPolicy.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ data class ActivitiesCancellationPolicy(
3636
val freeCancellationMinHours: kotlin.Int? = null,
3737
// 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.
3838
@JsonProperty("FreeCancellationEndDateTime")
39-
val freeCancellationEndDateTime: java.time.LocalDateTime? = null,
39+
val freeCancellationEndDateTime: java.time.OffsetDateTime? = null,
4040
) {
4141
init {
4242
require(freeCancellation != null) { "freeCancellation must not be null" }
@@ -51,15 +51,15 @@ data class ActivitiesCancellationPolicy(
5151
private var freeCancellation: kotlin.Boolean? = null,
5252
private var cancelPolicyDescription: kotlin.String? = null,
5353
private var freeCancellationMinHours: kotlin.Int? = null,
54-
private var freeCancellationEndDateTime: java.time.LocalDateTime? = null,
54+
private var freeCancellationEndDateTime: java.time.OffsetDateTime? = null,
5555
) {
5656
fun freeCancellation(freeCancellation: kotlin.Boolean) = apply { this.freeCancellation = freeCancellation }
5757

5858
fun cancelPolicyDescription(cancelPolicyDescription: kotlin.String?) = apply { this.cancelPolicyDescription = cancelPolicyDescription }
5959

6060
fun freeCancellationMinHours(freeCancellationMinHours: kotlin.Int?) = apply { this.freeCancellationMinHours = freeCancellationMinHours }
6161

62-
fun freeCancellationEndDateTime(freeCancellationEndDateTime: java.time.LocalDateTime?) = apply { this.freeCancellationEndDateTime = freeCancellationEndDateTime }
62+
fun freeCancellationEndDateTime(freeCancellationEndDateTime: java.time.OffsetDateTime?) = apply { this.freeCancellationEndDateTime = freeCancellationEndDateTime }
6363

6464
fun build(): ActivitiesCancellationPolicy {
6565
val instance =

xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/AvailableTimeSlot.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import com.fasterxml.jackson.annotation.JsonProperty
2929
data class AvailableTimeSlot(
3030
// The date and time when the activity happens.
3131
@JsonProperty("DateTime")
32-
val dateTime: java.time.LocalDateTime,
32+
val dateTime: java.time.OffsetDateTime,
3333
// Indicates whether the activity is an all-day activity.
3434
@JsonProperty("AllDayActivity")
3535
val allDayActivity: kotlin.Boolean,
@@ -58,12 +58,12 @@ data class AvailableTimeSlot(
5858
}
5959

6060
class Builder(
61-
private var dateTime: java.time.LocalDateTime? = null,
61+
private var dateTime: java.time.OffsetDateTime? = null,
6262
private var allDayActivity: kotlin.Boolean? = null,
6363
private var cancellationPolicy: ActivitiesCancellationPolicy? = null,
6464
private var tickets: kotlin.collections.List<Ticket>? = null,
6565
) {
66-
fun dateTime(dateTime: java.time.LocalDateTime) = apply { this.dateTime = dateTime }
66+
fun dateTime(dateTime: java.time.OffsetDateTime) = apply { this.dateTime = dateTime }
6767

6868
fun allDayActivity(allDayActivity: kotlin.Boolean) = apply { this.allDayActivity = allDayActivity }
6969

xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/CarsCancellationPolicy.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ data class CarsCancellationPolicy(
3636
val freeCancellation: kotlin.Boolean? = null,
3737
// Indicates the latest time that the car can be cancelled for free.
3838
@JsonProperty("FreeCancellationEndDateTime")
39-
val freeCancellationEndDateTime: java.time.LocalDateTime? = null,
39+
val freeCancellationEndDateTime: java.time.OffsetDateTime? = null,
4040
// Container for penalty rules
4141
@JsonProperty("PenaltyRules")
4242
val penaltyRules: kotlin.collections.List<PenaltyRule>? = null,
@@ -54,15 +54,15 @@ data class CarsCancellationPolicy(
5454
class Builder(
5555
private var cancellable: kotlin.Boolean? = null,
5656
private var freeCancellation: kotlin.Boolean? = null,
57-
private var freeCancellationEndDateTime: java.time.LocalDateTime? = null,
57+
private var freeCancellationEndDateTime: java.time.OffsetDateTime? = null,
5858
private var penaltyRules: kotlin.collections.List<PenaltyRule>? = null,
5959
private var nonCancellableDateTimeRange: NonCancellableDateTimeRange? = null,
6060
) {
6161
fun cancellable(cancellable: kotlin.Boolean?) = apply { this.cancellable = cancellable }
6262

6363
fun freeCancellation(freeCancellation: kotlin.Boolean?) = apply { this.freeCancellation = freeCancellation }
6464

65-
fun freeCancellationEndDateTime(freeCancellationEndDateTime: java.time.LocalDateTime?) = apply { this.freeCancellationEndDateTime = freeCancellationEndDateTime }
65+
fun freeCancellationEndDateTime(freeCancellationEndDateTime: java.time.OffsetDateTime?) = apply { this.freeCancellationEndDateTime = freeCancellationEndDateTime }
6666

6767
fun penaltyRules(penaltyRules: kotlin.collections.List<PenaltyRule>?) = apply { this.penaltyRules = penaltyRules }
6868

xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/NonCancellableDateTimeRange.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ import com.fasterxml.jackson.annotation.JsonProperty
2525
data class NonCancellableDateTimeRange(
2626
// The time of this non-cancellable window starts
2727
@JsonProperty("StartDateTime")
28-
val startDateTime: java.time.LocalDateTime,
28+
val startDateTime: java.time.OffsetDateTime,
2929
// The time of this non-cancellable window ends
3030
@JsonProperty("EndDateTime")
31-
val endDateTime: java.time.LocalDateTime,
31+
val endDateTime: java.time.OffsetDateTime,
3232
) {
3333
init {
3434
require(startDateTime != null) { "startDateTime must not be null" }
@@ -42,12 +42,12 @@ data class NonCancellableDateTimeRange(
4242
}
4343

4444
class Builder(
45-
private var startDateTime: java.time.LocalDateTime? = null,
46-
private var endDateTime: java.time.LocalDateTime? = null,
45+
private var startDateTime: java.time.OffsetDateTime? = null,
46+
private var endDateTime: java.time.OffsetDateTime? = null,
4747
) {
48-
fun startDateTime(startDateTime: java.time.LocalDateTime) = apply { this.startDateTime = startDateTime }
48+
fun startDateTime(startDateTime: java.time.OffsetDateTime) = apply { this.startDateTime = startDateTime }
4949

50-
fun endDateTime(endDateTime: java.time.LocalDateTime) = apply { this.endDateTime = endDateTime }
50+
fun endDateTime(endDateTime: java.time.OffsetDateTime) = apply { this.endDateTime = endDateTime }
5151

5252
fun build(): NonCancellableDateTimeRange {
5353
val instance =

xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/PenaltyRule.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ data class PenaltyRule(
2929
val penalty: PenaltyType,
3030
// The time when this penalty window starts
3131
@JsonProperty("StartDateTime")
32-
val startDateTime: java.time.LocalDateTime,
32+
val startDateTime: java.time.OffsetDateTime,
3333
// The time when this penalty window ends
3434
@JsonProperty("EndDateTime")
35-
val endDateTime: java.time.LocalDateTime,
35+
val endDateTime: java.time.OffsetDateTime,
3636
) {
3737
init {
3838
require(penalty != null) { "penalty must not be null" }
@@ -49,14 +49,14 @@ data class PenaltyRule(
4949

5050
class Builder(
5151
private var penalty: PenaltyType? = null,
52-
private var startDateTime: java.time.LocalDateTime? = null,
53-
private var endDateTime: java.time.LocalDateTime? = null,
52+
private var startDateTime: java.time.OffsetDateTime? = null,
53+
private var endDateTime: java.time.OffsetDateTime? = null,
5454
) {
5555
fun penalty(penalty: PenaltyType) = apply { this.penalty = penalty }
5656

57-
fun startDateTime(startDateTime: java.time.LocalDateTime) = apply { this.startDateTime = startDateTime }
57+
fun startDateTime(startDateTime: java.time.OffsetDateTime) = apply { this.startDateTime = startDateTime }
5858

59-
fun endDateTime(endDateTime: java.time.LocalDateTime) = apply { this.endDateTime = endDateTime }
59+
fun endDateTime(endDateTime: java.time.OffsetDateTime) = apply { this.endDateTime = endDateTime }
6060

6161
fun build(): PenaltyRule {
6262
val instance =

xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/models/VendorLocationDetails.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import com.fasterxml.jackson.annotation.JsonProperty
3131
data class VendorLocationDetails(
3232
// Pickup date and time.
3333
@JsonProperty("DateTime")
34-
val dateTime: java.time.LocalDateTime,
34+
val dateTime: java.time.OffsetDateTime,
3535
@JsonProperty("Location")
3636
val location: CarsLocation,
3737
// The category of shuttle from the terminal to the rental car counter. Please find list of Shuttle Categories in the Related Links Section below.
@@ -55,13 +55,13 @@ data class VendorLocationDetails(
5555
}
5656

5757
class Builder(
58-
private var dateTime: java.time.LocalDateTime? = null,
58+
private var dateTime: java.time.OffsetDateTime? = null,
5959
private var location: CarsLocation? = null,
6060
private var shuttleCategory: kotlin.String? = null,
6161
private var distance: CarsDistance? = null,
6262
private var openSchedule: kotlin.collections.List<DateTimePeriod>? = null,
6363
) {
64-
fun dateTime(dateTime: java.time.LocalDateTime) = apply { this.dateTime = dateTime }
64+
fun dateTime(dateTime: java.time.OffsetDateTime) = apply { this.dateTime = dateTime }
6565

6666
fun location(location: CarsLocation) = apply { this.location = location }
6767

xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetCarsListingsOperationParams.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ data class GetCarsListingsOperationParams(
6060
null,
6161
val dropOffRadius: kotlin.Int? =
6262
null,
63-
val pickupTime: java.time.LocalDateTime,
64-
val dropOffTime: java.time.LocalDateTime,
63+
val pickupTime: java.time.OffsetDateTime,
64+
val dropOffTime: java.time.OffsetDateTime,
6565
val sortType: GetCarsListingsOperationParams.SortType? =
6666
null,
6767
val sortOrder: GetCarsListingsOperationParams.SortOrder? =
@@ -171,8 +171,8 @@ data class GetCarsListingsOperationParams(
171171
@JsonProperty("dropOff.address") private var dropOffAddress: kotlin.String? = null,
172172
@JsonProperty("dropOff.geoLocation") private var dropOffGeoLocation: kotlin.String? = null,
173173
@JsonProperty("dropOff.radius") private var dropOffRadius: kotlin.Int? = null,
174-
@JsonProperty("pickupTime") private var pickupTime: java.time.LocalDateTime? = null,
175-
@JsonProperty("dropOffTime") private var dropOffTime: java.time.LocalDateTime? = null,
174+
@JsonProperty("pickupTime") private var pickupTime: java.time.OffsetDateTime? = null,
175+
@JsonProperty("dropOffTime") private var dropOffTime: java.time.OffsetDateTime? = null,
176176
@JsonProperty("sortType") private var sortType: GetCarsListingsOperationParams.SortType? = null,
177177
@JsonProperty("sortOrder") private var sortOrder: GetCarsListingsOperationParams.SortOrder? = null,
178178
@JsonProperty("limit") private var limit: kotlin.Int? = null,
@@ -257,12 +257,12 @@ data class GetCarsListingsOperationParams(
257257
/**
258258
* @param pickupTime Requested car pickup date and time.Date should be ISO8601 Date format.The default TIME is 10:30:00.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.)
259259
*/
260-
fun pickupTime(pickupTime: java.time.LocalDateTime) = apply { this.pickupTime = pickupTime }
260+
fun pickupTime(pickupTime: java.time.OffsetDateTime) = apply { this.pickupTime = pickupTime }
261261

262262
/**
263263
* @param dropOffTime 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.Note: The dropOffTime must be at least 2 hours later than the pickupTime for the request to be valid.
264264
*/
265-
fun dropOffTime(dropOffTime: java.time.LocalDateTime) = apply { this.dropOffTime = dropOffTime }
265+
fun dropOffTime(dropOffTime: java.time.OffsetDateTime) = apply { this.dropOffTime = dropOffTime }
266266

267267
/**
268268
* @param sortType Method of sorting the car search results.Supported value: Price.If no value is present a sort by 'price' will be assumed.

xap-sdk/src/main/kotlin/com/expediagroup/sdk/xap/operations/GetLodgingListingsOperationParams.kt

Lines changed: 103 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -614,54 +614,117 @@ data class GetLodgingListingsOperationParams(
614614
*/
615615
fun sortOrder(sortOrder: GetLodgingListingsOperationParams.SortOrder) = apply { this.sortOrder = sortOrder }
616616

617-
fun rooms(rooms: List<com.expediagroup.sdk.xap.models.Room>) =
618-
apply {
619-
if (rooms.size > 8) {
620-
throw com.expediagroup.sdk.rest.exception.client.PropertyConstraintViolationException(
621-
constraintViolations = listOf("rooms: size must be between 0 and 8"),
622-
)
623-
}
617+
/**
618+
* @param room1Adults Specifies the number of adults staying in a specific room. Default value is one room with 2 adults. Example: `room1.adults` is used to specify the number of adults in the first room.
619+
*/
620+
fun room1Adults(room1Adults: kotlin.Long) = apply { this.room1Adults = room1Adults }
624621

625-
rooms.elementAtOrNull(0)?.let {
626-
this.room1Adults = it.adults
627-
this.room1ChildAges = it.childAges?.map { item -> item.toString() }
628-
}
622+
/**
623+
* @param room1ChildAges Comma-separated list that specifies the age(s) for each of the children in each of the rooms. Example: `room2.childAges=1,3` means two children (1-year old and 3-year old) are staying in room #2. Children must be accompanied by an adult.
624+
*/
625+
fun room1ChildAges(
626+
room1ChildAges: kotlin.collections.List<
627+
kotlin.String,
628+
>,
629+
) = apply { this.room1ChildAges = room1ChildAges }
629630

630-
rooms.elementAtOrNull(1)?.let {
631-
this.room2Adults = it.adults
632-
this.room2ChildAges = it.childAges?.map { item -> item.toString() }
633-
}
631+
/**
632+
* @param room2Adults Specifies the number of adults staying in second room.
633+
*/
634+
fun room2Adults(room2Adults: kotlin.Long) = apply { this.room2Adults = room2Adults }
634635

635-
rooms.elementAtOrNull(2)?.let {
636-
this.room3Adults = it.adults
637-
this.room3ChildAges = it.childAges?.map { item -> item.toString() }
638-
}
636+
/**
637+
* @param room2ChildAges Comma-separated list that specifies the age(s) for each of the children in second room.
638+
*/
639+
fun room2ChildAges(
640+
room2ChildAges: kotlin.collections.List<
641+
kotlin.String,
642+
>,
643+
) = apply { this.room2ChildAges = room2ChildAges }
639644

640-
rooms.elementAtOrNull(3)?.let {
641-
this.room4Adults = it.adults
642-
this.room4ChildAges = it.childAges?.map { item -> item.toString() }
643-
}
645+
/**
646+
* @param room3Adults Specifies the number of adults staying in third room.
647+
*/
648+
fun room3Adults(room3Adults: kotlin.Long) = apply { this.room3Adults = room3Adults }
644649

645-
rooms.elementAtOrNull(4)?.let {
646-
this.room5Adults = it.adults
647-
this.room5ChildAges = it.childAges?.map { item -> item.toString() }
648-
}
650+
/**
651+
* @param room3ChildAges Comma-separated list that specifies the age(s) for each of the children in third room.
652+
*/
653+
fun room3ChildAges(
654+
room3ChildAges: kotlin.collections.List<
655+
kotlin.String,
656+
>,
657+
) = apply { this.room3ChildAges = room3ChildAges }
649658

650-
rooms.elementAtOrNull(5)?.let {
651-
this.room6Adults = it.adults
652-
this.room6ChildAges = it.childAges?.map { item -> item.toString() }
653-
}
659+
/**
660+
* @param room4Adults Specifies the number of adults staying in fourth room.
661+
*/
662+
fun room4Adults(room4Adults: kotlin.Long) = apply { this.room4Adults = room4Adults }
654663

655-
rooms.elementAtOrNull(6)?.let {
656-
this.room7Adults = it.adults
657-
this.room7ChildAges = it.childAges?.map { item -> item.toString() }
658-
}
664+
/**
665+
* @param room4ChildAges Comma-separated list that specifies the age(s) for each of the children in fourth room.
666+
*/
667+
fun room4ChildAges(
668+
room4ChildAges: kotlin.collections.List<
669+
kotlin.String,
670+
>,
671+
) = apply { this.room4ChildAges = room4ChildAges }
659672

660-
rooms.elementAtOrNull(7)?.let {
661-
this.room8Adults = it.adults
662-
this.room8ChildAges = it.childAges?.map { item -> item.toString() }
663-
}
664-
}
673+
/**
674+
* @param room5Adults Specifies the number of adults staying in fifth room.
675+
*/
676+
fun room5Adults(room5Adults: kotlin.Long) = apply { this.room5Adults = room5Adults }
677+
678+
/**
679+
* @param room5ChildAges Comma-separated list that specifies the age(s) for each of the children in fifth room.
680+
*/
681+
fun room5ChildAges(
682+
room5ChildAges: kotlin.collections.List<
683+
kotlin.String,
684+
>,
685+
) = apply { this.room5ChildAges = room5ChildAges }
686+
687+
/**
688+
* @param room6Adults Specifies the number of adults staying in sixth room.
689+
*/
690+
fun room6Adults(room6Adults: kotlin.Long) = apply { this.room6Adults = room6Adults }
691+
692+
/**
693+
* @param room6ChildAges Comma-separated list that specifies the age(s) for each of the children in sixth room.
694+
*/
695+
fun room6ChildAges(
696+
room6ChildAges: kotlin.collections.List<
697+
kotlin.String,
698+
>,
699+
) = apply { this.room6ChildAges = room6ChildAges }
700+
701+
/**
702+
* @param room7Adults Specifies the number of adults staying in seventh room.
703+
*/
704+
fun room7Adults(room7Adults: kotlin.Long) = apply { this.room7Adults = room7Adults }
705+
706+
/**
707+
* @param room7ChildAges Comma-separated list that specifies the age(s) for each of the children in seventh room.
708+
*/
709+
fun room7ChildAges(
710+
room7ChildAges: kotlin.collections.List<
711+
kotlin.String,
712+
>,
713+
) = apply { this.room7ChildAges = room7ChildAges }
714+
715+
/**
716+
* @param room8Adults Specifies the number of adults staying in eighth room.
717+
*/
718+
fun room8Adults(room8Adults: kotlin.Long) = apply { this.room8Adults = room8Adults }
719+
720+
/**
721+
* @param room8ChildAges Comma-separated list that specifies the age(s) for each of the children in eighth room.
722+
*/
723+
fun room8ChildAges(
724+
room8ChildAges: kotlin.collections.List<
725+
kotlin.String,
726+
>,
727+
) = apply { this.room8ChildAges = room8ChildAges }
665728

666729
fun build(): GetLodgingListingsOperationParams {
667730
val params =

0 commit comments

Comments
 (0)