Skip to content

Commit 7073bd8

Browse files
committed
chore: update date-time types from OffsetDateTime to LocalDateTime in various models
1 parent 234d23d commit 7073bd8

File tree

10 files changed

+111
-237
lines changed

10 files changed

+111
-237
lines changed

.github/workflows/generate-publish-sdk.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
5959
run: |
6060
if [ -z "${{ github.event.inputs.snapshot }}" ]; then
61-
gradle publishToSonatype closeAndReleaseSonatypeStagingRepository
61+
gradle publishSnapshot
6262
else
6363
exit 1
6464
gradle publishToSonatype closeAndReleaseSonatypeStagingRepository

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.OffsetDateTime? = null,
39+
val freeCancellationEndDateTime: java.time.LocalDateTime? = 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.OffsetDateTime? = null,
54+
private var freeCancellationEndDateTime: java.time.LocalDateTime? = 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.OffsetDateTime?) = apply { this.freeCancellationEndDateTime = freeCancellationEndDateTime }
62+
fun freeCancellationEndDateTime(freeCancellationEndDateTime: java.time.LocalDateTime?) = 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.OffsetDateTime,
32+
val dateTime: java.time.LocalDateTime,
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.OffsetDateTime? = null,
61+
private var dateTime: java.time.LocalDateTime? = 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.OffsetDateTime) = apply { this.dateTime = dateTime }
66+
fun dateTime(dateTime: java.time.LocalDateTime) = 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.OffsetDateTime? = null,
39+
val freeCancellationEndDateTime: java.time.LocalDateTime? = 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.OffsetDateTime? = null,
57+
private var freeCancellationEndDateTime: java.time.LocalDateTime? = 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.OffsetDateTime?) = apply { this.freeCancellationEndDateTime = freeCancellationEndDateTime }
65+
fun freeCancellationEndDateTime(freeCancellationEndDateTime: java.time.LocalDateTime?) = 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.OffsetDateTime,
28+
val startDateTime: java.time.LocalDateTime,
2929
// The time of this non-cancellable window ends
3030
@JsonProperty("EndDateTime")
31-
val endDateTime: java.time.OffsetDateTime,
31+
val endDateTime: java.time.LocalDateTime,
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.OffsetDateTime? = null,
46-
private var endDateTime: java.time.OffsetDateTime? = null,
45+
private var startDateTime: java.time.LocalDateTime? = null,
46+
private var endDateTime: java.time.LocalDateTime? = null,
4747
) {
48-
fun startDateTime(startDateTime: java.time.OffsetDateTime) = apply { this.startDateTime = startDateTime }
48+
fun startDateTime(startDateTime: java.time.LocalDateTime) = apply { this.startDateTime = startDateTime }
4949

50-
fun endDateTime(endDateTime: java.time.OffsetDateTime) = apply { this.endDateTime = endDateTime }
50+
fun endDateTime(endDateTime: java.time.LocalDateTime) = 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.OffsetDateTime,
32+
val startDateTime: java.time.LocalDateTime,
3333
// The time when this penalty window ends
3434
@JsonProperty("EndDateTime")
35-
val endDateTime: java.time.OffsetDateTime,
35+
val endDateTime: java.time.LocalDateTime,
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.OffsetDateTime? = null,
53-
private var endDateTime: java.time.OffsetDateTime? = null,
52+
private var startDateTime: java.time.LocalDateTime? = null,
53+
private var endDateTime: java.time.LocalDateTime? = null,
5454
) {
5555
fun penalty(penalty: PenaltyType) = apply { this.penalty = penalty }
5656

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

59-
fun endDateTime(endDateTime: java.time.OffsetDateTime) = apply { this.endDateTime = endDateTime }
59+
fun endDateTime(endDateTime: java.time.LocalDateTime) = 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.OffsetDateTime,
34+
val dateTime: java.time.LocalDateTime,
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.OffsetDateTime? = null,
58+
private var dateTime: java.time.LocalDateTime? = 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.OffsetDateTime) = apply { this.dateTime = dateTime }
64+
fun dateTime(dateTime: java.time.LocalDateTime) = 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.OffsetDateTime,
64-
val dropOffTime: java.time.OffsetDateTime,
63+
val pickupTime: java.time.LocalDateTime,
64+
val dropOffTime: java.time.LocalDateTime,
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.OffsetDateTime? = null,
175-
@JsonProperty("dropOffTime") private var dropOffTime: java.time.OffsetDateTime? = null,
174+
@JsonProperty("pickupTime") private var pickupTime: java.time.LocalDateTime? = null,
175+
@JsonProperty("dropOffTime") private var dropOffTime: java.time.LocalDateTime? = 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.OffsetDateTime) = apply { this.pickupTime = pickupTime }
260+
fun pickupTime(pickupTime: java.time.LocalDateTime) = 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.OffsetDateTime) = apply { this.dropOffTime = dropOffTime }
265+
fun dropOffTime(dropOffTime: java.time.LocalDateTime) = 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: 40 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -614,117 +614,54 @@ data class GetLodgingListingsOperationParams(
614614
*/
615615
fun sortOrder(sortOrder: GetLodgingListingsOperationParams.SortOrder) = apply { this.sortOrder = sortOrder }
616616

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 }
621-
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 }
630-
631-
/**
632-
* @param room2Adults Specifies the number of adults staying in second room.
633-
*/
634-
fun room2Adults(room2Adults: kotlin.Long) = apply { this.room2Adults = room2Adults }
635-
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 }
644-
645-
/**
646-
* @param room3Adults Specifies the number of adults staying in third room.
647-
*/
648-
fun room3Adults(room3Adults: kotlin.Long) = apply { this.room3Adults = room3Adults }
649-
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 }
658-
659-
/**
660-
* @param room4Adults Specifies the number of adults staying in fourth room.
661-
*/
662-
fun room4Adults(room4Adults: kotlin.Long) = apply { this.room4Adults = room4Adults }
663-
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 }
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+
}
672624

