@@ -31,11 +31,9 @@ public class ConnectionsEntity extends BaseManagementEntity {
3131 * @return a Request to execute.
3232 */
3333 public Request <List <Connection >> list (ConnectionFilter filter ) {
34- HttpUrl .Builder builder = HttpUrl . parse ( baseUrl )
34+ HttpUrl .Builder builder = baseUrl
3535 .newBuilder ()
36- .addPathSegment ("api" )
37- .addPathSegment ("v2" )
38- .addPathSegment ("connections" );
36+ .addPathSegments ("api/v2/connections" );
3937 if (filter != null ) {
4038 for (Map .Entry <String , Object > e : filter .getAsMap ().entrySet ()) {
4139 builder .addQueryParameter (e .getKey (), String .valueOf (e .getValue ()));
@@ -59,11 +57,9 @@ public Request<List<Connection>> list(ConnectionFilter filter) {
5957 public Request <Connection > get (String connectionId , ConnectionFilter filter ) {
6058 Asserts .assertNotNull (connectionId , "connection id" );
6159
62- HttpUrl .Builder builder = HttpUrl . parse ( baseUrl )
60+ HttpUrl .Builder builder = baseUrl
6361 .newBuilder ()
64- .addPathSegment ("api" )
65- .addPathSegment ("v2" )
66- .addPathSegment ("connections" )
62+ .addPathSegments ("api/v2/connections" )
6763 .addPathSegment (connectionId );
6864 if (filter != null ) {
6965 for (Map .Entry <String , Object > e : filter .getAsMap ().entrySet ()) {
@@ -87,11 +83,9 @@ public Request<Connection> get(String connectionId, ConnectionFilter filter) {
8783 public Request <Connection > create (Connection connection ) {
8884 Asserts .assertNotNull (connection , "connection" );
8985
90- String url = HttpUrl . parse ( baseUrl )
86+ String url = baseUrl
9187 .newBuilder ()
92- .addPathSegment ("api" )
93- .addPathSegment ("v2" )
94- .addPathSegment ("connections" )
88+ .addPathSegments ("api/v2/connections" )
9589 .build ()
9690 .toString ();
9791 CustomRequest <Connection > request = new CustomRequest <>(this .client , url , "POST" , new TypeReference <Connection >() {
@@ -111,11 +105,9 @@ public Request<Connection> create(Connection connection) {
111105 public Request delete (String connectionId ) {
112106 Asserts .assertNotNull (connectionId , "connection id" );
113107
114- String url = HttpUrl . parse ( baseUrl )
108+ String url = baseUrl
115109 .newBuilder ()
116- .addPathSegment ("api" )
117- .addPathSegment ("v2" )
118- .addPathSegment ("connections" )
110+ .addPathSegments ("api/v2/connections" )
119111 .addPathSegment (connectionId )
120112 .build ()
121113 .toString ();
@@ -136,11 +128,9 @@ public Request<Connection> update(String connectionId, Connection connection) {
136128 Asserts .assertNotNull (connectionId , "connection id" );
137129 Asserts .assertNotNull (connection , "connection" );
138130
139- String url = HttpUrl . parse ( baseUrl )
131+ String url = baseUrl
140132 .newBuilder ()
141- .addPathSegment ("api" )
142- .addPathSegment ("v2" )
143- .addPathSegment ("connections" )
133+ .addPathSegments ("api/v2/connections" )
144134 .addPathSegment (connectionId )
145135 .build ()
146136 .toString ();
@@ -163,11 +153,9 @@ public Request deleteUser(String connectionId, String email) {
163153 Asserts .assertNotNull (connectionId , "connection id" );
164154 Asserts .assertNotNull (email , "email" );
165155
166- String url = HttpUrl . parse ( baseUrl )
156+ String url = baseUrl
167157 .newBuilder ()
168- .addPathSegment ("api" )
169- .addPathSegment ("v2" )
170- .addPathSegment ("connections" )
158+ .addPathSegments ("api/v2/connections" )
171159 .addPathSegment (connectionId )
172160 .addPathSegment ("users" )
173161 .addQueryParameter ("email" , email )
@@ -177,6 +165,4 @@ public Request deleteUser(String connectionId, String email) {
177165 request .addHeader ("Authorization" , "Bearer " + apiToken );
178166 return request ;
179167 }
180-
181-
182168}
0 commit comments