use of com.microsoft.rest.ServiceResponse in project azure-sdk-for-java by Azure.
the class RegistriesInner method regenerateCredentialWithServiceResponseAsync.
/**
* Regenerates one of the login credentials for the specified container registry.
*
* @param resourceGroupName The name of the resource group to which the container registry belongs.
* @param registryName The name of the container registry.
* @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the RegistryListCredentials object
*/
public Observable<ServiceResponse<RegistryListCredentials>> regenerateCredentialWithServiceResponseAsync(String resourceGroupName, String registryName, PasswordName name) {
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 (registryName == null) {
throw new IllegalArgumentException("Parameter registryName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
if (name == null) {
throw new IllegalArgumentException("Parameter name is required and cannot be null.");
}
RegenerateCredentialParameters regenerateCredentialParameters = new RegenerateCredentialParameters();
regenerateCredentialParameters.withName(name);
return service.regenerateCredential(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), regenerateCredentialParameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RegistryListCredentials>>>() {
@Override
public Observable<ServiceResponse<RegistryListCredentials>> call(Response<ResponseBody> response) {
try {
ServiceResponse<RegistryListCredentials> clientResponse = regenerateCredentialDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of com.microsoft.rest.ServiceResponse in project azure-sdk-for-java by Azure.
the class RedisInner method regenerateKeyWithServiceResponseAsync.
/**
* Regenerate Redis cache's access keys. This operation requires write permission to the cache resource.
*
* @param resourceGroupName The name of the resource group.
* @param name The name of the Redis cache.
* @param keyType The Redis access key to regenerate. Possible values include: 'Primary', 'Secondary'
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the RedisAccessKeysInner object
*/
public Observable<ServiceResponse<RedisAccessKeysInner>> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String name, RedisKeyType keyType) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (name == null) {
throw new IllegalArgumentException("Parameter name 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.");
}
if (keyType == null) {
throw new IllegalArgumentException("Parameter keyType is required and cannot be null.");
}
RedisRegenerateKeyParameters parameters = new RedisRegenerateKeyParameters();
parameters.withKeyType(keyType);
return service.regenerateKey(resourceGroupName, name, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<RedisAccessKeysInner>>>() {
@Override
public Observable<ServiceResponse<RedisAccessKeysInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<RedisAccessKeysInner> clientResponse = regenerateKeyDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of com.microsoft.rest.ServiceResponse in project azure-sdk-for-java by Azure.
the class VirtualNetworkGatewaysInner method generatevpnclientpackageWithServiceResponseAsync.
/**
* Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkGatewayName The name of the virtual network gateway.
* @param processorArchitecture VPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86'
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the String object
*/
public Observable<ServiceResponse<String>> generatevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, ProcessorArchitecture processorArchitecture) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (virtualNetworkGatewayName == null) {
throw new IllegalArgumentException("Parameter virtualNetworkGatewayName 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 (processorArchitecture == null) {
throw new IllegalArgumentException("Parameter processorArchitecture is required and cannot be null.");
}
final String apiVersion = "2016-12-01";
VpnClientParameters parameters = new VpnClientParameters();
parameters.withProcessorArchitecture(processorArchitecture);
return service.generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<String>>>() {
@Override
public Observable<ServiceResponse<String>> call(Response<ResponseBody> response) {
try {
ServiceResponse<String> clientResponse = generatevpnclientpackageDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of com.microsoft.rest.ServiceResponse in project azure-sdk-for-java by Azure.
the class NetworkWatchersInner method getTopologyWithServiceResponseAsync.
/**
* Gets the current network topology by resource group.
*
* @param resourceGroupName The name of the resource group.
* @param networkWatcherName The name of the network watcher.
* @param targetResourceGroupName The name of the target resource group to perform topology on.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the TopologyInner object
*/
public Observable<ServiceResponse<TopologyInner>> getTopologyWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String targetResourceGroupName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkWatcherName == null) {
throw new IllegalArgumentException("Parameter networkWatcherName 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 (targetResourceGroupName == null) {
throw new IllegalArgumentException("Parameter targetResourceGroupName is required and cannot be null.");
}
final String apiVersion = "2016-12-01";
TopologyParameters parameters = new TopologyParameters();
parameters.withTargetResourceGroupName(targetResourceGroupName);
return service.getTopology(resourceGroupName, networkWatcherName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TopologyInner>>>() {
@Override
public Observable<ServiceResponse<TopologyInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<TopologyInner> clientResponse = getTopologyDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
use of com.microsoft.rest.ServiceResponse in project azure-sdk-for-java by Azure.
the class KeyVaultClientImpl method setCertificateIssuerWithServiceResponseAsync.
/**
* Sets the specified certificate issuer.
*
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param issuerName The name of the issuer.
* @param provider The issuer provider.
* @return the observable to the IssuerBundle object
*/
public Observable<ServiceResponse<IssuerBundle>> setCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName, String provider) {
if (vaultBaseUrl == null) {
throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null.");
}
if (issuerName == null) {
throw new IllegalArgumentException("Parameter issuerName is required and cannot be null.");
}
if (this.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
}
if (provider == null) {
throw new IllegalArgumentException("Parameter provider is required and cannot be null.");
}
final IssuerCredentials credentials = null;
final OrganizationDetails organizationDetails = null;
final IssuerAttributes attributes = null;
CertificateIssuerSetParameters parameter = new CertificateIssuerSetParameters();
parameter.withProvider(provider);
parameter.withCredentials(null);
parameter.withOrganizationDetails(null);
parameter.withAttributes(null);
String parameterizedHost = Joiner.on(", ").join("{vaultBaseUrl}", vaultBaseUrl);
return service.setCertificateIssuer(issuerName, this.apiVersion(), this.acceptLanguage(), parameter, parameterizedHost, this.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<IssuerBundle>>>() {
@Override
public Observable<ServiceResponse<IssuerBundle>> call(Response<ResponseBody> response) {
try {
ServiceResponse<IssuerBundle> clientResponse = setCertificateIssuerDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Aggregations