use of com.microsoft.azure.PagedList in project azure-sdk-for-java by Azure.
the class FilesImpl method listFromTask.
/**
* Lists the files in a task's directory on its compute node.
*
* @param jobId The id of the job that contains the task.
* @param taskId The id of the task whose files you want to list.
* @throws BatchErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the List<NodeFile> object wrapped in {@link ServiceResponseWithHeaders} if successful.
*/
public ServiceResponseWithHeaders<PagedList<NodeFile>, FileListFromTaskHeaders> listFromTask(final String jobId, final String taskId) throws BatchErrorException, IOException, IllegalArgumentException {
if (jobId == null) {
throw new IllegalArgumentException("Parameter jobId is required and cannot be null.");
}
if (taskId == null) {
throw new IllegalArgumentException("Parameter taskId is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
final Boolean recursive = null;
final FileListFromTaskOptions fileListFromTaskOptions = null;
String filter = null;
Integer maxResults = null;
Integer timeout = null;
String clientRequestId = null;
Boolean returnClientRequestId = null;
DateTime ocpDate = null;
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.listFromTask(jobId, taskId, recursive, this.client.apiVersion(), this.client.acceptLanguage(), filter, maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
ServiceResponseWithHeaders<PageImpl<NodeFile>, FileListFromTaskHeaders> response = listFromTaskDelegate(call.execute());
PagedList<NodeFile> result = new PagedList<NodeFile>(response.getBody()) {
@Override
public Page<NodeFile> nextPage(String nextPageLink) throws BatchErrorException, IOException {
return listFromTaskNext(nextPageLink, null).getBody();
}
};
return new ServiceResponseWithHeaders<>(result, response.getHeaders(), response.getResponse());
}
use of com.microsoft.azure.PagedList in project azure-sdk-for-java by Azure.
the class JobsImpl method list.
/**
* Lists all of the jobs in the specified account.
*
* @param jobListOptions Additional parameters for the operation
* @throws BatchErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the List<CloudJob> object wrapped in {@link ServiceResponseWithHeaders} if successful.
*/
public ServiceResponseWithHeaders<PagedList<CloudJob>, JobListHeaders> list(final JobListOptions jobListOptions) throws BatchErrorException, IOException, IllegalArgumentException {
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(jobListOptions);
String filter = null;
if (jobListOptions != null) {
filter = jobListOptions.filter();
}
String select = null;
if (jobListOptions != null) {
select = jobListOptions.select();
}
String expand = null;
if (jobListOptions != null) {
expand = jobListOptions.expand();
}
Integer maxResults = null;
if (jobListOptions != null) {
maxResults = jobListOptions.maxResults();
}
Integer timeout = null;
if (jobListOptions != null) {
timeout = jobListOptions.timeout();
}
String clientRequestId = null;
if (jobListOptions != null) {
clientRequestId = jobListOptions.clientRequestId();
}
Boolean returnClientRequestId = null;
if (jobListOptions != null) {
returnClientRequestId = jobListOptions.returnClientRequestId();
}
DateTime ocpDate = null;
if (jobListOptions != null) {
ocpDate = jobListOptions.ocpDate();
}
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.list(this.client.apiVersion(), this.client.acceptLanguage(), filter, select, expand, maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
ServiceResponseWithHeaders<PageImpl<CloudJob>, JobListHeaders> response = listDelegate(call.execute());
PagedList<CloudJob> result = new PagedList<CloudJob>(response.getBody()) {
@Override
public Page<CloudJob> nextPage(String nextPageLink) throws BatchErrorException, IOException {
JobListNextOptions jobListNextOptions = null;
if (jobListOptions != null) {
jobListNextOptions = new JobListNextOptions();
jobListNextOptions.withClientRequestId(jobListOptions.clientRequestId());
jobListNextOptions.withReturnClientRequestId(jobListOptions.returnClientRequestId());
jobListNextOptions.withOcpDate(jobListOptions.ocpDate());
}
return listNext(nextPageLink, jobListNextOptions).getBody();
}
};
return new ServiceResponseWithHeaders<>(result, response.getHeaders(), response.getResponse());
}
use of com.microsoft.azure.PagedList in project azure-sdk-for-java by Azure.
the class ApplicationsImpl method list.
/**
* Lists all of the applications available in the specified account.
*
* @param applicationListOptions Additional parameters for the operation
* @throws BatchErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the List<ApplicationSummary> object wrapped in {@link ServiceResponseWithHeaders} if successful.
*/
public ServiceResponseWithHeaders<PagedList<ApplicationSummary>, ApplicationListHeaders> list(final ApplicationListOptions applicationListOptions) throws BatchErrorException, IOException, IllegalArgumentException {
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(applicationListOptions);
Integer maxResults = null;
if (applicationListOptions != null) {
maxResults = applicationListOptions.maxResults();
}
Integer timeout = null;
if (applicationListOptions != null) {
timeout = applicationListOptions.timeout();
}
String clientRequestId = null;
if (applicationListOptions != null) {
clientRequestId = applicationListOptions.clientRequestId();
}
Boolean returnClientRequestId = null;
if (applicationListOptions != null) {
returnClientRequestId = applicationListOptions.returnClientRequestId();
}
DateTime ocpDate = null;
if (applicationListOptions != null) {
ocpDate = applicationListOptions.ocpDate();
}
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.list(this.client.apiVersion(), this.client.acceptLanguage(), maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
ServiceResponseWithHeaders<PageImpl<ApplicationSummary>, ApplicationListHeaders> response = listDelegate(call.execute());
PagedList<ApplicationSummary> result = new PagedList<ApplicationSummary>(response.getBody()) {
@Override
public Page<ApplicationSummary> nextPage(String nextPageLink) throws BatchErrorException, IOException {
ApplicationListNextOptions applicationListNextOptions = null;
if (applicationListOptions != null) {
applicationListNextOptions = new ApplicationListNextOptions();
applicationListNextOptions.withClientRequestId(applicationListOptions.clientRequestId());
applicationListNextOptions.withReturnClientRequestId(applicationListOptions.returnClientRequestId());
applicationListNextOptions.withOcpDate(applicationListOptions.ocpDate());
}
return listNext(nextPageLink, applicationListNextOptions).getBody();
}
};
return new ServiceResponseWithHeaders<>(result, response.getHeaders(), response.getResponse());
}
use of com.microsoft.azure.PagedList in project azure-sdk-for-java by Azure.
the class ComputeNodesImpl method list.
/**
* Lists the compute nodes in the specified pool.
*
* @param poolId The id of the pool from which you want to list nodes.
* @param computeNodeListOptions Additional parameters for the operation
* @throws BatchErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the List<ComputeNode> object wrapped in {@link ServiceResponseWithHeaders} if successful.
*/
public ServiceResponseWithHeaders<PagedList<ComputeNode>, ComputeNodeListHeaders> list(final String poolId, final ComputeNodeListOptions computeNodeListOptions) throws BatchErrorException, IOException, IllegalArgumentException {
if (poolId == null) {
throw new IllegalArgumentException("Parameter poolId is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(computeNodeListOptions);
String filter = null;
if (computeNodeListOptions != null) {
filter = computeNodeListOptions.filter();
}
String select = null;
if (computeNodeListOptions != null) {
select = computeNodeListOptions.select();
}
Integer maxResults = null;
if (computeNodeListOptions != null) {
maxResults = computeNodeListOptions.maxResults();
}
Integer timeout = null;
if (computeNodeListOptions != null) {
timeout = computeNodeListOptions.timeout();
}
String clientRequestId = null;
if (computeNodeListOptions != null) {
clientRequestId = computeNodeListOptions.clientRequestId();
}
Boolean returnClientRequestId = null;
if (computeNodeListOptions != null) {
returnClientRequestId = computeNodeListOptions.returnClientRequestId();
}
DateTime ocpDate = null;
if (computeNodeListOptions != null) {
ocpDate = computeNodeListOptions.ocpDate();
}
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.list(poolId, this.client.apiVersion(), this.client.acceptLanguage(), filter, select, maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
ServiceResponseWithHeaders<PageImpl<ComputeNode>, ComputeNodeListHeaders> response = listDelegate(call.execute());
PagedList<ComputeNode> result = new PagedList<ComputeNode>(response.getBody()) {
@Override
public Page<ComputeNode> nextPage(String nextPageLink) throws BatchErrorException, IOException {
ComputeNodeListNextOptions computeNodeListNextOptions = null;
if (computeNodeListOptions != null) {
computeNodeListNextOptions = new ComputeNodeListNextOptions();
computeNodeListNextOptions.withClientRequestId(computeNodeListOptions.clientRequestId());
computeNodeListNextOptions.withReturnClientRequestId(computeNodeListOptions.returnClientRequestId());
computeNodeListNextOptions.withOcpDate(computeNodeListOptions.ocpDate());
}
return listNext(nextPageLink, computeNodeListNextOptions).getBody();
}
};
return new ServiceResponseWithHeaders<>(result, response.getHeaders(), response.getResponse());
}
use of com.microsoft.azure.PagedList in project azure-sdk-for-java by Azure.
the class CertificatesImpl method list.
/**
* Lists all of the certificates that have been added to the specified account.
*
* @throws BatchErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the List<Certificate> object wrapped in {@link ServiceResponseWithHeaders} if successful.
*/
public ServiceResponseWithHeaders<PagedList<Certificate>, CertificateListHeaders> list() throws BatchErrorException, IOException, IllegalArgumentException {
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
final CertificateListOptions certificateListOptions = null;
String filter = null;
String select = null;
Integer maxResults = null;
Integer timeout = null;
String clientRequestId = null;
Boolean returnClientRequestId = null;
DateTime ocpDate = null;
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.list(this.client.apiVersion(), this.client.acceptLanguage(), filter, select, maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
ServiceResponseWithHeaders<PageImpl<Certificate>, CertificateListHeaders> response = listDelegate(call.execute());
PagedList<Certificate> result = new PagedList<Certificate>(response.getBody()) {
@Override
public Page<Certificate> nextPage(String nextPageLink) throws BatchErrorException, IOException {
return listNext(nextPageLink, null).getBody();
}
};
return new ServiceResponseWithHeaders<>(result, response.getHeaders(), response.getResponse());
}
Aggregations