services.BrandsService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of courier-java Show documentation
Show all versions of courier-java Show documentation
Java SDK for communicating with the Courier REST API.
package services;
import models.Brand;
import models.BrandCreateBody;
import models.BrandUpdateBody;
import models.Brands;
import java.io.IOException;
public class BrandsService {
private final BrandsInterface brandsInterface;
public BrandsService() {
brandsInterface = Courier.getRetrofit().create(BrandsInterface.class);
}
public Brands getBrands(
) throws IOException {
return brandsInterface.getBrands(
Courier.getAuthorizationHeader(),
Courier.getUserAgent()
).execute().body();
}
public Brand getBrand(
String brandId
) throws IOException {
return brandsInterface.getBrand(
brandId,
Courier.getAuthorizationHeader(),
Courier.getUserAgent()
).execute().body();
}
public Brand postBrand(
BrandCreateBody brand
) throws IOException {
return brandsInterface.postBrand(
brand,
Courier.getAuthorizationHeader(),
Courier.getUserAgent()
).execute().body();
}
public Brand putBrand(
String brandId,
BrandUpdateBody brand
) throws IOException {
return brandsInterface.putBrand(
brandId,
brand,
Courier.getAuthorizationHeader(),
Courier.getUserAgent()
).execute().body();
}
public void deleteBrand(
String brandId
) throws IOException {
brandsInterface.deleteBrand(
brandId,
Courier.getAuthorizationHeader(),
Courier.getUserAgent()
).execute();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy