diff --git a/snippets/numbers/available/List.java b/snippets/numbers/available/List.java new file mode 100644 index 0000000..397f1ee --- /dev/null +++ b/snippets/numbers/available/List.java @@ -0,0 +1,29 @@ +package numbers; + +import com.sinch.sdk.domains.numbers.*; +import com.sinch.sdk.domains.numbers.models.NumberType; +import com.sinch.sdk.domains.numbers.models.requests.AvailableNumberListAllRequestParameters; +import java.util.logging.Logger; + +public class List { + + private static final Logger LOGGER = Logger.getLogger(List.class.getName()); + + public void list(NumbersService numbersService) { + + var service = numbersService.available(); + + var regionCode = "US"; + var type = NumberType.LOCAL; + + var parameters = + AvailableNumberListAllRequestParameters.builder() + .setRegionCode(regionCode) + .setType(type) + .build(); + + var response = service.list(parameters); + + response.iterator().forEachRemaining(f -> LOGGER.info(f.toString())); + } +}