com.microsoft.azure.Page Java Examples

The following examples show how to use com.microsoft.azure.Page. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DeploymentOperationsInner.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
/**
 * Gets all deployments operations for a deployment.
 *
 * @param scope The scope of a deployment.
 * @param deploymentName The name of the deployment.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<DeploymentOperationInner>>> listAtScopeSinglePageAsync(final String scope, final String deploymentName) {
    if (scope == null) {
        throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
    }
    if (deploymentName == null) {
        throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    final Integer top = null;
    return service.listAtScope(scope, deploymentName, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DeploymentOperationInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<DeploymentOperationInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<DeploymentOperationInner>> result = listAtScopeDelegate(response);
                    return Observable.just(new ServiceResponse<Page<DeploymentOperationInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
 
Example #2
Source File: UserAssignedIdentitiesInner.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
/**
 * Lists all the userAssignedIdentities available under the specified subscription.
 *
ServiceResponse<PageImpl<IdentityInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;IdentityInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<IdentityInner>>> listNextSinglePageAsync(final String nextPageLink) {
    if (nextPageLink == null) {
        throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
    }
    String nextUrl = String.format("%s", nextPageLink);
    return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<IdentityInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<IdentityInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<IdentityInner>> result = listNextDelegate(response);
                    return Observable.just(new ServiceResponse<Page<IdentityInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
 
Example #3
Source File: GalleryImagesInner.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
/**
 * List gallery Image Definitions in a gallery.
 *
ServiceResponse<PageImpl1<GalleryImageInner>> * @param resourceGroupName The name of the resource group.
ServiceResponse<PageImpl1<GalleryImageInner>> * @param galleryName The name of the Shared Image Gallery from which Image Definitions are to be listed.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;GalleryImageInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<GalleryImageInner>>> listByGallerySinglePageAsync(final String resourceGroupName, final String galleryName) {
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (galleryName == null) {
        throw new IllegalArgumentException("Parameter galleryName is required and cannot be null.");
    }
    final String apiVersion = "2019-12-01";
    return service.listByGallery(this.client.subscriptionId(), resourceGroupName, galleryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<GalleryImageInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<GalleryImageInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl1<GalleryImageInner>> result = listByGalleryDelegate(response);
                    return Observable.just(new ServiceResponse<Page<GalleryImageInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
 
Example #4
Source File: DeletedWebAppsInner.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
/**
 * Get all deleted apps for a subscription at location.
 * Description for Get all deleted apps for a subscription at location.
 *
ServiceResponse<PageImpl<DeletedSiteInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;DeletedSiteInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<DeletedSiteInner>>> listByLocationNextSinglePageAsync(final String nextPageLink) {
    if (nextPageLink == null) {
        throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
    }
    String nextUrl = String.format("%s", nextPageLink);
    return service.listByLocationNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DeletedSiteInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<DeletedSiteInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<DeletedSiteInner>> result = listByLocationNextDelegate(response);
                    return Observable.just(new ServiceResponse<Page<DeletedSiteInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
 
Example #5
Source File: DeploymentOperationsInner.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
/**
 * Gets all deployments operations for a deployment.
 *
ServiceResponse<PageImpl<DeploymentOperationInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;DeploymentOperationInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<DeploymentOperationInner>>> listAtManagementGroupScopeNextSinglePageAsync(final String nextPageLink) {
    if (nextPageLink == null) {
        throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
    }
    String nextUrl = String.format("%s", nextPageLink);
    return service.listAtManagementGroupScopeNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<DeploymentOperationInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<DeploymentOperationInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<DeploymentOperationInner>> result = listAtManagementGroupScopeNextDelegate(response);
                    return Observable.just(new ServiceResponse<Page<DeploymentOperationInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
 
Example #6
Source File: VpnServerConfigurationsInner.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
/**
 * Lists all the VpnServerConfigurations in a subscription.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;VpnServerConfigurationInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<VpnServerConfigurationInner>>> listSinglePageAsync() {
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    final String apiVersion = "2019-11-01";
    return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<VpnServerConfigurationInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<VpnServerConfigurationInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<VpnServerConfigurationInner>> result = listDelegate(response);
                    return Observable.just(new ServiceResponse<Page<VpnServerConfigurationInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
 
Example #7
Source File: ContainerGroupsInner.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
/**
 * Get a list of container groups in the specified subscription.
 * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.
 *
ServiceResponse<PageImpl<ContainerGroupInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;ContainerGroupInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<ContainerGroupInner>>> listNextSinglePageAsync(final String nextPageLink) {
    if (nextPageLink == null) {
        throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
    }
    String nextUrl = String.format("%s", nextPageLink);
    return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ContainerGroupInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<ContainerGroupInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<ContainerGroupInner>> result = listNextDelegate(response);
                    return Observable.just(new ServiceResponse<Page<ContainerGroupInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
 
Example #8
Source File: ApplicationGatewaysInner.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
/**
 * Gets all the application gateways in a subscription.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;ApplicationGatewayInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<ApplicationGatewayInner>>> listSinglePageAsync() {
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    final String apiVersion = "2019-11-01";
    return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ApplicationGatewayInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<ApplicationGatewayInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<ApplicationGatewayInner>> result = listDelegate(response);
                    return Observable.just(new ServiceResponse<Page<ApplicationGatewayInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
 
Example #9
Source File: ResourceGroupsInner.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
/**
 * Gets all the resource groups for a subscription.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;ResourceGroupInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<ResourceGroupInner>>> listSinglePageAsync() {
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    final String filter = null;
    final Integer top = null;
    return service.list(this.client.subscriptionId(), filter, top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ResourceGroupInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<ResourceGroupInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<ResourceGroupInner>> result = listDelegate(response);
                    return Observable.just(new ServiceResponse<Page<ResourceGroupInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
 
Example #10
Source File: RoleAssignmentsInner.java    From azure-libraries-for-java with MIT License 6 votes vote down vote up
/**
 * Gets role assignments for a resource group.
 *
 * @param resourceGroupName The name of the resource group.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;RoleAssignmentInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<RoleAssignmentInner>>> listByResourceGroupSinglePageAsync(final String resourceGroupName) {
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    final String apiVersion = "2018-01-01-preview";
    final String filter = null;
    return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<RoleAssignmentInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<RoleAssignmentInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<RoleAssignmentInner>> result = listByResourceGroupDelegate(response);
                    return Observable.just(new ServiceResponse<Page<RoleAssignmentInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}
 
Example #11
Source File: AvailabilitySetsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Lists all availability sets in a subscription.
 *
 * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceFuture} object
 */