673-
/**
674-
* @param room5Adults Specifies the number of adults staying in fifth room.
675-
*/
676-
fun room5Adults(room5Adults: kotlin.Long) = apply { this.room5Adults = room5Adults }
625+
rooms.elementAtOrNull(0)?.let {
626+
this.room1Adults = it.adults
627+
this.room1ChildAges = it.childAges?.map { item -> item.toString() }
628+
}
677629

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 }
630+
rooms.elementAtOrNull(1)?.let {
631+
this.room2Adults = it.adults
632+
this.room2ChildAges = it.childAges?.map { item -> item.toString() }
633+
}
686634

687-
/**
688-
* @param room6Adults Specifies the number of adults staying in sixth room.
689-
*/
690-
fun room6Adults(room6Adults: kotlin.Long) = apply { this.room6Adults = room6Adults }
635+
rooms.elementAtOrNull(2)?.let {
636+
this.room3Adults = it.adults
637+
this.room3ChildAges = it.childAges?.map { item -> item.toString() }
638+
}
691639

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 }
640+
rooms.elementAtOrNull(3)?.let {
641+
this.room4Adults = it.adults
642+
this.room4ChildAges = it.childAges?.map { item -> item.toString() }
643+
}
700644

701-
/**
702-
* @param room7Adults Specifies the number of adults staying in seventh room.
703-
*/
704-
fun room7Adults(room7Adults: kotlin.Long) = apply { this.room7Adults = room7Adults }
645+
rooms.elementAtOrNull(4)?.let {
646+
this.room5Adults = it.adults
647+
this.room5ChildAges = it.childAges?.map { item -> item.toString() }
648+
}
705649

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 }
650+
rooms.elementAtOrNull(5)?.let {
651+
this.room6Adults = it.adults
652+
this.room6ChildAges = it.childAges?.map { item -> item.toString() }
653+
}
714654

715-
/**
716-
* @param room8Adults Specifies the number of adults staying in eighth room.
717-
*/
718-
fun room8Adults(room8Adults: kotlin.Long) = apply { this.room8Adults = room8Adults }
655+
rooms.elementAtOrNull(6)?.let {
656+
this.room7Adults = it.adults
657+
this.room7ChildAges = it.childAges?.map { item -> item.toString() }
658+
}
719659

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 }
660+
rooms.elementAtOrNull(7)?.let {
661+
this.room8Adults = it.adults
662+
this.room8ChildAges = it.childAges?.map { item -> item.toString() }
663+
}
664+
}
728665

729666
fun build(): GetLodgingListingsOperationParams {
730667
val params =

0 commit comments

Comments
 (0)