diff --git a/sdk/keyvault/mgmt-v2019_09_01/pom.xml b/sdk/keyvault/mgmt-v2019_09_01/pom.xml index 380b11cef8c07..cd108aecbd91d 100644 --- a/sdk/keyvault/mgmt-v2019_09_01/pom.xml +++ b/sdk/keyvault/mgmt-v2019_09_01/pom.xml @@ -7,18 +7,12 @@ --> 4.0.0 - com.microsoft.azure.keyvault.v2019_09_01 - - com.microsoft.azure - azure-arm-parent - 1.3.2 - ../../parents/azure-arm-parent/pom.xml - - azure-mgmt-keyvault - 1.0.0-beta + com.microsoft.azure + azure-keyvault + 1.7.1-SNAPSHOT jar - Microsoft Azure SDK for KeyVault Management - This package contains Microsoft KeyVault Management SDK. + Microsoft Azure SDK for KeyVault + This package contains Microsoft KeyVault SDK. https://github.com/Azure/azure-sdk-for-java @@ -46,34 +40,20 @@ com.microsoft.azure azure-client-runtime - - - com.microsoft.azure - azure-arm-client-runtime + 1.5.3 junit junit + 4.12 test com.microsoft.azure azure-client-authentication + 1.5.3 test - - com.microsoft.azure - azure-mgmt-resources - test - - - com.microsoft.azure - azure-arm-client-runtime - test-jar - test - - 1.6.5 - diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/KeyVaultManagementClient.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/KeyVaultManagementClient.java new file mode 100644 index 0000000000000..e7c790c13bedb --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/KeyVaultManagementClient.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for KeyVaultManagementClient class. + */ +public interface KeyVaultManagementClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + KeyVaultManagementClient withSubscriptionId(String subscriptionId); + + /** + * Gets Client Api Version.. + * + * @return the apiVersion value. + */ + String apiVersion(); + + /** + * Gets The preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets The preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + KeyVaultManagementClient withAcceptLanguage(String acceptLanguage); + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + KeyVaultManagementClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + KeyVaultManagementClient withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the Vaults object to access its operations. + * @return the Vaults object. + */ + Vaults vaults(); + + /** + * Gets the PrivateEndpointConnections object to access its operations. + * @return the PrivateEndpointConnections object. + */ + PrivateEndpointConnections privateEndpointConnections(); + + /** + * Gets the PrivateLinkResources object to access its operations. + * @return the PrivateLinkResources object. + */ + PrivateLinkResources privateLinkResources(); + + /** + * Gets the Operations object to access its operations. + * @return the Operations object. + */ + Operations operations(); + + /** + * Gets the Secrets object to access its operations. + * @return the Secrets object. + */ + Secrets secrets(); + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/Operations.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/Operations.java new file mode 100644 index 0000000000000..ba1051a596fc1 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/Operations.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.keyvault.v20190901.models.Operation; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public interface Operations { + /** + * Lists all of the available Key Vault Rest API 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<Operation> object if successful. + */ + PagedList list(); + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listAsync(final ListOperationCallback serviceCallback); + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Operation> object + */ + Observable> listAsync(); + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Operation> object + */ + Observable>> listWithServiceResponseAsync(); + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<Operation> object if successful. + */ + PagedList listNext(final String nextPageLink); + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * Lists all of the available Key Vault 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<Operation> object + */ + Observable> listNextAsync(final String nextPageLink); + + /** + * Lists all of the available Key Vault 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<Operation> object + */ + Observable>> listNextWithServiceResponseAsync(final String nextPageLink); + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/PrivateEndpointConnections.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..336b1b6072ca5 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/PrivateEndpointConnections.java @@ -0,0 +1,219 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.keyvault.v20190901.models.PrivateEndpointConnection; +import com.microsoft.azure.management.keyvault.v20190901.models.PrivateEndpointConnectionsDeleteHeaders; +import com.microsoft.azure.management.keyvault.v20190901.models.PrivateEndpointConnectionsPutHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections { + /** + * Gets the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @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 PrivateEndpointConnection object if successful. + */ + PrivateEndpointConnection get(String resourceGroupName, String vaultName, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, final ServiceCallback serviceCallback); + + /** + * Gets the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + Observable getAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + Observable> getWithServiceResponseAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName); + + /** + * Updates the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param properties The intended state of private endpoint connection. + * @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 PrivateEndpointConnection object if successful. + */ + PrivateEndpointConnection put(String resourceGroupName, String vaultName, String privateEndpointConnectionName, PrivateEndpointConnection properties); + + /** + * Updates the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param properties The intended state of private endpoint connection. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, PrivateEndpointConnection properties, final ServiceCallback serviceCallback); + + /** + * Updates the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param properties The intended state of private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + Observable putAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, PrivateEndpointConnection properties); + + /** + * Updates the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param properties The intended state of private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + Observable> putWithServiceResponseAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, PrivateEndpointConnection properties); + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @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 PrivateEndpointConnection object if successful. + */ + PrivateEndpointConnection delete(String resourceGroupName, String vaultName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, final ServiceCallback serviceCallback); + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + Observable deleteAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @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 PrivateEndpointConnection object if successful. + */ + PrivateEndpointConnection beginDelete(String resourceGroupName, String vaultName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, final ServiceCallback serviceCallback); + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + Observable beginDeleteAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName); + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/PrivateLinkResources.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/PrivateLinkResources.java new file mode 100644 index 0000000000000..204ad3d901f20 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/PrivateLinkResources.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.keyvault.v20190901.models.PrivateLinkResourceListResult; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateLinkResources. + */ +public interface PrivateLinkResources { + /** + * Gets the private link resources supported for the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @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 PrivateLinkResourceListResult object if successful. + */ + PrivateLinkResourceListResult listByVault(String resourceGroupName, String vaultName); + + /** + * Gets the private link resources supported for the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture listByVaultAsync(String resourceGroupName, String vaultName, final ServiceCallback serviceCallback); + + /** + * Gets the private link resources supported for the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceListResult object + */ + Observable listByVaultAsync(String resourceGroupName, String vaultName); + + /** + * Gets the private link resources supported for the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceListResult object + */ + Observable> listByVaultWithServiceResponseAsync(String resourceGroupName, String vaultName); + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/Secrets.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/Secrets.java new file mode 100644 index 0000000000000..8b7142379d6ea --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/Secrets.java @@ -0,0 +1,308 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.keyvault.v20190901.models.Secret; +import com.microsoft.azure.management.keyvault.v20190901.models.SecretCreateOrUpdateParameters; +import com.microsoft.azure.management.keyvault.v20190901.models.SecretPatchParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Secrets. + */ +public interface Secrets { + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to create or update the secret + * @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 Object object if successful. + */ + Object createOrUpdate(String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters); + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to create or update the secret + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createOrUpdateAsync(String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback); + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to create or update the secret + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable createOrUpdateAsync(String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters); + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to create or update the secret + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters); + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to patch the secret + * @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 Object object if successful. + */ + Object update(String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters); + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to patch the secret + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateAsync(String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters, final ServiceCallback serviceCallback); + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to patch the secret + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable updateAsync(String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters); + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to patch the secret + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> updateWithServiceResponseAsync(String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters); + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @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 Object object if successful. + */ + Object get(String resourceGroupName, String vaultName, String secretName); + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAsync(String resourceGroupName, String vaultName, String secretName, final ServiceCallback serviceCallback); + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable getAsync(String resourceGroupName, String vaultName, String secretName); + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> getWithServiceResponseAsync(String resourceGroupName, String vaultName, String secretName); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @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<Secret> object if successful. + */ + PagedList list(final String resourceGroupName, final String vaultName); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listAsync(final String resourceGroupName, final String vaultName, final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Secret> object + */ + Observable> listAsync(final String resourceGroupName, final String vaultName); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Secret> object + */ + Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String vaultName); + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @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<Secret> object if successful. + */ + PagedList list(final String resourceGroupName, final String vaultName, final Integer top); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listAsync(final String resourceGroupName, final String vaultName, final Integer top, final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Secret> object + */ + Observable> listAsync(final String resourceGroupName, final String vaultName, final Integer top); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Secret> object + */ + Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String vaultName, final Integer top); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<Secret> object if successful. + */ + PagedList listNext(final String nextPageLink); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @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<Secret> object + */ + Observable> listNextAsync(final String nextPageLink); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @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<Secret> object + */ + Observable>> listNextWithServiceResponseAsync(final String nextPageLink); + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/Vaults.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/Vaults.java new file mode 100644 index 0000000000000..dc7bd22e324cb --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/Vaults.java @@ -0,0 +1,904 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.keyvault.v20190901.models.AccessPolicyUpdateKind; +import com.microsoft.azure.management.keyvault.v20190901.models.CheckNameAvailabilityResult; +import com.microsoft.azure.management.keyvault.v20190901.models.DeletedVault; +import com.microsoft.azure.management.keyvault.v20190901.models.Vault; +import com.microsoft.azure.management.keyvault.v20190901.models.VaultAccessPolicyProperties; +import com.microsoft.azure.management.keyvault.v20190901.models.VaultCreateOrUpdateParameters; +import com.microsoft.azure.management.keyvault.v20190901.models.VaultPatchParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Resource; +import com.microsoft.rest.CloudError; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Vaults. + */ +public interface Vaults { + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @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 Object object if successful. + */ + Object createOrUpdate(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture createOrUpdateAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback); + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable createOrUpdateAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @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 Object object if successful. + */ + Object beginCreateOrUpdate(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback); + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable beginCreateOrUpdateAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); + + /** + * Update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to patch the vault + * @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 Object object if successful. + */ + Object update(String resourceGroupName, String vaultName, VaultPatchParameters parameters); + + /** + * Update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to patch the vault + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateAsync(String resourceGroupName, String vaultName, VaultPatchParameters parameters, final ServiceCallback serviceCallback); + + /** + * Update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to patch the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable updateAsync(String resourceGroupName, String vaultName, VaultPatchParameters parameters); + + /** + * Update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to patch the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> updateWithServiceResponseAsync(String resourceGroupName, String vaultName, VaultPatchParameters parameters); + + /** + * Deletes the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault to delete + * @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 CloudError object if successful. + */ + CloudError delete(String resourceGroupName, String vaultName); + + /** + * Deletes the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault to delete + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsync(String resourceGroupName, String vaultName, final ServiceCallback serviceCallback); + + /** + * Deletes the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault to delete + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudError object + */ + Observable deleteAsync(String resourceGroupName, String vaultName); + + /** + * Deletes the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault to delete + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudError object + */ + Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vaultName); + + /** + * Gets the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @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 Object object if successful. + */ + Object get(String resourceGroupName, String vaultName); + + /** + * Gets the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAsync(String resourceGroupName, String vaultName, final ServiceCallback serviceCallback); + + /** + * Gets the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable getAsync(String resourceGroupName, String vaultName); + + /** + * Gets the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> getWithServiceResponseAsync(String resourceGroupName, String vaultName); + + /** + * Update access policies in a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param operationKind Name of the operation. Possible values include: 'add', 'replace', 'remove' + * @param properties Properties of the access policy + * @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 Object object if successful. + */ + Object updateAccessPolicy(String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyProperties properties); + + /** + * Update access policies in a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param operationKind Name of the operation. Possible values include: 'add', 'replace', 'remove' + * @param properties Properties of the access policy + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateAccessPolicyAsync(String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyProperties properties, final ServiceCallback serviceCallback); + + /** + * Update access policies in a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param operationKind Name of the operation. Possible values include: 'add', 'replace', 'remove' + * @param properties Properties of the access policy + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable updateAccessPolicyAsync(String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyProperties properties); + + /** + * Update access policies in a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param operationKind Name of the operation. Possible values include: 'add', 'replace', 'remove' + * @param properties Properties of the access policy + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> updateAccessPolicyWithServiceResponseAsync(String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyProperties properties); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @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<Vault> object if successful. + */ + PagedList listByResourceGroup(final String resourceGroupName); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + Observable> listByResourceGroupAsync(final String resourceGroupName); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName); + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param top Maximum number of results to return. + * @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<Vault> object if successful. + */ + PagedList listByResourceGroup(final String resourceGroupName, final Integer top); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param top Maximum number of results to return. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final Integer top, final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + Observable> listByResourceGroupAsync(final String resourceGroupName, final Integer top); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final Integer top); + + /** + * 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<Vault> object if successful. + */ + PagedList listBySubscription(); + + /** + * The List operation gets information about the vaults associated with the 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 + */ + ServiceFuture> listBySubscriptionAsync(final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + Observable> listBySubscriptionAsync(); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + Observable>> listBySubscriptionWithServiceResponseAsync(); + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @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<Vault> object if successful. + */ + PagedList listBySubscription(final Integer top); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listBySubscriptionAsync(final Integer top, final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + Observable> listBySubscriptionAsync(final Integer top); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + Observable>> listBySubscriptionWithServiceResponseAsync(final Integer top); + + /** + * Gets information about the deleted vaults in a 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<DeletedVault> object if successful. + */ + PagedList listDeleted(); + + /** + * Gets information about the deleted vaults 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 + */ + ServiceFuture> listDeletedAsync(final ListOperationCallback serviceCallback); + + /** + * Gets information about the deleted vaults in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedVault> object + */ + Observable> listDeletedAsync(); + + /** + * Gets information about the deleted vaults in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedVault> object + */ + Observable>> listDeletedWithServiceResponseAsync(); + + /** + * Gets the deleted Azure key vault. + * + * @param vaultName The name of the vault. + * @param location The location of the deleted vault. + * @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 Object object if successful. + */ + Object getDeleted(String vaultName, String location); + + /** + * Gets the deleted Azure key vault. + * + * @param vaultName The name of the vault. + * @param location The location of the deleted vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDeletedAsync(String vaultName, String location, final ServiceCallback serviceCallback); + + /** + * Gets the deleted Azure key vault. + * + * @param vaultName The name of the vault. + * @param location The location of the deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable getDeletedAsync(String vaultName, String location); + + /** + * Gets the deleted Azure key vault. + * + * @param vaultName The name of the vault. + * @param location The location of the deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> getDeletedWithServiceResponseAsync(String vaultName, String location); + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @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 CloudError object if successful. + */ + CloudError purgeDeleted(String vaultName, String location); + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture purgeDeletedAsync(String vaultName, String location, final ServiceCallback serviceCallback); + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudError object + */ + Observable purgeDeletedAsync(String vaultName, String location); + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudError object + */ + Observable> purgeDeletedWithServiceResponseAsync(String vaultName, String location); + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @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 CloudError object if successful. + */ + CloudError beginPurgeDeleted(String vaultName, String location); + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPurgeDeletedAsync(String vaultName, String location, final ServiceCallback serviceCallback); + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudError object + */ + Observable beginPurgeDeletedAsync(String vaultName, String location); + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudError object + */ + Observable> beginPurgeDeletedWithServiceResponseAsync(String vaultName, String location); + + /** + * 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<Resource> object if successful. + */ + PagedList listResource(); + + /** + * The List operation gets information about the vaults associated with the 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 + */ + ServiceFuture> listResourceAsync(final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Resource> object + */ + Observable> listResourceAsync(); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Resource> object + */ + Observable>> listResourceWithServiceResponseAsync(); + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @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<Resource> object if successful. + */ + PagedList listResource(final Integer top); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listResourceAsync(final Integer top, final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Resource> object + */ + Observable> listResourceAsync(final Integer top); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Resource> object + */ + Observable>> listResourceWithServiceResponseAsync(final Integer top); + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param name The vault name. + * @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 CheckNameAvailabilityResult object if successful. + */ + CheckNameAvailabilityResult checkNameAvailability(String name); + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param name The vault name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback); + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param name The vault name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResult object + */ + Observable checkNameAvailabilityAsync(String name); + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param name The vault name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResult object + */ + Observable> checkNameAvailabilityWithServiceResponseAsync(String name); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<Vault> object if successful. + */ + PagedList listByResourceGroupNext(final String nextPageLink); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified 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<Vault> object + */ + Observable> listByResourceGroupNextAsync(final String nextPageLink); + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified 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<Vault> object + */ + Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<Vault> object if successful. + */ + PagedList listBySubscriptionNext(final String nextPageLink); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listBySubscriptionNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @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<Vault> object + */ + Observable> listBySubscriptionNextAsync(final String nextPageLink); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @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<Vault> object + */ + Observable>> listBySubscriptionNextWithServiceResponseAsync(final String nextPageLink); + + /** + * Gets information about the deleted vaults in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<DeletedVault> object if successful. + */ + PagedList listDeletedNext(final String nextPageLink); + + /** + * Gets information about the deleted vaults in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listDeletedNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * Gets information about the deleted vaults in a subscription. + * + * @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<DeletedVault> object + */ + Observable> listDeletedNextAsync(final String nextPageLink); + + /** + * Gets information about the deleted vaults in a subscription. + * + * @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<DeletedVault> object + */ + Observable>> listDeletedNextWithServiceResponseAsync(final String nextPageLink); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<Resource> object if successful. + */ + PagedList listResourceNext(final String nextPageLink); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> listResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @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<Resource> object + */ + Observable> listResourceNextAsync(final String nextPageLink); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @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<Resource> object + */ + Observable>> listResourceNextWithServiceResponseAsync(final String nextPageLink); + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/KeyVaultManagementClientImpl.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/KeyVaultManagementClientImpl.java new file mode 100644 index 0000000000000..c5e038631ef61 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/KeyVaultManagementClientImpl.java @@ -0,0 +1,258 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.management.keyvault.v20190901.KeyVaultManagementClient; +import com.microsoft.azure.management.keyvault.v20190901.Operations; +import com.microsoft.azure.management.keyvault.v20190901.PrivateEndpointConnections; +import com.microsoft.azure.management.keyvault.v20190901.PrivateLinkResources; +import com.microsoft.azure.management.keyvault.v20190901.Secrets; +import com.microsoft.azure.management.keyvault.v20190901.Vaults; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the KeyVaultManagementClientImpl class. + */ +public class KeyVaultManagementClientImpl extends AzureServiceClient implements KeyVaultManagementClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public KeyVaultManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public KeyVaultManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public KeyVaultManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public KeyVaultManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The Vaults object to access its operations. + */ + private Vaults vaults; + + /** + * Gets the Vaults object to access its operations. + * @return the Vaults object. + */ + public Vaults vaults() { + return this.vaults; + } + + /** + * The PrivateEndpointConnections object to access its operations. + */ + private PrivateEndpointConnections privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnections object to access its operations. + * @return the PrivateEndpointConnections object. + */ + public PrivateEndpointConnections privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResources object to access its operations. + */ + private PrivateLinkResources privateLinkResources; + + /** + * Gets the PrivateLinkResources object to access its operations. + * @return the PrivateLinkResources object. + */ + public PrivateLinkResources privateLinkResources() { + return this.privateLinkResources; + } + + /** + * The Operations object to access its operations. + */ + private Operations operations; + + /** + * Gets the Operations object to access its operations. + * @return the Operations object. + */ + public Operations operations() { + return this.operations; + } + + /** + * The Secrets object to access its operations. + */ + private Secrets secrets; + + /** + * Gets the Secrets object to access its operations. + * @return the Secrets object. + */ + public Secrets secrets() { + return this.secrets; + } + + /** + * Initializes an instance of KeyVaultManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public KeyVaultManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of KeyVaultManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public KeyVaultManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of KeyVaultManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public KeyVaultManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-09-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.vaults = new VaultsImpl(restClient().retrofit(), this); + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(restClient().retrofit(), this); + this.privateLinkResources = new PrivateLinkResourcesImpl(restClient().retrofit(), this); + this.operations = new OperationsImpl(restClient().retrofit(), this); + this.secrets = new SecretsImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "KeyVaultManagementClient", "2019-09-01"); + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/OperationsImpl.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..bac6c1b214c14 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/OperationsImpl.java @@ -0,0 +1,286 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.management.keyvault.v20190901.Operations; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.keyvault.v20190901.models.Operation; +import com.microsoft.azure.management.keyvault.v20190901.models.PageImpl; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsImpl implements Operations { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of OperationsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsImpl(Retrofit retrofit, KeyVaultManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.keyvault.v20190901.Operations list" }) + @GET("providers/Microsoft.KeyVault/operations") + Observable> list(@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.keyvault.v20190901.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Key Vault Rest API 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<Operation> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Operation> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Operation> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Operation> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<Operation> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Key Vault 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<Operation> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Key Vault 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<Operation> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Operation> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> 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, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/PrivateEndpointConnectionsImpl.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..f607f28d8176a --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,447 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.management.keyvault.v20190901.PrivateEndpointConnections; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.keyvault.v20190901.models.PrivateEndpointConnection; +import com.microsoft.azure.management.keyvault.v20190901.models.PrivateEndpointConnectionsDeleteHeaders; +import com.microsoft.azure.management.keyvault.v20190901.models.PrivateEndpointConnectionsPutHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsImpl(Retrofit retrofit, KeyVaultManagementClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.keyvault.v20190901.PrivateEndpointConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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.keyvault.v20190901.PrivateEndpointConnections put" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> put(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnection properties, @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.keyvault.v20190901.PrivateEndpointConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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.keyvault.v20190901.PrivateEndpointConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @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 PrivateEndpointConnection object if successful. + */ + public PrivateEndpointConnection get(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Gets the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @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 getAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Gets the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + public Observable getAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnection>() { + @Override + public PrivateEndpointConnection call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + 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 (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param properties The intended state of private endpoint connection. + * @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 PrivateEndpointConnection object if successful. + */ + public PrivateEndpointConnection put(String resourceGroupName, String vaultName, String privateEndpointConnectionName, PrivateEndpointConnection properties) { + return putWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties).toBlocking().single().body(); + } + + /** + * Updates the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param properties The intended state of private endpoint connection. + * @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 putAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, PrivateEndpointConnection properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties), serviceCallback); + } + + /** + * Updates the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param properties The intended state of private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + public Observable putAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, PrivateEndpointConnection properties) { + return putWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties).map(new Func1, PrivateEndpointConnection>() { + @Override + public PrivateEndpointConnection call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Updates the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @param properties The intended state of private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + public Observable> putWithServiceResponseAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, PrivateEndpointConnection properties) { + 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 (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName 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 (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + return service.put(this.client.subscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, this.client.apiVersion(), properties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = putDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders putDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, PrivateEndpointConnectionsPutHeaders.class); + } + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @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 PrivateEndpointConnection object if successful. + */ + public PrivateEndpointConnection delete(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @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 deleteAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnection>() { + @Override + public PrivateEndpointConnection call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + 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 (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), PrivateEndpointConnectionsDeleteHeaders.class); + } + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @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 PrivateEndpointConnection object if successful. + */ + public PrivateEndpointConnection beginDelete(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @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 beginDeleteAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + public Observable beginDeleteAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnection>() { + @Override + public PrivateEndpointConnection call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnection object + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + 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 (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, PrivateEndpointConnectionsDeleteHeaders.class); + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/PrivateLinkResourcesImpl.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..2896a414c71a8 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.management.keyvault.v20190901.PrivateLinkResources; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.keyvault.v20190901.models.PrivateLinkResourceListResult; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateLinkResources. + */ +public class PrivateLinkResourcesImpl implements PrivateLinkResources { + /** The Retrofit service to perform REST calls. */ + private PrivateLinkResourcesService service; + /** The service client containing this operation class. */ + private KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateLinkResourcesImpl(Retrofit retrofit, KeyVaultManagementClientImpl client) { + this.service = retrofit.create(PrivateLinkResourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateLinkResources to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.keyvault.v20190901.PrivateLinkResources listByVault" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateLinkResources") + Observable> listByVault(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the private link resources supported for the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @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 PrivateLinkResourceListResult object if successful. + */ + public PrivateLinkResourceListResult listByVault(String resourceGroupName, String vaultName) { + return listByVaultWithServiceResponseAsync(resourceGroupName, vaultName).toBlocking().single().body(); + } + + /** + * Gets the private link resources supported for the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @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 listByVaultAsync(String resourceGroupName, String vaultName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByVaultWithServiceResponseAsync(resourceGroupName, vaultName), serviceCallback); + } + + /** + * Gets the private link resources supported for the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceListResult object + */ + public Observable listByVaultAsync(String resourceGroupName, String vaultName) { + return listByVaultWithServiceResponseAsync(resourceGroupName, vaultName).map(new Func1, PrivateLinkResourceListResult>() { + @Override + public PrivateLinkResourceListResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the private link resources supported for the key vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateLinkResourceListResult object + */ + public Observable> listByVaultWithServiceResponseAsync(String resourceGroupName, String vaultName) { + 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 (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByVault(this.client.subscriptionId(), resourceGroupName, vaultName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByVaultDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByVaultDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/SecretsImpl.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/SecretsImpl.java new file mode 100644 index 0000000000000..be4d949ba97e4 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/SecretsImpl.java @@ -0,0 +1,752 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.management.keyvault.v20190901.Secrets; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.keyvault.v20190901.models.PageImpl; +import com.microsoft.azure.management.keyvault.v20190901.models.Secret; +import com.microsoft.azure.management.keyvault.v20190901.models.SecretCloudError; +import com.microsoft.azure.management.keyvault.v20190901.models.SecretCreateOrUpdateParameters; +import com.microsoft.azure.management.keyvault.v20190901.models.SecretPatchParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Secrets. + */ +public class SecretsImpl implements Secrets { + /** The Retrofit service to perform REST calls. */ + private SecretsService service; + /** The service client containing this operation class. */ + private KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of SecretsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SecretsImpl(Retrofit retrofit, KeyVaultManagementClientImpl client) { + this.service = retrofit.create(SecretsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Secrets to be + * used by Retrofit to perform actually REST calls. + */ + interface SecretsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.keyvault.v20190901.Secrets createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("secretName") String secretName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body SecretCreateOrUpdateParameters parameters, @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.keyvault.v20190901.Secrets update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("secretName") String secretName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body SecretPatchParameters parameters, @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.keyvault.v20190901.Secrets get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("secretName") String secretName, @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.keyvault.v20190901.Secrets list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @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.keyvault.v20190901.Secrets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to create or update the secret + * @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 Object object if successful. + */ + public Object createOrUpdate(String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, secretName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to create or update the secret + * @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 createOrUpdateAsync(String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, secretName, parameters), serviceCallback); + } + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to create or update the secret + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, secretName, parameters).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to create or update the secret + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(resourceGroupName, vaultName, secretName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(400, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .register(409, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to patch the secret + * @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 Object object if successful. + */ + public Object update(String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, vaultName, secretName, parameters).toBlocking().single().body(); + } + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to patch the secret + * @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 updateAsync(String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, vaultName, secretName, parameters), serviceCallback); + } + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to patch the secret + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable updateAsync(String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, vaultName, secretName, parameters).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param secretName Name of the secret + * @param parameters Parameters to patch the secret + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, vaultName, secretName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(400, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .register(409, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @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 Object object if successful. + */ + public Object get(String resourceGroupName, String vaultName, String secretName) { + return getWithServiceResponseAsync(resourceGroupName, vaultName, secretName).toBlocking().single().body(); + } + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @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 getAsync(String resourceGroupName, String vaultName, String secretName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, vaultName, secretName), serviceCallback); + } + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable getAsync(String resourceGroupName, String vaultName, String secretName) { + return getWithServiceResponseAsync(resourceGroupName, vaultName, secretName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vaultName, String secretName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (secretName == null) { + throw new IllegalArgumentException("Parameter secretName 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."); + } + return service.get(resourceGroupName, vaultName, secretName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @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<Secret> object if successful. + */ + public PagedList list(final String resourceGroupName, final String vaultName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, vaultName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @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> listAsync(final String resourceGroupName, final String vaultName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, vaultName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Secret> object + */ + public Observable> listAsync(final String resourceGroupName, final String vaultName) { + return listWithServiceResponseAsync(resourceGroupName, vaultName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Secret> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String vaultName) { + return listSinglePageAsync(resourceGroupName, vaultName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Secret> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String vaultName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName 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 Integer top = null; + return service.list(resourceGroupName, vaultName, this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @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<Secret> object if successful. + */ + public PagedList list(final String resourceGroupName, final String vaultName, final Integer top) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, vaultName, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @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> listAsync(final String resourceGroupName, final String vaultName, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, vaultName, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Secret> object + */ + public Observable> listAsync(final String resourceGroupName, final String vaultName, final Integer top) { + return listWithServiceResponseAsync(resourceGroupName, vaultName, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Secret> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String vaultName, final Integer top) { + return listSinglePageAsync(resourceGroupName, vaultName, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + ServiceResponse> * @param resourceGroupName The name of the Resource Group to which the vault belongs. + ServiceResponse> * @param vaultName The name of the vault. + ServiceResponse> * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Secret> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String vaultName, final Integer top) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName 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."); + } + return service.list(resourceGroupName, vaultName, this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<Secret> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @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<Secret> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @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<Secret> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Secret> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> 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, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/VaultsImpl.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/VaultsImpl.java new file mode 100644 index 0000000000000..409933bfefec6 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/VaultsImpl.java @@ -0,0 +1,2236 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.management.keyvault.v20190901.Vaults; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.keyvault.v20190901.models.AccessPolicyUpdateKind; +import com.microsoft.azure.management.keyvault.v20190901.models.CheckNameAvailabilityResult; +import com.microsoft.azure.management.keyvault.v20190901.models.DeletedVault; +import com.microsoft.azure.management.keyvault.v20190901.models.PageImpl; +import com.microsoft.azure.management.keyvault.v20190901.models.Vault; +import com.microsoft.azure.management.keyvault.v20190901.models.VaultAccessPolicyParameters; +import com.microsoft.azure.management.keyvault.v20190901.models.VaultAccessPolicyProperties; +import com.microsoft.azure.management.keyvault.v20190901.models.VaultCheckNameAvailabilityParameters; +import com.microsoft.azure.management.keyvault.v20190901.models.VaultCreateOrUpdateParameters; +import com.microsoft.azure.management.keyvault.v20190901.models.VaultPatchParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Resource; +import com.microsoft.rest.CloudError; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Vaults. + */ +public class VaultsImpl implements Vaults { + /** The Retrofit service to perform REST calls. */ + private VaultsService service; + /** The service client containing this operation class. */ + private KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of VaultsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VaultsImpl(Retrofit retrofit, KeyVaultManagementClientImpl client) { + this.service = retrofit.create(VaultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Vaults to be + * used by Retrofit to perform actually REST calls. + */ + interface VaultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.keyvault.v20190901.Vaults createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body VaultCreateOrUpdateParameters parameters, @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.keyvault.v20190901.Vaults beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body VaultCreateOrUpdateParameters parameters, @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.keyvault.v20190901.Vaults update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body VaultPatchParameters parameters, @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.keyvault.v20190901.Vaults delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @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.keyvault.v20190901.Vaults get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @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.keyvault.v20190901.Vaults updateAccessPolicy" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/accessPolicies/{operationKind}") + Observable> updateAccessPolicy(@Path("resourceGroupName") String resourceGroupName, @Path("vaultName") String vaultName, @Path("operationKind") AccessPolicyUpdateKind operationKind, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VaultAccessPolicyParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.keyvault.v20190901.Vaults listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @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.keyvault.v20190901.Vaults listBySubscription" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/vaults") + Observable> listBySubscription(@Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @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.keyvault.v20190901.Vaults listDeleted" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults") + Observable> listDeleted(@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.keyvault.v20190901.Vaults getDeleted" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}") + Observable> getDeleted(@Path("vaultName") String vaultName, @Path("location") String location, @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.keyvault.v20190901.Vaults purgeDeleted" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge") + Observable> purgeDeleted(@Path("vaultName") String vaultName, @Path("location") String location, @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.keyvault.v20190901.Vaults beginPurgeDeleted" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge") + Observable> beginPurgeDeleted(@Path("vaultName") String vaultName, @Path("location") String location, @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.keyvault.v20190901.Vaults listResource" }) + @GET("subscriptions/{subscriptionId}/resources") + Observable> listResource(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$top") Integer top, @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.keyvault.v20190901.Vaults checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body VaultCheckNameAvailabilityParameters vaultName, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.keyvault.v20190901.Vaults listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @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.keyvault.v20190901.Vaults listBySubscriptionNext" }) + @GET + Observable> listBySubscriptionNext(@Url String nextUrl, @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.keyvault.v20190901.Vaults listDeletedNext" }) + @GET + Observable> listDeletedNext(@Url String nextUrl, @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.keyvault.v20190901.Vaults listResourceNext" }) + @GET + Observable> listResourceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @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 Object object if successful. + */ + public Object createOrUpdate(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, parameters).toBlocking().last().body(); + } + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @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 createOrUpdateAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, parameters), serviceCallback); + } + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, parameters).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, vaultName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @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 Object object if successful. + */ + public Object beginCreateOrUpdate(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @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 beginCreateOrUpdateAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, parameters), serviceCallback); + } + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, parameters).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to create or update the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, vaultName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(400, new TypeToken() { }.getType()) + .register(409, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to patch the vault + * @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 Object object if successful. + */ + public Object update(String resourceGroupName, String vaultName, VaultPatchParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, vaultName, parameters).toBlocking().single().body(); + } + + /** + * Update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to patch the vault + * @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 updateAsync(String resourceGroupName, String vaultName, VaultPatchParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, vaultName, parameters), serviceCallback); + } + + /** + * Update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to patch the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable updateAsync(String resourceGroupName, String vaultName, VaultPatchParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, vaultName, parameters).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @param vaultName Name of the vault + * @param parameters Parameters to patch the vault + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String vaultName, VaultPatchParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(resourceGroupName, vaultName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(400, new TypeToken() { }.getType()) + .register(409, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault to delete + * @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 CloudError object if successful. + */ + public CloudError delete(String resourceGroupName, String vaultName) { + return deleteWithServiceResponseAsync(resourceGroupName, vaultName).toBlocking().single().body(); + } + + /** + * Deletes the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault to delete + * @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 deleteAsync(String resourceGroupName, String vaultName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, vaultName), serviceCallback); + } + + /** + * Deletes the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault to delete + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudError object + */ + public Observable deleteAsync(String resourceGroupName, String vaultName) { + return deleteWithServiceResponseAsync(resourceGroupName, vaultName).map(new Func1, CloudError>() { + @Override + public CloudError call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault to delete + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudError object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vaultName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName 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."); + } + return service.delete(resourceGroupName, vaultName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .register(400, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @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 Object object if successful. + */ + public Object get(String resourceGroupName, String vaultName) { + return getWithServiceResponseAsync(resourceGroupName, vaultName).toBlocking().single().body(); + } + + /** + * Gets the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @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 getAsync(String resourceGroupName, String vaultName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, vaultName), serviceCallback); + } + + /** + * Gets the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable getAsync(String resourceGroupName, String vaultName) { + return getWithServiceResponseAsync(resourceGroupName, vaultName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified Azure key vault. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vaultName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName 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."); + } + return service.get(resourceGroupName, vaultName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update access policies in a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param operationKind Name of the operation. Possible values include: 'add', 'replace', 'remove' + * @param properties Properties of the access policy + * @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 Object object if successful. + */ + public Object updateAccessPolicy(String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyProperties properties) { + return updateAccessPolicyWithServiceResponseAsync(resourceGroupName, vaultName, operationKind, properties).toBlocking().single().body(); + } + + /** + * Update access policies in a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param operationKind Name of the operation. Possible values include: 'add', 'replace', 'remove' + * @param properties Properties of the access policy + * @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 updateAccessPolicyAsync(String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateAccessPolicyWithServiceResponseAsync(resourceGroupName, vaultName, operationKind, properties), serviceCallback); + } + + /** + * Update access policies in a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param operationKind Name of the operation. Possible values include: 'add', 'replace', 'remove' + * @param properties Properties of the access policy + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable updateAccessPolicyAsync(String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyProperties properties) { + return updateAccessPolicyWithServiceResponseAsync(resourceGroupName, vaultName, operationKind, properties).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update access policies in a key vault in the specified subscription. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault + * @param operationKind Name of the operation. Possible values include: 'add', 'replace', 'remove' + * @param properties Properties of the access policy + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> updateAccessPolicyWithServiceResponseAsync(String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyProperties properties) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (operationKind == null) { + throw new IllegalArgumentException("Parameter operationKind 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 (properties == null) { + throw new IllegalArgumentException("Parameter properties is required and cannot be null."); + } + Validator.validate(properties); + VaultAccessPolicyParameters parameters = new VaultAccessPolicyParameters(); + parameters.withProperties(properties); + return service.updateAccessPolicy(resourceGroupName, vaultName, operationKind, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateAccessPolicyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateAccessPolicyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(400, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .register(409, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @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<Vault> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Vault> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer top = null; + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param top Maximum number of results to return. + * @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<Vault> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final Integer top) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param top Maximum number of results to return. + * @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> listByResourceGroupAsync(final String resourceGroupName, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final Integer top) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final Integer top) { + return listByResourceGroupSinglePageAsync(resourceGroupName, top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the Resource Group to which the vault belongs. + ServiceResponse> * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Vault> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final Integer top) { + 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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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<Vault> object if successful. + */ + public PagedList listBySubscription() { + ServiceResponse> response = listBySubscriptionSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the vaults associated with the 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> listBySubscriptionAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySubscriptionSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySubscriptionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + public Observable> listBySubscriptionAsync() { + return listBySubscriptionWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + public Observable>> listBySubscriptionWithServiceResponseAsync() { + return listBySubscriptionSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySubscriptionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Vault> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySubscriptionSinglePageAsync() { + 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 Integer top = null; + return service.listBySubscription(this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySubscriptionDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @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<Vault> object if successful. + */ + public PagedList listBySubscription(final Integer top) { + ServiceResponse> response = listBySubscriptionSinglePageAsync(top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @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> listBySubscriptionAsync(final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySubscriptionSinglePageAsync(top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySubscriptionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + public Observable> listBySubscriptionAsync(final Integer top) { + return listBySubscriptionWithServiceResponseAsync(top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Vault> object + */ + public Observable>> listBySubscriptionWithServiceResponseAsync(final Integer top) { + return listBySubscriptionSinglePageAsync(top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySubscriptionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + ServiceResponse> * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Vault> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySubscriptionSinglePageAsync(final Integer top) { + 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."); + } + return service.listBySubscription(this.client.subscriptionId(), top, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySubscriptionDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySubscriptionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the deleted vaults in a 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<DeletedVault> object if successful. + */ + public PagedList listDeleted() { + ServiceResponse> response = listDeletedSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listDeletedNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about the deleted vaults 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> listDeletedAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listDeletedSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listDeletedNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedVault> object + */ + public Observable> listDeletedAsync() { + return listDeletedWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DeletedVault> object + */ + public Observable>> listDeletedWithServiceResponseAsync() { + return listDeletedSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listDeletedNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedVault> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listDeletedSinglePageAsync() { + 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."); + } + return service.listDeleted(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDeletedDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDeletedDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the deleted Azure key vault. + * + * @param vaultName The name of the vault. + * @param location The location of the deleted vault. + * @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 Object object if successful. + */ + public Object getDeleted(String vaultName, String location) { + return getDeletedWithServiceResponseAsync(vaultName, location).toBlocking().single().body(); + } + + /** + * Gets the deleted Azure key vault. + * + * @param vaultName The name of the vault. + * @param location The location of the deleted vault. + * @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 getDeletedAsync(String vaultName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDeletedWithServiceResponseAsync(vaultName, location), serviceCallback); + } + + /** + * Gets the deleted Azure key vault. + * + * @param vaultName The name of the vault. + * @param location The location of the deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable getDeletedAsync(String vaultName, String location) { + return getDeletedWithServiceResponseAsync(vaultName, location).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the deleted Azure key vault. + * + * @param vaultName The name of the vault. + * @param location The location of the deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> getDeletedWithServiceResponseAsync(String vaultName, String location) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location 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."); + } + return service.getDeleted(vaultName, location, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDeletedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDeletedDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @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 CloudError object if successful. + */ + public CloudError purgeDeleted(String vaultName, String location) { + return purgeDeletedWithServiceResponseAsync(vaultName, location).toBlocking().last().body(); + } + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @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 purgeDeletedAsync(String vaultName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(purgeDeletedWithServiceResponseAsync(vaultName, location), serviceCallback); + } + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable purgeDeletedAsync(String vaultName, String location) { + return purgeDeletedWithServiceResponseAsync(vaultName, location).map(new Func1, CloudError>() { + @Override + public CloudError call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> purgeDeletedWithServiceResponseAsync(String vaultName, String location) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location 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."); + } + Observable> observable = service.purgeDeleted(vaultName, location, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @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 CloudError object if successful. + */ + public CloudError beginPurgeDeleted(String vaultName, String location) { + return beginPurgeDeletedWithServiceResponseAsync(vaultName, location).toBlocking().single().body(); + } + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @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 beginPurgeDeletedAsync(String vaultName, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPurgeDeletedWithServiceResponseAsync(vaultName, location), serviceCallback); + } + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudError object + */ + public Observable beginPurgeDeletedAsync(String vaultName, String location) { + return beginPurgeDeletedWithServiceResponseAsync(vaultName, location).map(new Func1, CloudError>() { + @Override + public CloudError call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + * + * @param vaultName The name of the soft-deleted vault. + * @param location The location of the soft-deleted vault. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CloudError object + */ + public Observable> beginPurgeDeletedWithServiceResponseAsync(String vaultName, String location) { + if (vaultName == null) { + throw new IllegalArgumentException("Parameter vaultName is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location 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."); + } + return service.beginPurgeDeleted(vaultName, location, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPurgeDeletedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPurgeDeletedDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(400, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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<Resource> object if successful. + */ + public PagedList listResource() { + ServiceResponse> response = listResourceSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the vaults associated with the 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> listResourceAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listResourceSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Resource> object + */ + public Observable> listResourceAsync() { + return listResourceWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Resource> object + */ + public Observable>> listResourceWithServiceResponseAsync() { + return listResourceSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Resource> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listResourceSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String filter = "resourceType eq 'Microsoft.KeyVault/vaults'"; + final String apiVersion = "2015-11-01"; + final Integer top = null; + return service.listResource(this.client.subscriptionId(), filter, top, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @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<Resource> object if successful. + */ + public PagedList listResource(final Integer top) { + ServiceResponse> response = listResourceSinglePageAsync(top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @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> listResourceAsync(final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listResourceSinglePageAsync(top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Resource> object + */ + public Observable> listResourceAsync(final Integer top) { + return listResourceWithServiceResponseAsync(top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Resource> object + */ + public Observable>> listResourceWithServiceResponseAsync(final Integer top) { + return listResourceSinglePageAsync(top) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + ServiceResponse> * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Resource> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listResourceSinglePageAsync(final Integer top) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String filter = "resourceType eq 'Microsoft.KeyVault/vaults'"; + final String apiVersion = "2015-11-01"; + return service.listResource(this.client.subscriptionId(), filter, top, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listResourceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listResourceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param name The vault name. + * @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 CheckNameAvailabilityResult object if successful. + */ + public CheckNameAvailabilityResult checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param name The vault name. + * @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 checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param name The vault name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResult object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResult>() { + @Override + public CheckNameAvailabilityResult call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param name The vault name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResult object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + VaultCheckNameAvailabilityParameters vaultName = new VaultCheckNameAvailabilityParameters(); + vaultName.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), vaultName, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<Vault> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified 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<Vault> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified 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<Vault> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription and within the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Vault> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<Vault> object if successful. + */ + public PagedList listBySubscriptionNext(final String nextPageLink) { + ServiceResponse> response = listBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySubscriptionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listBySubscriptionNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySubscriptionNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySubscriptionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @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<Vault> object + */ + public Observable> listBySubscriptionNextAsync(final String nextPageLink) { + return listBySubscriptionNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @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<Vault> object + */ + public Observable>> listBySubscriptionNextWithServiceResponseAsync(final String nextPageLink) { + return listBySubscriptionNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySubscriptionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Vault> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySubscriptionNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySubscriptionNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<DeletedVault> object if successful. + */ + public PagedList listDeletedNext(final String nextPageLink) { + ServiceResponse> response = listDeletedNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listDeletedNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listDeletedNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listDeletedNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listDeletedNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @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<DeletedVault> object + */ + public Observable> listDeletedNextAsync(final String nextPageLink) { + return listDeletedNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @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<DeletedVault> object + */ + public Observable>> listDeletedNextWithServiceResponseAsync(final String nextPageLink) { + return listDeletedNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listDeletedNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DeletedVault> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listDeletedNextSinglePageAsync(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.listDeletedNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDeletedNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDeletedNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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<Resource> object if successful. + */ + public PagedList listResourceNext(final String nextPageLink) { + ServiceResponse> response = listResourceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listResourceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listResourceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listResourceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listResourceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @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<Resource> object + */ + public Observable> listResourceNextAsync(final String nextPageLink) { + return listResourceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @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<Resource> object + */ + public Observable>> listResourceNextWithServiceResponseAsync(final String nextPageLink) { + return listResourceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listResourceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Resource> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listResourceNextSinglePageAsync(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.listResourceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listResourceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listResourceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/package-info.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/package-info.java new file mode 100644 index 0000000000000..cec779a262c29 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for KeyVaultManagementClient. + * The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. + */ +package com.microsoft.azure.management.keyvault.v2019_09_01.implementation; diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/AccessPolicyEntry.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/AccessPolicyEntry.java new file mode 100644 index 0000000000000..bd3120287699b --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/AccessPolicyEntry.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An identity that have access to the key vault. All identities in the array + * must use the same tenant ID as the key vault's tenant ID. + */ +public class AccessPolicyEntry { + /** + * The Azure Active Directory tenant ID that should be used for + * authenticating requests to the key vault. + */ + @JsonProperty(value = "tenantId", required = true) + private UUID tenantId; + + /** + * The object ID of a user, service principal or security group in the + * Azure Active Directory tenant for the vault. The object ID must be + * unique for the list of access policies. + */ + @JsonProperty(value = "objectId", required = true) + private String objectId; + + /** + * Application ID of the client making request on behalf of a principal. + */ + @JsonProperty(value = "applicationId") + private UUID applicationId; + + /** + * Permissions the identity has for keys, secrets and certificates. + */ + @JsonProperty(value = "permissions", required = true) + private Permissions permissions; + + /** + * Get the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + * + * @return the tenantId value + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Set the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + * + * @param tenantId the tenantId value to set + * @return the AccessPolicyEntry object itself. + */ + public AccessPolicyEntry withTenantId(UUID tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. The object ID must be unique for the list of access policies. + * + * @return the objectId value + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. The object ID must be unique for the list of access policies. + * + * @param objectId the objectId value to set + * @return the AccessPolicyEntry object itself. + */ + public AccessPolicyEntry withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get application ID of the client making request on behalf of a principal. + * + * @return the applicationId value + */ + public UUID applicationId() { + return this.applicationId; + } + + /** + * Set application ID of the client making request on behalf of a principal. + * + * @param applicationId the applicationId value to set + * @return the AccessPolicyEntry object itself. + */ + public AccessPolicyEntry withApplicationId(UUID applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Get permissions the identity has for keys, secrets and certificates. + * + * @return the permissions value + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set permissions the identity has for keys, secrets and certificates. + * + * @param permissions the permissions value to set + * @return the AccessPolicyEntry object itself. + */ + public AccessPolicyEntry withPermissions(Permissions permissions) { + this.permissions = permissions; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/AccessPolicyUpdateKind.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/AccessPolicyUpdateKind.java new file mode 100644 index 0000000000000..5303c529e92e3 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/AccessPolicyUpdateKind.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessPolicyUpdateKind. + */ +public enum AccessPolicyUpdateKind { + /** Enum value add. */ + ADD("add"), + + /** Enum value replace. */ + REPLACE("replace"), + + /** Enum value remove. */ + REMOVE("remove"); + + /** The actual serialized value for a AccessPolicyUpdateKind instance. */ + private String value; + + AccessPolicyUpdateKind(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessPolicyUpdateKind instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessPolicyUpdateKind object, or null if unable to parse. + */ + @JsonCreator + public static AccessPolicyUpdateKind fromString(String value) { + AccessPolicyUpdateKind[] items = AccessPolicyUpdateKind.values(); + for (AccessPolicyUpdateKind item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Attributes.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Attributes.java new file mode 100644 index 0000000000000..cb1d1110bde70 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Attributes.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object attributes managed by the KeyVault service. + */ +public class Attributes { + /** + * Determines whether the object is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Not before date in seconds since 1970-01-01T00:00:00Z. + */ + @JsonProperty(value = "nbf") + private Long notBefore; + + /** + * Expiry date in seconds since 1970-01-01T00:00:00Z. + */ + @JsonProperty(value = "exp") + private Long expires; + + /** + * Creation time in seconds since 1970-01-01T00:00:00Z. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private Long created; + + /** + * Last updated time in seconds since 1970-01-01T00:00:00Z. + */ + @JsonProperty(value = "updated", access = JsonProperty.Access.WRITE_ONLY) + private Long updated; + + /** + * Get determines whether the object is enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set determines whether the object is enabled. + * + * @param enabled the enabled value to set + * @return the Attributes object itself. + */ + public Attributes withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get not before date in seconds since 1970-01-01T00:00:00Z. + * + * @return the notBefore value + */ + public DateTime notBefore() { + if (this.notBefore == null) { + return null; + } + return new DateTime(this.notBefore * 1000L, DateTimeZone.UTC); + } + + /** + * Set not before date in seconds since 1970-01-01T00:00:00Z. + * + * @param notBefore the notBefore value to set + * @return the Attributes object itself. + */ + public Attributes withNotBefore(DateTime notBefore) { + if (notBefore == null) { + this.notBefore = null; + } else { + this.notBefore = notBefore.toDateTime(DateTimeZone.UTC).getMillis() / 1000; + } + return this; + } + + /** + * Get expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @return the expires value + */ + public DateTime expires() { + if (this.expires == null) { + return null; + } + return new DateTime(this.expires * 1000L, DateTimeZone.UTC); + } + + /** + * Set expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @param expires the expires value to set + * @return the Attributes object itself. + */ + public Attributes withExpires(DateTime expires) { + if (expires == null) { + this.expires = null; + } else { + this.expires = expires.toDateTime(DateTimeZone.UTC).getMillis() / 1000; + } + return this; + } + + /** + * Get creation time in seconds since 1970-01-01T00:00:00Z. + * + * @return the created value + */ + public DateTime created() { + if (this.created == null) { + return null; + } + return new DateTime(this.created * 1000L, DateTimeZone.UTC); + } + + /** + * Get last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @return the updated value + */ + public DateTime updated() { + if (this.updated == null) { + return null; + } + return new DateTime(this.updated * 1000L, DateTimeZone.UTC); + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/CertificatePermissions.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/CertificatePermissions.java new file mode 100644 index 0000000000000..3991fd0f26737 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/CertificatePermissions.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CertificatePermissions. + */ +public final class CertificatePermissions extends ExpandableStringEnum { + /** Static value all for CertificatePermissions. */ + public static final CertificatePermissions ALL = fromString("all"); + + /** Static value get for CertificatePermissions. */ + public static final CertificatePermissions GET = fromString("get"); + + /** Static value list for CertificatePermissions. */ + public static final CertificatePermissions LIST = fromString("list"); + + /** Static value delete for CertificatePermissions. */ + public static final CertificatePermissions DELETE = fromString("delete"); + + /** Static value create for CertificatePermissions. */ + public static final CertificatePermissions CREATE = fromString("create"); + + /** Static value import for CertificatePermissions. */ + public static final CertificatePermissions IMPORT = fromString("import"); + + /** Static value update for CertificatePermissions. */ + public static final CertificatePermissions UPDATE = fromString("update"); + + /** Static value managecontacts for CertificatePermissions. */ + public static final CertificatePermissions MANAGECONTACTS = fromString("managecontacts"); + + /** Static value getissuers for CertificatePermissions. */ + public static final CertificatePermissions GETISSUERS = fromString("getissuers"); + + /** Static value listissuers for CertificatePermissions. */ + public static final CertificatePermissions LISTISSUERS = fromString("listissuers"); + + /** Static value setissuers for CertificatePermissions. */ + public static final CertificatePermissions SETISSUERS = fromString("setissuers"); + + /** Static value deleteissuers for CertificatePermissions. */ + public static final CertificatePermissions DELETEISSUERS = fromString("deleteissuers"); + + /** Static value manageissuers for CertificatePermissions. */ + public static final CertificatePermissions MANAGEISSUERS = fromString("manageissuers"); + + /** Static value recover for CertificatePermissions. */ + public static final CertificatePermissions RECOVER = fromString("recover"); + + /** Static value purge for CertificatePermissions. */ + public static final CertificatePermissions PURGE = fromString("purge"); + + /** Static value backup for CertificatePermissions. */ + public static final CertificatePermissions BACKUP = fromString("backup"); + + /** Static value restore for CertificatePermissions. */ + public static final CertificatePermissions RESTORE = fromString("restore"); + + /** + * Creates or finds a CertificatePermissions from its string representation. + * @param name a name to look for + * @return the corresponding CertificatePermissions + */ + @JsonCreator + public static CertificatePermissions fromString(String name) { + return fromString(name, CertificatePermissions.class); + } + + /** + * @return known CertificatePermissions values + */ + public static Collection values() { + return values(CertificatePermissions.class); + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/CheckNameAvailabilityResult.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/CheckNameAvailabilityResult.java new file mode 100644 index 0000000000000..e41f2913cbba7 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/CheckNameAvailabilityResult.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CheckNameAvailability operation response. + */ +public class CheckNameAvailabilityResult { + /** + * A boolean value that indicates whether the name is available for you to + * use. If true, the name is available. If false, the name has already been + * taken or is invalid and cannot be used. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * The reason that a vault name could not be used. The Reason element is + * only returned if NameAvailable is false. Possible values include: + * 'AccountNameInvalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private Reason reason; + + /** + * An error message explaining the Reason value in more detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists'. + * + * @return the reason value + */ + public Reason reason() { + return this.reason; + } + + /** + * Get an error message explaining the Reason value in more detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/CreateMode.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/CreateMode.java new file mode 100644 index 0000000000000..3a2973836d645 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/CreateMode.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for CreateMode. + */ +public enum CreateMode { + /** Enum value recover. */ + RECOVER("recover"), + + /** Enum value default. */ + DEFAULT("default"); + + /** The actual serialized value for a CreateMode instance. */ + private String value; + + CreateMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CreateMode instance. + * + * @param value the serialized value to parse. + * @return the parsed CreateMode object, or null if unable to parse. + */ + @JsonCreator + public static CreateMode fromString(String value) { + CreateMode[] items = CreateMode.values(); + for (CreateMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/DeletedVault.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/DeletedVault.java new file mode 100644 index 0000000000000..3a62d92b5c574 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/DeletedVault.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Deleted vault information with extended details. + */ +public class DeletedVault { + /** + * The resource ID for the deleted key vault. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The name of the key vault. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The resource type of the key vault. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Properties of the vault. + */ + @JsonProperty(value = "properties") + private DeletedVaultProperties properties; + + /** + * Get the resource ID for the deleted key vault. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name of the key vault. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the resource type of the key vault. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get properties of the vault. + * + * @return the properties value + */ + public DeletedVaultProperties properties() { + return this.properties; + } + + /** + * Set properties of the vault. + * + * @param properties the properties value to set + * @return the DeletedVault object itself. + */ + public DeletedVault withProperties(DeletedVaultProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/DeletedVaultProperties.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/DeletedVaultProperties.java new file mode 100644 index 0000000000000..2ee992dcf20c1 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/DeletedVaultProperties.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the deleted vault. + */ +public class DeletedVaultProperties { + /** + * The resource id of the original vault. + */ + @JsonProperty(value = "vaultId", access = JsonProperty.Access.WRITE_ONLY) + private String vaultId; + + /** + * The location of the original vault. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * The deleted date. + */ + @JsonProperty(value = "deletionDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime deletionDate; + + /** + * The scheduled purged date. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime scheduledPurgeDate; + + /** + * Tags of the original vault. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + private Map tags; + + /** + * Purge protection status of the original vault. + */ + @JsonProperty(value = "purgeProtectionEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean purgeProtectionEnabled; + + /** + * Get the resource id of the original vault. + * + * @return the vaultId value + */ + public String vaultId() { + return this.vaultId; + } + + /** + * Get the location of the original vault. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Get the deleted date. + * + * @return the deletionDate value + */ + public DateTime deletionDate() { + return this.deletionDate; + } + + /** + * Get the scheduled purged date. + * + * @return the scheduledPurgeDate value + */ + public DateTime scheduledPurgeDate() { + return this.scheduledPurgeDate; + } + + /** + * Get tags of the original vault. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Get purge protection status of the original vault. + * + * @return the purgeProtectionEnabled value + */ + public Boolean purgeProtectionEnabled() { + return this.purgeProtectionEnabled; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/IPRule.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/IPRule.java new file mode 100644 index 0000000000000..a0d7d13844a35 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/IPRule.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A rule governing the accessibility of a vault from a specific ip address or + * ip range. + */ +public class IPRule { + /** + * An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple + * IP address) or '124.56.78.0/24' (all addresses that start with + * 124.56.78). + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get an IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that start with 124.56.78). + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set an IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that start with 124.56.78). + * + * @param value the value value to set + * @return the IPRule object itself. + */ + public IPRule withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/KeyPermissions.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/KeyPermissions.java new file mode 100644 index 0000000000000..f61dd3c4a9554 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/KeyPermissions.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for KeyPermissions. + */ +public final class KeyPermissions extends ExpandableStringEnum { + /** Static value all for KeyPermissions. */ + public static final KeyPermissions ALL = fromString("all"); + + /** Static value encrypt for KeyPermissions. */ + public static final KeyPermissions ENCRYPT = fromString("encrypt"); + + /** Static value decrypt for KeyPermissions. */ + public static final KeyPermissions DECRYPT = fromString("decrypt"); + + /** Static value wrapKey for KeyPermissions. */ + public static final KeyPermissions WRAP_KEY = fromString("wrapKey"); + + /** Static value unwrapKey for KeyPermissions. */ + public static final KeyPermissions UNWRAP_KEY = fromString("unwrapKey"); + + /** Static value sign for KeyPermissions. */ + public static final KeyPermissions SIGN = fromString("sign"); + + /** Static value verify for KeyPermissions. */ + public static final KeyPermissions VERIFY = fromString("verify"); + + /** Static value get for KeyPermissions. */ + public static final KeyPermissions GET = fromString("get"); + + /** Static value list for KeyPermissions. */ + public static final KeyPermissions LIST = fromString("list"); + + /** Static value create for KeyPermissions. */ + public static final KeyPermissions CREATE = fromString("create"); + + /** Static value update for KeyPermissions. */ + public static final KeyPermissions UPDATE = fromString("update"); + + /** Static value import for KeyPermissions. */ + public static final KeyPermissions IMPORT = fromString("import"); + + /** Static value delete for KeyPermissions. */ + public static final KeyPermissions DELETE = fromString("delete"); + + /** Static value backup for KeyPermissions. */ + public static final KeyPermissions BACKUP = fromString("backup"); + + /** Static value restore for KeyPermissions. */ + public static final KeyPermissions RESTORE = fromString("restore"); + + /** Static value recover for KeyPermissions. */ + public static final KeyPermissions RECOVER = fromString("recover"); + + /** Static value purge for KeyPermissions. */ + public static final KeyPermissions PURGE = fromString("purge"); + + /** + * Creates or finds a KeyPermissions from its string representation. + * @param name a name to look for + * @return the corresponding KeyPermissions + */ + @JsonCreator + public static KeyPermissions fromString(String name) { + return fromString(name, KeyPermissions.class); + } + + /** + * @return known KeyPermissions values + */ + public static Collection values() { + return values(KeyPermissions.class); + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/LogSpecification.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/LogSpecification.java new file mode 100644 index 0000000000000..bc116689fcc1d --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/LogSpecification.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Log specification of operation. + */ +public class LogSpecification { + /** + * Name of log specification. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of log specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Blob duration of specification. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get name of log specification. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of log specification. + * + * @param name the name value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of log specification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of log specification. + * + * @param displayName the displayName value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get blob duration of specification. + * + * @return the blobDuration value + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set blob duration of specification. + * + * @param blobDuration the blobDuration value to set + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/NetworkRuleAction.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/NetworkRuleAction.java new file mode 100644 index 0000000000000..f971cee39f3c3 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/NetworkRuleAction.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkRuleAction. + */ +public final class NetworkRuleAction extends ExpandableStringEnum { + /** Static value Allow for NetworkRuleAction. */ + public static final NetworkRuleAction ALLOW = fromString("Allow"); + + /** Static value Deny for NetworkRuleAction. */ + public static final NetworkRuleAction DENY = fromString("Deny"); + + /** + * Creates or finds a NetworkRuleAction from its string representation. + * @param name a name to look for + * @return the corresponding NetworkRuleAction + */ + @JsonCreator + public static NetworkRuleAction fromString(String name) { + return fromString(name, NetworkRuleAction.class); + } + + /** + * @return known NetworkRuleAction values + */ + public static Collection values() { + return values(NetworkRuleAction.class); + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/NetworkRuleBypassOptions.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/NetworkRuleBypassOptions.java new file mode 100644 index 0000000000000..3f781ea6df1d0 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/NetworkRuleBypassOptions.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkRuleBypassOptions. + */ +public final class NetworkRuleBypassOptions extends ExpandableStringEnum { + /** Static value AzureServices for NetworkRuleBypassOptions. */ + public static final NetworkRuleBypassOptions AZURE_SERVICES = fromString("AzureServices"); + + /** Static value None for NetworkRuleBypassOptions. */ + public static final NetworkRuleBypassOptions NONE = fromString("None"); + + /** + * Creates or finds a NetworkRuleBypassOptions from its string representation. + * @param name a name to look for + * @return the corresponding NetworkRuleBypassOptions + */ + @JsonCreator + public static NetworkRuleBypassOptions fromString(String name) { + return fromString(name, NetworkRuleBypassOptions.class); + } + + /** + * @return known NetworkRuleBypassOptions values + */ + public static Collection values() { + return values(NetworkRuleBypassOptions.class); + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/NetworkRuleSet.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/NetworkRuleSet.java new file mode 100644 index 0000000000000..4e0b8ef415119 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/NetworkRuleSet.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A set of rules governing the network accessibility of a vault. + */ +public class NetworkRuleSet { + /** + * Tells what traffic can bypass network rules. This can be 'AzureServices' + * or 'None'. If not specified the default is 'AzureServices'. Possible + * values include: 'AzureServices', 'None'. + */ + @JsonProperty(value = "bypass") + private NetworkRuleBypassOptions bypass; + + /** + * The default action when no rule from ipRules and from + * virtualNetworkRules match. This is only used after the bypass property + * has been evaluated. Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "defaultAction") + private NetworkRuleAction defaultAction; + + /** + * The list of IP address rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** + * The list of virtual network rules. + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /** + * Get tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default is 'AzureServices'. Possible values include: 'AzureServices', 'None'. + * + * @return the bypass value + */ + public NetworkRuleBypassOptions bypass() { + return this.bypass; + } + + /** + * Set tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default is 'AzureServices'. Possible values include: 'AzureServices', 'None'. + * + * @param bypass the bypass value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withBypass(NetworkRuleBypassOptions bypass) { + this.bypass = bypass; + return this; + } + + /** + * Get the default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property has been evaluated. Possible values include: 'Allow', 'Deny'. + * + * @return the defaultAction value + */ + public NetworkRuleAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass property has been evaluated. Possible values include: 'Allow', 'Deny'. + * + * @param defaultAction the defaultAction value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(NetworkRuleAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the list of IP address rules. + * + * @return the ipRules value + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the list of IP address rules. + * + * @param ipRules the ipRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get the list of virtual network rules. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the list of virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Operation.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Operation.java new file mode 100644 index 0000000000000..0efe4bfdfe503 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Operation.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Key Vault REST API operation definition. + */ +@JsonFlatten +public class Operation { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The origin of operations. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "properties.serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Property to specify whether the action is a data action. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the Operation object itself. + */ + public Operation withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the Operation object itself. + */ + public Operation withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin of operations. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin of operations. + * + * @param origin the origin value to set + * @return the Operation object itself. + */ + public Operation withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get one property of operation, include metric specifications. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set one property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the Operation object itself. + */ + public Operation withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Get property to specify whether the action is a data action. + * + * @return the isDataAction value + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set property to specify whether the action is a data action. + * + * @param isDataAction the isDataAction value to set + * @return the Operation object itself. + */ + public Operation withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/OperationDisplay.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/OperationDisplay.java new file mode 100644 index 0000000000000..157ae21d95082 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft Key Vault. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft Key Vault. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft Key Vault. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PageImpl.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PageImpl.java new file mode 100644 index 0000000000000..c91ceabcefadc --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Permissions.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Permissions.java new file mode 100644 index 0000000000000..2f43795a7d6b5 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Permissions.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Permissions the identity has for keys, secrets, certificates and storage. + */ +public class Permissions { + /** + * Permissions to keys. + */ + @JsonProperty(value = "keys") + private List keys; + + /** + * Permissions to secrets. + */ + @JsonProperty(value = "secrets") + private List secrets; + + /** + * Permissions to certificates. + */ + @JsonProperty(value = "certificates") + private List certificates; + + /** + * Permissions to storage accounts. + */ + @JsonProperty(value = "storage") + private List storage; + + /** + * Get permissions to keys. + * + * @return the keys value + */ + public List keys() { + return this.keys; + } + + /** + * Set permissions to keys. + * + * @param keys the keys value to set + * @return the Permissions object itself. + */ + public Permissions withKeys(List keys) { + this.keys = keys; + return this; + } + + /** + * Get permissions to secrets. + * + * @return the secrets value + */ + public List secrets() { + return this.secrets; + } + + /** + * Set permissions to secrets. + * + * @param secrets the secrets value to set + * @return the Permissions object itself. + */ + public Permissions withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get permissions to certificates. + * + * @return the certificates value + */ + public List certificates() { + return this.certificates; + } + + /** + * Set permissions to certificates. + * + * @param certificates the certificates value to set + * @return the Permissions object itself. + */ + public Permissions withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get permissions to storage accounts. + * + * @return the storage value + */ + public List storage() { + return this.storage; + } + + /** + * Set permissions to storage accounts. + * + * @param storage the storage value to set + * @return the Permissions object itself. + */ + public Permissions withStorage(List storage) { + this.storage = storage; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpoint.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..c66a14f503564 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpoint.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Private endpoint object properties. + */ +public class PrivateEndpoint { + /** + * Full identifier of the private endpoint resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get full identifier of the private endpoint resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnection.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..64ef7b6b66fb7 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnection.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Private endpoint connection resource. + */ +@JsonFlatten +@SkipParentValidation +public class PrivateEndpointConnection extends Resource { + /** + * Properties of the private endpoint object. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * Approval state of the private link connection. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Provisioning state of the private endpoint connection. Possible values + * include: 'Succeeded', 'Creating', 'Updating', 'Deleting', 'Failed', + * 'Disconnected'. + */ + @JsonProperty(value = "properties.provisioningState") + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Modified whenever the user or NRP changes the state of PE connection. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get properties of the private endpoint object. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set properties of the private endpoint object. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnection object itself. + */ + public PrivateEndpointConnection withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get approval state of the private link connection. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set approval state of the private link connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnection object itself. + */ + public PrivateEndpointConnection withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get provisioning state of the private endpoint connection. Possible values include: 'Succeeded', 'Creating', 'Updating', 'Deleting', 'Failed', 'Disconnected'. + * + * @return the provisioningState value + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the private endpoint connection. Possible values include: 'Succeeded', 'Creating', 'Updating', 'Deleting', 'Failed', 'Disconnected'. + * + * @param provisioningState the provisioningState value to set + * @return the PrivateEndpointConnection object itself. + */ + public PrivateEndpointConnection withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get modified whenever the user or NRP changes the state of PE connection. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set modified whenever the user or NRP changes the state of PE connection. + * + * @param etag the etag value to set + * @return the PrivateEndpointConnection object itself. + */ + public PrivateEndpointConnection withEtag(String etag) { + this.etag = etag; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionItem.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionItem.java new file mode 100644 index 0000000000000..fc7d2b89d08c9 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionItem.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Private endpoint connection item. + */ +@JsonFlatten +public class PrivateEndpointConnectionItem { + /** + * Properties of the private endpoint object. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * Approval state of the private link connection. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Provisioning state of the private endpoint connection. Possible values + * include: 'Succeeded', 'Creating', 'Updating', 'Deleting', 'Failed', + * 'Disconnected'. + */ + @JsonProperty(value = "properties.provisioningState") + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get properties of the private endpoint object. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set properties of the private endpoint object. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionItem object itself. + */ + public PrivateEndpointConnectionItem withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get approval state of the private link connection. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set approval state of the private link connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionItem object itself. + */ + public PrivateEndpointConnectionItem withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get provisioning state of the private endpoint connection. Possible values include: 'Succeeded', 'Creating', 'Updating', 'Deleting', 'Failed', 'Disconnected'. + * + * @return the provisioningState value + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the private endpoint connection. Possible values include: 'Succeeded', 'Creating', 'Updating', 'Deleting', 'Failed', 'Disconnected'. + * + * @param provisioningState the provisioningState value to set + * @return the PrivateEndpointConnectionItem object itself. + */ + public PrivateEndpointConnectionItem withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionProvisioningState.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..7f216125e6454 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. + */ +public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** Static value Disconnected for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding PrivateEndpointConnectionProvisioningState + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * @return known PrivateEndpointConnectionProvisioningState values + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionsDeleteHeaders.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionsDeleteHeaders.java new file mode 100644 index 0000000000000..471aa32683ac9 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionsDeleteHeaders.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Delete operation. + */ +public class PrivateEndpointConnectionsDeleteHeaders { + /** + * The recommended number of seconds to wait before calling the URI + * specified in the location header. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * The URI to poll for completion status. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the recommended number of seconds to wait before calling the URI specified in the location header. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the recommended number of seconds to wait before calling the URI specified in the location header. + * + * @param retryAfter the retryAfter value to set + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the URI to poll for completion status. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the URI to poll for completion status. + * + * @param location the location value to set + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionsPutHeaders.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionsPutHeaders.java new file mode 100644 index 0000000000000..8d808073b841f --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointConnectionsPutHeaders.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Put operation. + */ +public class PrivateEndpointConnectionsPutHeaders { + /** + * (specified only if operation does not finish synchronously) The + * recommended number of seconds to wait before calling the URI specified + * in Azure-AsyncOperation. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * (specified only if operation does not finish synchronously) The URI to + * poll for completion status. The response of this URI may be synchronous + * or asynchronous. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get (specified only if operation does not finish synchronously) The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set (specified only if operation does not finish synchronously) The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. + * + * @param retryAfter the retryAfter value to set + * @return the PrivateEndpointConnectionsPutHeaders object itself. + */ + public PrivateEndpointConnectionsPutHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get (specified only if operation does not finish synchronously) The URI to poll for completion status. The response of this URI may be synchronous or asynchronous. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set (specified only if operation does not finish synchronously) The URI to poll for completion status. The response of this URI may be synchronous or asynchronous. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the PrivateEndpointConnectionsPutHeaders object itself. + */ + public PrivateEndpointConnectionsPutHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointServiceConnectionStatus.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..03f40a5dae356 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. + */ +public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * @param name a name to look for + * @return the corresponding PrivateEndpointServiceConnectionStatus + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * @return known PrivateEndpointServiceConnectionStatus values + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateLinkResource.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..66966506524a4 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateLinkResource.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A private link resource. + */ +@JsonFlatten +@SkipParentValidation +public class PrivateLinkResource extends Resource { + /** + * Group identifier of private link resource. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /** + * Required member names of private link resource. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /** + * Required DNS zone names of the the private link resource. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get group identifier of private link resource. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Get required member names of private link resource. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set required DNS zone names of the the private link resource. + * + * @param requiredZoneNames the requiredZoneNames value to set + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateLinkResourceListResult.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..53455d3e9423d --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateLinkResourceListResult.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A list of private link resources. + */ +public class PrivateLinkResourceListResult { + /** + * Array of private link resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get array of private link resources. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set array of private link resources. + * + * @param value the value value to set + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateLinkServiceConnectionState.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..1ddb4e0fff101 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An object that represents the approval state of the private link connection. + */ +public class PrivateLinkServiceConnectionState { + /** + * Indicates whether the connection has been approved, rejected or removed + * by the key vault owner. Possible values include: 'Pending', 'Approved', + * 'Rejected', 'Disconnected'. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /** + * The reason for approval or rejection. + */ + @JsonProperty(value = "description") + private String description; + + /** + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get indicates whether the connection has been approved, rejected or removed by the key vault owner. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @return the status value + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set indicates whether the connection has been approved, rejected or removed by the key vault owner. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'. + * + * @param status the status value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the reason for approval or rejection. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the reason for approval or rejection. + * + * @param description the description value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get a message indicating if changes on the service provider require any updates on the consumer. + * + * @return the actionsRequired value + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set a message indicating if changes on the service provider require any updates on the consumer. + * + * @param actionsRequired the actionsRequired value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Reason.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Reason.java new file mode 100644 index 0000000000000..b077ce633a48c --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Reason.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Reason. + */ +public enum Reason { + /** Enum value AccountNameInvalid. */ + ACCOUNT_NAME_INVALID("AccountNameInvalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a Reason instance. */ + private String value; + + Reason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Reason instance. + * + * @param value the serialized value to parse. + * @return the parsed Reason object, or null if unable to parse. + */ + @JsonCreator + public static Reason fromString(String value) { + Reason[] items = Reason.values(); + for (Reason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Secret.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Secret.java new file mode 100644 index 0000000000000..0b7b9d6a428e6 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Secret.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Resource information with extended details. + */ +@SkipParentValidation +public class Secret extends Resource { + /** + * Properties of the secret. + */ + @JsonProperty(value = "properties", required = true) + private SecretProperties properties; + + /** + * Get properties of the secret. + * + * @return the properties value + */ + public SecretProperties properties() { + return this.properties; + } + + /** + * Set properties of the secret. + * + * @param properties the properties value to set + * @return the Secret object itself. + */ + public Secret withProperties(SecretProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretAttributes.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretAttributes.java new file mode 100644 index 0000000000000..e0592f7699094 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretAttributes.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + + +/** + * The secret management attributes. + */ +public class SecretAttributes extends Attributes { +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretCloudError.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretCloudError.java new file mode 100644 index 0000000000000..52c1f8ef92478 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretCloudError.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error response from Key Vault resource provider. + */ +public class SecretCloudError { + /** + * An error response from Key Vault resource provider. + */ + @JsonProperty(value = "error") + private SecretCloudErrorError error; + + /** + * Get an error response from Key Vault resource provider. + * + * @return the error value + */ + public SecretCloudErrorError error() { + return this.error; + } + + /** + * Set an error response from Key Vault resource provider. + * + * @param error the error value to set + * @return the SecretCloudError object itself. + */ + public SecretCloudError withError(SecretCloudErrorError error) { + this.error = error; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretCloudErrorError.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretCloudErrorError.java new file mode 100644 index 0000000000000..0cfdf51638d7c --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretCloudErrorError.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error response from Key Vault resource provider. + */ +public class SecretCloudErrorError { + /** + * Error code. This is a mnemonic that can be consumed programmatically. + */ + @JsonProperty(value = "code") + private String code; + + /** + * User friendly error message. The message is typically localized and may + * vary with service version. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. This is a mnemonic that can be consumed programmatically. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. This is a mnemonic that can be consumed programmatically. + * + * @param code the code value to set + * @return the SecretCloudErrorError object itself. + */ + public SecretCloudErrorError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get user friendly error message. The message is typically localized and may vary with service version. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set user friendly error message. The message is typically localized and may vary with service version. + * + * @param message the message value to set + * @return the SecretCloudErrorError object itself. + */ + public SecretCloudErrorError withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretCreateOrUpdateParameters.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..bff4a4f7a077b --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretCreateOrUpdateParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for creating or updating a secret. + */ +public class SecretCreateOrUpdateParameters { + /** + * The tags that will be assigned to the secret. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Properties of the secret. + */ + @JsonProperty(value = "properties", required = true) + private SecretProperties properties; + + /** + * Get the tags that will be assigned to the secret. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags that will be assigned to the secret. + * + * @param tags the tags value to set + * @return the SecretCreateOrUpdateParameters object itself. + */ + public SecretCreateOrUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get properties of the secret. + * + * @return the properties value + */ + public SecretProperties properties() { + return this.properties; + } + + /** + * Set properties of the secret. + * + * @param properties the properties value to set + * @return the SecretCreateOrUpdateParameters object itself. + */ + public SecretCreateOrUpdateParameters withProperties(SecretProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretPatchParameters.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretPatchParameters.java new file mode 100644 index 0000000000000..67995424f517a --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretPatchParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for patching a secret. + */ +public class SecretPatchParameters { + /** + * The tags that will be assigned to the secret. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Properties of the secret. + */ + @JsonProperty(value = "properties") + private SecretPatchProperties properties; + + /** + * Get the tags that will be assigned to the secret. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags that will be assigned to the secret. + * + * @param tags the tags value to set + * @return the SecretPatchParameters object itself. + */ + public SecretPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get properties of the secret. + * + * @return the properties value + */ + public SecretPatchProperties properties() { + return this.properties; + } + + /** + * Set properties of the secret. + * + * @param properties the properties value to set + * @return the SecretPatchParameters object itself. + */ + public SecretPatchParameters withProperties(SecretPatchProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretPatchProperties.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretPatchProperties.java new file mode 100644 index 0000000000000..65e23ecd02bcd --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretPatchProperties.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the secret. + */ +public class SecretPatchProperties { + /** + * The value of the secret. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The content type of the secret. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * The attributes of the secret. + */ + @JsonProperty(value = "attributes") + private SecretAttributes attributes; + + /** + * Get the value of the secret. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the secret. + * + * @param value the value value to set + * @return the SecretPatchProperties object itself. + */ + public SecretPatchProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the content type of the secret. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the content type of the secret. + * + * @param contentType the contentType value to set + * @return the SecretPatchProperties object itself. + */ + public SecretPatchProperties withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the attributes of the secret. + * + * @return the attributes value + */ + public SecretAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes of the secret. + * + * @param attributes the attributes value to set + * @return the SecretPatchProperties object itself. + */ + public SecretPatchProperties withAttributes(SecretAttributes attributes) { + this.attributes = attributes; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretPermissions.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretPermissions.java new file mode 100644 index 0000000000000..b4ea6a3199aab --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretPermissions.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecretPermissions. + */ +public final class SecretPermissions extends ExpandableStringEnum { + /** Static value all for SecretPermissions. */ + public static final SecretPermissions ALL = fromString("all"); + + /** Static value get for SecretPermissions. */ + public static final SecretPermissions GET = fromString("get"); + + /** Static value list for SecretPermissions. */ + public static final SecretPermissions LIST = fromString("list"); + + /** Static value set for SecretPermissions. */ + public static final SecretPermissions SET = fromString("set"); + + /** Static value delete for SecretPermissions. */ + public static final SecretPermissions DELETE = fromString("delete"); + + /** Static value backup for SecretPermissions. */ + public static final SecretPermissions BACKUP = fromString("backup"); + + /** Static value restore for SecretPermissions. */ + public static final SecretPermissions RESTORE = fromString("restore"); + + /** Static value recover for SecretPermissions. */ + public static final SecretPermissions RECOVER = fromString("recover"); + + /** Static value purge for SecretPermissions. */ + public static final SecretPermissions PURGE = fromString("purge"); + + /** + * Creates or finds a SecretPermissions from its string representation. + * @param name a name to look for + * @return the corresponding SecretPermissions + */ + @JsonCreator + public static SecretPermissions fromString(String name) { + return fromString(name, SecretPermissions.class); + } + + /** + * @return known SecretPermissions values + */ + public static Collection values() { + return values(SecretPermissions.class); + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretProperties.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretProperties.java new file mode 100644 index 0000000000000..100f66ab524c9 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SecretProperties.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the secret. + */ +public class SecretProperties { + /** + * The value of the secret. NOTE: 'value' will never be returned from the + * service, as APIs using this model are is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for + * interaction with vault secrets. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The content type of the secret. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * The attributes of the secret. + */ + @JsonProperty(value = "attributes") + private SecretAttributes attributes; + + /** + * The URI to retrieve the current version of the secret. + */ + @JsonProperty(value = "secretUri", access = JsonProperty.Access.WRITE_ONLY) + private String secretUri; + + /** + * The URI to retrieve the specific version of the secret. + */ + @JsonProperty(value = "secretUriWithVersion", access = JsonProperty.Access.WRITE_ONLY) + private String secretUriWithVersion; + + /** + * Get the value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param value the value value to set + * @return the SecretProperties object itself. + */ + public SecretProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the content type of the secret. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the content type of the secret. + * + * @param contentType the contentType value to set + * @return the SecretProperties object itself. + */ + public SecretProperties withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the attributes of the secret. + * + * @return the attributes value + */ + public SecretAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes of the secret. + * + * @param attributes the attributes value to set + * @return the SecretProperties object itself. + */ + public SecretProperties withAttributes(SecretAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the URI to retrieve the current version of the secret. + * + * @return the secretUri value + */ + public String secretUri() { + return this.secretUri; + } + + /** + * Get the URI to retrieve the specific version of the secret. + * + * @return the secretUriWithVersion value + */ + public String secretUriWithVersion() { + return this.secretUriWithVersion; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/ServiceSpecification.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/ServiceSpecification.java new file mode 100644 index 0000000000000..ee22ce87447cb --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/ServiceSpecification.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * One property of operation, include log specifications. + */ +public class ServiceSpecification { + /** + * Log specifications of operation. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get log specifications of operation. + * + * @return the logSpecifications value + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set log specifications of operation. + * + * @param logSpecifications the logSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Sku.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Sku.java new file mode 100644 index 0000000000000..506e41a8f7757 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Sku.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * SKU details. + */ +public class Sku { + /** + * SKU family name. + */ + @JsonProperty(value = "family", required = true) + private String family; + + /** + * SKU name to specify whether the key vault is a standard vault or a + * premium vault. Possible values include: 'standard', 'premium'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * Creates an instance of Sku class. + * @param name sKU name to specify whether the key vault is a standard vault or a premium vault. Possible values include: 'standard', 'premium'. + */ + public Sku() { + family = "A"; + } + + /** + * Get sKU family name. + * + * @return the family value + */ + public String family() { + return this.family; + } + + /** + * Set sKU family name. + * + * @param family the family value to set + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get sKU name to specify whether the key vault is a standard vault or a premium vault. Possible values include: 'standard', 'premium'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set sKU name to specify whether the key vault is a standard vault or a premium vault. Possible values include: 'standard', 'premium'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SkuName.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SkuName.java new file mode 100644 index 0000000000000..efef465f73c55 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/SkuName.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuName. + */ +public enum SkuName { + /** Enum value standard. */ + STANDARD("standard"), + + /** Enum value premium. */ + PREMIUM("premium"); + + /** The actual serialized value for a SkuName instance. */ + private String value; + + SkuName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuName instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuName object, or null if unable to parse. + */ + @JsonCreator + public static SkuName fromString(String value) { + SkuName[] items = SkuName.values(); + for (SkuName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/StoragePermissions.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/StoragePermissions.java new file mode 100644 index 0000000000000..19cee39c65b2f --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/StoragePermissions.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StoragePermissions. + */ +public final class StoragePermissions extends ExpandableStringEnum { + /** Static value all for StoragePermissions. */ + public static final StoragePermissions ALL = fromString("all"); + + /** Static value get for StoragePermissions. */ + public static final StoragePermissions GET = fromString("get"); + + /** Static value list for StoragePermissions. */ + public static final StoragePermissions LIST = fromString("list"); + + /** Static value delete for StoragePermissions. */ + public static final StoragePermissions DELETE = fromString("delete"); + + /** Static value set for StoragePermissions. */ + public static final StoragePermissions SET = fromString("set"); + + /** Static value update for StoragePermissions. */ + public static final StoragePermissions UPDATE = fromString("update"); + + /** Static value regeneratekey for StoragePermissions. */ + public static final StoragePermissions REGENERATEKEY = fromString("regeneratekey"); + + /** Static value recover for StoragePermissions. */ + public static final StoragePermissions RECOVER = fromString("recover"); + + /** Static value purge for StoragePermissions. */ + public static final StoragePermissions PURGE = fromString("purge"); + + /** Static value backup for StoragePermissions. */ + public static final StoragePermissions BACKUP = fromString("backup"); + + /** Static value restore for StoragePermissions. */ + public static final StoragePermissions RESTORE = fromString("restore"); + + /** Static value setsas for StoragePermissions. */ + public static final StoragePermissions SETSAS = fromString("setsas"); + + /** Static value listsas for StoragePermissions. */ + public static final StoragePermissions LISTSAS = fromString("listsas"); + + /** Static value getsas for StoragePermissions. */ + public static final StoragePermissions GETSAS = fromString("getsas"); + + /** Static value deletesas for StoragePermissions. */ + public static final StoragePermissions DELETESAS = fromString("deletesas"); + + /** + * Creates or finds a StoragePermissions from its string representation. + * @param name a name to look for + * @return the corresponding StoragePermissions + */ + @JsonCreator + public static StoragePermissions fromString(String name) { + return fromString(name, StoragePermissions.class); + } + + /** + * @return known StoragePermissions values + */ + public static Collection values() { + return values(StoragePermissions.class); + } +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Vault.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Vault.java new file mode 100644 index 0000000000000..c8892c4847906 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/Vault.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * Resource information with extended details. + */ +public class Vault extends Resource { + /** + * Properties of the vault. + */ + @JsonProperty(value = "properties", required = true) + private VaultProperties properties; + + /** + * Get properties of the vault. + * + * @return the properties value + */ + public VaultProperties properties() { + return this.properties; + } + + /** + * Set properties of the vault. + * + * @param properties the properties value to set + * @return the Vault object itself. + */ + public Vault withProperties(VaultProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultAccessPolicyParameters.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultAccessPolicyParameters.java new file mode 100644 index 0000000000000..b66c9c349ba13 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultAccessPolicyParameters.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Parameters for updating the access policy in a vault. + */ +public class VaultAccessPolicyParameters extends ProxyResource { + /** + * The resource type of the access policy. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Properties of the access policy. + */ + @JsonProperty(value = "properties", required = true) + private VaultAccessPolicyProperties properties; + + /** + * Get the resource type of the access policy. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Get properties of the access policy. + * + * @return the properties value + */ + public VaultAccessPolicyProperties properties() { + return this.properties; + } + + /** + * Set properties of the access policy. + * + * @param properties the properties value to set + * @return the VaultAccessPolicyParameters object itself. + */ + public VaultAccessPolicyParameters withProperties(VaultAccessPolicyProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultAccessPolicyProperties.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultAccessPolicyProperties.java new file mode 100644 index 0000000000000..40e6cb16f1448 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultAccessPolicyProperties.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the vault access policy. + */ +public class VaultAccessPolicyProperties { + /** + * An array of 0 to 16 identities that have access to the key vault. All + * identities in the array must use the same tenant ID as the key vault's + * tenant ID. + */ + @JsonProperty(value = "accessPolicies", required = true) + private List accessPolicies; + + /** + * Get an array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. + * + * @return the accessPolicies value + */ + public List accessPolicies() { + return this.accessPolicies; + } + + /** + * Set an array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. + * + * @param accessPolicies the accessPolicies value to set + * @return the VaultAccessPolicyProperties object itself. + */ + public VaultAccessPolicyProperties withAccessPolicies(List accessPolicies) { + this.accessPolicies = accessPolicies; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultCheckNameAvailabilityParameters.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultCheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..cff8f4a3d0a05 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultCheckNameAvailabilityParameters.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to check the availability of the vault name. + */ +public class VaultCheckNameAvailabilityParameters { + /** + * The vault name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource, Microsoft.KeyVault/vaults. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of VaultCheckNameAvailabilityParameters class. + * @param name the vault name. + */ + public VaultCheckNameAvailabilityParameters() { + type = "Microsoft.KeyVault/vaults"; + } + + /** + * Get the vault name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the vault name. + * + * @param name the name value to set + * @return the VaultCheckNameAvailabilityParameters object itself. + */ + public VaultCheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource, Microsoft.KeyVault/vaults. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of resource, Microsoft.KeyVault/vaults. + * + * @param type the type value to set + * @return the VaultCheckNameAvailabilityParameters object itself. + */ + public VaultCheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultCreateOrUpdateParameters.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..ddf73f9fe816c --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultCreateOrUpdateParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for creating or updating a vault. + */ +public class VaultCreateOrUpdateParameters { + /** + * The supported Azure location where the key vault should be created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The tags that will be assigned to the key vault. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Properties of the vault. + */ + @JsonProperty(value = "properties", required = true) + private VaultProperties properties; + + /** + * Get the supported Azure location where the key vault should be created. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the supported Azure location where the key vault should be created. + * + * @param location the location value to set + * @return the VaultCreateOrUpdateParameters object itself. + */ + public VaultCreateOrUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags that will be assigned to the key vault. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags that will be assigned to the key vault. + * + * @param tags the tags value to set + * @return the VaultCreateOrUpdateParameters object itself. + */ + public VaultCreateOrUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get properties of the vault. + * + * @return the properties value + */ + public VaultProperties properties() { + return this.properties; + } + + /** + * Set properties of the vault. + * + * @param properties the properties value to set + * @return the VaultCreateOrUpdateParameters object itself. + */ + public VaultCreateOrUpdateParameters withProperties(VaultProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultPatchParameters.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultPatchParameters.java new file mode 100644 index 0000000000000..0cafd9d280095 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultPatchParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for creating or updating a vault. + */ +public class VaultPatchParameters { + /** + * The tags that will be assigned to the key vault. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Properties of the vault. + */ + @JsonProperty(value = "properties") + private VaultPatchProperties properties; + + /** + * Get the tags that will be assigned to the key vault. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags that will be assigned to the key vault. + * + * @param tags the tags value to set + * @return the VaultPatchParameters object itself. + */ + public VaultPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get properties of the vault. + * + * @return the properties value + */ + public VaultPatchProperties properties() { + return this.properties; + } + + /** + * Set properties of the vault. + * + * @param properties the properties value to set + * @return the VaultPatchParameters object itself. + */ + public VaultPatchParameters withProperties(VaultPatchProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultPatchProperties.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultPatchProperties.java new file mode 100644 index 0000000000000..511c7c352b1a4 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultPatchProperties.java @@ -0,0 +1,351 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.UUID; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the vault. + */ +public class VaultPatchProperties { + /** + * The Azure Active Directory tenant ID that should be used for + * authenticating requests to the key vault. + */ + @JsonProperty(value = "tenantId") + private UUID tenantId; + + /** + * SKU details. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * An array of 0 to 16 identities that have access to the key vault. All + * identities in the array must use the same tenant ID as the key vault's + * tenant ID. + */ + @JsonProperty(value = "accessPolicies") + private List accessPolicies; + + /** + * Property to specify whether Azure Virtual Machines are permitted to + * retrieve certificates stored as secrets from the key vault. + */ + @JsonProperty(value = "enabledForDeployment") + private Boolean enabledForDeployment; + + /** + * Property to specify whether Azure Disk Encryption is permitted to + * retrieve secrets from the vault and unwrap keys. + */ + @JsonProperty(value = "enabledForDiskEncryption") + private Boolean enabledForDiskEncryption; + + /** + * Property to specify whether Azure Resource Manager is permitted to + * retrieve secrets from the key vault. + */ + @JsonProperty(value = "enabledForTemplateDeployment") + private Boolean enabledForTemplateDeployment; + + /** + * Property to specify whether the 'soft delete' functionality is enabled + * for this key vault. Once set to true, it cannot be reverted to false. + */ + @JsonProperty(value = "enableSoftDelete") + private Boolean enableSoftDelete; + + /** + * Property that controls how data actions are authorized. When true, the + * key vault will use Role Based Access Control (RBAC) for authorization of + * data actions, and the access policies specified in vault properties will + * be ignored (warning: this is a preview feature). When false, the key + * vault will use the access policies specified in vault properties, and + * any policy stored on Azure Resource Manager will be ignored. If null or + * not specified, the value of this property will not change. + */ + @JsonProperty(value = "enableRbacAuthorization") + private Boolean enableRbacAuthorization; + + /** + * softDelete data retention days. It accepts >=7 and <=90. + */ + @JsonProperty(value = "softDeleteRetentionInDays") + private Integer softDeleteRetentionInDays; + + /** + * The vault's create mode to indicate whether the vault need to be + * recovered or not. Possible values include: 'recover', 'default'. + */ + @JsonProperty(value = "createMode") + private CreateMode createMode; + + /** + * Property specifying whether protection against purge is enabled for this + * vault. Setting this property to true activates protection against purge + * for this vault and its content - only the Key Vault service may initiate + * a hard, irrecoverable deletion. The setting is effective only if soft + * delete is also enabled. Enabling this functionality is irreversible - + * that is, the property does not accept false as its value. + */ + @JsonProperty(value = "enablePurgeProtection") + private Boolean enablePurgeProtection; + + /** + * A collection of rules governing the accessibility of the vault from + * specific network locations. + */ + @JsonProperty(value = "networkAcls") + private NetworkRuleSet networkAcls; + + /** + * Get the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + * + * @return the tenantId value + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Set the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + * + * @param tenantId the tenantId value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withTenantId(UUID tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get sKU details. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set sKU details. + * + * @param sku the sku value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get an array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. + * + * @return the accessPolicies value + */ + public List accessPolicies() { + return this.accessPolicies; + } + + /** + * Set an array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. + * + * @param accessPolicies the accessPolicies value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withAccessPolicies(List accessPolicies) { + this.accessPolicies = accessPolicies; + return this; + } + + /** + * Get property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. + * + * @return the enabledForDeployment value + */ + public Boolean enabledForDeployment() { + return this.enabledForDeployment; + } + + /** + * Set property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. + * + * @param enabledForDeployment the enabledForDeployment value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withEnabledForDeployment(Boolean enabledForDeployment) { + this.enabledForDeployment = enabledForDeployment; + return this; + } + + /** + * Get property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. + * + * @return the enabledForDiskEncryption value + */ + public Boolean enabledForDiskEncryption() { + return this.enabledForDiskEncryption; + } + + /** + * Set property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. + * + * @param enabledForDiskEncryption the enabledForDiskEncryption value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withEnabledForDiskEncryption(Boolean enabledForDiskEncryption) { + this.enabledForDiskEncryption = enabledForDiskEncryption; + return this; + } + + /** + * Get property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. + * + * @return the enabledForTemplateDeployment value + */ + public Boolean enabledForTemplateDeployment() { + return this.enabledForTemplateDeployment; + } + + /** + * Set property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. + * + * @param enabledForTemplateDeployment the enabledForTemplateDeployment value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withEnabledForTemplateDeployment(Boolean enabledForTemplateDeployment) { + this.enabledForTemplateDeployment = enabledForTemplateDeployment; + return this; + } + + /** + * Get property to specify whether the 'soft delete' functionality is enabled for this key vault. Once set to true, it cannot be reverted to false. + * + * @return the enableSoftDelete value + */ + public Boolean enableSoftDelete() { + return this.enableSoftDelete; + } + + /** + * Set property to specify whether the 'soft delete' functionality is enabled for this key vault. Once set to true, it cannot be reverted to false. + * + * @param enableSoftDelete the enableSoftDelete value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withEnableSoftDelete(Boolean enableSoftDelete) { + this.enableSoftDelete = enableSoftDelete; + return this; + } + + /** + * Get property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the value of this property will not change. + * + * @return the enableRbacAuthorization value + */ + public Boolean enableRbacAuthorization() { + return this.enableRbacAuthorization; + } + + /** + * Set property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the value of this property will not change. + * + * @param enableRbacAuthorization the enableRbacAuthorization value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withEnableRbacAuthorization(Boolean enableRbacAuthorization) { + this.enableRbacAuthorization = enableRbacAuthorization; + return this; + } + + /** + * Get softDelete data retention days. It accepts >=7 and <=90. + * + * @return the softDeleteRetentionInDays value + */ + public Integer softDeleteRetentionInDays() { + return this.softDeleteRetentionInDays; + } + + /** + * Set softDelete data retention days. It accepts >=7 and <=90. + * + * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays) { + this.softDeleteRetentionInDays = softDeleteRetentionInDays; + return this; + } + + /** + * Get the vault's create mode to indicate whether the vault need to be recovered or not. Possible values include: 'recover', 'default'. + * + * @return the createMode value + */ + public CreateMode createMode() { + return this.createMode; + } + + /** + * Set the vault's create mode to indicate whether the vault need to be recovered or not. Possible values include: 'recover', 'default'. + * + * @param createMode the createMode value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withCreateMode(CreateMode createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get property specifying whether protection against purge is enabled for this vault. Setting this property to true activates protection against purge for this vault and its content - only the Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its value. + * + * @return the enablePurgeProtection value + */ + public Boolean enablePurgeProtection() { + return this.enablePurgeProtection; + } + + /** + * Set property specifying whether protection against purge is enabled for this vault. Setting this property to true activates protection against purge for this vault and its content - only the Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its value. + * + * @param enablePurgeProtection the enablePurgeProtection value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withEnablePurgeProtection(Boolean enablePurgeProtection) { + this.enablePurgeProtection = enablePurgeProtection; + return this; + } + + /** + * Get a collection of rules governing the accessibility of the vault from specific network locations. + * + * @return the networkAcls value + */ + public NetworkRuleSet networkAcls() { + return this.networkAcls; + } + + /** + * Set a collection of rules governing the accessibility of the vault from specific network locations. + * + * @param networkAcls the networkAcls value to set + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withNetworkAcls(NetworkRuleSet networkAcls) { + this.networkAcls = networkAcls; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultProperties.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultProperties.java new file mode 100644 index 0000000000000..4c4b681889e4b --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VaultProperties.java @@ -0,0 +1,422 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import java.util.UUID; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of the vault. + */ +public class VaultProperties { + /** + * The Azure Active Directory tenant ID that should be used for + * authenticating requests to the key vault. + */ + @JsonProperty(value = "tenantId", required = true) + private UUID tenantId; + + /** + * SKU details. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * An array of 0 to 1024 identities that have access to the key vault. All + * identities in the array must use the same tenant ID as the key vault's + * tenant ID. When `createMode` is set to `recover`, access policies are + * not required. Otherwise, access policies are required. + */ + @JsonProperty(value = "accessPolicies") + private List accessPolicies; + + /** + * The URI of the vault for performing operations on keys and secrets. + */ + @JsonProperty(value = "vaultUri") + private String vaultUri; + + /** + * Property to specify whether Azure Virtual Machines are permitted to + * retrieve certificates stored as secrets from the key vault. + */ + @JsonProperty(value = "enabledForDeployment") + private Boolean enabledForDeployment; + + /** + * Property to specify whether Azure Disk Encryption is permitted to + * retrieve secrets from the vault and unwrap keys. + */ + @JsonProperty(value = "enabledForDiskEncryption") + private Boolean enabledForDiskEncryption; + + /** + * Property to specify whether Azure Resource Manager is permitted to + * retrieve secrets from the key vault. + */ + @JsonProperty(value = "enabledForTemplateDeployment") + private Boolean enabledForTemplateDeployment; + + /** + * Property to specify whether the 'soft delete' functionality is enabled + * for this key vault. If it's not set to any value(true or false) when + * creating new key vault, it will be set to true by default. Once set to + * true, it cannot be reverted to false. + */ + @JsonProperty(value = "enableSoftDelete") + private Boolean enableSoftDelete; + + /** + * softDelete data retention days. It accepts >=7 and <=90. + */ + @JsonProperty(value = "softDeleteRetentionInDays") + private Integer softDeleteRetentionInDays; + + /** + * Property that controls how data actions are authorized. When true, the + * key vault will use Role Based Access Control (RBAC) for authorization of + * data actions, and the access policies specified in vault properties will + * be ignored (warning: this is a preview feature). When false, the key + * vault will use the access policies specified in vault properties, and + * any policy stored on Azure Resource Manager will be ignored. If null or + * not specified, the vault is created with the default value of false. + * Note that management actions are always authorized with RBAC. + */ + @JsonProperty(value = "enableRbacAuthorization") + private Boolean enableRbacAuthorization; + + /** + * The vault's create mode to indicate whether the vault need to be + * recovered or not. Possible values include: 'recover', 'default'. + */ + @JsonProperty(value = "createMode") + private CreateMode createMode; + + /** + * Property specifying whether protection against purge is enabled for this + * vault. Setting this property to true activates protection against purge + * for this vault and its content - only the Key Vault service may initiate + * a hard, irrecoverable deletion. The setting is effective only if soft + * delete is also enabled. Enabling this functionality is irreversible - + * that is, the property does not accept false as its value. + */ + @JsonProperty(value = "enablePurgeProtection") + private Boolean enablePurgeProtection; + + /** + * Rules governing the accessibility of the key vault from specific network + * locations. + */ + @JsonProperty(value = "networkAcls") + private NetworkRuleSet networkAcls; + + /** + * Provisioning state of the vault. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /** + * List of private endpoint connections associated with the key vault. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + * + * @return the tenantId value + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Set the Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + * + * @param tenantId the tenantId value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withTenantId(UUID tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get sKU details. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set sKU details. + * + * @param sku the sku value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get an array of 0 to 1024 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. When `createMode` is set to `recover`, access policies are not required. Otherwise, access policies are required. + * + * @return the accessPolicies value + */ + public List accessPolicies() { + return this.accessPolicies; + } + + /** + * Set an array of 0 to 1024 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault's tenant ID. When `createMode` is set to `recover`, access policies are not required. Otherwise, access policies are required. + * + * @param accessPolicies the accessPolicies value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withAccessPolicies(List accessPolicies) { + this.accessPolicies = accessPolicies; + return this; + } + + /** + * Get the URI of the vault for performing operations on keys and secrets. + * + * @return the vaultUri value + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set the URI of the vault for performing operations on keys and secrets. + * + * @param vaultUri the vaultUri value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Get property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. + * + * @return the enabledForDeployment value + */ + public Boolean enabledForDeployment() { + return this.enabledForDeployment; + } + + /** + * Set property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from the key vault. + * + * @param enabledForDeployment the enabledForDeployment value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withEnabledForDeployment(Boolean enabledForDeployment) { + this.enabledForDeployment = enabledForDeployment; + return this; + } + + /** + * Get property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. + * + * @return the enabledForDiskEncryption value + */ + public Boolean enabledForDiskEncryption() { + return this.enabledForDiskEncryption; + } + + /** + * Set property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap keys. + * + * @param enabledForDiskEncryption the enabledForDiskEncryption value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withEnabledForDiskEncryption(Boolean enabledForDiskEncryption) { + this.enabledForDiskEncryption = enabledForDiskEncryption; + return this; + } + + /** + * Get property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. + * + * @return the enabledForTemplateDeployment value + */ + public Boolean enabledForTemplateDeployment() { + return this.enabledForTemplateDeployment; + } + + /** + * Set property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. + * + * @param enabledForTemplateDeployment the enabledForTemplateDeployment value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withEnabledForTemplateDeployment(Boolean enabledForTemplateDeployment) { + this.enabledForTemplateDeployment = enabledForTemplateDeployment; + return this; + } + + /** + * Get property to specify whether the 'soft delete' functionality is enabled for this key vault. If it's not set to any value(true or false) when creating new key vault, it will be set to true by default. Once set to true, it cannot be reverted to false. + * + * @return the enableSoftDelete value + */ + public Boolean enableSoftDelete() { + return this.enableSoftDelete; + } + + /** + * Set property to specify whether the 'soft delete' functionality is enabled for this key vault. If it's not set to any value(true or false) when creating new key vault, it will be set to true by default. Once set to true, it cannot be reverted to false. + * + * @param enableSoftDelete the enableSoftDelete value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withEnableSoftDelete(Boolean enableSoftDelete) { + this.enableSoftDelete = enableSoftDelete; + return this; + } + + /** + * Get softDelete data retention days. It accepts >=7 and <=90. + * + * @return the softDeleteRetentionInDays value + */ + public Integer softDeleteRetentionInDays() { + return this.softDeleteRetentionInDays; + } + + /** + * Set softDelete data retention days. It accepts >=7 and <=90. + * + * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays) { + this.softDeleteRetentionInDays = softDeleteRetentionInDays; + return this; + } + + /** + * Get property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the vault is created with the default value of false. Note that management actions are always authorized with RBAC. + * + * @return the enableRbacAuthorization value + */ + public Boolean enableRbacAuthorization() { + return this.enableRbacAuthorization; + } + + /** + * Set property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be ignored (warning: this is a preview feature). When false, the key vault will use the access policies specified in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, the vault is created with the default value of false. Note that management actions are always authorized with RBAC. + * + * @param enableRbacAuthorization the enableRbacAuthorization value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withEnableRbacAuthorization(Boolean enableRbacAuthorization) { + this.enableRbacAuthorization = enableRbacAuthorization; + return this; + } + + /** + * Get the vault's create mode to indicate whether the vault need to be recovered or not. Possible values include: 'recover', 'default'. + * + * @return the createMode value + */ + public CreateMode createMode() { + return this.createMode; + } + + /** + * Set the vault's create mode to indicate whether the vault need to be recovered or not. Possible values include: 'recover', 'default'. + * + * @param createMode the createMode value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withCreateMode(CreateMode createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get property specifying whether protection against purge is enabled for this vault. Setting this property to true activates protection against purge for this vault and its content - only the Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its value. + * + * @return the enablePurgeProtection value + */ + public Boolean enablePurgeProtection() { + return this.enablePurgeProtection; + } + + /** + * Set property specifying whether protection against purge is enabled for this vault. Setting this property to true activates protection against purge for this vault and its content - only the Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its value. + * + * @param enablePurgeProtection the enablePurgeProtection value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withEnablePurgeProtection(Boolean enablePurgeProtection) { + this.enablePurgeProtection = enablePurgeProtection; + return this; + } + + /** + * Get rules governing the accessibility of the key vault from specific network locations. + * + * @return the networkAcls value + */ + public NetworkRuleSet networkAcls() { + return this.networkAcls; + } + + /** + * Set rules governing the accessibility of the key vault from specific network locations. + * + * @param networkAcls the networkAcls value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withNetworkAcls(NetworkRuleSet networkAcls) { + this.networkAcls = networkAcls; + return this; + } + + /** + * Get provisioning state of the vault. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the vault. + * + * @param provisioningState the provisioningState value to set + * @return the VaultProperties object itself. + */ + public VaultProperties withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get list of private endpoint connections associated with the key vault. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VirtualNetworkRule.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VirtualNetworkRule.java new file mode 100644 index 0000000000000..7883795536789 --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/VirtualNetworkRule.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.keyvault.v2019_09_01.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A rule governing the accessibility of a vault from a specific virtual + * network. + */ +public class VirtualNetworkRule { + /** + * Full resource id of a vnet subnet, such as + * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + * + * @param id the id value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/package-info.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/package-info.java new file mode 100644 index 0000000000000..c0df79840c32f --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the models classes for KeyVaultManagementClient. + * The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. + */ +package com.microsoft.azure.management.keyvault.v2019_09_01.models; diff --git a/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/package-info.java b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/package-info.java new file mode 100644 index 0000000000000..8924c5bddf39c --- /dev/null +++ b/sdk/keyvault/mgmt-v2019_09_01/src/main/java/com/microsoft/azure/management/keyvault/v20190901/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for KeyVaultManagementClient. + * The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. + */ +package com.microsoft.azure.management.keyvault.v2019_09_01;