use of com.microsoft.azure.management.appservice.ResourceNameAvailabilityRequest in project azure-sdk-for-java by Azure.
the class WebSiteManagementClientImpl method checkNameAvailabilityWithServiceResponseAsync.
/**
* Check if a resource name is available.
* Check if a resource name is available.
*
* @param name Resource name to verify.
* @param type Resource type used for verification. Possible values include: 'Site', 'Slot', 'HostingEnvironment'
* @param isFqdn Is fully qualified domain name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceNameAvailabilityInner object
*/
public Observable<ServiceResponse<ResourceNameAvailabilityInner>> checkNameAvailabilityWithServiceResponseAsync(String name, CheckNameResourceTypes type, Boolean isFqdn) {
if (this.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null.");
}
if (name == null) {
throw new IllegalArgumentException("Parameter name is required and cannot be null.");
}
if (type == null) {
throw new IllegalArgumentException("Parameter type is required and cannot be null.");
}
final String apiVersion = "2016-03-01";
ResourceNameAvailabilityRequest request = new ResourceNameAvailabilityRequest();
request.withName(name);
request.withType(type);
request.withIsFqdn(isFqdn);
return service.checkNameAvailability(this.subscriptionId(), apiVersion, this.acceptLanguage(), request, this.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceNameAvailabilityInner>>>() {
@Override
public Observable<ServiceResponse<ResourceNameAvailabilityInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ResourceNameAvailabilityInner> clientResponse = checkNameAvailabilityDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of com.microsoft.azure.management.appservice.ResourceNameAvailabilityRequest in project azure-sdk-for-java by Azure.
the class WebSiteManagementClientImpl method checkNameAvailabilityWithServiceResponseAsync.
/**
* Check if a resource name is available.
* Check if a resource name is available.
*
* @param name Resource name to verify.
* @param type Resource type used for verification. Possible values include: 'Site', 'Slot', 'HostingEnvironment'
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the ResourceNameAvailabilityInner object
*/
public Observable<ServiceResponse<ResourceNameAvailabilityInner>> checkNameAvailabilityWithServiceResponseAsync(String name, CheckNameResourceTypes type) {
if (this.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null.");
}
if (name == null) {
throw new IllegalArgumentException("Parameter name is required and cannot be null.");
}
if (type == null) {
throw new IllegalArgumentException("Parameter type is required and cannot be null.");
}
final String apiVersion = "2016-03-01";
final Boolean isFqdn = null;
ResourceNameAvailabilityRequest request = new ResourceNameAvailabilityRequest();
request.withName(name);
request.withType(type);
request.withIsFqdn(null);
return service.checkNameAvailability(this.subscriptionId(), apiVersion, this.acceptLanguage(), request, this.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ResourceNameAvailabilityInner>>>() {
@Override
public Observable<ServiceResponse<ResourceNameAvailabilityInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ResourceNameAvailabilityInner> clientResponse = checkNameAvailabilityDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Aggregations