public ServiceFuture<List<AvailabilitySetInner>> listAsync(final ListOperationCallback<AvailabilitySetInner> serviceCallback) {
    return AzureServiceFuture.fromPageResponse(
        listSinglePageAsync(),
        new Func1<String, Observable<ServiceResponse<Page<AvailabilitySetInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<AvailabilitySetInner>>> call(String nextPageLink) {
                return listNextSinglePageAsync(nextPageLink);
            }
        },
        serviceCallback);
}
 
Example #12
Source File: DefaultSecurityRulesInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets all default security rules in a network security group.
 *
 * @param resourceGroupName The name of the resource group.
 * @param networkSecurityGroupName The name of the network security group.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;SecurityRuleInner&gt; object
 */
public Observable<Page<SecurityRuleInner>> listAsync(final String resourceGroupName, final String networkSecurityGroupName) {
    return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName)
        .map(new Func1<ServiceResponse<Page<SecurityRuleInner>>, Page<SecurityRuleInner>>() {
            @Override
            public Page<SecurityRuleInner> call(ServiceResponse<Page<SecurityRuleInner>> response) {
                return response.body();
            }
        });
}
 
Example #13
Source File: VaultsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * The List operation gets information about the vaults associated with the subscription.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @throws CloudException thrown if the request is rejected by server
 * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
 * @return the PagedList&lt;VaultInner&gt; object if successful.
 */
public PagedList<VaultInner> listBySubscription() {
    ServiceResponse<Page<VaultInner>> response = listBySubscriptionSinglePageAsync().toBlocking().single();
    return new PagedList<VaultInner>(response.body()) {
        @Override
        public Page<VaultInner> nextPage(String nextPageLink) {
            return listBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body();
        }
    };
}
 
