use of com.microsoft.azure.management.batch.AutoStorageBaseProperties in project azure-sdk-for-java by Azure.
the class BatchAccountImpl method createResourceAsync.
@Override
public Observable<BatchAccount> createResourceAsync() {
final BatchAccountImpl self = this;
handleStorageSettings();
BatchAccountCreateParametersInner batchAccountCreateParametersInner = new BatchAccountCreateParametersInner();
if (autoStorage != null) {
batchAccountCreateParametersInner.withAutoStorage(new AutoStorageBaseProperties());
batchAccountCreateParametersInner.autoStorage().withStorageAccountId(autoStorage.storageAccountId());
} else {
batchAccountCreateParametersInner.withAutoStorage(null);
}
batchAccountCreateParametersInner.withLocation(this.inner().location());
batchAccountCreateParametersInner.withTags(this.inner().getTags());
return this.manager().inner().batchAccounts().createAsync(this.resourceGroupName(), this.name(), batchAccountCreateParametersInner).map(new Func1<BatchAccountInner, BatchAccount>() {
@Override
public BatchAccount call(BatchAccountInner batchAccountInner) {
self.creatableStorageAccountKey = null;
setInner(batchAccountInner);
return self;
}
}).flatMap(new Func1<BatchAccount, Observable<? extends BatchAccount>>() {
@Override
public Observable<? extends BatchAccount> call(BatchAccount batchAccount) {
return self.applicationsImpl.commitAndGetAllAsync().map(new Func1<List<ApplicationImpl>, BatchAccount>() {
@Override
public BatchAccount call(List<ApplicationImpl> applications) {
return self;
}
});
}
});
}
Aggregations