com.microsoft.azure.management.resources.implementation.TenantsImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-mgmt-resources Show documentation
Show all versions of azure-mgmt-resources Show documentation
This package contains Microsoft Azure Resource Management SDK.
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.management.resources.implementation;
import com.microsoft.azure.PagedList;
import com.microsoft.azure.management.resources.Tenant;
import com.microsoft.azure.management.resources.Tenants;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl;
import com.microsoft.azure.management.resources.fluentcore.utils.PagedListConverter;
import rx.Observable;
import rx.functions.Func1;
/**
* Implementation for {@link Tenants}.
*/
final class TenantsImpl
implements Tenants {
private final TenantsInner client;
TenantsImpl(final TenantsInner client) {
this.client = client;
}
@Override
public PagedList list() {
PagedListConverter converter = new PagedListConverter() {
@Override
public Observable typeConvertAsync(TenantIdDescriptionInner tenantInner) {
return Observable.just((Tenant) new TenantImpl(tenantInner));
}
};
return converter.convert(client.list());
}
@Override
public Observable listAsync() {
return ReadableWrappersImpl.convertPageToInnerAsync(client.listAsync()).map(new Func1() {
@Override
public Tenant call(TenantIdDescriptionInner tenantIdDescriptionInners) {
return new TenantImpl(tenantIdDescriptionInners);
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy