How to Set Quota Parameters in the Oracle Field Service Cloud with the Capacity Management API

import static java.lang.System.out;

import java.time.LocalDate;

import toa.capacity.CapacityPortType;
import toa.capacity.SetQuotaBucketElement;
import toa.capacity.SetQuotaDayElement;
import toa.capacity.SetQuotaRequestElement;
import toa.capacity.ToaCapacityInterface;
import toa.capacity.UserElement;

public final class OfscSample {

  public static void main(final String[] args) {
    final ToaCapacityInterface service = new ToaCapacityInterface();

    final CapacityPortType port = service.getToaCapacityInterface();

    final SetQuotaRequestElement req = new SetQuotaRequestElement();

    final UserElement user = new UserElement();

    user.setNow("now");

    user.setLogin("login");

    user.setCompany("company");

    user.setAuthString("authString");

    req.setUser(user);

    final SetQuotaBucketElement bucket = new SetQuotaBucketElement();

    bucket.setBucketId("bucketId");

    final SetQuotaDayElement day = new SetQuotaDayElement();

    day.setDate(LocalDate.of(0, 0, 0)); // requires customization

    day.setQuota(0);

    bucket.getDay().add(day);

    req.getBucket().add(bucket);

    out.println(port.setQuota(req));
  }

}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s