-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAdminAPI.java
More file actions
38 lines (27 loc) · 1.13 KB
/
AdminAPI.java
File metadata and controls
38 lines (27 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package bookingbugAPI.api;
import bookingbugAPI.models.*;
import bookingbugAPI.models.params.BookingListParams;
import bookingbugAPI.services.HttpService;
import bookingbugAPI.services.OkHttpService;
import helpers.Utils;
import java.io.IOException;
import java.net.URL;
public class AdminAPI extends AbstractAPI {
AdminAPI(ApiConfig builder) {
super(builder);
}
public BookingAPI booking() {
return new BookingAPI(newConfig());
}
public class BookingAPI extends AbstractAPI {
BookingAPI(ApiConfig config) {
super(config);
}
public BBCollection<Booking> getBookings(Company company, BookingListParams bLParams) throws IOException {
URL url = new URL(Utils.inflateLink(company.get_bookingsLink(), bLParams.getParams()));
BBCollection<Booking> bookings = new BBCollection<Booking>(httpService.api_GET(url), getAuthToken(), "bookings", Booking.class);
//BBCollection<Booking> bookings = new BBCollection<Booking>(HttpService.api_GET(url, getAuthToken()), getAuthToken(), "bookings", Booking.class);
return bookings;
}
}
}