Search in sources :

Example 1 with Reason

use of com.azure.resourcemanager.storage.models.Reason in project azure-maven-plugins by microsoft.

the class AzureStorageAccount method checkNameAvailability.

public CheckNameAvailabilityResultEntity checkNameAvailability(String subscriptionId, String name) {
    StorageManager manager = StorageManagerFactory.create(subscriptionId);
    CheckNameAvailabilityResult result = manager.storageAccounts().checkNameAvailability(name);
    return new CheckNameAvailabilityResultEntity(result.isAvailable(), Optional.ofNullable(result.reason()).map(Reason::toString).orElse(null), result.message());
}
Also used : StorageManager(com.azure.resourcemanager.storage.StorageManager) CheckNameAvailabilityResult(com.azure.resourcemanager.storage.models.CheckNameAvailabilityResult) CheckNameAvailabilityResultEntity(com.microsoft.azure.toolkit.lib.common.entity.CheckNameAvailabilityResultEntity) Reason(com.azure.resourcemanager.storage.models.Reason)

Aggregations

StorageManager (com.azure.resourcemanager.storage.StorageManager)1 CheckNameAvailabilityResult (com.azure.resourcemanager.storage.models.CheckNameAvailabilityResult)1 Reason (com.azure.resourcemanager.storage.models.Reason)1 CheckNameAvailabilityResultEntity (com.microsoft.azure.toolkit.lib.common.entity.CheckNameAvailabilityResultEntity)1