Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR sdk/network/mgmt-v2020_05_01] Adding express route port authorization apis #3675

Open
wants to merge 1 commit into
base: sdkAutomation/sdk_network_mgmt-v2020_05_01
Choose a base branch
from
Open
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,4 @@ public interface VirtualNetworks extends SupportsCreating<VirtualNetwork.Definit
*/
Observable<VirtualNetworkUsage> listUsageAsync(final String resourceGroupName, final String virtualNetworkName);

/**
* Get a list of bastion hosts accessible from the given network.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkName The name of the virtual network.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<BastionHostListResult> getBastionHostsAsync(String resourceGroupName, String virtualNetworkName);

}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.microsoft.azure.Page;
import com.microsoft.azure.management.network.v2020_05_01.IPAddressAvailabilityResult;
import com.microsoft.azure.management.network.v2020_05_01.VirtualNetworkUsage;
import com.microsoft.azure.management.network.v2020_05_01.BastionHostListResult;

class VirtualNetworksImpl extends GroupableResourcesCoreImpl<VirtualNetwork, VirtualNetworkImpl, VirtualNetworkInner, VirtualNetworksInner, NetworkManager> implements VirtualNetworks {
protected VirtualNetworksImpl(NetworkManager manager) {
Expand Down Expand Up @@ -172,16 +171,4 @@ public VirtualNetworkUsage call(VirtualNetworkUsageInner inner) {
});
}

@Override
public Observable<BastionHostListResult> getBastionHostsAsync(String resourceGroupName, String virtualNetworkName) {
VirtualNetworksInner client = this.inner();
return client.getBastionHostsAsync(resourceGroupName, virtualNetworkName)
.map(new Func1<BastionHostListResultInner, BastionHostListResult>() {
@Override
public BastionHostListResult call(BastionHostListResultInner inner) {
return new BastionHostListResultImpl(inner, manager());
}
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ interface VirtualNetworksService {
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages")
Observable<Response<ResponseBody>> listUsage(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2020_05_01.VirtualNetworks getBastionHosts" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/bastionHosts")
Observable<Response<ResponseBody>> getBastionHosts(@Path("resourceGroupName") String resourceGroupName, @Path("virtualNetworkName") String virtualNetworkName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);

@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.network.v2020_05_01.VirtualNetworks listNext" })
@GET
Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
Expand Down Expand Up @@ -1211,90 +1207,6 @@ private ServiceResponse<PageImpl<VirtualNetworkUsageInner>> listUsageDelegate(Re
.build(response);
}

/**
* Get a list of bastion hosts accessible from the given network.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkName The name of the virtual network.
* @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 BastionHostListResultInner object if successful.
*/
public BastionHostListResultInner getBastionHosts(String resourceGroupName, String virtualNetworkName) {
return getBastionHostsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().body();
}

/**
* Get a list of bastion hosts accessible from the given network.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkName The name of the virtual network.
* @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<BastionHostListResultInner> getBastionHostsAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback<BastionHostListResultInner> serviceCallback) {
return ServiceFuture.fromResponse(getBastionHostsWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback);
}

/**
* Get a list of bastion hosts accessible from the given network.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkName The name of the virtual network.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the BastionHostListResultInner object
*/
public Observable<BastionHostListResultInner> getBastionHostsAsync(String resourceGroupName, String virtualNetworkName) {
return getBastionHostsWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1<ServiceResponse<BastionHostListResultInner>, BastionHostListResultInner>() {
@Override
public BastionHostListResultInner call(ServiceResponse<BastionHostListResultInner> response) {
return response.body();
}
});
}

/**
* Get a list of bastion hosts accessible from the given network.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkName The name of the virtual network.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the BastionHostListResultInner object
*/
public Observable<ServiceResponse<BastionHostListResultInner>> getBastionHostsWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (virtualNetworkName == null) {
throw new IllegalArgumentException("Parameter virtualNetworkName 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 = "2020-05-01";
return service.getBastionHosts(resourceGroupName, virtualNetworkName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<BastionHostListResultInner>>>() {
@Override
public Observable<ServiceResponse<BastionHostListResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<BastionHostListResultInner> clientResponse = getBastionHostsDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}

private ServiceResponse<BastionHostListResultInner> getBastionHostsDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<BastionHostListResultInner, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<BastionHostListResultInner>() { }.getType())
.registerError(CloudException.class)
.build(response);
}

/**
* Gets all virtual networks in a subscription.
*
Expand Down