Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,13 @@ public interface ManagementLocks extends SupportsCreating<ManagementLockObject.D
*/
Observable<ManagementLockObject> listAtResourceLevelAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName);

/**
* Gets all the management locks for a scope.
*
* @param scope The scope for the lock. When providing a scope for the assignment, use '/subscriptions/{subscriptionId}' for subscriptions, '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for resource groups, and '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}' for resources.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<ManagementLockObject> listByScopeAsync(final String scope);

}
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,24 @@ public ManagementLockObject call(ManagementLockObjectInner inner) {
});
}

@Override
public Observable<ManagementLockObject> listByScopeAsync(final String scope) {
ManagementLocksInner client = this.inner();
return client.listByScopeAsync(scope)
.flatMapIterable(new Func1<Page<ManagementLockObjectInner>, Iterable<ManagementLockObjectInner>>() {
@Override
public Iterable<ManagementLockObjectInner> call(Page<ManagementLockObjectInner> page) {
return page.items();
}
})
.map(new Func1<ManagementLockObjectInner, ManagementLockObject>() {
@Override
public ManagementLockObject call(ManagementLockObjectInner inner) {
return new ManagementLockObjectImpl(inner, manager());
}
});
}

@Override
public PagedList<ManagementLockObject> list() {
ManagementLocksInner client = this.inner();
Expand Down
Loading