Skip to content

Commit 2066ff0

Browse files
committed
[Gradle Release Plugin] - pre tag commit: 'v0.5.2'.
1 parent 80e497b commit 2066ff0

27 files changed

+729
-212
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
v0.5.2 - TBD
1+
v0.5.2 - 7/11/2016
22
------------
3+
### Added
4+
- [Issue #22](https://github.com/uber/rides-java-sdk/issues/22) Support for Uber Pool
35

46
v0.5.1 - 6/7/2016
57
-----------------

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ This SDK helps your Java App make HTTP requests to the Uber Rides API.
66
### Installing
77

88
#### Before you begin
9-
Register your app in the [Uber developer dashboard](https://developer.uber.com/dashboard). Notice that the app gets a client ID, secret, and server token required for authenticating with the API.
9+
Register your app in the [Uber developer dashboard](https://developer.uber.com/dashboard). Notice that the app gets a client ID, secret, and server token required for authenticating with the API.
1010

1111
Note: Using Android? Be sure to checkout the [Uber Android SDK](github.com/uber/rides-android-sdk) in addition, which has native authentication mechanisms.
1212

1313
#### Gradle
1414
If using Gradle, add this to your project’s `build.gradle` file:
1515
```gradle
1616
dependencies {
17-
compile 'com.uber.sdk:rides:0.5.1'
17+
compile 'com.uber.sdk:rides:0.5.2'
1818
}
1919
```
2020

@@ -24,7 +24,7 @@ If using Maven, add this to your project's `pom.xml` file:
2424
<dependency>
2525
<groupId>com.uber.sdk</groupId>
2626
<artifactId>rides</artifactId>
27-
<version>0.5.1</version>
27+
<version>0.5.2</version>
2828
</dependency>
2929
```
3030

@@ -44,7 +44,7 @@ ServerTokenSession session = new ServerTokenSession(config));
4444
```
4545
#### Create a session using the OAuth 2 flow
4646
In an OAuth session, the app first asks the user to authorize and then exchanges the authorization code for an access token from Uber.
47-
Note: Make sure the redirect URI matches the callback URI in the developer dashboard for the app.
47+
Note: Make sure the redirect URI matches the callback URI in the developer dashboard for the app.
4848

4949
**Step 1**. Create an OAuth2Credentials object with your client ID, client secret, scopes, and a redirect callback URI to capture the user’s authorization code.
5050
```java
@@ -54,13 +54,13 @@ SessionConfiguration config = new SessionConfiguration.Builder()
5454
.setScopes(yourScopes)
5555
.setRedirectUri(redirectUri)
5656
.build();
57-
57+
5858
OAuth2Credentials credentials = new OAuth2Credentials.Builder()
5959
.setSessionConfiguration(config)
6060
.build();
61-
61+
6262
```
63-
**Step 2**. Navigate the user to the authorization URL from the OAuth2Credentials object.
63+
**Step 2**. Navigate the user to the authorization URL from the OAuth2Credentials object.
6464
```java
6565
String authorizationUrl = credentials.getAuthorizationUrl();
6666
```

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ group=com.uber.sdk
2424
groupId=com.uber.sdk
2525
artifactId=rides
2626
githubDownloadPrefix=https://github.com/uber/rides-java-sdk/releases/download/
27-
version=0.5.2-SNAPSHOT
27+
version=0.5.2

sdk/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ dependencies {
130130
testCompile 'org.assertj:assertj-core:1.7.1'
131131
testCompile 'org.hamcrest:hamcrest-library:1.3'
132132
testCompile 'org.mockito:mockito-core:1.10.8'
133-
testCompile 'com.squareup.okhttp:mockwebserver:2.5.0'
134133

135-
testCompile 'com.github.tomakehurst:wiremock:1.57'
134+
testCompile 'com.github.tomakehurst:wiremock:2.1.0-beta'
136135
}

sdk/src/main/java/com/uber/sdk/rides/client/UberRidesApi.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@
2424

2525
import com.squareup.moshi.Moshi;
2626
import com.uber.sdk.rides.client.internal.ApiInterceptor;
27-
import com.uber.sdk.rides.client.internal.PrimitiveAdapter;
2827
import com.uber.sdk.rides.client.internal.RefreshAuthenticator;
2928
import com.uber.sdk.rides.client.services.RidesService;
30-
31-
import javax.annotation.Nonnull;
32-
3329
import okhttp3.OkHttpClient;
3430
import okhttp3.logging.HttpLoggingInterceptor;
3531
import retrofit2.Retrofit;
3632
import retrofit2.converter.moshi.MoshiConverterFactory;
3733

34+
import javax.annotation.Nonnull;
35+
3836
public class UberRidesApi {
3937

4038
private final Retrofit retrofit;
@@ -128,7 +126,7 @@ OkHttpClient createClient(OkHttpClient client,
128126
}
129127

130128
Retrofit createRetrofit(OkHttpClient client, Session session) {
131-
Moshi moshi = new Moshi.Builder().add(new PrimitiveAdapter()).build();
129+
Moshi moshi = new Moshi.Builder().build();
132130

133131
return new Retrofit.Builder()
134132
.addConverterFactory(MoshiConverterFactory.create(moshi))

sdk/src/main/java/com/uber/sdk/rides/client/internal/PrimitiveAdapter.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

sdk/src/main/java/com/uber/sdk/rides/client/model/Driver.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@
2222

2323
package com.uber.sdk.rides.client.model;
2424

25+
import javax.annotation.Nullable;
26+
2527
/**
2628
* The vehicle's driver.
2729
*/
2830
public class Driver {
2931

3032
private String phone_number;
31-
private float rating;
33+
@Nullable
34+
private Float rating;
35+
@Nullable
3236
private String picture_url;
3337
private String name;
3438

@@ -42,13 +46,15 @@ public String getPhoneNumber() {
4246
/**
4347
* The driver's star rating out of 5 stars.
4448
*/
45-
public float getRating() {
49+
@Nullable
50+
public Float getRating() {
4651
return rating;
4752
}
4853

4954
/**
5055
* The URL to the photo of the driver.
5156
*/
57+
@Nullable
5258
public String getPictureUrl() {
5359
return picture_url;
5460
}

sdk/src/main/java/com/uber/sdk/rides/client/model/Location.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public class Location {
3131

3232
private float latitude;
3333
private float longitude;
34-
@Nullable private Integer bearing;
34+
@Nullable
35+
private Integer bearing;
3536

3637
/**
3738
* Location must be created with a non-null latitude and longitude.

sdk/src/main/java/com/uber/sdk/rides/client/model/PaymentMethod.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@
2222

2323
package com.uber.sdk.rides.client.model;
2424

25+
import javax.annotation.Nullable;
26+
2527
/**
2628
* A user's Payment Method. See
27-
* <a href="https://developer.uber.com/docs/v1-payment-methods-details">Payment Methods</a>
29+
* <a href="https://developer.uber.com/docs/rides/api/v1-payment-methods">Payment Methods</a>
2830
* for more information.
2931
*/
3032
public class PaymentMethod {
3133

3234
private String payment_method_id;
3335
private String type;
36+
@Nullable
3437
private String description;
3538

3639
/**
@@ -52,6 +55,7 @@ public String getType() {
5255
/**
5356
* Gets the description of a Payment Method.
5457
*/
58+
@Nullable
5559
public String getDescription() {
5660
return description;
5761
}

sdk/src/main/java/com/uber/sdk/rides/client/model/PriceEstimate.java

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,29 @@
2222

2323
package com.uber.sdk.rides.client.model;
2424

25+
import javax.annotation.Nullable;
26+
2527
/**
2628
* An estimated price for a product on the Uber platform. See
27-
* <a href="https://developer.uber.com/v1/endpoints/#price-estimates">Price Estimates</a>
29+
* <a href="https://developer.uber.com/docs/rides/api/v1-estimates-price">Price Estimates</a>
2830
* for more information.
2931
*/
3032
public class PriceEstimate {
3133

3234
private String product_id;
35+
@Nullable
3336
private String currency_code;
3437
private String display_name;
3538
private String estimate;
36-
private int low_estimate;
37-
private int high_estimate;
39+
@Nullable
40+
private Integer low_estimate;
41+
@Nullable
42+
private Integer high_estimate;
3843
private float surge_multiplier;
39-
private int duration;
40-
private float distance;
44+
@Nullable
45+
private Integer duration;
46+
@Nullable
47+
private Float distance;
4148

4249
/**
4350
* Unique identifier representing a specific product for a given latitude &amp; longitude. For
@@ -50,6 +57,7 @@ public String getProductId() {
5057
/**
5158
* ISO 4217 currency code.
5259
*/
60+
@Nullable
5361
public String getCurrencyCode() {
5462
return currency_code;
5563
}
@@ -72,14 +80,16 @@ public String getEstimate() {
7280
/**
7381
* Lower bound of the estimated price.
7482
*/
75-
public int getLowEstimate() {
83+
@Nullable
84+
public Integer getLowEstimate() {
7685
return low_estimate;
7786
}
7887

7988
/**
8089
* Upper bound of the estimated price.
8190
*/
82-
public int getHighEstimate() {
91+
@Nullable
92+
public Integer getHighEstimate() {
8393
return high_estimate;
8494
}
8595

@@ -94,14 +104,16 @@ public float getSurgeMultiplier() {
94104
/**
95105
* Expected activity duration (in seconds). Always show duration in minutes.
96106
*/
97-
public int getDuration() {
107+
@Nullable
108+
public Integer getDuration() {
98109
return duration;
99110
}
100111

101112
/**
102113
* Expected activity distance (in miles).
103114
*/
104-
public float getDistance() {
115+
@Nullable
116+
public Float getDistance() {
105117
return distance;
106118
}
107119
}

0 commit comments

Comments
 (0)