Search in sources :

Example 1 with AccessPolicyEntry

use of com.microsoft.azure.management.keyvault.AccessPolicyEntry in project azure-sdk-for-java by Azure.

the class VaultImpl method createResourceAsync.

@Override
public Observable<Vault> createResourceAsync() {
    final VaultsInner client = this.manager().inner().vaults();
    return populateAccessPolicies().flatMap(new Func1<Object, Observable<VaultInner>>() {

        @Override
        public Observable<VaultInner> call(Object o) {
            VaultCreateOrUpdateParametersInner parameters = new VaultCreateOrUpdateParametersInner();
            parameters.withLocation(regionName());
            parameters.withProperties(inner().properties());
            parameters.withTags(inner().getTags());
            parameters.properties().withAccessPolicies(new ArrayList<AccessPolicyEntry>());
            for (AccessPolicy accessPolicy : accessPolicies) {
                parameters.properties().accessPolicies().add(accessPolicy.inner());
            }
            return client.createOrUpdateAsync(resourceGroupName(), name(), parameters);
        }
    }).map(innerToFluentMap(this));
}
Also used : AccessPolicyEntry(com.microsoft.azure.management.keyvault.AccessPolicyEntry) Func1(rx.functions.Func1) AccessPolicy(com.microsoft.azure.management.keyvault.AccessPolicy)

Aggregations

AccessPolicy (com.microsoft.azure.management.keyvault.AccessPolicy)1 AccessPolicyEntry (com.microsoft.azure.management.keyvault.AccessPolicyEntry)1 Func1 (rx.functions.Func1)1