Example #14
Source File: SubscriptionsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets all subscriptions for a tenant.
 *
 * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;SubscriptionInner&gt; object
 */
public Observable<Page<SubscriptionInner>> listNextAsync(final String nextPageLink) {
    return listNextWithServiceResponseAsync(nextPageLink)
        .map(new Func1<ServiceResponse<Page<SubscriptionInner>>, Page<SubscriptionInner>>() {
            @Override
            public Page<SubscriptionInner> call(ServiceResponse<Page<SubscriptionInner>> response) {
                return response.body();
            }
        });
}
 
Example #15
Source File: RecordSetsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Lists all record sets in a DNS zone.
 *
 * @param resourceGroupName The name of the resource group.
 * @param zoneName The name of the DNS zone (without a terminating dot).
 * @param top The maximum number of record sets to return. If not specified, returns up to 100 record sets.
 * @param recordSetNameSuffix The suffix label of the record set name that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will return only records that end with .&lt;recordSetNameSuffix&gt;
 * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceFuture} object
 */
public ServiceFuture<List<RecordSetInner>> listAllByDnsZoneAsync(final String resourceGroupName, final String zoneName, final Integer top, final String recordSetNameSuffix, final ListOperationCallback<RecordSetInner> serviceCallback) {
    return AzureServiceFuture.fromPageResponse(
        listAllByDnsZoneSinglePageAsync(resourceGroupName, zoneName, top, recordSetNameSuffix),
        new Func1<String, Observable<ServiceResponse<Page<RecordSetInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<RecordSetInner>>> call(String nextPageLink) {
                return listAllByDnsZoneNextSinglePageAsync(nextPageLink);
            }
        },
        serviceCallback);
}
 
Example #16
Source File: PublicIPAddressesInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets all public IP addresses in a resource group.
 *
 * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;PublicIPAddressInner&gt; object
 */
public Observable<Page<PublicIPAddressInner>> listByResourceGroupNextAsync(final String nextPageLink) {
    return listByResourceGroupNextWithServiceResponseAsync(nextPageLink)
        .map(new Func1<ServiceResponse<Page<PublicIPAddressInner>>, Page<PublicIPAddressInner>>() {
            @Override
            public Page<PublicIPAddressInner> call(ServiceResponse<Page<PublicIPAddressInner>> response) {
                return response.body();
            }
        });
}
 
Example #17
Source File: ObjectsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets AD group membership for the specified AD object IDs.
 *
 * @param parameters Objects filtering parameters.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @throws CloudException thrown if the request is rejected by server
 * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
 * @return the PagedList&lt;AADObjectInner&gt; object if successful.
 */
public PagedList<AADObjectInner> getObjectsByObjectIds(final GetObjectsParametersInner parameters) {
    ServiceResponse<Page<AADObjectInner>> response = getObjectsByObjectIdsSinglePageAsync(parameters).toBlocking().single();
    return new PagedList<AADObjectInner>(response.body()) {
        @Override
        public Page<AADObjectInner> nextPage(String nextLink) {
            return getObjectsByObjectIdsNextSinglePageAsync(nextLink).toBlocking().single().body();
        }
    };
}
 
Example #18
Source File: WorkspacesInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets a list of Workspaces within the specified resource group.
 *
 * @param resourceGroupName Name of the resource group to which the resource belongs.
 * @param workspacesListByResourceGroupOptions Additional parameters for the operation
 * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceFuture} object
 */
public ServiceFuture<List<WorkspaceInner>> listByResourceGroupAsync(final String resourceGroupName, final WorkspacesListByResourceGroupOptions workspacesListByResourceGroupOptions, final ListOperationCallback<WorkspaceInner> serviceCallback) {
    return AzureServiceFuture.fromPageResponse(
        listByResourceGroupSinglePageAsync(resourceGroupName, workspacesListByResourceGroupOptions),
        new Func1<String, Observable<ServiceResponse<Page<WorkspaceInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<WorkspaceInner>>> call(String nextPageLink) {
                return listByResourceGroupNextSinglePageAsync(nextPageLink);
            }
        },
        serviceCallback);
}
 
