JsonJavaObject response = getSubscriberManagementService().addSubscriber(subscriber);
return String.valueOf(response.getAsLong("Long"));
}
public String createSubscription(String customerId, int duration, String partNumber, int quantity) throws BssException, JsonException, IOException {
SubscriptionManagementService subscriptionManagement = getSubscriptionManagementService();
OrderJsonBuilder order = new OrderJsonBuilder();
order.setCustomerId(customerId)
.setDurationUnits(SubscriptionManagementService.DurationUnits.YEARS)
.setDurationLength(duration)
.setPartNumber(partNumber)
.setPartQuantity(quantity)
.setBillingFrequency(BillingFrequency.ARC);
EntityList<JsonEntity> subscriptionList = subscriptionManagement.createSubscription(order);
for (JsonEntity subscription : subscriptionList) {
System.out.println(subscription.toJsonString());
}
return String.valueOf(subscriptionList.get(0).getAsLong("SubscriptionId"));
}