Skip to content

Commit

Permalink
adding support for $iata_carrier_code for $booking complex field (#111)
Browse files Browse the repository at this point in the history
* adding support for iata_carrier_code

* correcting the version
  • Loading branch information
rsomavarapu-sift authored Sep 26, 2024
1 parent df6ba5f commit c41008a
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGES.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
3.16.0 (2024-09-26)
=================
- Added support for `$iata_carrier_code` to the `$booking` complex field

3.15.2 (2024-07-11)
=================
- Added support for `$guest_user_id` and `$guest_booking_reference_id` fields to `$guest` complex field for `$create_order` and `$update_order` events
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Java 1.7 or later.
<dependency>
<groupId>com.siftscience</groupId>
<artifactId>sift-java</artifactId>
<version>3.15.2</version>
<version>3.16.0</version>
</dependency>
```
### Gradle
```
dependencies {
compile 'com.siftscience:sift-java:3.15.2'
compile 'com.siftscience:sift-java:3.16.0'
}
```
### Other
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'signing'
apply plugin: 'java-library-distribution'

group = 'com.siftscience'
version = '3.15.2'
version = '3.16.0'

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/siftscience/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public class Constants {

public static final String API_VERSION = "v205";
public static final String LIB_VERSION = "3.15.2";
public static final String LIB_VERSION = "3.16.0";
public static final String USER_AGENT_HEADER = String.format("SiftScience/%s sift-java/%s", API_VERSION, LIB_VERSION);
}
10 changes: 10 additions & 0 deletions src/main/java/com/siftscience/model/Booking.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class Booking {
@Expose @SerializedName("$price") private Long price;
@Expose @SerializedName("$currency_code") private String currencyCode;
@Expose @SerializedName("$quantity") private Long quantity;
@Expose @SerializedName("$iata_carrier_code") private String iataCarrierCode;
@Expose @SerializedName("$guests") private List<Guest> guests;
@Expose @SerializedName("$segments") private List<Segment> segments;
@Expose @SerializedName("$room_type") private String roomType;
Expand Down Expand Up @@ -85,6 +86,15 @@ public Booking setQuantity(Long quantity) {
return this;
}

public String getIataCarrierCode() {
return iataCarrierCode;
}

public Booking setIataCarrierCode(String iataCarrierCode) {
this.iataCarrierCode = iataCarrierCode;
return this;
}

public List<Guest> getGuests() {
return guests;
}
Expand Down
1 change: 1 addition & 0 deletions src/test/java/com/siftscience/CreateOrderEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void testCreateOrderEventWithBookings() throws JSONException, IOException
" ],\n" +
" \"$price\": 49900000,\n" +
" \"$currency_code\": \"USD\",\n" +
" \"$iata_carrier_code\": \"AS\",\n" +
" \"$quantity\": 1,\n" +
" \"$tags\": [\n" +
" \"team-123\",\n" +
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/siftscience/SiftRequestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void testUserAgentHeader() throws Exception {

// Verify the request.
RecordedRequest recordedRequest = server.takeRequest();
Assert.assertEquals("SiftScience/v205 sift-java/3.15.2", recordedRequest.getHeader("User-Agent"));
Assert.assertEquals("SiftScience/v205 sift-java/3.16.0", recordedRequest.getHeader("User-Agent"));
}

@Test
Expand Down
1 change: 1 addition & 0 deletions src/test/java/com/siftscience/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ static Booking sampleBooking() {
.setSegments(segments)
.setPrice(49900000L)
.setCurrencyCode("USD")
.setIataCarrierCode("AS")
.setTags(sampleTags3())
.setQuantity(1L);
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/com/siftscience/UpdateOrderEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void testUpdateOrderEventWithBookings() throws JSONException, IOException
" ],\n" +
" \"$price\": 49900000,\n" +
" \"$currency_code\": \"USD\",\n" +
" \"$iata_carrier_code\": \"AS\",\n" +
" \"$quantity\": 1,\n" +
" \"$tags\": [\n" +
" \"team-123\",\n" +
Expand Down Expand Up @@ -331,6 +332,7 @@ public void testUpdateOrderEventWithBookingsShippingCarrierIsNull() throws IOExc
" ],\n" +
" \"$price\": 49900000,\n" +
" \"$currency_code\": \"USD\",\n" +
" \"$iata_carrier_code\": \"AS\",\n" +
" \"$quantity\": 1,\n" +
" \"$tags\": [\n" +
" \"team-123\",\n" +
Expand Down Expand Up @@ -497,6 +499,7 @@ public void testUpdateOrderEventWithBookingsShippingTrackingNumberIsNull() throw
" ],\n" +
" \"$price\": 49900000,\n" +
" \"$currency_code\": \"USD\",\n" +
" \"$iata_carrier_code\": \"AS\",\n" +
" \"$quantity\": 1,\n" +
" \"$tags\": [\n" +
" \"team-123\",\n" +
Expand Down

0 comments on commit c41008a

Please sign in to comment.