Example #19
Source File: FileSharesInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Lists all shares.
 *
 * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;FileShareItemInner&gt; object
 */
public Observable<Page<FileShareItemInner>> listNextAsync(final String nextPageLink) {
    return listNextWithServiceResponseAsync(nextPageLink)
        .map(new Func1<ServiceResponse<Page<FileShareItemInner>>, Page<FileShareItemInner>>() {
            @Override
            public Page<FileShareItemInner> call(ServiceResponse<Page<FileShareItemInner>> response) {
                return response.body();
            }
        });
}
 
Example #20
Source File: RoleAssignmentsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets role assignments for a resource.
 *
 * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;RoleAssignmentInner&gt; object
 */
public Observable<Page<RoleAssignmentInner>> listForResourceNextAsync(final String nextPageLink) {
    return listForResourceNextWithServiceResponseAsync(nextPageLink)
        .map(new Func1<ServiceResponse<Page<RoleAssignmentInner>>, Page<RoleAssignmentInner>>() {
            @Override
            public Page<RoleAssignmentInner> call(ServiceResponse<Page<RoleAssignmentInner>> response) {
                return response.body();
            }
        });
}
 
Example #21
Source File: DeploymentOperationsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets all deployments operations for a deployment.
 *
 * @param deploymentName The name of the deployment.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;DeploymentOperationInner&gt; object
 */
public Observable<Page<DeploymentOperationInner>> listAtTenantScopeAsync(final String deploymentName) {
    return listAtTenantScopeWithServiceResponseAsync(deploymentName)
        .map(new Func1<ServiceResponse<Page<DeploymentOperationInner>>, Page<DeploymentOperationInner>>() {
            @Override
            public Page<DeploymentOperationInner> call(ServiceResponse<Page<DeploymentOperationInner>> response) {
                return response.body();
            }
        });
}
 
Example #22
Source File: NamespacesInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets all the available namespaces within the subscription, irrespective of the resource groups.
 *
 * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;NamespaceInner&gt; object
 */
public Observable<Page<NamespaceInner>> listNextAsync(final String nextPageLink) {
    return listNextWithServiceResponseAsync(nextPageLink)
        .map(new Func1<ServiceResponse<Page<NamespaceInner>>, Page<NamespaceInner>>() {
            @Override
            public Page<NamespaceInner> call(ServiceResponse<Page<NamespaceInner>> response) {
                return response.body();
            }
        });
}
 
Example #23
Source File: OperationsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Lists all of the available Cosmos DB Resource Provider operations.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @throws CloudException thrown if the request is rejected by server
 * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
 * @return the PagedList&lt;OperationInner&gt; object if successful.
 */
public PagedList<OperationInner> list() {
    ServiceResponse<Page<OperationInner>> response = listSinglePageAsync().toBlocking().single();
    return new PagedList<OperationInner>(response.body()) {
        @Override
        public Page<OperationInner> nextPage(String nextPageLink) {
            return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
        }
    };
}
 
Example #24
Source File: VirtualHubsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Lists all the VirtualHubs in a resource group.
 *
 * @param resourceGroupName The resource group name of the VirtualHub.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @throws CloudException thrown if the request is rejected by server
 * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
 * @return the PagedList&lt;VirtualHubInner&gt; object if successful.
 */
public PagedList<VirtualHubInner> listByResourceGroup(final String resourceGroupName) {
    ServiceResponse<Page<VirtualHubInner>> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single();
    return new PagedList<VirtualHubInner>(response.body()) {
        @Override
        public Page<VirtualHubInner> nextPage(String nextPageLink) {
            return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body();
        }
    };
}
 
Example #25
Source File: RouteTablesInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets all route tables in a subscription.
 *
 * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceFuture} object
 */
public ServiceFuture<List<RouteTableInner>> listAsync(final ListOperationCallback<RouteTableInner> serviceCallback) {
    return AzureServiceFuture.fromPageResponse(
        listSinglePageAsync(),
        new Func1<String, Observable<ServiceResponse<Page<RouteTableInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<RouteTableInner>>> call(String nextPageLink) {
                return listNextSinglePageAsync(nextPageLink);
            }
        },
        serviceCallback);
}
 
