use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.
the class AccountsImpl method listNodeAgentSkusAsync.
/**
* Lists all node agent SKUs supported by the Azure Batch service.
*
* @param accountListNodeAgentSkusOptions Additional parameters for the operation
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link Call} object
*/
public ServiceCall listNodeAgentSkusAsync(final AccountListNodeAgentSkusOptions accountListNodeAgentSkusOptions, final ListOperationCallback<NodeAgentSku> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
if (this.client.apiVersion() == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."));
return null;
}
Validator.validate(accountListNodeAgentSkusOptions, serviceCallback);
String filter = null;
if (accountListNodeAgentSkusOptions != null) {
filter = accountListNodeAgentSkusOptions.filter();
}
Integer maxResults = null;
if (accountListNodeAgentSkusOptions != null) {
maxResults = accountListNodeAgentSkusOptions.maxResults();
}
Integer timeout = null;
if (accountListNodeAgentSkusOptions != null) {
timeout = accountListNodeAgentSkusOptions.timeout();
}
String clientRequestId = null;
if (accountListNodeAgentSkusOptions != null) {
clientRequestId = accountListNodeAgentSkusOptions.clientRequestId();
}
Boolean returnClientRequestId = null;
if (accountListNodeAgentSkusOptions != null) {
returnClientRequestId = accountListNodeAgentSkusOptions.returnClientRequestId();
}
DateTime ocpDate = null;
if (accountListNodeAgentSkusOptions != null) {
ocpDate = accountListNodeAgentSkusOptions.ocpDate();
}
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.listNodeAgentSkus(this.client.apiVersion(), this.client.acceptLanguage(), filter, maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<List<NodeAgentSku>>(serviceCallback) {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
try {
ServiceResponseWithHeaders<PageImpl<NodeAgentSku>, AccountListNodeAgentSkusHeaders> result = listNodeAgentSkusDelegate(response);
serviceCallback.load(result.getBody().getItems());
if (result.getBody().getNextPageLink() != null && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) {
AccountListNodeAgentSkusNextOptions accountListNodeAgentSkusNextOptions = null;
if (accountListNodeAgentSkusOptions != null) {
accountListNodeAgentSkusNextOptions = new AccountListNodeAgentSkusNextOptions();
accountListNodeAgentSkusNextOptions.withClientRequestId(accountListNodeAgentSkusOptions.clientRequestId());
accountListNodeAgentSkusNextOptions.withReturnClientRequestId(accountListNodeAgentSkusOptions.returnClientRequestId());
accountListNodeAgentSkusNextOptions.withOcpDate(accountListNodeAgentSkusOptions.ocpDate());
}
listNodeAgentSkusNextAsync(result.getBody().getNextPageLink(), accountListNodeAgentSkusNextOptions, serviceCall, serviceCallback);
} else {
serviceCallback.success(new ServiceResponseWithHeaders<>(serviceCallback.get(), result.getHeaders(), result.getResponse()));
}
} catch (BatchErrorException | IOException exception) {
serviceCallback.failure(exception);
}
}
});
return serviceCall;
}
use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.
the class ApplicationsImpl method listNext.
/**
* Lists all of the applications available in the specified account.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @param applicationListNextOptions 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<PageImpl<ApplicationSummary>, ApplicationListHeaders> listNext(final String nextPageLink, final ApplicationListNextOptions applicationListNextOptions) throws BatchErrorException, IOException, IllegalArgumentException {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
Validator.validate(applicationListNextOptions);
String clientRequestId = null;
if (applicationListNextOptions != null) {
clientRequestId = applicationListNextOptions.clientRequestId();
}
Boolean returnClientRequestId = null;
if (applicationListNextOptions != null) {
returnClientRequestId = applicationListNextOptions.returnClientRequestId();
}
DateTime ocpDate = null;
if (applicationListNextOptions != null) {
ocpDate = applicationListNextOptions.ocpDate();
}
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.listNext(nextPageLink, this.client.acceptLanguage(), clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
return listNextDelegate(call.execute());
}
use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.
the class ApplicationsImpl method get.
/**
* Gets information about the specified application.
*
* @param applicationId The id of the application.
* @param applicationGetOptions 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 ApplicationSummary object wrapped in {@link ServiceResponseWithHeaders} if successful.
*/
public ServiceResponseWithHeaders<ApplicationSummary, ApplicationGetHeaders> get(String applicationId, ApplicationGetOptions applicationGetOptions) throws BatchErrorException, IOException, IllegalArgumentException {
if (applicationId == null) {
throw new IllegalArgumentException("Parameter applicationId 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(applicationGetOptions);
Integer timeout = null;
if (applicationGetOptions != null) {
timeout = applicationGetOptions.timeout();
}
String clientRequestId = null;
if (applicationGetOptions != null) {
clientRequestId = applicationGetOptions.clientRequestId();
}
Boolean returnClientRequestId = null;
if (applicationGetOptions != null) {
returnClientRequestId = applicationGetOptions.returnClientRequestId();
}
DateTime ocpDate = null;
if (applicationGetOptions != null) {
ocpDate = applicationGetOptions.ocpDate();
}
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
Call<ResponseBody> call = service.get(applicationId, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
return getDelegate(call.execute());
}
use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.
the class ApplicationsImpl method get.
/**
* Gets information about the specified application.
*
* @param applicationId The id of the application.
* @throws BatchErrorException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the ApplicationSummary object wrapped in {@link ServiceResponseWithHeaders} if successful.
*/
public ServiceResponseWithHeaders<ApplicationSummary, ApplicationGetHeaders> get(String applicationId) throws BatchErrorException, IOException, IllegalArgumentException {
if (applicationId == null) {
throw new IllegalArgumentException("Parameter applicationId 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 ApplicationGetOptions applicationGetOptions = 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.get(applicationId, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
return getDelegate(call.execute());
}
use of com.microsoft.rest.DateTimeRfc1123 in project azure-sdk-for-java by Azure.
the class ApplicationsImpl method listAsync.
/**
* Lists all of the applications available in the specified account.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link Call} object
*/
public ServiceCall listAsync(final ListOperationCallback<ApplicationSummary> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
if (this.client.apiVersion() == null) {
serviceCallback.failure(new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."));
return null;
}
final ApplicationListOptions applicationListOptions = 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(), maxResults, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent());
final ServiceCall serviceCall = new ServiceCall(call);
call.enqueue(new ServiceResponseCallback<List<ApplicationSummary>>(serviceCallback) {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
try {
ServiceResponseWithHeaders<PageImpl<ApplicationSummary>, ApplicationListHeaders> result = listDelegate(response);
serviceCallback.load(result.getBody().getItems());
if (result.getBody().getNextPageLink() != null && serviceCallback.progress(result.getBody().getItems()) == ListOperationCallback.PagingBahavior.CONTINUE) {
listNextAsync(result.getBody().getNextPageLink(), null, serviceCall, serviceCallback);
} else {
serviceCallback.success(new ServiceResponseWithHeaders<>(serviceCallback.get(), result.getHeaders(), result.getResponse()));
}
} catch (BatchErrorException | IOException exception) {
serviceCallback.failure(exception);
}
}
});
return serviceCall;
}
Aggregations