Adds the ability to get and create opt out resources.
Includes some changes and improvements to the existing tests to increase coverage for regression protection.
Usage:
-
Create an instance of the optout service
UserPassword userPassword = new UserPassword("YourUsername","YourPassword"); BasicServiceFactory serviceFactory = ServiceFactory.createBasicAuthenticatingFactory(userPassword); OptOutService optOutService = serviceFactory.getOptOutService();
-
Get single opt out
OptOutResponse optout = optOutService.getOptOut("b6a39581-9cfc-40ea-9b40-9320444cf49d");
-
Get paged opt outs
OptOutCollectionResponse optouts = optOutService.getOptOuts(1, 15);
-
Create an opt out
FromAddress fromAddress = new FromAddress(); fromAddress.setPhoneNumber("99887744556322"); OptOutRequest request = new OptOutRequestImpl(); request.setAccountReference("EX006789"); request.setFromAddress(fromAddress); OptOutResponse optout = optOutService.createOptOut(request);