Factory method for Endpoint list
@param client the user client
@param domainId the domain id.
@param page the starting page.
@param size the page size.
@return the Endpoint list.
483982
public static ResourceList<Endpoint> list(final BandwidthClient client, final String domainId, final int page, final int size) {
        assert(domainId != null);
        assert(page  >= 0);
        assert(size > 0);
        final String resourceUri = String.format(client.getUserResourceUri(BandwidthConstants.ENDPOINTS_URI_PATH), domainId);
        final ResourceList<Endpoint> endpoints = new ResourceList<Endpoint>(page, size, resourceUri, Endpoint.class);
        endpoints.setClient(client);
        endpoints.initialize();
        return endpoints;
    }
14542
public Observable<ServiceResponse<List<String>>> listDomainsWithServiceResponseAsync() {
        if (this.client.endpoint() == null) {
            throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
        }
        String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint());
        return service.listDomains(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<String>>>>() {
                @Override
                public Observable<ServiceResponse<List<String>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<List<String>> clientResponse = listDomainsDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
803386
public static ResourceList<PhoneNumber> list(final BandwidthClient client, final int page, final int size) throws IOException {
    	
        final String resourceUri = client.getUserResourceUri(BandwidthConstants.PHONE_NUMBER_URI_PATH);
        final ResourceList<PhoneNumber> phoneNumbers = 
        			new ResourceList<PhoneNumber>(page, size, resourceUri, PhoneNumber.class);

        phoneNumbers.setClient(client);
        phoneNumbers.initialize();
        
        return phoneNumbers;
    }
262981
public ServiceFuture<List<Domain>> getDomainsAsync(final ServiceCallback<List<Domain>> serviceCallback) {
        return ServiceFuture.fromResponse(getDomainsWithServiceResponseAsync(), serviceCallback);
    }
1232809
public static ResourceList<AvailableNumber> list(final int page, final int size) throws IOException {
    	        
        return list(BandwidthClient.getInstance(), page, size);
    }
574328
public static ResourceList<Message> list(final int page, final int size) throws Exception {
    	
        
        return list(BandwidthClient.getInstance(), page, size);
    }
1203236
public static PageRequest of(final int page, final int size, final Sort sort) {
    return new PageRequest(page, size, sort);
  }
1043379
public PaginatedList<User> listFromCurrentCompany(Integer page, Integer pageSize) {

		if (page == null || page < 1) {
			page = 1;
		}
		if (pageSize == null) {
			pageSize = PAGESIZE;
		}
		PaginatedList<User> results = new PaginatedList<User>();
		if (this.domain == null) {
			Criteria criteria = this.dao.newCriteria(User.class).setFirstResult((page - 1) * pageSize)
					.setMaxResults(pageSize).addOrder(Order.asc("name"));
			Criteria counting = this.dao.newCriteria(User.class).setProjection(Projections.countDistinct("id"));
			results.setList(this.dao.findByCriteria(criteria, User.class));
			results.setTotal((Long) counting.uniqueResult());

		} else {
			Criteria criteria = this.dao.newCriteria(CompanyUser.class).setFirstResult((page - 1) * pageSize)
					.setMaxResults(pageSize).add(Restrictions.eq("company", this.domain.getCompany()))
					.createAlias("user", "user", JoinType.INNER_JOIN).addOrder(Order.asc("user.name"));
			Criteria counting = this.dao.newCriteria(CompanyUser.class)
					.add(Restrictions.eq("company", this.domain.getCompany()))
					.createAlias("user", "user", JoinType.INNER_JOIN)
					.setProjection(Projections.countDistinct("user.id"));
			List<CompanyUser> companyUsers = this.dao.findByCriteria(criteria, CompanyUser.class);
			ArrayList<User> users = new ArrayList<User>(companyUsers.size());
			for (CompanyUser companyUser : companyUsers) {
				User user = companyUser.getUser();
				user.setAccessLevel(Math.max(user.getAccessLevel(), companyUser.getAccessLevel()));
				users.add(user);
			}
			results.setList(users);
			results.setTotal((Long) counting.uniqueResult());
		}
		return results;
	}
165188
public ServiceFuture<List<String>> listDomainsAsync(final ServiceCallback<List<String>> serviceCallback) {
        return ServiceFuture.fromResponse(listDomainsWithServiceResponseAsync(), serviceCallback);
    }
301465
public static ResourceList<Error> list(final int page, final int size) throws IOException {
    	        
        return list(BandwidthClient.getInstance(), page, size);
    }
844016
@Override
    public Page<User> nextPage(final Page<User> page, 
                               final TwilioRestClient client) {
        Request request = new Request(
            HttpMethod.GET,
            page.getNextPageUrl(
                Domains.IPMESSAGING.toString(),
                client.getRegion()
            )
        );
        return pageForRequest(client, request);
    }
347892
public static Domain get(final BandwidthClient client, final String id) throws ParseException, Exception {
        assert(client != null);
        final String domainsUri =  client.getUserResourceInstanceUri(BandwidthConstants.DOMAINS_URI_PATH, id);
        final JSONObject jsonObject = toJSONObject(client.get(domainsUri, null));
        return new Domain(client, jsonObject);
    }
1186070
public static <T> DataPage<T> getByList(List<T> list, int pageSize, int pageNo) {
        List<T> l = subList(list, pageSize, pageNo);
        return new DataPage<T>(l, list.size(), pageSize, pageNo);
    }
605032
public static ClientConfiguration createClient(final List<Endpoint> endpoints, final List<DataProvider> providers) {
        return createClient(null, null, endpoints, providers);
    }
1012610
void doMain(String[] args, boolean throwOnError) throws Exception {
		if (args.length == 0) {
			usage(throwOnError, "no arguments specified");
			return;
		} else if (args.length > 2) {
			usage(throwOnError, "improper number of arguments:" + Arrays.toString(args));
			return;
		}

		// check for --usage or --help
		if (args.length == 1 && ("--usage".equals(args[0]) || "--help".equals(args[0]))) {
			usage(throwOnError, null);
			return;
		}

		CommandLineJmxClient jmxClient;
		if (args[0].indexOf('/') >= 0) {
			jmxClient = new CommandLineJmxClient(args[0]);
		} else {
			String[] parts = args[0].split(":");
			if (parts.length != 2) {
				usage(throwOnError, "argument should be in 'hostname:port' format, not: " + args[0]);
				return;
			}
			String hostName = parts[0];
			int port = 0;
			try {
				port = Integer.parseInt(parts[1]);
			} catch (NumberFormatException e) {
				usage(throwOnError, "port number not in the right format: " + parts[1]);
				return;
			}
			jmxClient = new CommandLineJmxClient(hostName, port);
		}

		if (args.length == 1) {
			jmxClient.runCommandLine();
		} else if (args.length == 2) {
			jmxClient.runBatchFile(new File(args[1]));
		}
	}
801165
function Client (id, apiKey) {
	if (!(this instanceof Client)) {
		return new Client(id, apiKey);
	}

	this.endpoint = 'https://www.googleapis.com';
	this.apiKey = apiKey;
	this.id = id;
}
1030769
@Override
    @SuppressWarnings("checkstyle:linelength")
    public Page<Account> firstPage(final TwilioRestClient client) {
        Request request = new Request(
            HttpMethod.GET,
            Domains.API.toString(),
            "/2010-04-01/Accounts.json",
            client.getRegion()
        );

        addQueryParams(request);
        return pageForRequest(client, request);
    }