Example #26
Source File: ExpressRouteCircuitsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets all the express route circuits in a resource group.
 *
 * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;ExpressRouteCircuitInner&gt; object
 */
public Observable<Page<ExpressRouteCircuitInner>> listByResourceGroupNextAsync(final String nextPageLink) {
    return listByResourceGroupNextWithServiceResponseAsync(nextPageLink)
        .map(new Func1<ServiceResponse<Page<ExpressRouteCircuitInner>>, Page<ExpressRouteCircuitInner>>() {
            @Override
            public Page<ExpressRouteCircuitInner> call(ServiceResponse<Page<ExpressRouteCircuitInner>> response) {
                return response.body();
            }
        });
}
 
Example #27
Source File: TenantsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets the tenants for your account.
 *
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;TenantIdDescriptionInner&gt; object
 */
public Observable<Page<TenantIdDescriptionInner>> listAsync() {
    return listWithServiceResponseAsync()
        .map(new Func1<ServiceResponse<Page<TenantIdDescriptionInner>>, Page<TenantIdDescriptionInner>>() {
            @Override
            public Page<TenantIdDescriptionInner> call(ServiceResponse<Page<TenantIdDescriptionInner>> response) {
                return response.body();
            }
        });
}
 
Example #28
Source File: GalleryApplicationsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * List gallery Application Definitions in a gallery.
 *
 * @param resourceGroupName The name of the resource group.
 * @param galleryName The name of the Shared Application Gallery from which Application Definitions are to be listed.
 * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceFuture} object
 */
public ServiceFuture<List<GalleryApplicationInner>> listByGalleryAsync(final String resourceGroupName, final String galleryName, final ListOperationCallback<GalleryApplicationInner> serviceCallback) {
    return AzureServiceFuture.fromPageResponse(
        listByGallerySinglePageAsync(resourceGroupName, galleryName),
        new Func1<String, Observable<ServiceResponse<Page<GalleryApplicationInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<GalleryApplicationInner>>> call(String nextPageLink) {
                return listByGalleryNextSinglePageAsync(nextPageLink);
            }
        },
        serviceCallback);
}
 
Example #29
Source File: OperationsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Lists all of the available SQL Rest API operations.
 *
 * @param nextPageLink The NextLink from the previous successful call to List operation.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the observable to the PagedList&lt;OperationInner&gt; object
 */
public Observable<Page<OperationInner>> listNextAsync(final String nextPageLink) {
    return listNextWithServiceResponseAsync(nextPageLink)
        .map(new Func1<ServiceResponse<Page<OperationInner>>, Page<OperationInner>>() {
            @Override
            public Page<OperationInner> call(ServiceResponse<Page<OperationInner>> response) {
                return response.body();
            }
        });
}
 
Example #30
Source File: ExperimentsInner.java    From azure-libraries-for-java with MIT License 5 votes vote down vote up
/**
 * Gets a list of Experiments within the specified Workspace.
 *
 * @param resourceGroupName Name of the resource group to which the resource belongs.
 * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the PagedList&lt;ExperimentInner&gt; object wrapped in {@link ServiceResponse} if successful.
 */
public Observable<ServiceResponse<Page<ExperimentInner>>> listByWorkspaceSinglePageAsync(final String resourceGroupName, final String workspaceName) {
    if (resourceGroupName == null) {
        throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
    }
    if (workspaceName == null) {
        throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null.");
    }
    if (this.client.subscriptionId() == null) {
        throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
    }
    if (this.client.apiVersion() == null) {
        throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
    }
    final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions = null;
    Integer maxResults = null;
    return service.listByWorkspace(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), maxResults, this.client.userAgent())
        .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<ExperimentInner>>> call(Response<ResponseBody> response) {
                try {
                    ServiceResponse<PageImpl<ExperimentInner>> result = listByWorkspaceDelegate(response);
                    return Observable.just(new ServiceResponse<Page<ExperimentInner>>(result.body(), result.response()));
                } catch (Throwable t) {
                    return Observable.error(t);
                }
            }
        });
}