From 7935be3c21c234fea003e11a0d54b08b01416151 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 16 Nov 2021 03:46:26 +0000 Subject: [PATCH] CodeGen from PR 16763 in Azure/azure-rest-api-specs Merge 1de86290055518109e3cf73a0ecb5e1a9e5e6c76 into 48e3687f073bee2cdc03b1bab8b2cbbee07dcf49 --- eng/versioning/version_client.txt | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 + .../SAMPLE.md | 1288 ++++++++ .../pom.xml | 81 + .../keyvault/generated/KeyVaultManager.java | 344 +++ .../fluent/KeyVaultManagementClient.java | 110 + .../keyvault/generated/fluent/KeysClient.java | 170 ++ .../generated/fluent/ManagedHsmsClient.java | 395 +++ .../MhsmPrivateEndpointConnectionsClient.java | 190 ++ .../MhsmPrivateLinkResourcesClient.java | 42 + .../generated/fluent/OperationsClient.java | 36 + .../PrivateEndpointConnectionsClient.java | 179 ++ .../fluent/PrivateLinkResourcesClient.java | 42 + .../generated/fluent/SecretsClient.java | 156 + .../generated/fluent/VaultsClient.java | 410 +++ .../CheckNameAvailabilityResultInner.java | 75 + .../fluent/models/DeletedManagedHsmInner.java | 99 + .../fluent/models/DeletedVaultInner.java | 99 + .../generated/fluent/models/KeyInner.java | 252 ++ .../fluent/models/KeyProperties.java | 258 ++ .../fluent/models/ManagedHsmInner.java | 80 + .../MhsmPrivateEndpointConnectionInner.java | 169 ++ ...smPrivateEndpointConnectionProperties.java | 113 + ...hsmPrivateLinkResourceListResultInner.java | 55 + .../MhsmPrivateLinkResourceProperties.java | 81 + .../fluent/models/OperationInner.java | 174 ++ .../fluent/models/OperationProperties.java | 54 + .../PrivateEndpointConnectionInner.java | 159 + .../PrivateEndpointConnectionProperties.java | 113 + .../PrivateLinkResourceListResultInner.java | 55 + .../models/PrivateLinkResourceProperties.java | 81 + .../generated/fluent/models/SecretInner.java | 74 + .../VaultAccessPolicyParametersInner.java | 75 + .../generated/fluent/models/VaultInner.java | 90 + .../generated/fluent/models/package-info.java | 9 + .../generated/fluent/package-info.java | 9 + .../CheckNameAvailabilityResultImpl.java | 42 + .../implementation/DeletedManagedHsmImpl.java | 46 + .../implementation/DeletedVaultImpl.java | 45 + .../generated/implementation/KeyImpl.java | 185 ++ .../KeyVaultManagementClientBuilder.java | 149 + .../KeyVaultManagementClientImpl.java | 410 +++ .../implementation/KeysClientImpl.java | 1205 ++++++++ .../generated/implementation/KeysImpl.java | 162 + .../implementation/ManagedHsmImpl.java | 179 ++ .../implementation/ManagedHsmsClientImpl.java | 2211 ++++++++++++++ .../implementation/ManagedHsmsImpl.java | 212 ++ .../MhsmPrivateEndpointConnectionImpl.java | 228 ++ ...mPrivateEndpointConnectionsClientImpl.java | 1070 +++++++ .../MhsmPrivateEndpointConnectionsImpl.java | 220 ++ ...MhsmPrivateLinkResourceListResultImpl.java | 41 + .../MhsmPrivateLinkResourcesClientImpl.java | 223 ++ .../MhsmPrivateLinkResourcesImpl.java | 62 + .../implementation/OperationImpl.java | 50 + .../implementation/OperationsClientImpl.java | 269 ++ .../implementation/OperationsImpl.java | 46 + .../PrivateEndpointConnectionImpl.java | 213 ++ .../PrivateEndpointConnectionsClientImpl.java | 1047 +++++++ .../PrivateEndpointConnectionsImpl.java | 222 ++ .../PrivateLinkResourceListResultImpl.java | 41 + .../PrivateLinkResourcesClientImpl.java | 222 ++ .../PrivateLinkResourcesImpl.java | 62 + .../generated/implementation/SecretImpl.java | 187 ++ .../implementation/SecretsClientImpl.java | 979 ++++++ .../generated/implementation/SecretsImpl.java | 128 + .../generated/implementation/Utils.java | 204 ++ .../VaultAccessPolicyParametersImpl.java | 50 + .../generated/implementation/VaultImpl.java | 196 ++ .../implementation/VaultsClientImpl.java | 2661 +++++++++++++++++ .../generated/implementation/VaultsImpl.java | 285 ++ .../implementation/package-info.java | 9 + .../generated/models/AccessPolicyEntry.java | 156 + .../models/AccessPolicyUpdateKind.java | 50 + .../keyvault/generated/models/Action.java | 50 + .../generated/models/ActionsRequired.java | 31 + .../keyvault/generated/models/Attributes.java | 132 + .../models/CertificatePermissions.java | 79 + .../models/CheckNameAvailabilityResult.java | 41 + .../keyvault/generated/models/CreateMode.java | 47 + .../generated/models/DeletedManagedHsm.java | 45 + .../models/DeletedManagedHsmListResult.java | 81 + .../models/DeletedManagedHsmProperties.java | 118 + .../generated/models/DeletedVault.java | 45 + .../models/DeletedVaultListResult.java | 81 + .../models/DeletedVaultProperties.java | 118 + .../models/DeletionRecoveryLevel.java | 41 + .../generated/models/DimensionProperties.java | 105 + .../keyvault/generated/models/Error.java | 43 + .../generated/models/ErrorException.java | 37 + .../keyvault/generated/models/IpRule.java | 58 + .../generated/models/JsonWebKeyCurveName.java | 40 + .../generated/models/JsonWebKeyOperation.java | 52 + .../generated/models/JsonWebKeyType.java | 40 + .../keyvault/generated/models/Key.java | 215 ++ .../generated/models/KeyAttributes.java | 178 ++ .../generated/models/KeyCreateParameters.java | 87 + .../generated/models/KeyListResult.java | 81 + .../generated/models/KeyPermissions.java | 91 + .../generated/models/KeyReleasePolicy.java | 85 + .../models/KeyRotationPolicyActionType.java | 47 + .../models/KeyRotationPolicyAttributes.java | 83 + .../keyvault/generated/models/Keys.java | 152 + .../generated/models/LifetimeAction.java | 82 + .../generated/models/LogSpecification.java | 102 + .../keyvault/generated/models/ManagedHsm.java | 255 ++ .../models/ManagedHsmListResult.java | 81 + .../models/ManagedHsmProperties.java | 346 +++ .../generated/models/ManagedHsmResource.java | 86 + .../generated/models/ManagedHsmSku.java | 86 + .../generated/models/ManagedHsmSkuFamily.java | 31 + .../generated/models/ManagedHsmSkuName.java | 47 + .../generated/models/ManagedHsms.java | 245 ++ .../generated/models/MetricSpecification.java | 318 ++ .../generated/models/MhsmNetworkRuleSet.java | 142 + .../generated/models/MhsmPrivateEndpoint.java | 39 + .../models/MhsmPrivateEndpointConnection.java | 358 +++ .../MhsmPrivateEndpointConnectionItem.java | 114 + .../MhsmPrivateEndpointConnections.java | 157 + ...ivateEndpointConnectionsDeleteHeaders.java | 76 + ...vateEndpointConnectionsDeleteResponse.java | 38 + ...mPrivateEndpointConnectionsListResult.java | 81 + ...mPrivateEndpointConnectionsPutHeaders.java | 76 + ...PrivateEndpointConnectionsPutResponse.java | 38 + .../models/MhsmPrivateLinkResource.java | 109 + .../MhsmPrivateLinkResourceListResult.java | 26 + .../models/MhsmPrivateLinkResources.java | 37 + ...MhsmPrivateLinkServiceConnectionState.java | 108 + .../models/MhsmVirtualNetworkRule.java | 58 + .../keyvault/generated/models/MhsmipRule.java | 59 + .../generated/models/NetworkRuleAction.java | 34 + .../models/NetworkRuleBypassOptions.java | 34 + .../generated/models/NetworkRuleSet.java | 142 + .../keyvault/generated/models/Operation.java | 52 + .../generated/models/OperationDisplay.java | 128 + .../generated/models/OperationListResult.java | 84 + .../keyvault/generated/models/Operations.java | 31 + .../generated/models/Permissions.java | 129 + .../generated/models/PrivateEndpoint.java | 39 + .../models/PrivateEndpointConnection.java | 317 ++ .../models/PrivateEndpointConnectionItem.java | 167 ++ .../PrivateEndpointConnectionListResult.java | 81 + ...teEndpointConnectionProvisioningState.java | 47 + .../models/PrivateEndpointConnections.java | 148 + ...ivateEndpointConnectionsDeleteHeaders.java | 76 + ...vateEndpointConnectionsDeleteResponse.java | 38 + .../PrivateEndpointConnectionsPutHeaders.java | 76 + ...PrivateEndpointConnectionsPutResponse.java | 38 + ...rivateEndpointServiceConnectionStatus.java | 41 + .../generated/models/PrivateLinkResource.java | 101 + .../models/PrivateLinkResourceListResult.java | 26 + .../models/PrivateLinkResources.java | 37 + .../PrivateLinkServiceConnectionState.java | 108 + .../generated/models/ProvisioningState.java | 52 + .../generated/models/PublicNetworkAccess.java | 34 + .../keyvault/generated/models/Reason.java | 47 + .../generated/models/ResourceListResult.java | 78 + .../generated/models/RotationPolicy.java | 83 + .../keyvault/generated/models/Secret.java | 202 ++ .../generated/models/SecretAttributes.java | 46 + .../SecretCreateOrUpdateParameters.java | 87 + .../generated/models/SecretListResult.java | 81 + .../models/SecretPatchParameters.java | 82 + .../models/SecretPatchProperties.java | 105 + .../generated/models/SecretPermissions.java | 55 + .../generated/models/SecretProperties.java | 142 + .../keyvault/generated/models/Secrets.java | 102 + .../models/ServiceSpecification.java | 83 + .../keyvault/generated/models/Sku.java | 85 + .../keyvault/generated/models/SkuFamily.java | 31 + .../keyvault/generated/models/SkuName.java | 47 + .../generated/models/StoragePermissions.java | 73 + .../keyvault/generated/models/Trigger.java | 82 + .../keyvault/generated/models/Vault.java | 228 ++ .../models/VaultAccessPolicyParameters.java | 53 + .../models/VaultAccessPolicyProperties.java | 63 + .../VaultCheckNameAvailabilityParameters.java | 87 + .../models/VaultCreateOrUpdateParameters.java | 119 + .../generated/models/VaultListResult.java | 81 + .../models/VaultPatchParameters.java | 82 + .../models/VaultPatchProperties.java | 433 +++ .../generated/models/VaultProperties.java | 535 ++++ .../models/VaultProvisioningState.java | 34 + .../keyvault/generated/models/Vaults.java | 314 ++ .../generated/models/VirtualNetworkRule.java | 87 + .../generated/models/package-info.java | 9 + .../keyvault/generated/package-info.java | 9 + .../src/main/java/module-info.java | 19 + .../KeysCreateIfNotExistSamples.java | 28 + .../generated/generated/KeysGetSamples.java | 22 + .../generated/KeysGetVersionSamples.java | 29 + .../generated/generated/KeysListSamples.java | 22 + .../generated/KeysListVersionsSamples.java | 22 + .../ManagedHsmsCreateOrUpdateSamples.java | 55 + .../generated/ManagedHsmsDeleteSamples.java | 22 + .../ManagedHsmsGetByResourceGroupSamples.java | 22 + .../ManagedHsmsGetDeletedSamples.java | 23 + ...ManagedHsmsListByResourceGroupSamples.java | 23 + .../ManagedHsmsListDeletedSamples.java | 23 + .../generated/ManagedHsmsListSamples.java | 23 + .../ManagedHsmsPurgeDeletedSamples.java | 22 + .../generated/ManagedHsmsUpdateSamples.java | 39 + ...ivateEndpointConnectionsDeleteSamples.java | 23 + ...mPrivateEndpointConnectionsGetSamples.java | 25 + ...pointConnectionsListByResourceSamples.java | 23 + ...mPrivateEndpointConnectionsPutSamples.java | 33 + ...inkResourcesListByMhsmResourceSamples.java | 23 + .../generated/OperationsListSamples.java | 23 + ...ivateEndpointConnectionsDeleteSamples.java | 23 + .../PrivateEndpointConnectionsGetSamples.java | 25 + ...pointConnectionsListByResourceSamples.java | 23 + .../PrivateEndpointConnectionsPutSamples.java | 34 + ...rivateLinkResourcesListByVaultSamples.java | 23 + .../SecretsCreateOrUpdateSamples.java | 27 + .../generated/SecretsGetSamples.java | 22 + .../generated/SecretsListSamples.java | 22 + .../generated/SecretsUpdateSamples.java | 26 + .../VaultsCheckNameAvailabilitySamples.java | 26 + .../VaultsCreateOrUpdateSamples.java | 146 + .../generated/VaultsDeleteSamples.java | 22 + .../VaultsGetByResourceGroupSamples.java | 22 + .../generated/VaultsGetDeletedSamples.java | 22 + .../VaultsListByResourceGroupSamples.java | 23 + .../VaultsListBySubscriptionSamples.java | 23 + .../generated/VaultsListDeletedSamples.java | 23 + .../generated/VaultsListSamples.java | 23 + .../generated/VaultsPurgeDeletedSamples.java | 22 + .../VaultsUpdateAccessPolicySamples.java | 53 + .../generated/VaultsUpdateSamples.java | 104 + sdk/keyvault/ci.yml | 3 + sdk/keyvault/pom.xml | 17 +- 231 files changed, 31985 insertions(+), 8 deletions(-) create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/CHANGELOG.md create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/README.md create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/SAMPLE.md create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/pom.xml create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/KeyVaultManager.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/KeyVaultManagementClient.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/KeysClient.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/ManagedHsmsClient.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/MhsmPrivateEndpointConnectionsClient.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/MhsmPrivateLinkResourcesClient.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/OperationsClient.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/PrivateLinkResourcesClient.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/SecretsClient.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/VaultsClient.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/CheckNameAvailabilityResultInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/DeletedManagedHsmInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/DeletedVaultInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/KeyInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/KeyProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/ManagedHsmInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateEndpointConnectionInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateEndpointConnectionProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateLinkResourceListResultInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateLinkResourceProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/OperationInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/OperationProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateLinkResourceListResultInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateLinkResourceProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/SecretInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/VaultAccessPolicyParametersInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/VaultInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/package-info.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/package-info.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/CheckNameAvailabilityResultImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/DeletedManagedHsmImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/DeletedVaultImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyVaultManagementClientBuilder.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyVaultManagementClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeysClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeysImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmsClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmsImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionsImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourceListResultImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourcesClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourcesImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationsImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourceListResultImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourcesClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretsClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretsImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/Utils.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultAccessPolicyParametersImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultsClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultsImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/package-info.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/AccessPolicyEntry.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/AccessPolicyUpdateKind.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Action.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ActionsRequired.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Attributes.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CertificatePermissions.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CheckNameAvailabilityResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CreateMode.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsm.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsmListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsmProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVault.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVaultListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVaultProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletionRecoveryLevel.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DimensionProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Error.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ErrorException.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/IpRule.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyCurveName.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyOperation.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyType.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Key.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyAttributes.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyCreateParameters.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyPermissions.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyReleasePolicy.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyRotationPolicyActionType.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyRotationPolicyAttributes.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Keys.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/LifetimeAction.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/LogSpecification.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsm.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmResource.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSku.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSkuFamily.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSkuName.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsms.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MetricSpecification.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmNetworkRuleSet.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpoint.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnection.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionItem.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnections.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsDeleteHeaders.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsDeleteResponse.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsPutHeaders.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsPutResponse.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResource.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResourceListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResources.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkServiceConnectionState.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmVirtualNetworkRule.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmipRule.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleAction.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleBypassOptions.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleSet.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Operation.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/OperationDisplay.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/OperationListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Operations.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Permissions.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpoint.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnection.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionItem.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnections.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsDeleteHeaders.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsDeleteResponse.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsPutHeaders.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsPutResponse.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointServiceConnectionStatus.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResource.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResourceListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResources.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ProvisioningState.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PublicNetworkAccess.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Reason.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ResourceListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/RotationPolicy.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Secret.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretAttributes.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretCreateOrUpdateParameters.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPatchParameters.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPatchProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPermissions.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Secrets.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ServiceSpecification.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Sku.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SkuFamily.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SkuName.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/StoragePermissions.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Trigger.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Vault.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultAccessPolicyParameters.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultAccessPolicyProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultCheckNameAvailabilityParameters.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultCreateOrUpdateParameters.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultPatchParameters.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultPatchProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultProperties.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultProvisioningState.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Vaults.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VirtualNetworkRule.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/package-info.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/package-info.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/module-info.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysCreateIfNotExistSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysGetSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysGetVersionSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysListSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysListVersionsSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsCreateOrUpdateSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsDeleteSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsGetByResourceGroupSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsGetDeletedSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListByResourceGroupSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListDeletedSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsPurgeDeletedSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsUpdateSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsListByResourceSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsPutSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateLinkResourcesListByMhsmResourceSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/OperationsListSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsListByResourceSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsPutSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateLinkResourcesListByVaultSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsCreateOrUpdateSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsGetSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsListSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsUpdateSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsCheckNameAvailabilitySamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsCreateOrUpdateSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsDeleteSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsGetByResourceGroupSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsGetDeletedSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListByResourceGroupSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListBySubscriptionSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListDeletedSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsPurgeDeletedSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsUpdateAccessPolicySamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsUpdateSamples.java diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index a3a187eb13995..65d1996b1cac4 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -323,6 +323,7 @@ com.azure.resourcemanager:azure-resourcemanager-logz;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-storagepool;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-dataprotection;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-desktopvirtualization;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-keyvault-generated;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/CHANGELOG.md b/sdk/keyvault/azure-resourcemanager-keyvault-generated/CHANGELOG.md new file mode 100644 index 0000000000000..f32a3af7faaba --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-11-16) + +- Azure Resource Manager KeyVault client library for Java. This package contains Microsoft Azure SDK for KeyVault Management SDK. The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. Package tag package-preview-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/README.md b/sdk/keyvault/azure-resourcemanager-keyvault-generated/README.md new file mode 100644 index 0000000000000..3f0d48322de97 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager KeyVault client library for Java + +Azure Resource Manager KeyVault client library for Java. + +This package contains Microsoft Azure SDK for KeyVault Management SDK. The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. Package tag package-preview-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-keyvault-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-keyvault-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +KeyVaultManager manager = KeyVaultManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/keyvault/azure-resourcemanager-keyvault-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/SAMPLE.md b/sdk/keyvault/azure-resourcemanager-keyvault-generated/SAMPLE.md new file mode 100644 index 0000000000000..9019702a54291 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/SAMPLE.md @@ -0,0 +1,1288 @@ +# Code snippets and samples + + +## Keys + +- [CreateIfNotExist](#keys_createifnotexist) +- [Get](#keys_get) +- [GetVersion](#keys_getversion) +- [List](#keys_list) +- [ListVersions](#keys_listversions) + +## ManagedHsms + +- [CreateOrUpdate](#managedhsms_createorupdate) +- [Delete](#managedhsms_delete) +- [GetByResourceGroup](#managedhsms_getbyresourcegroup) +- [GetDeleted](#managedhsms_getdeleted) +- [List](#managedhsms_list) +- [ListByResourceGroup](#managedhsms_listbyresourcegroup) +- [ListDeleted](#managedhsms_listdeleted) +- [PurgeDeleted](#managedhsms_purgedeleted) +- [Update](#managedhsms_update) + +## MhsmPrivateEndpointConnections + +- [Delete](#mhsmprivateendpointconnections_delete) +- [Get](#mhsmprivateendpointconnections_get) +- [ListByResource](#mhsmprivateendpointconnections_listbyresource) +- [Put](#mhsmprivateendpointconnections_put) + +## MhsmPrivateLinkResources + +- [ListByMhsmResource](#mhsmprivatelinkresources_listbymhsmresource) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByResource](#privateendpointconnections_listbyresource) +- [Put](#privateendpointconnections_put) + +## PrivateLinkResources + +- [ListByVault](#privatelinkresources_listbyvault) + +## Secrets + +- [CreateOrUpdate](#secrets_createorupdate) +- [Get](#secrets_get) +- [List](#secrets_list) +- [Update](#secrets_update) + +## Vaults + +- [CheckNameAvailability](#vaults_checknameavailability) +- [CreateOrUpdate](#vaults_createorupdate) +- [Delete](#vaults_delete) +- [GetByResourceGroup](#vaults_getbyresourcegroup) +- [GetDeleted](#vaults_getdeleted) +- [List](#vaults_list) +- [ListByResourceGroup](#vaults_listbyresourcegroup) +- [ListBySubscription](#vaults_listbysubscription) +- [ListDeleted](#vaults_listdeleted) +- [PurgeDeleted](#vaults_purgedeleted) +- [Update](#vaults_update) +- [UpdateAccessPolicy](#vaults_updateaccesspolicy) +### Keys_CreateIfNotExist + +```java +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyProperties; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyType; + +/** Samples for Keys CreateIfNotExist. */ +public final class KeysCreateIfNotExistSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/createKey.json + */ + /** + * Sample code: Create a key. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createAKey(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .keys() + .define("sample-key-name") + .withExistingVault("sample-group", "sample-vault-name") + .withProperties(new KeyProperties().withKty(JsonWebKeyType.RSA)) + .create(); + } +} +``` + +### Keys_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Keys Get. */ +public final class KeysGetSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getKey.json + */ + /** + * Sample code: Get a key. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void getAKey(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.keys().getWithResponse("sample-group", "sample-vault-name", "sample-key-name", Context.NONE); + } +} +``` + +### Keys_GetVersion + +```java +import com.azure.core.util.Context; + +/** Samples for Keys GetVersion. */ +public final class KeysGetVersionSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getKeyVersion.json + */ + /** + * Sample code: Get a key version. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void getAKeyVersion(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .keys() + .getVersionWithResponse( + "sample-group", + "sample-vault-name", + "sample-key-name", + "fd618d9519b74f9aae94ade66b876acc", + Context.NONE); + } +} +``` + +### Keys_List + +```java +import com.azure.core.util.Context; + +/** Samples for Keys List. */ +public final class KeysListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listKeys.json + */ + /** + * Sample code: List keys in the vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listKeysInTheVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.keys().list("sample-group", "sample-vault-name", Context.NONE); + } +} +``` + +### Keys_ListVersions + +```java +import com.azure.core.util.Context; + +/** Samples for Keys ListVersions. */ +public final class KeysListVersionsSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listKeyVersions.json + */ + /** + * Sample code: List key versions in the vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listKeyVersionsInTheVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.keys().listVersions("sample-group", "sample-vault-name", "sample-key-name", Context.NONE); + } +} +``` + +### ManagedHsms_CreateOrUpdate + +```java +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmProperties; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmSku; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmSkuFamily; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmSkuName; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** Samples for ManagedHsms CreateOrUpdate. */ +public final class ManagedHsmsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_CreateOrUpdate.json + */ + /** + * Sample code: Create a new managed HSM Pool or update an existing managed HSM Pool. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createANewManagedHSMPoolOrUpdateAnExistingManagedHSMPool( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .managedHsms() + .define("hsm1") + .withRegion("westus") + .withExistingResourceGroup("hsm-group") + .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) + .withSku(new ManagedHsmSku().withFamily(ManagedHsmSkuFamily.B).withName(ManagedHsmSkuName.STANDARD_B1)) + .withProperties( + new ManagedHsmProperties() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withInitialAdminObjectIds(Arrays.asList("00000000-0000-0000-0000-000000000000")) + .withEnableSoftDelete(true) + .withSoftDeleteRetentionInDays(90) + .withEnablePurgeProtection(true)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ManagedHsms_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsms Delete. */ +public final class ManagedHsmsDeleteSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_Delete.json + */ + /** + * Sample code: Delete a managed HSM Pool. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void deleteAManagedHSMPool(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().delete("hsm-group", "hsm1", Context.NONE); + } +} +``` + +### ManagedHsms_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsms GetByResourceGroup. */ +public final class ManagedHsmsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_Get.json + */ + /** + * Sample code: Retrieve a managed HSM Pool. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void retrieveAManagedHSMPool(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().getByResourceGroupWithResponse("hsm-group", "hsm1", Context.NONE); + } +} +``` + +### ManagedHsms_GetDeleted + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsms GetDeleted. */ +public final class ManagedHsmsGetDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/DeletedManagedHsm_Get.json + */ + /** + * Sample code: Retrieve a deleted managed HSM. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void retrieveADeletedManagedHSM( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().getDeletedWithResponse("hsm1", "westus", Context.NONE); + } +} +``` + +### ManagedHsms_List + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsms List. */ +public final class ManagedHsmsListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_ListBySubscription.json + */ + /** + * Sample code: List managed HSM Pools in a subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listManagedHSMPoolsInASubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().list(null, Context.NONE); + } +} +``` + +### ManagedHsms_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsms ListByResourceGroup. */ +public final class ManagedHsmsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_ListByResourceGroup.json + */ + /** + * Sample code: List managed HSM Pools in a resource group. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listManagedHSMPoolsInAResourceGroup( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().listByResourceGroup("hsm-group", null, Context.NONE); + } +} +``` + +### ManagedHsms_ListDeleted + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsms ListDeleted. */ +public final class ManagedHsmsListDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/DeletedManagedHsm_List.json + */ + /** + * Sample code: List deleted managed HSMs in the specified subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listDeletedManagedHSMsInTheSpecifiedSubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().listDeleted(Context.NONE); + } +} +``` + +### ManagedHsms_PurgeDeleted + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsms PurgeDeleted. */ +public final class ManagedHsmsPurgeDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/DeletedManagedHsm_Purge.json + */ + /** + * Sample code: Purge a managed HSM Pool. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void purgeAManagedHSMPool(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().purgeDeleted("hsm1", "westus", Context.NONE); + } +} +``` + +### ManagedHsms_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsm; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedHsms Update. */ +public final class ManagedHsmsUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_Update.json + */ + /** + * Sample code: Update an existing managed HSM Pool. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void updateAnExistingManagedHSMPool( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + ManagedHsm resource = + manager.managedHsms().getByResourceGroupWithResponse("hsm-group", "hsm1", Context.NONE).getValue(); + resource.update().withTags(mapOf("Dept", "hsm", "Environment", "dogfood", "Slice", "A")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### MhsmPrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for MhsmPrivateEndpointConnections Delete. */ +public final class MhsmPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_deletePrivateEndpointConnection.json + */ + /** + * Sample code: ManagedHsmDeletePrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void managedHsmDeletePrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.mhsmPrivateEndpointConnections().delete("sample-group", "sample-mhsm", "sample-pec", Context.NONE); + } +} +``` + +### MhsmPrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for MhsmPrivateEndpointConnections Get. */ +public final class MhsmPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_getPrivateEndpointConnection.json + */ + /** + * Sample code: ManagedHsmGetPrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void managedHsmGetPrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .mhsmPrivateEndpointConnections() + .getWithResponse("sample-group", "sample-mhsm", "sample-pec", Context.NONE); + } +} +``` + +### MhsmPrivateEndpointConnections_ListByResource + +```java +import com.azure.core.util.Context; + +/** Samples for MhsmPrivateEndpointConnections ListByResource. */ +public final class MhsmPrivateEndpointConnectionsListByResourceSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json + */ + /** + * Sample code: List managed HSM Pools in a subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listManagedHSMPoolsInASubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.mhsmPrivateEndpointConnections().listByResource("sample-group", "sample-mhsm", Context.NONE); + } +} +``` + +### MhsmPrivateEndpointConnections_Put + +```java +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointServiceConnectionStatus; + +/** Samples for MhsmPrivateEndpointConnections Put. */ +public final class MhsmPrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_putPrivateEndpointConnection.json + */ + /** + * Sample code: ManagedHsmPutPrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void managedHsmPutPrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .mhsmPrivateEndpointConnections() + .define("sample-pec") + .withRegion((String) null) + .withExistingManagedHSM("sample-group", "sample-mhsm") + .withPrivateLinkServiceConnectionState( + new MhsmPrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("My name is Joe and I'm approving this.")) + .create(); + } +} +``` + +### MhsmPrivateLinkResources_ListByMhsmResource + +```java +import com.azure.core.util.Context; + +/** Samples for MhsmPrivateLinkResources ListByMhsmResource. */ +public final class MhsmPrivateLinkResourcesListByMhsmResourceSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_listPrivateLinkResources.json + */ + /** + * Sample code: KeyVaultListPrivateLinkResources. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultListPrivateLinkResources( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.mhsmPrivateLinkResources().listByMhsmResourceWithResponse("sample-group", "sample-mhsm", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listOperations.json + */ + /** + * Sample code: Lists available Rest API operations. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listsAvailableRestAPIOperations( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/deletePrivateEndpointConnection.json + */ + /** + * Sample code: KeyVaultDeletePrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultDeletePrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.privateEndpointConnections().delete("sample-group", "sample-vault", "sample-pec", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getPrivateEndpointConnection.json + */ + /** + * Sample code: KeyVaultGetPrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultGetPrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("sample-group", "sample-vault", "sample-pec", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListByResource + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByResource. */ +public final class PrivateEndpointConnectionsListByResourceSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listPrivateEndpointConnection.json + */ + /** + * Sample code: KeyVaultListPrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultListPrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.privateEndpointConnections().listByResource("sample-group", "sample-vault", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Put + +```java +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Put. */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/putPrivateEndpointConnection.json + */ + /** + * Sample code: KeyVaultPutPrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultPutPrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .privateEndpointConnections() + .define("sample-pec") + .withRegion((String) null) + .withExistingVault("sample-group", "sample-vault") + .withEtag("") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("My name is Joe and I'm approving this.")) + .create(); + } +} +``` + +### PrivateLinkResources_ListByVault + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByVault. */ +public final class PrivateLinkResourcesListByVaultSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listPrivateLinkResources.json + */ + /** + * Sample code: KeyVaultListPrivateLinkResources. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultListPrivateLinkResources( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.privateLinkResources().listByVaultWithResponse("sample-group", "sample-vault", Context.NONE); + } +} +``` + +### Secrets_CreateOrUpdate + +```java +import com.azure.resourcemanager.keyvault.generated.models.SecretProperties; + +/** Samples for Secrets CreateOrUpdate. */ +public final class SecretsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/createSecret.json + */ + /** + * Sample code: Create a secret. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createASecret(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .secrets() + .define("secret-name") + .withExistingVault("sample-group", "sample-vault") + .withProperties(new SecretProperties().withValue("secret-value")) + .create(); + } +} +``` + +### Secrets_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets Get. */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getSecret.json + */ + /** + * Sample code: Get a secret. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void getASecret(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.secrets().getWithResponse("sample-group", "sample-vault", "secret-name", Context.NONE); + } +} +``` + +### Secrets_List + +```java +import com.azure.core.util.Context; + +/** Samples for Secrets List. */ +public final class SecretsListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listSecrets.json + */ + /** + * Sample code: List secrets in the vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listSecretsInTheVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.secrets().list("sample-group", "sample-vault", null, Context.NONE); + } +} +``` + +### Secrets_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.models.Secret; +import com.azure.resourcemanager.keyvault.generated.models.SecretPatchProperties; + +/** Samples for Secrets Update. */ +public final class SecretsUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/updateSecret.json + */ + /** + * Sample code: Update a secret. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void updateASecret(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + Secret resource = + manager.secrets().getWithResponse("sample-group", "sample-vault", "secret-name", Context.NONE).getValue(); + resource.update().withProperties(new SecretPatchProperties().withValue("secret-value2")).apply(); + } +} +``` + +### Vaults_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.models.VaultCheckNameAvailabilityParameters; + +/** Samples for Vaults CheckNameAvailability. */ +public final class VaultsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/checkVaultNameAvailability.json + */ + /** + * Sample code: Validate a vault name. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void validateAVaultName(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .vaults() + .checkNameAvailabilityWithResponse( + new VaultCheckNameAvailabilityParameters().withName("sample-vault"), Context.NONE); + } +} +``` + +### Vaults_CreateOrUpdate + +```java +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyEntry; +import com.azure.resourcemanager.keyvault.generated.models.CertificatePermissions; +import com.azure.resourcemanager.keyvault.generated.models.IpRule; +import com.azure.resourcemanager.keyvault.generated.models.KeyPermissions; +import com.azure.resourcemanager.keyvault.generated.models.NetworkRuleAction; +import com.azure.resourcemanager.keyvault.generated.models.NetworkRuleBypassOptions; +import com.azure.resourcemanager.keyvault.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.keyvault.generated.models.Permissions; +import com.azure.resourcemanager.keyvault.generated.models.SecretPermissions; +import com.azure.resourcemanager.keyvault.generated.models.Sku; +import com.azure.resourcemanager.keyvault.generated.models.SkuFamily; +import com.azure.resourcemanager.keyvault.generated.models.SkuName; +import com.azure.resourcemanager.keyvault.generated.models.VaultProperties; +import com.azure.resourcemanager.keyvault.generated.models.VirtualNetworkRule; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for Vaults CreateOrUpdate. */ +public final class VaultsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/createVaultWithNetworkAcls.json + */ + /** + * Sample code: Create or update a vault with network acls. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createOrUpdateAVaultWithNetworkAcls( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .vaults() + .define("sample-vault") + .withRegion("westus") + .withExistingResourceGroup("sample-resource-group") + .withProperties( + new VaultProperties() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) + .withEnabledForDeployment(true) + .withEnabledForDiskEncryption(true) + .withEnabledForTemplateDeployment(true) + .withNetworkAcls( + new NetworkRuleSet() + .withBypass(NetworkRuleBypassOptions.AZURE_SERVICES) + .withDefaultAction(NetworkRuleAction.DENY) + .withIpRules( + Arrays + .asList( + new IpRule().withValue("124.56.78.91"), + new IpRule().withValue("'10.91.4.0/24'"))) + .withVirtualNetworkRules( + Arrays + .asList( + new VirtualNetworkRule() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"))))) + .create(); + } + + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/createVault.json + */ + /** + * Sample code: Create a new vault or update an existing vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createANewVaultOrUpdateAnExistingVault( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .vaults() + .define("sample-vault") + .withRegion("westus") + .withExistingResourceGroup("sample-resource-group") + .withProperties( + new VaultProperties() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) + .withAccessPolicies( + Arrays + .asList( + new AccessPolicyEntry() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withObjectId("00000000-0000-0000-0000-000000000000") + .withPermissions( + new Permissions() + .withKeys( + Arrays + .asList( + KeyPermissions.ENCRYPT, + KeyPermissions.DECRYPT, + KeyPermissions.WRAP_KEY, + KeyPermissions.UNWRAP_KEY, + KeyPermissions.SIGN, + KeyPermissions.VERIFY, + KeyPermissions.GET, + KeyPermissions.LIST, + KeyPermissions.CREATE, + KeyPermissions.UPDATE, + KeyPermissions.IMPORT, + KeyPermissions.DELETE, + KeyPermissions.BACKUP, + KeyPermissions.RESTORE, + KeyPermissions.RECOVER, + KeyPermissions.PURGE)) + .withSecrets( + Arrays + .asList( + SecretPermissions.GET, + SecretPermissions.LIST, + SecretPermissions.SET, + SecretPermissions.DELETE, + SecretPermissions.BACKUP, + SecretPermissions.RESTORE, + SecretPermissions.RECOVER, + SecretPermissions.PURGE)) + .withCertificates( + Arrays + .asList( + CertificatePermissions.GET, + CertificatePermissions.LIST, + CertificatePermissions.DELETE, + CertificatePermissions.CREATE, + CertificatePermissions.IMPORT, + CertificatePermissions.UPDATE, + CertificatePermissions.MANAGECONTACTS, + CertificatePermissions.GETISSUERS, + CertificatePermissions.LISTISSUERS, + CertificatePermissions.SETISSUERS, + CertificatePermissions.DELETEISSUERS, + CertificatePermissions.MANAGEISSUERS, + CertificatePermissions.RECOVER, + CertificatePermissions.PURGE))))) + .withEnabledForDeployment(true) + .withEnabledForDiskEncryption(true) + .withEnabledForTemplateDeployment(true) + .withPublicNetworkAccess("Enabled")) + .create(); + } +} +``` + +### Vaults_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults Delete. */ +public final class VaultsDeleteSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/deleteVault.json + */ + /** + * Sample code: Delete a vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void deleteAVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().deleteWithResponse("sample-resource-group", "sample-vault", Context.NONE); + } +} +``` + +### Vaults_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults GetByResourceGroup. */ +public final class VaultsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getVault.json + */ + /** + * Sample code: Retrieve a vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void retrieveAVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().getByResourceGroupWithResponse("sample-resource-group", "sample-vault", Context.NONE); + } +} +``` + +### Vaults_GetDeleted + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults GetDeleted. */ +public final class VaultsGetDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getDeletedVault.json + */ + /** + * Sample code: Retrieve a deleted vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void retrieveADeletedVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().getDeletedWithResponse("sample-vault", "westus", Context.NONE); + } +} +``` + +### Vaults_List + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults List. */ +public final class VaultsListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listVault.json + */ + /** + * Sample code: List vaults in the specified subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listVaultsInTheSpecifiedSubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().list(1, Context.NONE); + } +} +``` + +### Vaults_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults ListByResourceGroup. */ +public final class VaultsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listVaultByResourceGroup.json + */ + /** + * Sample code: List vaults in the specified resource group. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listVaultsInTheSpecifiedResourceGroup( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().listByResourceGroup("sample-group", 1, Context.NONE); + } +} +``` + +### Vaults_ListBySubscription + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults ListBySubscription. */ +public final class VaultsListBySubscriptionSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listVaultBySubscription.json + */ + /** + * Sample code: List vaults in the specified subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listVaultsInTheSpecifiedSubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().listBySubscription(1, Context.NONE); + } +} +``` + +### Vaults_ListDeleted + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults ListDeleted. */ +public final class VaultsListDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listDeletedVaults.json + */ + /** + * Sample code: List deleted vaults in the specified subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listDeletedVaultsInTheSpecifiedSubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().listDeleted(Context.NONE); + } +} +``` + +### Vaults_PurgeDeleted + +```java +import com.azure.core.util.Context; + +/** Samples for Vaults PurgeDeleted. */ +public final class VaultsPurgeDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/purgeDeletedVault.json + */ + /** + * Sample code: Purge a deleted vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void purgeADeletedVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().purgeDeleted("sample-vault", "westus", Context.NONE); + } +} +``` + +### Vaults_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyEntry; +import com.azure.resourcemanager.keyvault.generated.models.CertificatePermissions; +import com.azure.resourcemanager.keyvault.generated.models.KeyPermissions; +import com.azure.resourcemanager.keyvault.generated.models.Permissions; +import com.azure.resourcemanager.keyvault.generated.models.SecretPermissions; +import com.azure.resourcemanager.keyvault.generated.models.Sku; +import com.azure.resourcemanager.keyvault.generated.models.SkuFamily; +import com.azure.resourcemanager.keyvault.generated.models.SkuName; +import com.azure.resourcemanager.keyvault.generated.models.Vault; +import com.azure.resourcemanager.keyvault.generated.models.VaultPatchProperties; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for Vaults Update. */ +public final class VaultsUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/updateVault.json + */ + /** + * Sample code: Update an existing vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void updateAnExistingVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + Vault resource = + manager + .vaults() + .getByResourceGroupWithResponse("sample-resource-group", "sample-vault", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new VaultPatchProperties() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) + .withAccessPolicies( + Arrays + .asList( + new AccessPolicyEntry() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withObjectId("00000000-0000-0000-0000-000000000000") + .withPermissions( + new Permissions() + .withKeys( + Arrays + .asList( + KeyPermissions.ENCRYPT, + KeyPermissions.DECRYPT, + KeyPermissions.WRAP_KEY, + KeyPermissions.UNWRAP_KEY, + KeyPermissions.SIGN, + KeyPermissions.VERIFY, + KeyPermissions.GET, + KeyPermissions.LIST, + KeyPermissions.CREATE, + KeyPermissions.UPDATE, + KeyPermissions.IMPORT, + KeyPermissions.DELETE, + KeyPermissions.BACKUP, + KeyPermissions.RESTORE, + KeyPermissions.RECOVER, + KeyPermissions.PURGE)) + .withSecrets( + Arrays + .asList( + SecretPermissions.GET, + SecretPermissions.LIST, + SecretPermissions.SET, + SecretPermissions.DELETE, + SecretPermissions.BACKUP, + SecretPermissions.RESTORE, + SecretPermissions.RECOVER, + SecretPermissions.PURGE)) + .withCertificates( + Arrays + .asList( + CertificatePermissions.GET, + CertificatePermissions.LIST, + CertificatePermissions.DELETE, + CertificatePermissions.CREATE, + CertificatePermissions.IMPORT, + CertificatePermissions.UPDATE, + CertificatePermissions.MANAGECONTACTS, + CertificatePermissions.GETISSUERS, + CertificatePermissions.LISTISSUERS, + CertificatePermissions.SETISSUERS, + CertificatePermissions.DELETEISSUERS, + CertificatePermissions.MANAGEISSUERS, + CertificatePermissions.RECOVER, + CertificatePermissions.PURGE))))) + .withEnabledForDeployment(true) + .withEnabledForDiskEncryption(true) + .withEnabledForTemplateDeployment(true) + .withPublicNetworkAccess("Enabled")) + .apply(); + } +} +``` + +### Vaults_UpdateAccessPolicy + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultAccessPolicyParametersInner; +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyEntry; +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyUpdateKind; +import com.azure.resourcemanager.keyvault.generated.models.CertificatePermissions; +import com.azure.resourcemanager.keyvault.generated.models.KeyPermissions; +import com.azure.resourcemanager.keyvault.generated.models.Permissions; +import com.azure.resourcemanager.keyvault.generated.models.SecretPermissions; +import com.azure.resourcemanager.keyvault.generated.models.VaultAccessPolicyProperties; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for Vaults UpdateAccessPolicy. */ +public final class VaultsUpdateAccessPolicySamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/updateAccessPoliciesAdd.json + */ + /** + * Sample code: Add an access policy, or update an access policy with new permissions. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void addAnAccessPolicyOrUpdateAnAccessPolicyWithNewPermissions( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .vaults() + .updateAccessPolicyWithResponse( + "sample-group", + "sample-vault", + AccessPolicyUpdateKind.ADD, + new VaultAccessPolicyParametersInner() + .withProperties( + new VaultAccessPolicyProperties() + .withAccessPolicies( + Arrays + .asList( + new AccessPolicyEntry() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withObjectId("00000000-0000-0000-0000-000000000000") + .withPermissions( + new Permissions() + .withKeys(Arrays.asList(KeyPermissions.ENCRYPT)) + .withSecrets(Arrays.asList(SecretPermissions.GET)) + .withCertificates(Arrays.asList(CertificatePermissions.GET)))))), + Context.NONE); + } +} +``` + diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/pom.xml b/sdk/keyvault/azure-resourcemanager-keyvault-generated/pom.xml new file mode 100644 index 0000000000000..a69bb6eed9d7e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/pom.xml @@ -0,0 +1,81 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-keyvault-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for KeyVault Management + This package contains Microsoft Azure SDK for KeyVault Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. Package tag package-preview-2021-06. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + false + + + + + + com.azure + azure-core + 1.22.0 + + + com.azure + azure-core-management + 1.4.3 + + + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/KeyVaultManager.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/KeyVaultManager.java new file mode 100644 index 0000000000000..383b75ed503aa --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/KeyVaultManager.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.KeyVaultManagementClient; +import com.azure.resourcemanager.keyvault.generated.implementation.KeyVaultManagementClientBuilder; +import com.azure.resourcemanager.keyvault.generated.implementation.KeysImpl; +import com.azure.resourcemanager.keyvault.generated.implementation.ManagedHsmsImpl; +import com.azure.resourcemanager.keyvault.generated.implementation.MhsmPrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.keyvault.generated.implementation.MhsmPrivateLinkResourcesImpl; +import com.azure.resourcemanager.keyvault.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.keyvault.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.keyvault.generated.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.keyvault.generated.implementation.SecretsImpl; +import com.azure.resourcemanager.keyvault.generated.implementation.VaultsImpl; +import com.azure.resourcemanager.keyvault.generated.models.Keys; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsms; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateEndpointConnections; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkResources; +import com.azure.resourcemanager.keyvault.generated.models.Operations; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.keyvault.generated.models.Secrets; +import com.azure.resourcemanager.keyvault.generated.models.Vaults; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to KeyVaultManager. The Azure management API provides a RESTful set of web services that interact with + * Azure Key Vault. + */ +public final class KeyVaultManager { + private Keys keys; + + private Vaults vaults; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private ManagedHsms managedHsms; + + private MhsmPrivateEndpointConnections mhsmPrivateEndpointConnections; + + private MhsmPrivateLinkResources mhsmPrivateLinkResources; + + private Operations operations; + + private Secrets secrets; + + private final KeyVaultManagementClient clientObject; + + private KeyVaultManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new KeyVaultManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of KeyVault service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the KeyVault service API instance. + */ + public static KeyVaultManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create KeyVaultManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new KeyVaultManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of KeyVault service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the KeyVault service API instance. + */ + public KeyVaultManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.keyvault.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new KeyVaultManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Keys. */ + public Keys keys() { + if (this.keys == null) { + this.keys = new KeysImpl(clientObject.getKeys(), this); + } + return keys; + } + + /** @return Resource collection API of Vaults. */ + public Vaults vaults() { + if (this.vaults == null) { + this.vaults = new VaultsImpl(clientObject.getVaults(), this); + } + return vaults; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of ManagedHsms. */ + public ManagedHsms managedHsms() { + if (this.managedHsms == null) { + this.managedHsms = new ManagedHsmsImpl(clientObject.getManagedHsms(), this); + } + return managedHsms; + } + + /** @return Resource collection API of MhsmPrivateEndpointConnections. */ + public MhsmPrivateEndpointConnections mhsmPrivateEndpointConnections() { + if (this.mhsmPrivateEndpointConnections == null) { + this.mhsmPrivateEndpointConnections = + new MhsmPrivateEndpointConnectionsImpl(clientObject.getMhsmPrivateEndpointConnections(), this); + } + return mhsmPrivateEndpointConnections; + } + + /** @return Resource collection API of MhsmPrivateLinkResources. */ + public MhsmPrivateLinkResources mhsmPrivateLinkResources() { + if (this.mhsmPrivateLinkResources == null) { + this.mhsmPrivateLinkResources = + new MhsmPrivateLinkResourcesImpl(clientObject.getMhsmPrivateLinkResources(), this); + } + return mhsmPrivateLinkResources; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of Secrets. */ + public Secrets secrets() { + if (this.secrets == null) { + this.secrets = new SecretsImpl(clientObject.getSecrets(), this); + } + return secrets; + } + + /** + * @return Wrapped service client KeyVaultManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public KeyVaultManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/KeyVaultManagementClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/KeyVaultManagementClient.java new file mode 100644 index 0000000000000..34dd320600db2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/KeyVaultManagementClient.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for KeyVaultManagementClient class. */ +public interface KeyVaultManagementClient { + /** + * 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 getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the KeysClient object to access its operations. + * + * @return the KeysClient object. + */ + KeysClient getKeys(); + + /** + * Gets the VaultsClient object to access its operations. + * + * @return the VaultsClient object. + */ + VaultsClient getVaults(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the ManagedHsmsClient object to access its operations. + * + * @return the ManagedHsmsClient object. + */ + ManagedHsmsClient getManagedHsms(); + + /** + * Gets the MhsmPrivateEndpointConnectionsClient object to access its operations. + * + * @return the MhsmPrivateEndpointConnectionsClient object. + */ + MhsmPrivateEndpointConnectionsClient getMhsmPrivateEndpointConnections(); + + /** + * Gets the MhsmPrivateLinkResourcesClient object to access its operations. + * + * @return the MhsmPrivateLinkResourcesClient object. + */ + MhsmPrivateLinkResourcesClient getMhsmPrivateLinkResources(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SecretsClient object to access its operations. + * + * @return the SecretsClient object. + */ + SecretsClient getSecrets(); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/KeysClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/KeysClient.java new file mode 100644 index 0000000000000..931edb07cd6d8 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/KeysClient.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyInner; +import com.azure.resourcemanager.keyvault.generated.models.KeyCreateParameters; + +/** An instance of this class provides access to all the operations defined in KeysClient. */ +public interface KeysClient { + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KeyInner createIfNotExist( + String resourceGroupName, String vaultName, String keyName, KeyCreateParameters parameters); + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. + * @param parameters The parameters used to create the specified key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createIfNotExistWithResponse( + String resourceGroupName, String vaultName, String keyName, KeyCreateParameters parameters, Context context); + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KeyInner get(String resourceGroupName, String vaultName, String keyName); + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, String keyName, Context context); + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KeyInner getVersion(String resourceGroupName, String vaultName, String keyName, String keyVersion); + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVersionWithResponse( + String resourceGroupName, String vaultName, String keyName, String keyVersion, Context context); + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String resourceGroupName, String vaultName, String keyName); + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String resourceGroupName, String vaultName, String keyName, Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/ManagedHsmsClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/ManagedHsmsClient.java new file mode 100644 index 0000000000000..11129ce52d618 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/ManagedHsmsClient.java @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedManagedHsmInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmInner; + +/** An instance of this class provides access to all the operations defined in ManagedHsmsClient. */ +public interface ManagedHsmsClient { + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedHsmInner> beginCreateOrUpdate( + String resourceGroupName, String name, ManagedHsmInner parameters); + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedHsmInner> beginCreateOrUpdate( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context); + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedHsmInner createOrUpdate(String resourceGroupName, String name, ManagedHsmInner parameters); + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedHsmInner createOrUpdate(String resourceGroupName, String name, ManagedHsmInner parameters, Context context); + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedHsmInner> beginUpdate( + String resourceGroupName, String name, ManagedHsmInner parameters); + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedHsmInner> beginUpdate( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context); + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedHsmInner update(String resourceGroupName, String name, ManagedHsmInner parameters); + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedHsmInner update(String resourceGroupName, String name, ManagedHsmInner parameters, Context context); + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name); + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String name, Context context); + + /** + * Gets the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedHsmInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Gets the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context); + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Integer top, Context context); + + /** + * The List operation gets information about the deleted managed HSMs associated with the subscription. + * + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDeleted(); + + /** + * The List operation gets information about the deleted managed HSMs associated with the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDeleted(Context context); + + /** + * Gets the specified deleted managed HSM. + * + * @param name The name of the deleted managed HSM. + * @param location The location of the deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified deleted managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeletedManagedHsmInner getDeleted(String name, String location); + + /** + * Gets the specified deleted managed HSM. + * + * @param name The name of the deleted managed HSM. + * @param location The location of the deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified deleted managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDeletedWithResponse(String name, String location, Context context); + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurgeDeleted(String name, String location); + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurgeDeleted(String name, String location, Context context); + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purgeDeleted(String name, String location); + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purgeDeleted(String name, String location, Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/MhsmPrivateEndpointConnectionsClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/MhsmPrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..ea57c7c427e8d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/MhsmPrivateEndpointConnectionsClient.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionInner; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateEndpointConnectionsPutResponse; + +/** An instance of this class provides access to all the operations defined in MhsmPrivateEndpointConnectionsClient. */ +public interface MhsmPrivateEndpointConnectionsClient { + /** + * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResource(String resourceGroupName, String name); + + /** + * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResource( + String resourceGroupName, String name, Context context); + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MhsmPrivateEndpointConnectionInner get(String resourceGroupName, String name, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context); + + /** + * Updates the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param properties The intended state of private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MhsmPrivateEndpointConnectionInner put( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + MhsmPrivateEndpointConnectionInner properties); + + /** + * Updates the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param properties The intended state of private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MhsmPrivateEndpointConnectionsPutResponse putWithResponse( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + MhsmPrivateEndpointConnectionInner properties, + Context context); + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MhsmPrivateEndpointConnectionInner> beginDelete( + String resourceGroupName, String name, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MhsmPrivateEndpointConnectionInner> beginDelete( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MhsmPrivateEndpointConnectionInner delete( + String resourceGroupName, String name, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MhsmPrivateEndpointConnectionInner delete( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/MhsmPrivateLinkResourcesClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/MhsmPrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..392c80f9b243e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/MhsmPrivateLinkResourcesClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateLinkResourceListResultInner; + +/** An instance of this class provides access to all the operations defined in MhsmPrivateLinkResourcesClient. */ +public interface MhsmPrivateLinkResourcesClient { + /** + * Gets the private link resources supported for the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the managed hsm pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MhsmPrivateLinkResourceListResultInner listByMhsmResource(String resourceGroupName, String name); + + /** + * Gets the private link resources supported for the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the managed hsm pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByMhsmResourceWithResponse( + String resourceGroupName, String name, Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/OperationsClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..b9344bc31604c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Key Vault Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..5687cbbc8a14b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnectionsPutResponse; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner put( + String resourceGroupName, + String vaultName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionsPutResponse putWithResponse( + String resourceGroupName, + String vaultName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginDelete( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner delete( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); + + /** + * The List operation gets information about the private endpoint connections associated with the 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResource(String resourceGroupName, String vaultName); + + /** + * The List operation gets information about the private endpoint connections associated with the vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResource( + String resourceGroupName, String vaultName, Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/PrivateLinkResourcesClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..c1e66ed2befce --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateLinkResourceListResultInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceListResultInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByVaultWithResponse( + String resourceGroupName, String vaultName, Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/SecretsClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/SecretsClient.java new file mode 100644 index 0000000000000..ef0b0812e1eec --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/SecretsClient.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.SecretInner; +import com.azure.resourcemanager.keyvault.generated.models.SecretCreateOrUpdateParameters; +import com.azure.resourcemanager.keyvault.generated.models.SecretPatchParameters; + +/** An instance of this class provides access to all the operations defined in SecretsClient. */ +public interface SecretsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + String secretName, + SecretCreateOrUpdateParameters parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String vaultName, + String secretName, + SecretPatchParameters parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String secretName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Integer top, Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/VaultsClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/VaultsClient.java new file mode 100644 index 0000000000000..fc1d8ca85a8a2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/VaultsClient.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.keyvault.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedVaultInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultAccessPolicyParametersInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultInner; +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyUpdateKind; +import com.azure.resourcemanager.keyvault.generated.models.VaultCheckNameAvailabilityParameters; +import com.azure.resourcemanager.keyvault.generated.models.VaultCreateOrUpdateParameters; +import com.azure.resourcemanager.keyvault.generated.models.VaultPatchParameters; + +/** An instance of this class provides access to all the operations defined in VaultsClient. */ +public interface VaultsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultInner> 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VaultInner> beginCreateOrUpdate( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultInner createOrUpdate( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String vaultName, VaultPatchParameters parameters, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultInner getByResourceGroup(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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * 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. + * @param parameters Access policy to merge into the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters for updating the access policy in a vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VaultAccessPolicyParametersInner updateAccessPolicy( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters); + + /** + * 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. + * @param parameters Access policy to merge into the vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters for updating the access policy in a vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateAccessPolicyWithResponse( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(Integer top, Context context); + + /** + * Gets information about the deleted vaults in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the deleted vaults in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDeleted(); + + /** + * Gets information about the deleted vaults in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the deleted vaults in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDeleted(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deleted Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeletedVaultInner 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deleted Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDeletedWithResponse(String vaultName, String location, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPurgeDeleted(String vaultName, String location, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void purgeDeleted(String vaultName, String location, Context context); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Integer top, Context context); + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability(VaultCheckNameAvailabilityParameters vaultName); + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param vaultName The name of the vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + VaultCheckNameAvailabilityParameters vaultName, Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..9de9588baf235 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/CheckNameAvailabilityResultInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.Reason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CheckNameAvailability operation response. */ +@Immutable +public final class CheckNameAvailabilityResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); + + /* + * 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. + */ + @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 the nameAvailable property: 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 property: The reason that a vault name could not be used. The Reason element is only returned if + * NameAvailable is false. + * + * @return the reason value. + */ + public Reason reason() { + return this.reason; + } + + /** + * Get the message property: An error message explaining the Reason value in more detail. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/DeletedManagedHsmInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/DeletedManagedHsmInner.java new file mode 100644 index 0000000000000..5978be84bdeed --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/DeletedManagedHsmInner.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.DeletedManagedHsmProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DeletedManagedHsm model. */ +@Fluent +public final class DeletedManagedHsmInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedManagedHsmInner.class); + + /* + * The Azure Resource Manager resource ID for the deleted managed HSM Pool. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The name of the managed HSM Pool. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resource type of the managed HSM Pool. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * Properties of the deleted managed HSM + */ + @JsonProperty(value = "properties") + private DeletedManagedHsmProperties properties; + + /** + * Get the id property: The Azure Resource Manager resource ID for the deleted managed HSM Pool. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the managed HSM Pool. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type of the managed HSM Pool. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the properties property: Properties of the deleted managed HSM. + * + * @return the properties value. + */ + public DeletedManagedHsmProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the deleted managed HSM. + * + * @param properties the properties value to set. + * @return the DeletedManagedHsmInner object itself. + */ + public DeletedManagedHsmInner withProperties(DeletedManagedHsmProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/DeletedVaultInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/DeletedVaultInner.java new file mode 100644 index 0000000000000..9edf1e0c864e2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/DeletedVaultInner.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.DeletedVaultProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deleted vault information with extended details. */ +@Fluent +public final class DeletedVaultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedVaultInner.class); + + /* + * 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 id property: The resource ID for the deleted key vault. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the key vault. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The resource type of the key vault. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the properties property: Properties of the vault. + * + * @return the properties value. + */ + public DeletedVaultProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the vault. + * + * @param properties the properties value to set. + * @return the DeletedVaultInner object itself. + */ + public DeletedVaultInner withProperties(DeletedVaultProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/KeyInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/KeyInner.java new file mode 100644 index 0000000000000..9ed9f0b15a594 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/KeyInner.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyCurveName; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyOperation; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyType; +import com.azure.resourcemanager.keyvault.generated.models.KeyAttributes; +import com.azure.resourcemanager.keyvault.generated.models.KeyReleasePolicy; +import com.azure.resourcemanager.keyvault.generated.models.RotationPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The key resource. */ +@Fluent +public final class KeyInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyInner.class); + + /* + * The properties of the key. + */ + @JsonProperty(value = "properties", required = true) + private KeyProperties innerProperties = new KeyProperties(); + + /** + * Get the innerProperties property: The properties of the key. + * + * @return the innerProperties value. + */ + private KeyProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public KeyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public KeyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the attributes property: The attributes of the key. + * + * @return the attributes value. + */ + public KeyAttributes attributes() { + return this.innerProperties() == null ? null : this.innerProperties().attributes(); + } + + /** + * Set the attributes property: The attributes of the key. + * + * @param attributes the attributes value to set. + * @return the KeyInner object itself. + */ + public KeyInner withAttributes(KeyAttributes attributes) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withAttributes(attributes); + return this; + } + + /** + * Get the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @return the kty value. + */ + public JsonWebKeyType kty() { + return this.innerProperties() == null ? null : this.innerProperties().kty(); + } + + /** + * Set the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @param kty the kty value to set. + * @return the KeyInner object itself. + */ + public KeyInner withKty(JsonWebKeyType kty) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withKty(kty); + return this; + } + + /** + * Get the keyOps property: The keyOps property. + * + * @return the keyOps value. + */ + public List keyOps() { + return this.innerProperties() == null ? null : this.innerProperties().keyOps(); + } + + /** + * Set the keyOps property: The keyOps property. + * + * @param keyOps the keyOps value to set. + * @return the KeyInner object itself. + */ + public KeyInner withKeyOps(List keyOps) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withKeyOps(keyOps); + return this; + } + + /** + * Get the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @return the keySize value. + */ + public Integer keySize() { + return this.innerProperties() == null ? null : this.innerProperties().keySize(); + } + + /** + * Set the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param keySize the keySize value to set. + * @return the KeyInner object itself. + */ + public KeyInner withKeySize(Integer keySize) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withKeySize(keySize); + return this; + } + + /** + * Get the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @return the curveName value. + */ + public JsonWebKeyCurveName curveName() { + return this.innerProperties() == null ? null : this.innerProperties().curveName(); + } + + /** + * Set the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @param curveName the curveName value to set. + * @return the KeyInner object itself. + */ + public KeyInner withCurveName(JsonWebKeyCurveName curveName) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withCurveName(curveName); + return this; + } + + /** + * Get the keyUri property: The URI to retrieve the current version of the key. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.innerProperties() == null ? null : this.innerProperties().keyUri(); + } + + /** + * Get the keyUriWithVersion property: The URI to retrieve the specific version of the key. + * + * @return the keyUriWithVersion value. + */ + public String keyUriWithVersion() { + return this.innerProperties() == null ? null : this.innerProperties().keyUriWithVersion(); + } + + /** + * Get the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the rotationPolicy value. + */ + public RotationPolicy rotationPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().rotationPolicy(); + } + + /** + * Set the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param rotationPolicy the rotationPolicy value to set. + * @return the KeyInner object itself. + */ + public KeyInner withRotationPolicy(RotationPolicy rotationPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withRotationPolicy(rotationPolicy); + return this; + } + + /** + * Get the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the releasePolicy value. + */ + public KeyReleasePolicy releasePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().releasePolicy(); + } + + /** + * Set the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param releasePolicy the releasePolicy value to set. + * @return the KeyInner object itself. + */ + public KeyInner withReleasePolicy(KeyReleasePolicy releasePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withReleasePolicy(releasePolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model KeyInner")); + } else { + innerProperties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/KeyProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/KeyProperties.java new file mode 100644 index 0000000000000..ef8ff096770e2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/KeyProperties.java @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyCurveName; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyOperation; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyType; +import com.azure.resourcemanager.keyvault.generated.models.KeyAttributes; +import com.azure.resourcemanager.keyvault.generated.models.KeyReleasePolicy; +import com.azure.resourcemanager.keyvault.generated.models.RotationPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of the key. */ +@Fluent +public final class KeyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyProperties.class); + + /* + * The attributes of the key. + */ + @JsonProperty(value = "attributes") + private KeyAttributes attributes; + + /* + * The type of the key. For valid values, see JsonWebKeyType. + */ + @JsonProperty(value = "kty") + private JsonWebKeyType kty; + + /* + * The keyOps property. + */ + @JsonProperty(value = "keyOps") + private List keyOps; + + /* + * The key size in bits. For example: 2048, 3072, or 4096 for RSA. + */ + @JsonProperty(value = "keySize") + private Integer keySize; + + /* + * The elliptic curve name. For valid values, see JsonWebKeyCurveName. + */ + @JsonProperty(value = "curveName") + private JsonWebKeyCurveName curveName; + + /* + * The URI to retrieve the current version of the key. + */ + @JsonProperty(value = "keyUri", access = JsonProperty.Access.WRITE_ONLY) + private String keyUri; + + /* + * The URI to retrieve the specific version of the key. + */ + @JsonProperty(value = "keyUriWithVersion", access = JsonProperty.Access.WRITE_ONLY) + private String keyUriWithVersion; + + /* + * Key rotation policy in response. It will be used for both output and + * input. Omitted if empty + */ + @JsonProperty(value = "rotationPolicy") + private RotationPolicy rotationPolicy; + + /* + * Key release policy in response. It will be used for both output and + * input. Omitted if empty + */ + @JsonProperty(value = "release_policy") + private KeyReleasePolicy releasePolicy; + + /** + * Get the attributes property: The attributes of the key. + * + * @return the attributes value. + */ + public KeyAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: The attributes of the key. + * + * @param attributes the attributes value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withAttributes(KeyAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @return the kty value. + */ + public JsonWebKeyType kty() { + return this.kty; + } + + /** + * Set the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @param kty the kty value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withKty(JsonWebKeyType kty) { + this.kty = kty; + return this; + } + + /** + * Get the keyOps property: The keyOps property. + * + * @return the keyOps value. + */ + public List keyOps() { + return this.keyOps; + } + + /** + * Set the keyOps property: The keyOps property. + * + * @param keyOps the keyOps value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withKeyOps(List keyOps) { + this.keyOps = keyOps; + return this; + } + + /** + * Get the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @return the keySize value. + */ + public Integer keySize() { + return this.keySize; + } + + /** + * Set the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param keySize the keySize value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withKeySize(Integer keySize) { + this.keySize = keySize; + return this; + } + + /** + * Get the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @return the curveName value. + */ + public JsonWebKeyCurveName curveName() { + return this.curveName; + } + + /** + * Set the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @param curveName the curveName value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withCurveName(JsonWebKeyCurveName curveName) { + this.curveName = curveName; + return this; + } + + /** + * Get the keyUri property: The URI to retrieve the current version of the key. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Get the keyUriWithVersion property: The URI to retrieve the specific version of the key. + * + * @return the keyUriWithVersion value. + */ + public String keyUriWithVersion() { + return this.keyUriWithVersion; + } + + /** + * Get the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the rotationPolicy value. + */ + public RotationPolicy rotationPolicy() { + return this.rotationPolicy; + } + + /** + * Set the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param rotationPolicy the rotationPolicy value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withRotationPolicy(RotationPolicy rotationPolicy) { + this.rotationPolicy = rotationPolicy; + return this; + } + + /** + * Get the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the releasePolicy value. + */ + public KeyReleasePolicy releasePolicy() { + return this.releasePolicy; + } + + /** + * Set the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param releasePolicy the releasePolicy value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withReleasePolicy(KeyReleasePolicy releasePolicy) { + this.releasePolicy = releasePolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributes() != null) { + attributes().validate(); + } + if (rotationPolicy() != null) { + rotationPolicy().validate(); + } + if (releasePolicy() != null) { + releasePolicy().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/ManagedHsmInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/ManagedHsmInner.java new file mode 100644 index 0000000000000..61d83c6523890 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/ManagedHsmInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmProperties; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmResource; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmSku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Resource information with extended details. */ +@Fluent +public final class ManagedHsmInner extends ManagedHsmResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedHsmInner.class); + + /* + * Properties of the managed HSM + */ + @JsonProperty(value = "properties") + private ManagedHsmProperties properties; + + /** + * Get the properties property: Properties of the managed HSM. + * + * @return the properties value. + */ + public ManagedHsmProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the managed HSM. + * + * @param properties the properties value to set. + * @return the ManagedHsmInner object itself. + */ + public ManagedHsmInner withProperties(ManagedHsmProperties properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedHsmInner withSku(ManagedHsmSku sku) { + super.withSku(sku); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedHsmInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedHsmInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateEndpointConnectionInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..68489d49f4806 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateEndpointConnectionInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmResource; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmSku; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateEndpoint; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnectionProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Private endpoint connection resource. */ +@Fluent +public final class MhsmPrivateEndpointConnectionInner extends ManagedHsmResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateEndpointConnectionInner.class); + + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private MhsmPrivateEndpointConnectionProperties innerProperties; + + /* + * Modified whenever there is a change in the state of private endpoint + * connection. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private MhsmPrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Modified whenever there is a change in the state of private endpoint connection. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Modified whenever there is a change in the state of private endpoint connection. + * + * @param etag the etag value to set. + * @return the MhsmPrivateEndpointConnectionInner object itself. + */ + public MhsmPrivateEndpointConnectionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public MhsmPrivateEndpointConnectionInner withSku(ManagedHsmSku sku) { + super.withSku(sku); + return this; + } + + /** {@inheritDoc} */ + @Override + public MhsmPrivateEndpointConnectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MhsmPrivateEndpointConnectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the privateEndpoint property: Properties of the private endpoint object. + * + * @return the privateEndpoint value. + */ + public MhsmPrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: Properties of the private endpoint object. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the MhsmPrivateEndpointConnectionInner object itself. + */ + public MhsmPrivateEndpointConnectionInner withPrivateEndpoint(MhsmPrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new MhsmPrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the MhsmPrivateEndpointConnectionInner object itself. + */ + public MhsmPrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new MhsmPrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: Provisioning state of the private endpoint connection. + * + * @param provisioningState the provisioningState value to set. + * @return the MhsmPrivateEndpointConnectionInner object itself. + */ + public MhsmPrivateEndpointConnectionInner withProvisioningState( + PrivateEndpointConnectionProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new MhsmPrivateEndpointConnectionProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateEndpointConnectionProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..fc3569fff295a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateEndpointConnectionProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateEndpoint; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnectionProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the private endpoint connection resource. */ +@Fluent +public final class MhsmPrivateEndpointConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateEndpointConnectionProperties.class); + + /* + * Properties of the private endpoint object. + */ + @JsonProperty(value = "privateEndpoint") + private MhsmPrivateEndpoint privateEndpoint; + + /* + * Approval state of the private link connection. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * Provisioning state of the private endpoint connection. + */ + @JsonProperty(value = "provisioningState") + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: Properties of the private endpoint object. + * + * @return the privateEndpoint value. + */ + public MhsmPrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: Properties of the private endpoint object. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the MhsmPrivateEndpointConnectionProperties object itself. + */ + public MhsmPrivateEndpointConnectionProperties withPrivateEndpoint(MhsmPrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the MhsmPrivateEndpointConnectionProperties object itself. + */ + public MhsmPrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of the private endpoint connection. + * + * @param provisioningState the provisioningState value to set. + * @return the MhsmPrivateEndpointConnectionProperties object itself. + */ + public MhsmPrivateEndpointConnectionProperties withProvisioningState( + PrivateEndpointConnectionProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateLinkResourceListResultInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateLinkResourceListResultInner.java new file mode 100644 index 0000000000000..c03aca3a0e01a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateLinkResourceListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class MhsmPrivateLinkResourceListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateLinkResourceListResultInner.class); + + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the MhsmPrivateLinkResourceListResultInner object itself. + */ + public MhsmPrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateLinkResourceProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..bb9f7149a4206 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateLinkResourceProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class MhsmPrivateLinkResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateLinkResourceProperties.class); + + /* + * Group identifier of private link resource. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * Required member names of private link resource. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * Required DNS zone names of the the private link resource. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: Group identifier of private link resource. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: Required member names of private link resource. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the MhsmPrivateLinkResourceProperties object itself. + */ + public MhsmPrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/OperationInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..ea2e92bb21ea5 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/OperationInner.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.OperationDisplay; +import com.azure.resourcemanager.keyvault.generated.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key Vault REST API operation definition. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * 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; + + /* + * Properties of operation, include metric specifications. + */ + @JsonProperty(value = "properties") + private OperationProperties innerOperationProperties; + + /* + * Property to specify whether the action is a data action. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display metadata associated with the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The origin of operations. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The origin of operations. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the innerOperationProperties property: Properties of operation, include metric specifications. + * + * @return the innerOperationProperties value. + */ + private OperationProperties innerOperationProperties() { + return this.innerOperationProperties; + } + + /** + * Get the isDataAction property: Property to specify whether the action is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Property to specify whether the action is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.innerOperationProperties() == null ? null : this.innerOperationProperties().serviceSpecification(); + } + + /** + * Set the serviceSpecification property: One property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + if (this.innerOperationProperties() == null) { + this.innerOperationProperties = new OperationProperties(); + } + this.innerOperationProperties().withServiceSpecification(serviceSpecification); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (innerOperationProperties() != null) { + innerOperationProperties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/OperationProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/OperationProperties.java new file mode 100644 index 0000000000000..760c5f56908c4 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/OperationProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of operation, include metric specifications. */ +@Fluent +public final class OperationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationProperties.class); + + /* + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: One property of operation, include metric specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..4622cecdcdd21 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Modified whenever there is a change in the state of private endpoint + * connection. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: Modified whenever there is a change in the state of private endpoint connection. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Modified whenever there is a change in the state of private endpoint connection. + * + * @param etag the etag value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointConnectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointConnectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the privateEndpoint property: Properties of the private endpoint object. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: Properties of the private endpoint object. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: Provisioning state of the private endpoint connection. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProvisioningState( + PrivateEndpointConnectionProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..9f2edbe3fe8b3 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /* + * Properties of the private endpoint object. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * Approval state of the private link connection. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * Provisioning state of the private endpoint connection. + */ + @JsonProperty(value = "provisioningState") + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: Properties of the private endpoint object. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: Properties of the private endpoint object. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of the private endpoint connection. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withProvisioningState( + PrivateEndpointConnectionProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateLinkResourceListResultInner.java new file mode 100644 index 0000000000000..2ae6791480560 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateLinkResourceListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResultInner.class); + + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateLinkResourceProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..9f9f1494b68b3 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceProperties.class); + + /* + * Group identifier of private link resource. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * Required member names of private link resource. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * Required DNS zone names of the the private link resource. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: Group identifier of private link resource. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: Required member names of private link resource. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/SecretInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/SecretInner.java new file mode 100644 index 0000000000000..68b146d23e4c7 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/SecretInner.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.SecretProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Resource information with extended details. */ +@Fluent +public final class SecretInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretInner.class); + + /* + * Properties of the secret + */ + @JsonProperty(value = "properties", required = true) + private SecretProperties properties; + + /** + * Get the properties property: Properties of the secret. + * + * @return the properties value. + */ + public SecretProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the secret. + * + * @param properties the properties value to set. + * @return the SecretInner object itself. + */ + public SecretInner withProperties(SecretProperties properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public SecretInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecretInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model SecretInner")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/VaultAccessPolicyParametersInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/VaultAccessPolicyParametersInner.java new file mode 100644 index 0000000000000..c2a2d06d2f075 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/VaultAccessPolicyParametersInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.VaultAccessPolicyProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for updating the access policy in a vault. */ +@Fluent +public final class VaultAccessPolicyParametersInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultAccessPolicyParametersInner.class); + + /* + * 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 location property: The resource type of the access policy. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the properties property: Properties of the access policy. + * + * @return the properties value. + */ + public VaultAccessPolicyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the access policy. + * + * @param properties the properties value to set. + * @return the VaultAccessPolicyParametersInner object itself. + */ + public VaultAccessPolicyParametersInner withProperties(VaultAccessPolicyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model VaultAccessPolicyParametersInner")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/VaultInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/VaultInner.java new file mode 100644 index 0000000000000..8583e92952480 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/VaultInner.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.models.VaultProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Resource information with extended details. */ +@Fluent +public final class VaultInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultInner.class); + + /* + * System metadata for the key vault. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Properties of the vault + */ + @JsonProperty(value = "properties", required = true) + private VaultProperties properties; + + /** + * Get the systemData property: System metadata for the key vault. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: Properties of the vault. + * + * @return the properties value. + */ + public VaultProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the vault. + * + * @param properties the properties value to set. + * @return the VaultInner object itself. + */ + public VaultInner withProperties(VaultProperties properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VaultInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model VaultInner")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/package-info.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..b8b64813b1fe5 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for KeyVaultManagementClient. The Azure management API provides a RESTful + * set of web services that interact with Azure Key Vault. + */ +package com.azure.resourcemanager.keyvault.generated.fluent.models; diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/package-info.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/package-info.java new file mode 100644 index 0000000000000..701bc9105a453 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for KeyVaultManagementClient. The Azure management API provides a RESTful set + * of web services that interact with Azure Key Vault. + */ +package com.azure.resourcemanager.keyvault.generated.fluent; diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/CheckNameAvailabilityResultImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..d0d72a84f82c6 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.keyvault.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.keyvault.generated.models.Reason; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + CheckNameAvailabilityResultImpl( + CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public Reason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/DeletedManagedHsmImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/DeletedManagedHsmImpl.java new file mode 100644 index 0000000000000..9d4d5a26c43c3 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/DeletedManagedHsmImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedManagedHsmInner; +import com.azure.resourcemanager.keyvault.generated.models.DeletedManagedHsm; +import com.azure.resourcemanager.keyvault.generated.models.DeletedManagedHsmProperties; + +public final class DeletedManagedHsmImpl implements DeletedManagedHsm { + private DeletedManagedHsmInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + DeletedManagedHsmImpl( + DeletedManagedHsmInner innerObject, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DeletedManagedHsmProperties properties() { + return this.innerModel().properties(); + } + + public DeletedManagedHsmInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/DeletedVaultImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/DeletedVaultImpl.java new file mode 100644 index 0000000000000..d1f9a7c920015 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/DeletedVaultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedVaultInner; +import com.azure.resourcemanager.keyvault.generated.models.DeletedVault; +import com.azure.resourcemanager.keyvault.generated.models.DeletedVaultProperties; + +public final class DeletedVaultImpl implements DeletedVault { + private DeletedVaultInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + DeletedVaultImpl( + DeletedVaultInner innerObject, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DeletedVaultProperties properties() { + return this.innerModel().properties(); + } + + public DeletedVaultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyImpl.java new file mode 100644 index 0000000000000..2b9a6aaf8f6c5 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyImpl.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyProperties; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyCurveName; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyOperation; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyType; +import com.azure.resourcemanager.keyvault.generated.models.Key; +import com.azure.resourcemanager.keyvault.generated.models.KeyAttributes; +import com.azure.resourcemanager.keyvault.generated.models.KeyCreateParameters; +import com.azure.resourcemanager.keyvault.generated.models.KeyReleasePolicy; +import com.azure.resourcemanager.keyvault.generated.models.RotationPolicy; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class KeyImpl implements Key, Key.Definition { + private KeyInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + KeyImpl(KeyInner innerObject, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public KeyAttributes attributes() { + return this.innerModel().attributes(); + } + + public JsonWebKeyType kty() { + return this.innerModel().kty(); + } + + public List keyOps() { + List inner = this.innerModel().keyOps(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Integer keySize() { + return this.innerModel().keySize(); + } + + public JsonWebKeyCurveName curveName() { + return this.innerModel().curveName(); + } + + public String keyUri() { + return this.innerModel().keyUri(); + } + + public String keyUriWithVersion() { + return this.innerModel().keyUriWithVersion(); + } + + public RotationPolicy rotationPolicy() { + return this.innerModel().rotationPolicy(); + } + + public KeyReleasePolicy releasePolicy() { + return this.innerModel().releasePolicy(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public KeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private String keyName; + + private KeyCreateParameters createParameters; + + public KeyImpl withExistingVault(String resourceGroupName, String vaultName) { + this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; + return this; + } + + public Key create() { + this.innerObject = + serviceManager + .serviceClient() + .getKeys() + .createIfNotExistWithResponse(resourceGroupName, vaultName, keyName, createParameters, Context.NONE) + .getValue(); + return this; + } + + public Key create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKeys() + .createIfNotExistWithResponse(resourceGroupName, vaultName, keyName, createParameters, context) + .getValue(); + return this; + } + + KeyImpl(String name, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = new KeyInner(); + this.serviceManager = serviceManager; + this.keyName = name; + this.createParameters = new KeyCreateParameters(); + } + + public Key refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getKeys() + .getWithResponse(resourceGroupName, vaultName, keyName, Context.NONE) + .getValue(); + return this; + } + + public Key refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKeys() + .getWithResponse(resourceGroupName, vaultName, keyName, context) + .getValue(); + return this; + } + + public KeyImpl withProperties(KeyProperties properties) { + this.createParameters.withProperties(properties); + return this; + } + + public KeyImpl withTags(Map tags) { + this.createParameters.withTags(tags); + return this; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyVaultManagementClientBuilder.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyVaultManagementClientBuilder.java new file mode 100644 index 0000000000000..6541d1611ec48 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyVaultManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the KeyVaultManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {KeyVaultManagementClientImpl.class}) +public final class KeyVaultManagementClientBuilder { + /* + * Subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private 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 KeyVaultManagementClientBuilder. + */ + public KeyVaultManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the KeyVaultManagementClientBuilder. + */ + public KeyVaultManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the KeyVaultManagementClientBuilder. + */ + public KeyVaultManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the KeyVaultManagementClientBuilder. + */ + public KeyVaultManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the KeyVaultManagementClientBuilder. + */ + public KeyVaultManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the KeyVaultManagementClientBuilder. + */ + public KeyVaultManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of KeyVaultManagementClientImpl with the provided parameters. + * + * @return an instance of KeyVaultManagementClientImpl. + */ + public KeyVaultManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + KeyVaultManagementClientImpl client = + new KeyVaultManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyVaultManagementClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyVaultManagementClientImpl.java new file mode 100644 index 0000000000000..016466f21788b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyVaultManagementClientImpl.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.keyvault.generated.fluent.KeyVaultManagementClient; +import com.azure.resourcemanager.keyvault.generated.fluent.KeysClient; +import com.azure.resourcemanager.keyvault.generated.fluent.ManagedHsmsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.MhsmPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.MhsmPrivateLinkResourcesClient; +import com.azure.resourcemanager.keyvault.generated.fluent.OperationsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.keyvault.generated.fluent.SecretsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.VaultsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the KeyVaultManagementClientImpl type. */ +@ServiceClient(builder = KeyVaultManagementClientBuilder.class) +public final class KeyVaultManagementClientImpl implements KeyVaultManagementClient { + private final ClientLogger logger = new ClientLogger(KeyVaultManagementClientImpl.class); + + /** + * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final 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 getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The KeysClient object to access its operations. */ + private final KeysClient keys; + + /** + * Gets the KeysClient object to access its operations. + * + * @return the KeysClient object. + */ + public KeysClient getKeys() { + return this.keys; + } + + /** The VaultsClient object to access its operations. */ + private final VaultsClient vaults; + + /** + * Gets the VaultsClient object to access its operations. + * + * @return the VaultsClient object. + */ + public VaultsClient getVaults() { + return this.vaults; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The ManagedHsmsClient object to access its operations. */ + private final ManagedHsmsClient managedHsms; + + /** + * Gets the ManagedHsmsClient object to access its operations. + * + * @return the ManagedHsmsClient object. + */ + public ManagedHsmsClient getManagedHsms() { + return this.managedHsms; + } + + /** The MhsmPrivateEndpointConnectionsClient object to access its operations. */ + private final MhsmPrivateEndpointConnectionsClient mhsmPrivateEndpointConnections; + + /** + * Gets the MhsmPrivateEndpointConnectionsClient object to access its operations. + * + * @return the MhsmPrivateEndpointConnectionsClient object. + */ + public MhsmPrivateEndpointConnectionsClient getMhsmPrivateEndpointConnections() { + return this.mhsmPrivateEndpointConnections; + } + + /** The MhsmPrivateLinkResourcesClient object to access its operations. */ + private final MhsmPrivateLinkResourcesClient mhsmPrivateLinkResources; + + /** + * Gets the MhsmPrivateLinkResourcesClient object to access its operations. + * + * @return the MhsmPrivateLinkResourcesClient object. + */ + public MhsmPrivateLinkResourcesClient getMhsmPrivateLinkResources() { + return this.mhsmPrivateLinkResources; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The SecretsClient object to access its operations. */ + private final SecretsClient secrets; + + /** + * Gets the SecretsClient object to access its operations. + * + * @return the SecretsClient object. + */ + public SecretsClient getSecrets() { + return this.secrets; + } + + /** + * Initializes an instance of KeyVaultManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + KeyVaultManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2021-06-01-preview"; + this.keys = new KeysClientImpl(this); + this.vaults = new VaultsClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.managedHsms = new ManagedHsmsClientImpl(this); + this.mhsmPrivateEndpointConnections = new MhsmPrivateEndpointConnectionsClientImpl(this); + this.mhsmPrivateLinkResources = new MhsmPrivateLinkResourcesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.secrets = new SecretsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeysClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeysClientImpl.java new file mode 100644 index 0000000000000..efa64685a801b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeysClientImpl.java @@ -0,0 +1,1205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.KeysClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyInner; +import com.azure.resourcemanager.keyvault.generated.models.KeyCreateParameters; +import com.azure.resourcemanager.keyvault.generated.models.KeyListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in KeysClient. */ +public final class KeysClientImpl implements KeysClient { + private final ClientLogger logger = new ClientLogger(KeysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final KeysService service; + + /** The service client containing this operation class. */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of KeysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + KeysClientImpl(KeyVaultManagementClientImpl client) { + this.service = RestProxy.create(KeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientKeys to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + private interface KeysService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/keys/{keyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createIfNotExist( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("keyName") String keyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") KeyCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/keys/{keyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("keyName") String keyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/keys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/keys/{keyName}/versions/{keyVersion}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVersion( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("keyName") String keyName, + @PathParam("keyVersion") String keyVersion, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/keys/{keyName}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVersions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("keyName") String keyName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVersionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createIfNotExistWithResponseAsync( + String resourceGroupName, String vaultName, String keyName, KeyCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createIfNotExist( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + keyName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. + * @param parameters The parameters used to create the specified key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createIfNotExistWithResponseAsync( + String resourceGroupName, String vaultName, String keyName, KeyCreateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createIfNotExist( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + keyName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIfNotExistAsync( + String resourceGroupName, String vaultName, String keyName, KeyCreateParameters parameters) { + return createIfNotExistWithResponseAsync(resourceGroupName, vaultName, keyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KeyInner createIfNotExist( + String resourceGroupName, String vaultName, String keyName, KeyCreateParameters parameters) { + return createIfNotExistAsync(resourceGroupName, vaultName, keyName, parameters).block(); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. + * @param parameters The parameters used to create the specified key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createIfNotExistWithResponse( + String resourceGroupName, String vaultName, String keyName, KeyCreateParameters parameters, Context context) { + return createIfNotExistWithResponseAsync(resourceGroupName, vaultName, keyName, parameters, context).block(); + } + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, String keyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + keyName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String keyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + keyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String keyName) { + return getWithResponseAsync(resourceGroupName, vaultName, keyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KeyInner get(String resourceGroupName, String vaultName, String keyName) { + return getAsync(resourceGroupName, vaultName, keyName).block(); + } + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String keyName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, keyName, context).block(); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVersionWithResponseAsync( + String resourceGroupName, String vaultName, String keyName, String keyVersion) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (keyVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter keyVersion is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getVersion( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + keyName, + keyVersion, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVersionWithResponseAsync( + String resourceGroupName, String vaultName, String keyName, String keyVersion, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (keyVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter keyVersion is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getVersion( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + keyName, + keyVersion, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVersionAsync( + String resourceGroupName, String vaultName, String keyName, String keyVersion) { + return getVersionWithResponseAsync(resourceGroupName, vaultName, keyName, keyVersion) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KeyInner getVersion(String resourceGroupName, String vaultName, String keyName, String keyVersion) { + return getVersionAsync(resourceGroupName, vaultName, keyName, keyVersion).block(); + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVersionWithResponse( + String resourceGroupName, String vaultName, String keyName, String keyVersion, Context context) { + return getVersionWithResponseAsync(resourceGroupName, vaultName, keyName, keyVersion, context).block(); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsSinglePageAsync( + String resourceGroupName, String vaultName, String keyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listVersions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + keyName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsSinglePageAsync( + String resourceGroupName, String vaultName, String keyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVersions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + keyName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVersionsAsync(String resourceGroupName, String vaultName, String keyName) { + return new PagedFlux<>( + () -> listVersionsSinglePageAsync(resourceGroupName, vaultName, keyName), + nextLink -> listVersionsNextSinglePageAsync(nextLink)); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVersionsAsync( + String resourceGroupName, String vaultName, String keyName, Context context) { + return new PagedFlux<>( + () -> listVersionsSinglePageAsync(resourceGroupName, vaultName, keyName, context), + nextLink -> listVersionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String resourceGroupName, String vaultName, String keyName) { + return new PagedIterable<>(listVersionsAsync(resourceGroupName, vaultName, keyName)); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions( + String resourceGroupName, String vaultName, String keyName, Context context) { + return new PagedIterable<>(listVersionsAsync(resourceGroupName, vaultName, keyName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listVersionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVersionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeysImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeysImpl.java new file mode 100644 index 0000000000000..b6ff192944d1e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeysImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.KeysClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyInner; +import com.azure.resourcemanager.keyvault.generated.models.Key; +import com.azure.resourcemanager.keyvault.generated.models.Keys; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class KeysImpl implements Keys { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeysImpl.class); + + private final KeysClient innerClient; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public KeysImpl( + KeysClient innerClient, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Key get(String resourceGroupName, String vaultName, String keyName) { + KeyInner inner = this.serviceClient().get(resourceGroupName, vaultName, keyName); + if (inner != null) { + return new KeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String vaultName, String keyName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, vaultName, keyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new KeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new KeyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName, context); + return Utils.mapPage(inner, inner1 -> new KeyImpl(inner1, this.manager())); + } + + public Key getVersion(String resourceGroupName, String vaultName, String keyName, String keyVersion) { + KeyInner inner = this.serviceClient().getVersion(resourceGroupName, vaultName, keyName, keyVersion); + if (inner != null) { + return new KeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getVersionWithResponse( + String resourceGroupName, String vaultName, String keyName, String keyVersion, Context context) { + Response inner = + this.serviceClient().getVersionWithResponse(resourceGroupName, vaultName, keyName, keyVersion, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new KeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listVersions(String resourceGroupName, String vaultName, String keyName) { + PagedIterable inner = this.serviceClient().listVersions(resourceGroupName, vaultName, keyName); + return Utils.mapPage(inner, inner1 -> new KeyImpl(inner1, this.manager())); + } + + public PagedIterable listVersions( + String resourceGroupName, String vaultName, String keyName, Context context) { + PagedIterable inner = + this.serviceClient().listVersions(resourceGroupName, vaultName, keyName, context); + return Utils.mapPage(inner, inner1 -> new KeyImpl(inner1, this.manager())); + } + + public Key getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + String keyName = Utils.getValueFromIdByName(id, "keys"); + if (keyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'keys'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, keyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + String keyName = Utils.getValueFromIdByName(id, "keys"); + if (keyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'keys'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, keyName, context); + } + + private KeysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + public KeyImpl define(String name) { + return new KeyImpl(name, this.manager()); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmImpl.java new file mode 100644 index 0000000000000..a8674727eba1d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmInner; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsm; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmProperties; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmSku; +import java.util.Collections; +import java.util.Map; + +public final class ManagedHsmImpl implements ManagedHsm, ManagedHsm.Definition, ManagedHsm.Update { + private ManagedHsmInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedHsmSku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ManagedHsmProperties properties() { + return this.innerModel().properties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ManagedHsmInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + public ManagedHsmImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ManagedHsm create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedHsms() + .createOrUpdate(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ManagedHsm create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedHsms() + .createOrUpdate(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ManagedHsmImpl(String name, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = new ManagedHsmInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ManagedHsmImpl update() { + return this; + } + + public ManagedHsm apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedHsms() + .update(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ManagedHsm apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getManagedHsms().update(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ManagedHsmImpl( + ManagedHsmInner innerObject, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "managedHSMs"); + } + + public ManagedHsm refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedHsms() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ManagedHsm refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedHsms() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ManagedHsmImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ManagedHsmImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ManagedHsmImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ManagedHsmImpl withSku(ManagedHsmSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ManagedHsmImpl withProperties(ManagedHsmProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmsClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmsClientImpl.java new file mode 100644 index 0000000000000..bebd2c5816b4c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmsClientImpl.java @@ -0,0 +1,2211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.keyvault.generated.fluent.ManagedHsmsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedManagedHsmInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmInner; +import com.azure.resourcemanager.keyvault.generated.models.DeletedManagedHsmListResult; +import com.azure.resourcemanager.keyvault.generated.models.ErrorException; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedHsmsClient. */ +public final class ManagedHsmsClientImpl implements ManagedHsmsClient { + private final ClientLogger logger = new ClientLogger(ManagedHsmsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedHsmsService service; + + /** The service client containing this operation class. */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of ManagedHsmsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedHsmsClientImpl(KeyVaultManagementClientImpl client) { + this.service = + RestProxy.create(ManagedHsmsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientManagedHsms to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + private interface ManagedHsmsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ManagedHsmInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ManagedHsmInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedManagedHSMs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listDeleted( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs" + + "/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> getDeleted( + @HostParam("$host") String endpoint, + @PathParam("name") String name, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs" + + "/{name}/purge") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono>> purgeDeleted( + @HostParam("$host") String endpoint, + @PathParam("name") String name, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listDeletedNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String name, ManagedHsmInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedHsmInner> beginCreateOrUpdateAsync( + String resourceGroupName, String name, ManagedHsmInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedHsmInner.class, ManagedHsmInner.class, Context.NONE); + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedHsmInner> beginCreateOrUpdateAsync( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, name, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedHsmInner.class, ManagedHsmInner.class, context); + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedHsmInner> beginCreateOrUpdate( + String resourceGroupName, String name, ManagedHsmInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, name, parameters).getSyncPoller(); + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedHsmInner> beginCreateOrUpdate( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, parameters, context).getSyncPoller(); + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String name, ManagedHsmInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, name, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedHsmInner createOrUpdate(String resourceGroupName, String name, ManagedHsmInner parameters) { + return createOrUpdateAsync(resourceGroupName, name, parameters).block(); + } + + /** + * Create or update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to create or update the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedHsmInner createOrUpdate( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, name, parameters, context).block(); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String name, ManagedHsmInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedHsmInner> beginUpdateAsync( + String resourceGroupName, String name, ManagedHsmInner parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedHsmInner.class, ManagedHsmInner.class, Context.NONE); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedHsmInner> beginUpdateAsync( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedHsmInner.class, ManagedHsmInner.class, context); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedHsmInner> beginUpdate( + String resourceGroupName, String name, ManagedHsmInner parameters) { + return beginUpdateAsync(resourceGroupName, name, parameters).getSyncPoller(); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedHsmInner> beginUpdate( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, name, parameters, context).getSyncPoller(); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, ManagedHsmInner parameters) { + return beginUpdateAsync(resourceGroupName, name, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, name, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedHsmInner update(String resourceGroupName, String name, ManagedHsmInner parameters) { + return updateAsync(resourceGroupName, name, parameters).block(); + } + + /** + * Update a managed HSM Pool in the specified subscription. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param parameters Parameters to patch the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedHsmInner update(String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + return updateAsync(resourceGroupName, name, parameters, context).block(); + } + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Gets the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedHsmInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupAsync(resourceGroupName, name).block(); + } + + /** + * Gets the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top, context)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(top, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Integer top = null; + return new PagedIterable<>(listAsync(top)); + } + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Integer top, Context context) { + return new PagedIterable<>(listAsync(top, context)); + } + + /** + * The List operation gets information about the deleted managed HSMs associated with the subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeletedSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDeleted( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The List operation gets information about the deleted managed HSMs associated with the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeletedSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDeleted( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The List operation gets information about the deleted managed HSMs associated with the subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDeletedAsync() { + return new PagedFlux<>( + () -> listDeletedSinglePageAsync(), nextLink -> listDeletedNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the deleted managed HSMs associated with the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDeletedAsync(Context context) { + return new PagedFlux<>( + () -> listDeletedSinglePageAsync(context), nextLink -> listDeletedNextSinglePageAsync(nextLink, context)); + } + + /** + * The List operation gets information about the deleted managed HSMs associated with the subscription. + * + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeleted() { + return new PagedIterable<>(listDeletedAsync()); + } + + /** + * The List operation gets information about the deleted managed HSMs associated with the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeleted(Context context) { + return new PagedIterable<>(listDeletedAsync(context)); + } + + /** + * Gets the specified deleted managed HSM. + * + * @param name The name of the deleted managed HSM. + * @param location The location of the deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified deleted managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeletedWithResponseAsync(String name, String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDeleted( + this.client.getEndpoint(), + name, + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified deleted managed HSM. + * + * @param name The name of the deleted managed HSM. + * @param location The location of the deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified deleted managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeletedWithResponseAsync( + String name, String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDeleted( + this.client.getEndpoint(), + name, + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified deleted managed HSM. + * + * @param name The name of the deleted managed HSM. + * @param location The location of the deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified deleted managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDeletedAsync(String name, String location) { + return getDeletedWithResponseAsync(name, location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified deleted managed HSM. + * + * @param name The name of the deleted managed HSM. + * @param location The location of the deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified deleted managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeletedManagedHsmInner getDeleted(String name, String location) { + return getDeletedAsync(name, location).block(); + } + + /** + * Gets the specified deleted managed HSM. + * + * @param name The name of the deleted managed HSM. + * @param location The location of the deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified deleted managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeletedWithResponse(String name, String location, Context context) { + return getDeletedWithResponseAsync(name, location, context).block(); + } + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeDeletedWithResponseAsync(String name, String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .purgeDeleted( + this.client.getEndpoint(), + name, + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeDeletedWithResponseAsync( + String name, String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .purgeDeleted( + this.client.getEndpoint(), + name, + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeDeletedAsync(String name, String location) { + Mono>> mono = purgeDeletedWithResponseAsync(name, location); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeDeletedAsync(String name, String location, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = purgeDeletedWithResponseAsync(name, location, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurgeDeleted(String name, String location) { + return beginPurgeDeletedAsync(name, location).getSyncPoller(); + } + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurgeDeleted(String name, String location, Context context) { + return beginPurgeDeletedAsync(name, location, context).getSyncPoller(); + } + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeDeletedAsync(String name, String location) { + return beginPurgeDeletedAsync(name, location).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeDeletedAsync(String name, String location, Context context) { + return beginPurgeDeletedAsync(name, location, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purgeDeleted(String name, String location) { + purgeDeletedAsync(name, location).block(); + } + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purgeDeleted(String name, String location, Context context) { + purgeDeletedAsync(name, location, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeletedNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDeletedNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeletedNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDeletedNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmsImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmsImpl.java new file mode 100644 index 0000000000000..0724ce5a85a5c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmsImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.ManagedHsmsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedManagedHsmInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmInner; +import com.azure.resourcemanager.keyvault.generated.models.DeletedManagedHsm; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsm; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsms; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagedHsmsImpl implements ManagedHsms { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedHsmsImpl.class); + + private final ManagedHsmsClient innerClient; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public ManagedHsmsImpl( + ManagedHsmsClient innerClient, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ManagedHsm getByResourceGroup(String resourceGroupName, String name) { + ManagedHsmInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ManagedHsmImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedHsmImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ManagedHsmImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, top, context); + return Utils.mapPage(inner, inner1 -> new ManagedHsmImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ManagedHsmImpl(inner1, this.manager())); + } + + public PagedIterable list(Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(top, context); + return Utils.mapPage(inner, inner1 -> new ManagedHsmImpl(inner1, this.manager())); + } + + public PagedIterable listDeleted() { + PagedIterable inner = this.serviceClient().listDeleted(); + return Utils.mapPage(inner, inner1 -> new DeletedManagedHsmImpl(inner1, this.manager())); + } + + public PagedIterable listDeleted(Context context) { + PagedIterable inner = this.serviceClient().listDeleted(context); + return Utils.mapPage(inner, inner1 -> new DeletedManagedHsmImpl(inner1, this.manager())); + } + + public DeletedManagedHsm getDeleted(String name, String location) { + DeletedManagedHsmInner inner = this.serviceClient().getDeleted(name, location); + if (inner != null) { + return new DeletedManagedHsmImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDeletedWithResponse(String name, String location, Context context) { + Response inner = this.serviceClient().getDeletedWithResponse(name, location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeletedManagedHsmImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void purgeDeleted(String name, String location) { + this.serviceClient().purgeDeleted(name, location); + } + + public void purgeDeleted(String name, String location, Context context) { + this.serviceClient().purgeDeleted(name, location, context); + } + + public ManagedHsm getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "managedHSMs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedHSMs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "managedHSMs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedHSMs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "managedHSMs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedHSMs'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "managedHSMs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedHSMs'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ManagedHsmsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + public ManagedHsmImpl define(String name) { + return new ManagedHsmImpl(name, this.manager()); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..ed503236260a1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionInner; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmSku; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateEndpoint; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateEndpointConnection; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnectionProvisioningState; +import java.util.Collections; +import java.util.Map; + +public final class MhsmPrivateEndpointConnectionImpl + implements MhsmPrivateEndpointConnection, + MhsmPrivateEndpointConnection.Definition, + MhsmPrivateEndpointConnection.Update { + private MhsmPrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedHsmSku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public MhsmPrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public MhsmPrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private String privateEndpointConnectionName; + + public MhsmPrivateEndpointConnectionImpl withExistingManagedHSM(String resourceGroupName, String name) { + this.resourceGroupName = resourceGroupName; + this.name = name; + return this; + } + + public MhsmPrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getMhsmPrivateEndpointConnections() + .putWithResponse( + resourceGroupName, name, privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public MhsmPrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMhsmPrivateEndpointConnections() + .putWithResponse(resourceGroupName, name, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + MhsmPrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = new MhsmPrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public MhsmPrivateEndpointConnectionImpl update() { + return this; + } + + public MhsmPrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMhsmPrivateEndpointConnections() + .putWithResponse( + resourceGroupName, name, privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public MhsmPrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMhsmPrivateEndpointConnections() + .putWithResponse(resourceGroupName, name, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + MhsmPrivateEndpointConnectionImpl( + MhsmPrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "managedHSMs"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public MhsmPrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMhsmPrivateEndpointConnections() + .getWithResponse(resourceGroupName, name, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public MhsmPrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMhsmPrivateEndpointConnections() + .getWithResponse(resourceGroupName, name, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public MhsmPrivateEndpointConnectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public MhsmPrivateEndpointConnectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public MhsmPrivateEndpointConnectionImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public MhsmPrivateEndpointConnectionImpl withSku(ManagedHsmSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public MhsmPrivateEndpointConnectionImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public MhsmPrivateEndpointConnectionImpl withPrivateEndpoint(MhsmPrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public MhsmPrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + public MhsmPrivateEndpointConnectionImpl withProvisioningState( + PrivateEndpointConnectionProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionsClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..43ba84024d96f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1070 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.keyvault.generated.fluent.MhsmPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionInner; +import com.azure.resourcemanager.keyvault.generated.models.ErrorException; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateEndpointConnectionsListResult; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateEndpointConnectionsPutResponse; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MhsmPrivateEndpointConnectionsClient. */ +public final class MhsmPrivateEndpointConnectionsClientImpl implements MhsmPrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(MhsmPrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final MhsmPrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of MhsmPrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MhsmPrivateEndpointConnectionsClientImpl(KeyVaultManagementClientImpl client) { + this.service = + RestProxy + .create( + MhsmPrivateEndpointConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientMhsmPrivateEndpointConnections to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + private interface MhsmPrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResource( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono put( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") MhsmPrivateEndpointConnectionInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorException.class) + Mono> listByResourceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceSinglePageAsync( + String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResource( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceSinglePageAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResource( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceAsync(String resourceGroupName, String name) { + return new PagedFlux<>( + () -> listByResourceSinglePageAsync(resourceGroupName, name), + nextLink -> listByResourceNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceAsync( + String resourceGroupName, String name, Context context) { + return new PagedFlux<>( + () -> listByResourceSinglePageAsync(resourceGroupName, name, context), + nextLink -> listByResourceNextSinglePageAsync(nextLink, context)); + } + + /** + * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResource(String resourceGroupName, String name) { + return new PagedIterable<>(listByResourceAsync(resourceGroupName, name)); + } + + /** + * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResource( + String resourceGroupName, String name, Context context) { + return new PagedIterable<>(listByResourceAsync(resourceGroupName, name, context)); + } + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String name, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String name, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MhsmPrivateEndpointConnectionInner get( + String resourceGroupName, String name, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, name, privateEndpointConnectionName).block(); + } + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, context).block(); + } + + /** + * Updates the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param properties The intended state of private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putWithResponseAsync( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + MhsmPrivateEndpointConnectionInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + privateEndpointConnectionName, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param properties The intended state of private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putWithResponseAsync( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + MhsmPrivateEndpointConnectionInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + privateEndpointConnectionName, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * Updates the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param properties The intended state of private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + MhsmPrivateEndpointConnectionInner properties) { + return putWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, properties) + .flatMap( + (MhsmPrivateEndpointConnectionsPutResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param properties The intended state of private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MhsmPrivateEndpointConnectionInner put( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + MhsmPrivateEndpointConnectionInner properties) { + return putAsync(resourceGroupName, name, privateEndpointConnectionName, properties).block(); + } + + /** + * Updates the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param properties The intended state of private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MhsmPrivateEndpointConnectionsPutResponse putWithResponse( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + MhsmPrivateEndpointConnectionInner properties, + Context context) { + return putWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, properties, context) + .block(); + } + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String name, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MhsmPrivateEndpointConnectionInner> + beginDeleteAsync(String resourceGroupName, String name, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MhsmPrivateEndpointConnectionInner.class, + MhsmPrivateEndpointConnectionInner.class, + Context.NONE); + } + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MhsmPrivateEndpointConnectionInner> + beginDeleteAsync(String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MhsmPrivateEndpointConnectionInner.class, + MhsmPrivateEndpointConnectionInner.class, + context); + } + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MhsmPrivateEndpointConnectionInner> beginDelete( + String resourceGroupName, String name, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, name, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MhsmPrivateEndpointConnectionInner> beginDelete( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, name, privateEndpointConnectionName, context).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String name, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, name, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, name, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MhsmPrivateEndpointConnectionInner delete( + String resourceGroupName, String name, String privateEndpointConnectionName) { + return deleteAsync(resourceGroupName, name, privateEndpointConnectionName).block(); + } + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MhsmPrivateEndpointConnectionInner delete( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + return deleteAsync(resourceGroupName, name, privateEndpointConnectionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionsImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..20b7b5c30937b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionsImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.MhsmPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionInner; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateEndpointConnection; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MhsmPrivateEndpointConnectionsImpl implements MhsmPrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateEndpointConnectionsImpl.class); + + private final MhsmPrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public MhsmPrivateEndpointConnectionsImpl( + MhsmPrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResource(String resourceGroupName, String name) { + PagedIterable inner = + this.serviceClient().listByResource(resourceGroupName, name); + return Utils.mapPage(inner, inner1 -> new MhsmPrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResource( + String resourceGroupName, String name, Context context) { + PagedIterable inner = + this.serviceClient().listByResource(resourceGroupName, name, context); + return Utils.mapPage(inner, inner1 -> new MhsmPrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public MhsmPrivateEndpointConnection get( + String resourceGroupName, String name, String privateEndpointConnectionName) { + MhsmPrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, name, privateEndpointConnectionName); + if (inner != null) { + return new MhsmPrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, name, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MhsmPrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MhsmPrivateEndpointConnection delete( + String resourceGroupName, String name, String privateEndpointConnectionName) { + MhsmPrivateEndpointConnectionInner inner = + this.serviceClient().delete(resourceGroupName, name, privateEndpointConnectionName); + if (inner != null) { + return new MhsmPrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public MhsmPrivateEndpointConnection delete( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + MhsmPrivateEndpointConnectionInner inner = + this.serviceClient().delete(resourceGroupName, name, privateEndpointConnectionName, context); + if (inner != null) { + return new MhsmPrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public MhsmPrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "managedHSMs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedHSMs'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, name, privateEndpointConnectionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "managedHSMs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedHSMs'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, name, privateEndpointConnectionName, context); + } + + public MhsmPrivateEndpointConnection deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "managedHSMs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedHSMs'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.delete(resourceGroupName, name, privateEndpointConnectionName, Context.NONE); + } + + public MhsmPrivateEndpointConnection deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String name = Utils.getValueFromIdByName(id, "managedHSMs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedHSMs'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.delete(resourceGroupName, name, privateEndpointConnectionName, context); + } + + private MhsmPrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + public MhsmPrivateEndpointConnectionImpl define(String name) { + return new MhsmPrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourceListResultImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourceListResultImpl.java new file mode 100644 index 0000000000000..0828ea4529fd4 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourceListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateLinkResourceListResultInner; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkResource; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkResourceListResult; +import java.util.Collections; +import java.util.List; + +public final class MhsmPrivateLinkResourceListResultImpl implements MhsmPrivateLinkResourceListResult { + private MhsmPrivateLinkResourceListResultInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + MhsmPrivateLinkResourceListResultImpl( + MhsmPrivateLinkResourceListResultInner innerObject, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MhsmPrivateLinkResourceListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourcesClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..21f50d430cccf --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourcesClientImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.MhsmPrivateLinkResourcesClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateLinkResourceListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MhsmPrivateLinkResourcesClient. */ +public final class MhsmPrivateLinkResourcesClientImpl implements MhsmPrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(MhsmPrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final MhsmPrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of MhsmPrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MhsmPrivateLinkResourcesClientImpl(KeyVaultManagementClientImpl client) { + this.service = + RestProxy + .create(MhsmPrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientMhsmPrivateLinkResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + private interface MhsmPrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByMhsmResource( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the private link resources supported for the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the managed hsm pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMhsmResourceWithResponseAsync( + String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByMhsmResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources supported for the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the managed hsm pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByMhsmResourceWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByMhsmResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the private link resources supported for the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the managed hsm pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByMhsmResourceAsync( + String resourceGroupName, String name) { + return listByMhsmResourceWithResponseAsync(resourceGroupName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the private link resources supported for the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the managed hsm pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MhsmPrivateLinkResourceListResultInner listByMhsmResource(String resourceGroupName, String name) { + return listByMhsmResourceAsync(resourceGroupName, name).block(); + } + + /** + * Gets the private link resources supported for the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the managed hsm pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByMhsmResourceWithResponse( + String resourceGroupName, String name, Context context) { + return listByMhsmResourceWithResponseAsync(resourceGroupName, name, context).block(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourcesImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..fb88299018c40 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourcesImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.MhsmPrivateLinkResourcesClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateLinkResourceListResultInner; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkResourceListResult; +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MhsmPrivateLinkResourcesImpl implements MhsmPrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateLinkResourcesImpl.class); + + private final MhsmPrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public MhsmPrivateLinkResourcesImpl( + MhsmPrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public MhsmPrivateLinkResourceListResult listByMhsmResource(String resourceGroupName, String name) { + MhsmPrivateLinkResourceListResultInner inner = this.serviceClient().listByMhsmResource(resourceGroupName, name); + if (inner != null) { + return new MhsmPrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByMhsmResourceWithResponse( + String resourceGroupName, String name, Context context) { + Response inner = + this.serviceClient().listByMhsmResourceWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MhsmPrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private MhsmPrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..32034337d7981 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.keyvault.generated.models.Operation; +import com.azure.resourcemanager.keyvault.generated.models.OperationDisplay; +import com.azure.resourcemanager.keyvault.generated.models.ServiceSpecification; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public ServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationsClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..35a924ea3d6c0 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.OperationsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.keyvault.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(KeyVaultManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.KeyVault/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationsImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..5a558c2e60d3f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.OperationsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.keyvault.generated.models.Operation; +import com.azure.resourcemanager.keyvault.generated.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..1a05854fc22a0 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkServiceConnectionState; +import java.util.Collections; +import java.util.Map; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingVault(String resourceGroupName, String vaultName) { + this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .putWithResponse( + resourceGroupName, vaultName, privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .putWithResponse( + resourceGroupName, vaultName, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .putWithResponse( + resourceGroupName, vaultName, privateEndpointConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .putWithResponse( + resourceGroupName, vaultName, privateEndpointConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, vaultName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, vaultName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PrivateEndpointConnectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PrivateEndpointConnectionImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public PrivateEndpointConnectionImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + public PrivateEndpointConnectionImpl withProvisioningState( + PrivateEndpointConnectionProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..a9752004ab59e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1047 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.keyvault.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnectionsPutResponse; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(KeyVaultManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono put( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResource( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, vaultName, privateEndpointConnectionName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putWithResponseAsync( + String resourceGroupName, + String vaultName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + privateEndpointConnectionName, + this.client.getApiVersion(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putWithResponseAsync( + String resourceGroupName, + String vaultName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .put( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + privateEndpointConnectionName, + this.client.getApiVersion(), + properties, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String vaultName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return putWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties) + .flatMap( + (PrivateEndpointConnectionsPutResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner put( + String resourceGroupName, + String vaultName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return putAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionsPutResponse putWithResponse( + String resourceGroupName, + String vaultName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + return putWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginDeleteAsync( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginDeleteAsync( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginDelete( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginDelete( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner delete( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return deleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner delete( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + return deleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context).block(); + } + + /** + * The List operation gets information about the private endpoint connections associated with the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceSinglePageAsync( + String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The List operation gets information about the private endpoint connections associated with the vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceSinglePageAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResource( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * The List operation gets information about the private endpoint connections associated with the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>( + () -> listByResourceSinglePageAsync(resourceGroupName, vaultName), + nextLink -> listByResourceNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the private endpoint connections associated with the vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceAsync( + String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>( + () -> listByResourceSinglePageAsync(resourceGroupName, vaultName, context), + nextLink -> listByResourceNextSinglePageAsync(nextLink, context)); + } + + /** + * The List operation gets information about the private endpoint connections associated with the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResource(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listByResourceAsync(resourceGroupName, vaultName)); + } + + /** + * The List operation gets information about the private endpoint connections associated with the vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResource( + String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listByResourceAsync(resourceGroupName, vaultName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..1a9203f255ddc --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnection get( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, vaultName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection delete( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().delete(resourceGroupName, vaultName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PrivateEndpointConnection delete( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + PrivateEndpointConnectionInner inner = + this.serviceClient().delete(resourceGroupName, vaultName, privateEndpointConnectionName, context); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResource(String resourceGroupName, String vaultName) { + PagedIterable inner = + this.serviceClient().listByResource(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResource( + String resourceGroupName, String vaultName, Context context) { + PagedIterable inner = + this.serviceClient().listByResource(resourceGroupName, vaultName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, vaultName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, vaultName, privateEndpointConnectionName, context); + } + + public PrivateEndpointConnection deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.delete(resourceGroupName, vaultName, privateEndpointConnectionName, Context.NONE); + } + + public PrivateEndpointConnection deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.delete(resourceGroupName, vaultName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourceListResultImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 0000000000000..fe2f6fa88c26c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkResourceListResult; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { + private PrivateLinkResourceListResultInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + PrivateLinkResourceListResultImpl( + PrivateLinkResourceListResultInner innerObject, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourcesClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..43bcc1787d412 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateLinkResourceListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(KeyVaultManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVault( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVaultWithResponseAsync( + String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByVault( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVaultWithResponseAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVault( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByVaultAsync(String resourceGroupName, String vaultName) { + return listByVaultWithResponseAsync(resourceGroupName, vaultName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceListResultInner listByVault(String resourceGroupName, String vaultName) { + return listByVaultAsync(resourceGroupName, vaultName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByVaultWithResponse( + String resourceGroupName, String vaultName, Context context) { + return listByVaultWithResponseAsync(resourceGroupName, vaultName, context).block(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourcesImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..9cbd402adab33 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateLinkResourceListResult listByVault(String resourceGroupName, String vaultName) { + PrivateLinkResourceListResultInner inner = this.serviceClient().listByVault(resourceGroupName, vaultName); + if (inner != null) { + return new PrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByVaultWithResponse( + String resourceGroupName, String vaultName, Context context) { + Response inner = + this.serviceClient().listByVaultWithResponse(resourceGroupName, vaultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretImpl.java new file mode 100644 index 0000000000000..11b6a1eef1356 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.SecretInner; +import com.azure.resourcemanager.keyvault.generated.models.Secret; +import com.azure.resourcemanager.keyvault.generated.models.SecretCreateOrUpdateParameters; +import com.azure.resourcemanager.keyvault.generated.models.SecretPatchParameters; +import com.azure.resourcemanager.keyvault.generated.models.SecretPatchProperties; +import com.azure.resourcemanager.keyvault.generated.models.SecretProperties; +import java.util.Collections; +import java.util.Map; + +public final class SecretImpl implements Secret, Secret.Definition, Secret.Update { + private SecretInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SecretProperties properties() { + return this.innerModel().properties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SecretInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private String secretName; + + private SecretCreateOrUpdateParameters createParameters; + + private SecretPatchParameters updateParameters; + + public SecretImpl withExistingVault(String resourceGroupName, String vaultName) { + this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; + return this; + } + + public Secret create() { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .createOrUpdateWithResponse(resourceGroupName, vaultName, secretName, createParameters, Context.NONE) + .getValue(); + return this; + } + + public Secret create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .createOrUpdateWithResponse(resourceGroupName, vaultName, secretName, createParameters, context) + .getValue(); + return this; + } + + SecretImpl(String name, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = new SecretInner(); + this.serviceManager = serviceManager; + this.secretName = name; + this.createParameters = new SecretCreateOrUpdateParameters(); + } + + public SecretImpl update() { + this.updateParameters = new SecretPatchParameters(); + return this; + } + + public Secret apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .updateWithResponse(resourceGroupName, vaultName, secretName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Secret apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .updateWithResponse(resourceGroupName, vaultName, secretName, updateParameters, context) + .getValue(); + return this; + } + + SecretImpl(SecretInner innerObject, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + this.secretName = Utils.getValueFromIdByName(innerObject.id(), "secrets"); + } + + public Secret refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .getWithResponse(resourceGroupName, vaultName, secretName, Context.NONE) + .getValue(); + return this; + } + + public Secret refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSecrets() + .getWithResponse(resourceGroupName, vaultName, secretName, context) + .getValue(); + return this; + } + + public SecretImpl withProperties(SecretProperties properties) { + this.createParameters.withProperties(properties); + return this; + } + + public SecretImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SecretImpl withProperties(SecretPatchProperties properties) { + this.updateParameters.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretsClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretsClientImpl.java new file mode 100644 index 0000000000000..a5bdc821f0b0a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretsClientImpl.java @@ -0,0 +1,979 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.SecretsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.SecretInner; +import com.azure.resourcemanager.keyvault.generated.models.SecretCreateOrUpdateParameters; +import com.azure.resourcemanager.keyvault.generated.models.SecretListResult; +import com.azure.resourcemanager.keyvault.generated.models.SecretPatchParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SecretsClient. */ +public final class SecretsClientImpl implements SecretsClient { + private final ClientLogger logger = new ClientLogger(SecretsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SecretsService service; + + /** The service client containing this operation class. */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of SecretsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecretsClientImpl(KeyVaultManagementClientImpl client) { + this.service = RestProxy.create(SecretsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientSecrets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + private interface SecretsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/secrets/{secretName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("secretName") String secretName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecretCreateOrUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/secrets/{secretName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("secretName") String secretName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecretPatchParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/secrets/{secretName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("secretName") String secretName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/secrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + secretName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String vaultName, + String secretName, + SecretCreateOrUpdateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + secretName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, secretName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner createOrUpdate( + String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters) { + return createOrUpdateAsync(resourceGroupName, vaultName, secretName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + String secretName, + SecretCreateOrUpdateParameters parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, secretName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + secretName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String vaultName, + String secretName, + SecretPatchParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + secretName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters) { + return updateWithResponseAsync(resourceGroupName, vaultName, secretName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner update( + String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters) { + return updateAsync(resourceGroupName, vaultName, secretName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String vaultName, + String secretName, + SecretPatchParameters parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, vaultName, secretName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String secretName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + secretName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String vaultName, String secretName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + secretName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String secretName) { + return getWithResponseAsync(resourceGroupName, vaultName, secretName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner get(String resourceGroupName, String vaultName, String secretName) { + return getAsync(resourceGroupName, vaultName, secretName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String secretName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, secretName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String vaultName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + final Integer top = null; + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, Integer top, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, top, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretsImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretsImpl.java new file mode 100644 index 0000000000000..f113db5135eef --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretsImpl.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.SecretsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.SecretInner; +import com.azure.resourcemanager.keyvault.generated.models.Secret; +import com.azure.resourcemanager.keyvault.generated.models.Secrets; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SecretsImpl implements Secrets { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretsImpl.class); + + private final SecretsClient innerClient; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public SecretsImpl( + SecretsClient innerClient, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Secret get(String resourceGroupName, String vaultName, String secretName) { + SecretInner inner = this.serviceClient().get(resourceGroupName, vaultName, secretName); + if (inner != null) { + return new SecretImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String vaultName, String secretName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, vaultName, secretName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecretImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return Utils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName, top, context); + return Utils.mapPage(inner, inner1 -> new SecretImpl(inner1, this.manager())); + } + + public Secret getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + String secretName = Utils.getValueFromIdByName(id, "secrets"); + if (secretName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, secretName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + String secretName = Utils.getValueFromIdByName(id, "secrets"); + if (secretName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'secrets'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, secretName, context); + } + + private SecretsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + public SecretImpl define(String name) { + return new SecretImpl(name, this.manager()); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/Utils.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/Utils.java new file mode 100644 index 0000000000000..d4dad5974f08e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultAccessPolicyParametersImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultAccessPolicyParametersImpl.java new file mode 100644 index 0000000000000..3026978bdcabe --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultAccessPolicyParametersImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultAccessPolicyParametersInner; +import com.azure.resourcemanager.keyvault.generated.models.VaultAccessPolicyParameters; +import com.azure.resourcemanager.keyvault.generated.models.VaultAccessPolicyProperties; + +public final class VaultAccessPolicyParametersImpl implements VaultAccessPolicyParameters { + private VaultAccessPolicyParametersInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + VaultAccessPolicyParametersImpl( + VaultAccessPolicyParametersInner innerObject, + com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public VaultAccessPolicyProperties properties() { + return this.innerModel().properties(); + } + + public VaultAccessPolicyParametersInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultImpl.java new file mode 100644 index 0000000000000..ad4f1763b8932 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultInner; +import com.azure.resourcemanager.keyvault.generated.models.Vault; +import com.azure.resourcemanager.keyvault.generated.models.VaultCreateOrUpdateParameters; +import com.azure.resourcemanager.keyvault.generated.models.VaultPatchParameters; +import com.azure.resourcemanager.keyvault.generated.models.VaultPatchProperties; +import com.azure.resourcemanager.keyvault.generated.models.VaultProperties; +import java.util.Collections; +import java.util.Map; + +public final class VaultImpl implements Vault, Vault.Definition, Vault.Update { + private VaultInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public VaultProperties properties() { + return this.innerModel().properties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VaultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private VaultCreateOrUpdateParameters createParameters; + + private VaultPatchParameters updateParameters; + + public VaultImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Vault create() { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .createOrUpdate(resourceGroupName, vaultName, createParameters, Context.NONE); + return this; + } + + public Vault create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .createOrUpdate(resourceGroupName, vaultName, createParameters, context); + return this; + } + + VaultImpl(String name, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = new VaultInner(); + this.serviceManager = serviceManager; + this.vaultName = name; + this.createParameters = new VaultCreateOrUpdateParameters(); + } + + public VaultImpl update() { + this.updateParameters = new VaultPatchParameters(); + return this; + } + + public Vault apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .updateWithResponse(resourceGroupName, vaultName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Vault apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .updateWithResponse(resourceGroupName, vaultName, updateParameters, context) + .getValue(); + return this; + } + + VaultImpl(VaultInner innerObject, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "vaults"); + } + + public Vault refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .getByResourceGroupWithResponse(resourceGroupName, vaultName, Context.NONE) + .getValue(); + return this; + } + + public Vault refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVaults() + .getByResourceGroupWithResponse(resourceGroupName, vaultName, context) + .getValue(); + return this; + } + + public VaultImpl withRegion(Region location) { + this.createParameters.withLocation(location.toString()); + return this; + } + + public VaultImpl withRegion(String location) { + this.createParameters.withLocation(location); + return this; + } + + public VaultImpl withProperties(VaultProperties properties) { + this.createParameters.withProperties(properties); + return this; + } + + public VaultImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VaultImpl withProperties(VaultPatchProperties properties) { + this.updateParameters.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultsClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultsClientImpl.java new file mode 100644 index 0000000000000..d0ba6f768864d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultsClientImpl.java @@ -0,0 +1,2661 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.Resource; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.keyvault.generated.fluent.VaultsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedVaultInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultAccessPolicyParametersInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultInner; +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyUpdateKind; +import com.azure.resourcemanager.keyvault.generated.models.DeletedVaultListResult; +import com.azure.resourcemanager.keyvault.generated.models.ResourceListResult; +import com.azure.resourcemanager.keyvault.generated.models.VaultCheckNameAvailabilityParameters; +import com.azure.resourcemanager.keyvault.generated.models.VaultCreateOrUpdateParameters; +import com.azure.resourcemanager.keyvault.generated.models.VaultListResult; +import com.azure.resourcemanager.keyvault.generated.models.VaultPatchParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VaultsClient. */ +public final class VaultsClientImpl implements VaultsClient { + private final ClientLogger logger = new ClientLogger(VaultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VaultsService service; + + /** The service client containing this operation class. */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of VaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VaultsClientImpl(KeyVaultManagementClientImpl client) { + this.service = RestProxy.create(VaultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientVaults to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + private interface VaultsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VaultCreateOrUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VaultPatchParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults" + + "/{vaultName}/accessPolicies/{operationKind}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateAccessPolicy( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vaultName") String vaultName, + @PathParam("operationKind") AccessPolicyUpdateKind operationKind, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VaultAccessPolicyParametersInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/vaults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription( + @HostParam("$host") String endpoint, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDeleted( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults" + + "/{vaultName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDeleted( + @HostParam("$host") String endpoint, + @PathParam("vaultName") String vaultName, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults" + + "/{vaultName}/purge") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purgeDeleted( + @HostParam("$host") String endpoint, + @PathParam("vaultName") String vaultName, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VaultCheckNameAvailabilityParameters vaultName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDeletedNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultInner> beginCreateOrUpdateAsync( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vaultName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VaultInner.class, VaultInner.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VaultInner> beginCreateOrUpdateAsync( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, vaultName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VaultInner.class, VaultInner.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultInner> beginCreateOrUpdate( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VaultInner> beginCreateOrUpdate( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultInner createOrUpdate( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + return createOrUpdateAsync(resourceGroupName, vaultName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultInner createOrUpdate( + String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, vaultName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String vaultName, VaultPatchParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String vaultName, VaultPatchParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String vaultName, VaultPatchParameters parameters) { + return updateWithResponseAsync(resourceGroupName, vaultName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultInner update(String resourceGroupName, String vaultName, VaultPatchParameters parameters) { + return updateAsync(resourceGroupName, vaultName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String vaultName, VaultPatchParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, vaultName, parameters, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vaultName) { + return deleteWithResponseAsync(resourceGroupName, vaultName).flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vaultName) { + deleteAsync(resourceGroupName, vaultName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String vaultName, Context context) { + return deleteWithResponseAsync(resourceGroupName, vaultName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String vaultName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultInner getByResourceGroup(String resourceGroupName, String vaultName) { + return getByResourceGroupAsync(resourceGroupName, vaultName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName, context).block(); + } + + /** + * 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. + * @param parameters Access policy to merge into the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters for updating the access policy in a vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateAccessPolicyWithResponseAsync( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (operationKind == null) { + return Mono.error(new IllegalArgumentException("Parameter operationKind is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAccessPolicy( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + operationKind, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * @param parameters Access policy to merge into the vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters for updating the access policy in a vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateAccessPolicyWithResponseAsync( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (operationKind == null) { + return Mono.error(new IllegalArgumentException("Parameter operationKind is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateAccessPolicy( + this.client.getEndpoint(), + resourceGroupName, + vaultName, + operationKind, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * 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. + * @param parameters Access policy to merge into the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters for updating the access policy in a vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAccessPolicyAsync( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters) { + return updateAccessPolicyWithResponseAsync(resourceGroupName, vaultName, operationKind, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + * @param parameters Access policy to merge into the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters for updating the access policy in a vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VaultAccessPolicyParametersInner updateAccessPolicy( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters) { + return updateAccessPolicyAsync(resourceGroupName, vaultName, operationKind, parameters).block(); + } + + /** + * 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. + * @param parameters Access policy to merge into the vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters for updating the access policy in a vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateAccessPolicyWithResponse( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters, + Context context) { + return updateAccessPolicyWithResponseAsync(resourceGroupName, vaultName, operationKind, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionSinglePageAsync(Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySubscription( + this.client.getEndpoint(), + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionSinglePageAsync(Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscription( + this.client.getEndpoint(), + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync(Integer top) { + return new PagedFlux<>( + () -> listBySubscriptionSinglePageAsync(top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync() { + final Integer top = null; + return new PagedFlux<>( + () -> listBySubscriptionSinglePageAsync(top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync(Integer top, Context context) { + return new PagedFlux<>( + () -> listBySubscriptionSinglePageAsync(top, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription() { + final Integer top = null; + return new PagedIterable<>(listBySubscriptionAsync(top)); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(Integer top, Context context) { + return new PagedIterable<>(listBySubscriptionAsync(top, context)); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the deleted vaults in a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeletedSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDeleted( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the deleted vaults in a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeletedSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDeleted( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the deleted vaults in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDeletedAsync() { + return new PagedFlux<>( + () -> listDeletedSinglePageAsync(), nextLink -> listDeletedNextSinglePageAsync(nextLink)); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the deleted vaults in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDeletedAsync(Context context) { + return new PagedFlux<>( + () -> listDeletedSinglePageAsync(context), nextLink -> listDeletedNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the deleted vaults in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeleted() { + return new PagedIterable<>(listDeletedAsync()); + } + + /** + * Gets information about the deleted vaults in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the deleted vaults in a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeleted(Context context) { + return new PagedIterable<>(listDeletedAsync(context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deleted Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeletedWithResponseAsync(String vaultName, String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDeleted( + this.client.getEndpoint(), + vaultName, + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the deleted Azure key vault. + * + * @param vaultName The name of the vault. + * @param location The location of the deleted vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deleted Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeletedWithResponseAsync( + String vaultName, String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDeleted( + this.client.getEndpoint(), + vaultName, + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deleted Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDeletedAsync(String vaultName, String location) { + return getDeletedWithResponseAsync(vaultName, location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deleted Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeletedVaultInner getDeleted(String vaultName, String location) { + return getDeletedAsync(vaultName, location).block(); + } + + /** + * Gets the deleted Azure key vault. + * + * @param vaultName The name of the vault. + * @param location The location of the deleted vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deleted Azure key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeletedWithResponse(String vaultName, String location, Context context) { + return getDeletedWithResponseAsync(vaultName, location, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeDeletedWithResponseAsync(String vaultName, String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .purgeDeleted( + this.client.getEndpoint(), + vaultName, + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> purgeDeletedWithResponseAsync( + String vaultName, String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .purgeDeleted( + this.client.getEndpoint(), + vaultName, + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeDeletedAsync(String vaultName, String location) { + Mono>> mono = purgeDeletedWithResponseAsync(vaultName, location); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPurgeDeletedAsync( + String vaultName, String location, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = purgeDeletedWithResponseAsync(vaultName, location, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurgeDeleted(String vaultName, String location) { + return beginPurgeDeletedAsync(vaultName, location).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPurgeDeleted(String vaultName, String location, Context context) { + return beginPurgeDeletedAsync(vaultName, location, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeDeletedAsync(String vaultName, String location) { + return beginPurgeDeletedAsync(vaultName, location).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono purgeDeletedAsync(String vaultName, String location, Context context) { + return beginPurgeDeletedAsync(vaultName, location, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purgeDeleted(String vaultName, String location) { + purgeDeletedAsync(vaultName, location).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void purgeDeleted(String vaultName, String location, Context context) { + purgeDeletedAsync(vaultName, location, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String filter = "resourceType eq 'Microsoft.KeyVault/vaults'"; + final String apiVersion = "2015-11-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + filter, + top, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String filter = "resourceType eq 'Microsoft.KeyVault/vaults'"; + final String apiVersion = "2015-11-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), filter, top, apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(top, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Integer top = null; + return new PagedIterable<>(listAsync(top)); + } + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Integer top, Context context) { + return new PagedIterable<>(listAsync(top, context)); + } + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + VaultCheckNameAvailabilityParameters vaultName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } else { + vaultName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + vaultName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param vaultName The name of the vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + VaultCheckNameAvailabilityParameters vaultName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } else { + vaultName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + vaultName, + accept, + context); + } + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + VaultCheckNameAvailabilityParameters vaultName) { + return checkNameAvailabilityWithResponseAsync(vaultName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability(VaultCheckNameAvailabilityParameters vaultName) { + return checkNameAvailabilityAsync(vaultName).block(); + } + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param vaultName The name of the vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + VaultCheckNameAvailabilityParameters vaultName, Context context) { + return checkNameAvailabilityWithResponseAsync(vaultName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeletedNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listDeletedNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeletedNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDeletedNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultsImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultsImpl.java new file mode 100644 index 0000000000000..d29bbbbf006bb --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultsImpl.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.VaultsClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedVaultInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultAccessPolicyParametersInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultInner; +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyUpdateKind; +import com.azure.resourcemanager.keyvault.generated.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.keyvault.generated.models.DeletedVault; +import com.azure.resourcemanager.keyvault.generated.models.Vault; +import com.azure.resourcemanager.keyvault.generated.models.VaultAccessPolicyParameters; +import com.azure.resourcemanager.keyvault.generated.models.VaultCheckNameAvailabilityParameters; +import com.azure.resourcemanager.keyvault.generated.models.Vaults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class VaultsImpl implements Vaults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultsImpl.class); + + private final VaultsClient innerClient; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public VaultsImpl( + VaultsClient innerClient, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteByResourceGroup(String resourceGroupName, String vaultName) { + this.serviceClient().delete(resourceGroupName, vaultName); + } + + public Response deleteWithResponse(String resourceGroupName, String vaultName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, vaultName, context); + } + + public Vault getByResourceGroup(String resourceGroupName, String vaultName) { + VaultInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, vaultName); + if (inner != null) { + return new VaultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, vaultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VaultAccessPolicyParameters updateAccessPolicy( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters) { + VaultAccessPolicyParametersInner inner = + this.serviceClient().updateAccessPolicy(resourceGroupName, vaultName, operationKind, parameters); + if (inner != null) { + return new VaultAccessPolicyParametersImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateAccessPolicyWithResponse( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .updateAccessPolicyWithResponse(resourceGroupName, vaultName, operationKind, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VaultAccessPolicyParametersImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new VaultImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, top, context); + return Utils.mapPage(inner, inner1 -> new VaultImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription() { + PagedIterable inner = this.serviceClient().listBySubscription(); + return Utils.mapPage(inner, inner1 -> new VaultImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription(Integer top, Context context) { + PagedIterable inner = this.serviceClient().listBySubscription(top, context); + return Utils.mapPage(inner, inner1 -> new VaultImpl(inner1, this.manager())); + } + + public PagedIterable listDeleted() { + PagedIterable inner = this.serviceClient().listDeleted(); + return Utils.mapPage(inner, inner1 -> new DeletedVaultImpl(inner1, this.manager())); + } + + public PagedIterable listDeleted(Context context) { + PagedIterable inner = this.serviceClient().listDeleted(context); + return Utils.mapPage(inner, inner1 -> new DeletedVaultImpl(inner1, this.manager())); + } + + public DeletedVault getDeleted(String vaultName, String location) { + DeletedVaultInner inner = this.serviceClient().getDeleted(vaultName, location); + if (inner != null) { + return new DeletedVaultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDeletedWithResponse(String vaultName, String location, Context context) { + Response inner = this.serviceClient().getDeletedWithResponse(vaultName, location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeletedVaultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void purgeDeleted(String vaultName, String location) { + this.serviceClient().purgeDeleted(vaultName, location); + } + + public void purgeDeleted(String vaultName, String location, Context context) { + this.serviceClient().purgeDeleted(vaultName, location, context); + } + + public PagedIterable list() { + return this.serviceClient().list(); + } + + public PagedIterable list(Integer top, Context context) { + return this.serviceClient().list(top, context); + } + + public CheckNameAvailabilityResult checkNameAvailability(VaultCheckNameAvailabilityParameters vaultName) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(vaultName); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + VaultCheckNameAvailabilityParameters vaultName, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(vaultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Vault getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vaultName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, vaultName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + this.deleteWithResponse(resourceGroupName, vaultName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = Utils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + return this.deleteWithResponse(resourceGroupName, vaultName, context); + } + + private VaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + public VaultImpl define(String name) { + return new VaultImpl(name, this.manager()); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/package-info.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/package-info.java new file mode 100644 index 0000000000000..f0e15a325d579 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for KeyVaultManagementClient. The Azure management API provides a RESTful set + * of web services that interact with Azure Key Vault. + */ +package com.azure.resourcemanager.keyvault.generated.implementation; diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/AccessPolicyEntry.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/AccessPolicyEntry.java new file mode 100644 index 0000000000000..edfcabc414a5d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/AccessPolicyEntry.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** + * 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. + */ +@Fluent +public final class AccessPolicyEntry { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AccessPolicyEntry.class); + + /* + * 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 tenantId property: 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 tenantId property: 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 objectId property: 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 objectId property: 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 the applicationId property: Application ID of the client making request on behalf of a principal. + * + * @return the applicationId value. + */ + public UUID applicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: 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 the permissions property: Permissions the identity has for keys, secrets and certificates. + * + * @return the permissions value. + */ + public Permissions permissions() { + return this.permissions; + } + + /** + * Set the permissions property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tenantId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property tenantId in model AccessPolicyEntry")); + } + if (objectId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property objectId in model AccessPolicyEntry")); + } + if (permissions() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property permissions in model AccessPolicyEntry")); + } else { + permissions().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/AccessPolicyUpdateKind.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/AccessPolicyUpdateKind.java new file mode 100644 index 0000000000000..aec86c38aba49 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/AccessPolicyUpdateKind.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.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 final 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Action.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Action.java new file mode 100644 index 0000000000000..867467c461634 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Action.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Action model. */ +@Fluent +public final class Action { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Action.class); + + /* + * The type of action. + */ + @JsonProperty(value = "type") + private KeyRotationPolicyActionType type; + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public KeyRotationPolicyActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the Action object itself. + */ + public Action withType(KeyRotationPolicyActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ActionsRequired.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ActionsRequired.java new file mode 100644 index 0000000000000..7eaf07bc2c94b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ActionsRequired.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionsRequired. */ +public final class ActionsRequired extends ExpandableStringEnum { + /** Static value None for ActionsRequired. */ + public static final ActionsRequired NONE = fromString("None"); + + /** + * Creates or finds a ActionsRequired from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionsRequired. + */ + @JsonCreator + public static ActionsRequired fromString(String name) { + return fromString(name, ActionsRequired.class); + } + + /** @return known ActionsRequired values. */ + public static Collection values() { + return values(ActionsRequired.class); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Attributes.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Attributes.java new file mode 100644 index 0000000000000..3032af3afb0c7 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Attributes.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object attributes managed by the KeyVault service. */ +@Fluent +public class Attributes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Attributes.class); + + /* + * 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 the enabled property: Determines whether the object is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: 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 the notBefore property: Not before date in seconds since 1970-01-01T00:00:00Z. + * + * @return the notBefore value. + */ + public Long notBefore() { + return this.notBefore; + } + + /** + * Set the notBefore property: 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(Long notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * Get the expires property: Expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @return the expires value. + */ + public Long expires() { + return this.expires; + } + + /** + * Set the expires property: 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(Long expires) { + this.expires = expires; + return this; + } + + /** + * Get the created property: Creation time in seconds since 1970-01-01T00:00:00Z. + * + * @return the created value. + */ + public Long created() { + return this.created; + } + + /** + * Get the updated property: Last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @return the updated value. + */ + public Long updated() { + return this.updated; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CertificatePermissions.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CertificatePermissions.java new file mode 100644 index 0000000000000..d5b8668e71140 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CertificatePermissions.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CheckNameAvailabilityResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CheckNameAvailabilityResult.java new file mode 100644 index 0000000000000..17e125b1e0e69 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CheckNameAvailabilityResult.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.CheckNameAvailabilityResultInner; + +/** An immutable client-side representation of CheckNameAvailabilityResult. */ +public interface CheckNameAvailabilityResult { + /** + * Gets the nameAvailable property: 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. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason that a vault name could not be used. The Reason element is only returned if + * NameAvailable is false. + * + * @return the reason value. + */ + Reason reason(); + + /** + * Gets the message property: An error message explaining the Reason value in more detail. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.CheckNameAvailabilityResultInner + * object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CreateMode.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CreateMode.java new file mode 100644 index 0000000000000..ff74a04c87170 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CreateMode.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.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 final 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsm.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsm.java new file mode 100644 index 0000000000000..d045a15876716 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsm.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedManagedHsmInner; + +/** An immutable client-side representation of DeletedManagedHsm. */ +public interface DeletedManagedHsm { + /** + * Gets the id property: The Azure Resource Manager resource ID for the deleted managed HSM Pool. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the managed HSM Pool. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type of the managed HSM Pool. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of the deleted managed HSM. + * + * @return the properties value. + */ + DeletedManagedHsmProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedManagedHsmInner object. + * + * @return the inner object. + */ + DeletedManagedHsmInner innerModel(); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsmListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsmListResult.java new file mode 100644 index 0000000000000..bbc82bdfe2c35 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsmListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedManagedHsmInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of deleted managed HSM Pools. */ +@Fluent +public final class DeletedManagedHsmListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedManagedHsmListResult.class); + + /* + * The list of deleted managed HSM Pools. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of deleted managed HSM Pools. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of deleted managed HSM Pools. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of deleted managed HSM Pools. + * + * @param value the value value to set. + * @return the DeletedManagedHsmListResult object itself. + */ + public DeletedManagedHsmListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of deleted managed HSM Pools. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of deleted managed HSM Pools. + * + * @param nextLink the nextLink value to set. + * @return the DeletedManagedHsmListResult object itself. + */ + public DeletedManagedHsmListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsmProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsmProperties.java new file mode 100644 index 0000000000000..026ca2a5ad717 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedManagedHsmProperties.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Properties of the deleted managed HSM. */ +@Immutable +public final class DeletedManagedHsmProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedManagedHsmProperties.class); + + /* + * The resource id of the original managed HSM. + */ + @JsonProperty(value = "mhsmId", access = JsonProperty.Access.WRITE_ONLY) + private String mhsmId; + + /* + * The location of the original managed HSM. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * The deleted date. + */ + @JsonProperty(value = "deletionDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime deletionDate; + + /* + * The scheduled purged date. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime scheduledPurgeDate; + + /* + * Purge protection status of the original managed HSM. + */ + @JsonProperty(value = "purgeProtectionEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean purgeProtectionEnabled; + + /* + * Tags of the original managed HSM. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the mhsmId property: The resource id of the original managed HSM. + * + * @return the mhsmId value. + */ + public String mhsmId() { + return this.mhsmId; + } + + /** + * Get the location property: The location of the original managed HSM. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the deletionDate property: The deleted date. + * + * @return the deletionDate value. + */ + public OffsetDateTime deletionDate() { + return this.deletionDate; + } + + /** + * Get the scheduledPurgeDate property: The scheduled purged date. + * + * @return the scheduledPurgeDate value. + */ + public OffsetDateTime scheduledPurgeDate() { + return this.scheduledPurgeDate; + } + + /** + * Get the purgeProtectionEnabled property: Purge protection status of the original managed HSM. + * + * @return the purgeProtectionEnabled value. + */ + public Boolean purgeProtectionEnabled() { + return this.purgeProtectionEnabled; + } + + /** + * Get the tags property: Tags of the original managed HSM. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVault.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVault.java new file mode 100644 index 0000000000000..525aa0d7196e2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVault.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedVaultInner; + +/** An immutable client-side representation of DeletedVault. */ +public interface DeletedVault { + /** + * Gets the id property: The resource ID for the deleted key vault. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the key vault. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type of the key vault. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of the vault. + * + * @return the properties value. + */ + DeletedVaultProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedVaultInner object. + * + * @return the inner object. + */ + DeletedVaultInner innerModel(); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVaultListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVaultListResult.java new file mode 100644 index 0000000000000..6586213bdbdcb --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVaultListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.DeletedVaultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of vaults. */ +@Fluent +public final class DeletedVaultListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedVaultListResult.class); + + /* + * The list of deleted vaults. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of deleted vaults. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of deleted vaults. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of deleted vaults. + * + * @param value the value value to set. + * @return the DeletedVaultListResult object itself. + */ + public DeletedVaultListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of deleted vaults. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of deleted vaults. + * + * @param nextLink the nextLink value to set. + * @return the DeletedVaultListResult object itself. + */ + public DeletedVaultListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVaultProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVaultProperties.java new file mode 100644 index 0000000000000..1cac658be6bf8 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletedVaultProperties.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Properties of the deleted vault. */ +@Immutable +public final class DeletedVaultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeletedVaultProperties.class); + + /* + * 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 OffsetDateTime deletionDate; + + /* + * The scheduled purged date. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime scheduledPurgeDate; + + /* + * Tags of the original vault. + */ + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Purge protection status of the original vault. + */ + @JsonProperty(value = "purgeProtectionEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean purgeProtectionEnabled; + + /** + * Get the vaultId property: The resource id of the original vault. + * + * @return the vaultId value. + */ + public String vaultId() { + return this.vaultId; + } + + /** + * Get the location property: The location of the original vault. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the deletionDate property: The deleted date. + * + * @return the deletionDate value. + */ + public OffsetDateTime deletionDate() { + return this.deletionDate; + } + + /** + * Get the scheduledPurgeDate property: The scheduled purged date. + * + * @return the scheduledPurgeDate value. + */ + public OffsetDateTime scheduledPurgeDate() { + return this.scheduledPurgeDate; + } + + /** + * Get the tags property: Tags of the original vault. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the purgeProtectionEnabled property: Purge protection status of the original vault. + * + * @return the purgeProtectionEnabled value. + */ + public Boolean purgeProtectionEnabled() { + return this.purgeProtectionEnabled; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletionRecoveryLevel.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletionRecoveryLevel.java new file mode 100644 index 0000000000000..ea71719f4df85 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletionRecoveryLevel.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeletionRecoveryLevel. */ +public final class DeletionRecoveryLevel extends ExpandableStringEnum { + /** Static value Purgeable for DeletionRecoveryLevel. */ + public static final DeletionRecoveryLevel PURGEABLE = fromString("Purgeable"); + + /** Static value Recoverable+Purgeable for DeletionRecoveryLevel. */ + public static final DeletionRecoveryLevel RECOVERABLE_PURGEABLE = fromString("Recoverable+Purgeable"); + + /** Static value Recoverable for DeletionRecoveryLevel. */ + public static final DeletionRecoveryLevel RECOVERABLE = fromString("Recoverable"); + + /** Static value Recoverable+ProtectedSubscription for DeletionRecoveryLevel. */ + public static final DeletionRecoveryLevel RECOVERABLE_PROTECTED_SUBSCRIPTION = + fromString("Recoverable+ProtectedSubscription"); + + /** + * Creates or finds a DeletionRecoveryLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeletionRecoveryLevel. + */ + @JsonCreator + public static DeletionRecoveryLevel fromString(String name) { + return fromString(name, DeletionRecoveryLevel.class); + } + + /** @return known DeletionRecoveryLevel values. */ + public static Collection values() { + return values(DeletionRecoveryLevel.class); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DimensionProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DimensionProperties.java new file mode 100644 index 0000000000000..8fabc2190db1e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DimensionProperties.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Type of operation: get, read, delete, etc. */ +@Fluent +public final class DimensionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DimensionProperties.class); + + /* + * Name of dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Property to specify whether the dimension should be exported for + * Shoebox. + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** + * Get the name property: Name of dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of dimension. + * + * @param name the name value to set. + * @return the DimensionProperties object itself. + */ + public DimensionProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of dimension. + * + * @param displayName the displayName value to set. + * @return the DimensionProperties object itself. + */ + public DimensionProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the toBeExportedForShoebox property: Property to specify whether the dimension should be exported for + * Shoebox. + * + * @return the toBeExportedForShoebox value. + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set the toBeExportedForShoebox property: Property to specify whether the dimension should be exported for + * Shoebox. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. + * @return the DimensionProperties object itself. + */ + public DimensionProperties withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Error.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Error.java new file mode 100644 index 0000000000000..b9b21cb0a28a8 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Error.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The error exception. */ +@Immutable +public final class Error extends ManagementError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Error.class); + + /* + * The inner error, contains a more specific error code. + */ + @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) + private Error innerError; + + /** + * Get the innerError property: The inner error, contains a more specific error code. + * + * @return the innerError value. + */ + public Error getInnerError() { + return this.innerError; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (getInnerError() != null) { + getInnerError().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ErrorException.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ErrorException.java new file mode 100644 index 0000000000000..20c6034e1af60 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ErrorException.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.HttpResponse; +import com.azure.core.management.exception.ManagementException; + +/** Exception thrown for an invalid response with Error information. */ +public final class ErrorException extends ManagementException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public ErrorException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the deserialized response value. + */ + public ErrorException(String message, HttpResponse response, Error value) { + super(message, response, value); + } + + @Override + public Error getValue() { + return (Error) super.getValue(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/IpRule.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/IpRule.java new file mode 100644 index 0000000000000..f0537cd58389f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/IpRule.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A rule governing the accessibility of a vault from a specific ip address or ip range. */ +@Fluent +public final class IpRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpRule.class); + + /* + * 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 the value property: 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 the value property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property value in model IpRule")); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyCurveName.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyCurveName.java new file mode 100644 index 0000000000000..31536445a9466 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyCurveName.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JsonWebKeyCurveName. */ +public final class JsonWebKeyCurveName extends ExpandableStringEnum { + /** Static value P-256 for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_256 = fromString("P-256"); + + /** Static value P-384 for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_384 = fromString("P-384"); + + /** Static value P-521 for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_521 = fromString("P-521"); + + /** Static value P-256K for JsonWebKeyCurveName. */ + public static final JsonWebKeyCurveName P_256K = fromString("P-256K"); + + /** + * Creates or finds a JsonWebKeyCurveName from its string representation. + * + * @param name a name to look for. + * @return the corresponding JsonWebKeyCurveName. + */ + @JsonCreator + public static JsonWebKeyCurveName fromString(String name) { + return fromString(name, JsonWebKeyCurveName.class); + } + + /** @return known JsonWebKeyCurveName values. */ + public static Collection values() { + return values(JsonWebKeyCurveName.class); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyOperation.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyOperation.java new file mode 100644 index 0000000000000..27d133eb36b7c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyOperation.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JsonWebKeyOperation. */ +public final class JsonWebKeyOperation extends ExpandableStringEnum { + /** Static value encrypt for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation ENCRYPT = fromString("encrypt"); + + /** Static value decrypt for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation DECRYPT = fromString("decrypt"); + + /** Static value sign for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation SIGN = fromString("sign"); + + /** Static value verify for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation VERIFY = fromString("verify"); + + /** Static value wrapKey for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation WRAP_KEY = fromString("wrapKey"); + + /** Static value unwrapKey for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation UNWRAP_KEY = fromString("unwrapKey"); + + /** Static value import for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation IMPORT = fromString("import"); + + /** Static value release for JsonWebKeyOperation. */ + public static final JsonWebKeyOperation RELEASE = fromString("release"); + + /** + * Creates or finds a JsonWebKeyOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding JsonWebKeyOperation. + */ + @JsonCreator + public static JsonWebKeyOperation fromString(String name) { + return fromString(name, JsonWebKeyOperation.class); + } + + /** @return known JsonWebKeyOperation values. */ + public static Collection values() { + return values(JsonWebKeyOperation.class); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyType.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyType.java new file mode 100644 index 0000000000000..281d8b387b67e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JsonWebKeyType. */ +public final class JsonWebKeyType extends ExpandableStringEnum { + /** Static value EC for JsonWebKeyType. */ + public static final JsonWebKeyType EC = fromString("EC"); + + /** Static value EC-HSM for JsonWebKeyType. */ + public static final JsonWebKeyType EC_HSM = fromString("EC-HSM"); + + /** Static value RSA for JsonWebKeyType. */ + public static final JsonWebKeyType RSA = fromString("RSA"); + + /** Static value RSA-HSM for JsonWebKeyType. */ + public static final JsonWebKeyType RSA_HSM = fromString("RSA-HSM"); + + /** + * Creates or finds a JsonWebKeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JsonWebKeyType. + */ + @JsonCreator + public static JsonWebKeyType fromString(String name) { + return fromString(name, JsonWebKeyType.class); + } + + /** @return known JsonWebKeyType values. */ + public static Collection values() { + return values(JsonWebKeyType.class); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Key.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Key.java new file mode 100644 index 0000000000000..a77e6a7f5f4c4 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Key.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyProperties; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Key. */ +public interface Key { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the attributes property: The attributes of the key. + * + * @return the attributes value. + */ + KeyAttributes attributes(); + + /** + * Gets the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @return the kty value. + */ + JsonWebKeyType kty(); + + /** + * Gets the keyOps property: The keyOps property. + * + * @return the keyOps value. + */ + List keyOps(); + + /** + * Gets the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @return the keySize value. + */ + Integer keySize(); + + /** + * Gets the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @return the curveName value. + */ + JsonWebKeyCurveName curveName(); + + /** + * Gets the keyUri property: The URI to retrieve the current version of the key. + * + * @return the keyUri value. + */ + String keyUri(); + + /** + * Gets the keyUriWithVersion property: The URI to retrieve the specific version of the key. + * + * @return the keyUriWithVersion value. + */ + String keyUriWithVersion(); + + /** + * Gets the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the rotationPolicy value. + */ + RotationPolicy rotationPolicy(); + + /** + * Gets the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the releasePolicy value. + */ + KeyReleasePolicy releasePolicy(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.KeyInner object. + * + * @return the inner object. + */ + KeyInner innerModel(); + + /** The entirety of the Key definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The Key definition stages. */ + interface DefinitionStages { + /** The first stage of the Key definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Key definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vaultName. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @return the next definition stage. + */ + WithProperties withExistingVault(String resourceGroupName, String vaultName); + } + /** The stage of the Key definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of the key to be created.. + * + * @param properties The properties of the key to be created. + * @return the next definition stage. + */ + WithCreate withProperties(KeyProperties properties); + } + /** + * The stage of the Key definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + Key create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Key create(Context context); + } + /** The stage of the Key definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags that will be assigned to the key.. + * + * @param tags The tags that will be assigned to the key. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Key refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Key refresh(Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyAttributes.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyAttributes.java new file mode 100644 index 0000000000000..838dc3b05a1e9 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyAttributes.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object attributes managed by the Azure Key Vault service. */ +@Fluent +public final class KeyAttributes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyAttributes.class); + + /* + * Determines whether or not 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; + + /* + * The deletion recovery level currently in effect for the object. If it + * contains 'Purgeable', then the object can be permanently deleted by a + * privileged user; otherwise, only the system can purge the object at the + * end of the retention interval. + */ + @JsonProperty(value = "recoveryLevel", access = JsonProperty.Access.WRITE_ONLY) + private DeletionRecoveryLevel recoveryLevel; + + /* + * Indicates if the private key can be exported. + */ + @JsonProperty(value = "exportable") + private Boolean exportable; + + /** + * Get the enabled property: Determines whether or not the object is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether or not the object is enabled. + * + * @param enabled the enabled value to set. + * @return the KeyAttributes object itself. + */ + public KeyAttributes withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the notBefore property: Not before date in seconds since 1970-01-01T00:00:00Z. + * + * @return the notBefore value. + */ + public Long notBefore() { + return this.notBefore; + } + + /** + * Set the notBefore property: Not before date in seconds since 1970-01-01T00:00:00Z. + * + * @param notBefore the notBefore value to set. + * @return the KeyAttributes object itself. + */ + public KeyAttributes withNotBefore(Long notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * Get the expires property: Expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @return the expires value. + */ + public Long expires() { + return this.expires; + } + + /** + * Set the expires property: Expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @param expires the expires value to set. + * @return the KeyAttributes object itself. + */ + public KeyAttributes withExpires(Long expires) { + this.expires = expires; + return this; + } + + /** + * Get the created property: Creation time in seconds since 1970-01-01T00:00:00Z. + * + * @return the created value. + */ + public Long created() { + return this.created; + } + + /** + * Get the updated property: Last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @return the updated value. + */ + public Long updated() { + return this.updated; + } + + /** + * Get the recoveryLevel property: The deletion recovery level currently in effect for the object. If it contains + * 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can + * purge the object at the end of the retention interval. + * + * @return the recoveryLevel value. + */ + public DeletionRecoveryLevel recoveryLevel() { + return this.recoveryLevel; + } + + /** + * Get the exportable property: Indicates if the private key can be exported. + * + * @return the exportable value. + */ + public Boolean exportable() { + return this.exportable; + } + + /** + * Set the exportable property: Indicates if the private key can be exported. + * + * @param exportable the exportable value to set. + * @return the KeyAttributes object itself. + */ + public KeyAttributes withExportable(Boolean exportable) { + this.exportable = exportable; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyCreateParameters.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyCreateParameters.java new file mode 100644 index 0000000000000..4861c0df7b362 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyCreateParameters.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters used to create a key. */ +@Fluent +public final class KeyCreateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyCreateParameters.class); + + /* + * The tags that will be assigned to the key. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The properties of the key to be created. + */ + @JsonProperty(value = "properties", required = true) + private KeyProperties properties; + + /** + * Get the tags property: The tags that will be assigned to the key. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags that will be assigned to the key. + * + * @param tags the tags value to set. + * @return the KeyCreateParameters object itself. + */ + public KeyCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The properties of the key to be created. + * + * @return the properties value. + */ + public KeyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the key to be created. + * + * @param properties the properties value to set. + * @return the KeyCreateParameters object itself. + */ + public KeyCreateParameters withProperties(KeyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model KeyCreateParameters")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyListResult.java new file mode 100644 index 0000000000000..0efc6fb753e65 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The page of keys. */ +@Fluent +public final class KeyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyListResult.class); + + /* + * The key resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next page of keys. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The key resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The key resources. + * + * @param value the value value to set. + * @return the KeyListResult object itself. + */ + public KeyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next page of keys. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next page of keys. + * + * @param nextLink the nextLink value to set. + * @return the KeyListResult object itself. + */ + public KeyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyPermissions.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyPermissions.java new file mode 100644 index 0000000000000..43633ef8628d5 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyPermissions.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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"); + + /** Static value rotate for KeyPermissions. */ + public static final KeyPermissions ROTATE = fromString("rotate"); + + /** Static value getrotationpolicy for KeyPermissions. */ + public static final KeyPermissions GETROTATIONPOLICY = fromString("getrotationpolicy"); + + /** Static value setrotationpolicy for KeyPermissions. */ + public static final KeyPermissions SETROTATIONPOLICY = fromString("setrotationpolicy"); + + /** Static value release for KeyPermissions. */ + public static final KeyPermissions RELEASE = fromString("release"); + + /** + * 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyReleasePolicy.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyReleasePolicy.java new file mode 100644 index 0000000000000..4ac623a1e6f55 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyReleasePolicy.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.Base64Url; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The KeyReleasePolicy model. */ +@Fluent +public final class KeyReleasePolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyReleasePolicy.class); + + /* + * Content type and version of key release policy + */ + @JsonProperty(value = "contentType") + private String contentType; + + /* + * Blob encoding the policy rules under which the key can be released. + */ + @JsonProperty(value = "data") + private Base64Url data; + + /** + * Get the contentType property: Content type and version of key release policy. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: Content type and version of key release policy. + * + * @param contentType the contentType value to set. + * @return the KeyReleasePolicy object itself. + */ + public KeyReleasePolicy withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the data property: Blob encoding the policy rules under which the key can be released. + * + * @return the data value. + */ + public byte[] data() { + if (this.data == null) { + return new byte[0]; + } + return this.data.decodedBytes(); + } + + /** + * Set the data property: Blob encoding the policy rules under which the key can be released. + * + * @param data the data value to set. + * @return the KeyReleasePolicy object itself. + */ + public KeyReleasePolicy withData(byte[] data) { + if (data == null) { + this.data = null; + } else { + this.data = Base64Url.encode(CoreUtils.clone(data)); + } + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyRotationPolicyActionType.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyRotationPolicyActionType.java new file mode 100644 index 0000000000000..f49f200528a6e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyRotationPolicyActionType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for KeyRotationPolicyActionType. */ +public enum KeyRotationPolicyActionType { + /** Enum value rotate. */ + ROTATE("rotate"), + + /** Enum value notify. */ + NOTIFY("notify"); + + /** The actual serialized value for a KeyRotationPolicyActionType instance. */ + private final String value; + + KeyRotationPolicyActionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyRotationPolicyActionType instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyRotationPolicyActionType object, or null if unable to parse. + */ + @JsonCreator + public static KeyRotationPolicyActionType fromString(String value) { + KeyRotationPolicyActionType[] items = KeyRotationPolicyActionType.values(); + for (KeyRotationPolicyActionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyRotationPolicyAttributes.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyRotationPolicyAttributes.java new file mode 100644 index 0000000000000..ea361ed63e9d3 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyRotationPolicyAttributes.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The KeyRotationPolicyAttributes model. */ +@Fluent +public final class KeyRotationPolicyAttributes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyRotationPolicyAttributes.class); + + /* + * 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; + + /* + * The expiration time for the new key version. It should be in ISO8601 + * format. Eg: 'P90D', 'P1Y'. + */ + @JsonProperty(value = "expiryTime") + private String expiryTime; + + /** + * Get the created property: Creation time in seconds since 1970-01-01T00:00:00Z. + * + * @return the created value. + */ + public Long created() { + return this.created; + } + + /** + * Get the updated property: Last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @return the updated value. + */ + public Long updated() { + return this.updated; + } + + /** + * Get the expiryTime property: The expiration time for the new key version. It should be in ISO8601 format. Eg: + * 'P90D', 'P1Y'. + * + * @return the expiryTime value. + */ + public String expiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: The expiration time for the new key version. It should be in ISO8601 format. Eg: + * 'P90D', 'P1Y'. + * + * @param expiryTime the expiryTime value to set. + * @return the KeyRotationPolicyAttributes object itself. + */ + public KeyRotationPolicyAttributes withExpiryTime(String expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Keys.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Keys.java new file mode 100644 index 0000000000000..47c9ced3f3598 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Keys.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Keys. */ +public interface Keys { + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + Key get(String resourceGroupName, String vaultName, String keyName); + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + Response getWithResponse(String resourceGroupName, String vaultName, String keyName, Context context); + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + Key getVersion(String resourceGroupName, String vaultName, String keyName, String keyVersion); + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + Response getVersionWithResponse( + String resourceGroupName, String vaultName, String keyName, String keyVersion, Context context); + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + PagedIterable listVersions(String resourceGroupName, String vaultName, String keyName); + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys. + */ + PagedIterable listVersions(String resourceGroupName, String vaultName, String keyName, Context context); + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + Key getById(String id); + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Key resource. + * + * @param name resource name. + * @return the first stage of the new Key definition. + */ + Key.DefinitionStages.Blank define(String name); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/LifetimeAction.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/LifetimeAction.java new file mode 100644 index 0000000000000..d76d221b82c9e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/LifetimeAction.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The LifetimeAction model. */ +@Fluent +public final class LifetimeAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LifetimeAction.class); + + /* + * The trigger of key rotation policy lifetimeAction. + */ + @JsonProperty(value = "trigger") + private Trigger trigger; + + /* + * The action of key rotation policy lifetimeAction. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Get the trigger property: The trigger of key rotation policy lifetimeAction. + * + * @return the trigger value. + */ + public Trigger trigger() { + return this.trigger; + } + + /** + * Set the trigger property: The trigger of key rotation policy lifetimeAction. + * + * @param trigger the trigger value to set. + * @return the LifetimeAction object itself. + */ + public LifetimeAction withTrigger(Trigger trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the action property: The action of key rotation policy lifetimeAction. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of key rotation policy lifetimeAction. + * + * @param action the action value to set. + * @return the LifetimeAction object itself. + */ + public LifetimeAction withAction(Action action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (trigger() != null) { + trigger().validate(); + } + if (action() != null) { + action().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/LogSpecification.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/LogSpecification.java new file mode 100644 index 0000000000000..57db5b879bbe9 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/LogSpecification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log specification of operation. */ +@Fluent +public final class LogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); + + /* + * 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 the name property: Name of log specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 the displayName property: Display name of log specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: 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 the blobDuration property: Blob duration of specification. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsm.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsm.java new file mode 100644 index 0000000000000..aa5cc77e5cf6b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsm.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmInner; +import java.util.Map; + +/** An immutable client-side representation of ManagedHsm. */ +public interface ManagedHsm { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: SKU details. + * + * @return the sku value. + */ + ManagedHsmSku sku(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the key vault resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Properties of the managed HSM. + * + * @return the properties value. + */ + ManagedHsmProperties properties(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmInner object. + * + * @return the inner object. + */ + ManagedHsmInner innerModel(); + + /** The entirety of the ManagedHsm definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ManagedHsm definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedHsm definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ManagedHsm definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ManagedHsm definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ManagedHsm definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithSku, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedHsm create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedHsm create(Context context); + } + /** The stage of the ManagedHsm definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ManagedHsm definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU details. + * + * @param sku SKU details. + * @return the next definition stage. + */ + WithCreate withSku(ManagedHsmSku sku); + } + /** The stage of the ManagedHsm definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the managed HSM. + * + * @param properties Properties of the managed HSM. + * @return the next definition stage. + */ + WithCreate withProperties(ManagedHsmProperties properties); + } + } + /** + * Begins update for the ManagedHsm resource. + * + * @return the stage of resource update. + */ + ManagedHsm.Update update(); + + /** The template for ManagedHsm update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedHsm apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedHsm apply(Context context); + } + /** The ManagedHsm update stages. */ + interface UpdateStages { + /** The stage of the ManagedHsm update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ManagedHsm update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU details. + * + * @param sku SKU details. + * @return the next definition stage. + */ + Update withSku(ManagedHsmSku sku); + } + /** The stage of the ManagedHsm update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the managed HSM. + * + * @param properties Properties of the managed HSM. + * @return the next definition stage. + */ + Update withProperties(ManagedHsmProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedHsm refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedHsm refresh(Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmListResult.java new file mode 100644 index 0000000000000..da5de94eeee39 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of managed HSM Pools. */ +@Fluent +public final class ManagedHsmListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedHsmListResult.class); + + /* + * The list of managed HSM Pools. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of managed HSM Pools. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of managed HSM Pools. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of managed HSM Pools. + * + * @param value the value value to set. + * @return the ManagedHsmListResult object itself. + */ + public ManagedHsmListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of managed HSM Pools. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of managed HSM Pools. + * + * @param nextLink the nextLink value to set. + * @return the ManagedHsmListResult object itself. + */ + public ManagedHsmListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmProperties.java new file mode 100644 index 0000000000000..3739bc0aa658c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmProperties.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** Properties of the managed HSM Pool. */ +@Fluent +public final class ManagedHsmProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedHsmProperties.class); + + /* + * The Azure Active Directory tenant ID that should be used for + * authenticating requests to the managed HSM pool. + */ + @JsonProperty(value = "tenantId") + private UUID tenantId; + + /* + * Array of initial administrators object ids for this managed hsm pool. + */ + @JsonProperty(value = "initialAdminObjectIds") + private List initialAdminObjectIds; + + /* + * The URI of the managed hsm pool for performing operations on keys. + */ + @JsonProperty(value = "hsmUri", access = JsonProperty.Access.WRITE_ONLY) + private String hsmUri; + + /* + * Property to specify whether the 'soft delete' functionality is enabled + * for this managed HSM pool. If it's not set to any value(true or false) + * when creating new managed HSM pool, 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 specifying whether protection against purge is enabled for this + * managed HSM pool. Setting this property to true activates protection + * against purge for this managed HSM pool and its content - only the + * Managed HSM service may initiate a hard, irrecoverable deletion. The + * setting is effective only if soft delete is also enabled. Enabling this + * functionality is irreversible. + */ + @JsonProperty(value = "enablePurgeProtection") + private Boolean enablePurgeProtection; + + /* + * The create mode to indicate whether the resource is being created or is + * being recovered from a deleted resource. + */ + @JsonProperty(value = "createMode") + private CreateMode createMode; + + /* + * Resource Status Message. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private String statusMessage; + + /* + * Provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Rules governing the accessibility of the key vault from specific network + * locations. + */ + @JsonProperty(value = "networkAcls") + private MhsmNetworkRuleSet networkAcls; + + /* + * List of private endpoint connections associated with the managed hsm + * pool. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Control permission for data plane traffic coming from public networks + * while private endpoint is enabled. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * The scheduled purge date in UTC. + */ + @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime scheduledPurgeDate; + + /** + * Get the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests + * to the managed HSM pool. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests + * to the managed HSM pool. + * + * @param tenantId the tenantId value to set. + * @return the ManagedHsmProperties object itself. + */ + public ManagedHsmProperties withTenantId(UUID tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the initialAdminObjectIds property: Array of initial administrators object ids for this managed hsm pool. + * + * @return the initialAdminObjectIds value. + */ + public List initialAdminObjectIds() { + return this.initialAdminObjectIds; + } + + /** + * Set the initialAdminObjectIds property: Array of initial administrators object ids for this managed hsm pool. + * + * @param initialAdminObjectIds the initialAdminObjectIds value to set. + * @return the ManagedHsmProperties object itself. + */ + public ManagedHsmProperties withInitialAdminObjectIds(List initialAdminObjectIds) { + this.initialAdminObjectIds = initialAdminObjectIds; + return this; + } + + /** + * Get the hsmUri property: The URI of the managed hsm pool for performing operations on keys. + * + * @return the hsmUri value. + */ + public String hsmUri() { + return this.hsmUri; + } + + /** + * Get the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for + * this managed HSM pool. If it's not set to any value(true or false) when creating new managed HSM pool, 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 the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for + * this managed HSM pool. If it's not set to any value(true or false) when creating new managed HSM pool, 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 ManagedHsmProperties object itself. + */ + public ManagedHsmProperties withEnableSoftDelete(Boolean enableSoftDelete) { + this.enableSoftDelete = enableSoftDelete; + return this; + } + + /** + * Get the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. + * + * @return the softDeleteRetentionInDays value. + */ + public Integer softDeleteRetentionInDays() { + return this.softDeleteRetentionInDays; + } + + /** + * Set the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. + * + * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. + * @return the ManagedHsmProperties object itself. + */ + public ManagedHsmProperties withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays) { + this.softDeleteRetentionInDays = softDeleteRetentionInDays; + return this; + } + + /** + * Get the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this + * managed HSM pool. Setting this property to true activates protection against purge for this managed HSM pool and + * its content - only the Managed HSM service may initiate a hard, irrecoverable deletion. The setting is effective + * only if soft delete is also enabled. Enabling this functionality is irreversible. + * + * @return the enablePurgeProtection value. + */ + public Boolean enablePurgeProtection() { + return this.enablePurgeProtection; + } + + /** + * Set the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this + * managed HSM pool. Setting this property to true activates protection against purge for this managed HSM pool and + * its content - only the Managed HSM service may initiate a hard, irrecoverable deletion. The setting is effective + * only if soft delete is also enabled. Enabling this functionality is irreversible. + * + * @param enablePurgeProtection the enablePurgeProtection value to set. + * @return the ManagedHsmProperties object itself. + */ + public ManagedHsmProperties withEnablePurgeProtection(Boolean enablePurgeProtection) { + this.enablePurgeProtection = enablePurgeProtection; + return this; + } + + /** + * Get the createMode property: The create mode to indicate whether the resource is being created or is being + * recovered from a deleted resource. + * + * @return the createMode value. + */ + public CreateMode createMode() { + return this.createMode; + } + + /** + * Set the createMode property: The create mode to indicate whether the resource is being created or is being + * recovered from a deleted resource. + * + * @param createMode the createMode value to set. + * @return the ManagedHsmProperties object itself. + */ + public ManagedHsmProperties withCreateMode(CreateMode createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get the statusMessage property: Resource Status Message. + * + * @return the statusMessage value. + */ + public String statusMessage() { + return this.statusMessage; + } + + /** + * Get the provisioningState property: Provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the networkAcls property: Rules governing the accessibility of the key vault from specific network locations. + * + * @return the networkAcls value. + */ + public MhsmNetworkRuleSet networkAcls() { + return this.networkAcls; + } + + /** + * Set the networkAcls property: Rules governing the accessibility of the key vault from specific network locations. + * + * @param networkAcls the networkAcls value to set. + * @return the ManagedHsmProperties object itself. + */ + public ManagedHsmProperties withNetworkAcls(MhsmNetworkRuleSet networkAcls) { + this.networkAcls = networkAcls; + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the managed hsm + * pool. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while + * private endpoint is enabled. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ManagedHsmProperties object itself. + */ + public ManagedHsmProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the scheduledPurgeDate property: The scheduled purge date in UTC. + * + * @return the scheduledPurgeDate value. + */ + public OffsetDateTime scheduledPurgeDate() { + return this.scheduledPurgeDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkAcls() != null) { + networkAcls().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmResource.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmResource.java new file mode 100644 index 0000000000000..30ebcbc093f73 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmResource.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed HSM resource. */ +@Fluent +public class ManagedHsmResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedHsmResource.class); + + /* + * SKU details + */ + @JsonProperty(value = "sku") + private ManagedHsmSku sku; + + /* + * Metadata pertaining to creation and last modification of the key vault + * resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the sku property: SKU details. + * + * @return the sku value. + */ + public ManagedHsmSku sku() { + return this.sku; + } + + /** + * Set the sku property: SKU details. + * + * @param sku the sku value to set. + * @return the ManagedHsmResource object itself. + */ + public ManagedHsmResource withSku(ManagedHsmSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the key vault resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ManagedHsmResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedHsmResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSku.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSku.java new file mode 100644 index 0000000000000..0549c37f5a40e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSku.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU details. */ +@Fluent +public final class ManagedHsmSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedHsmSku.class); + + /* + * SKU Family of the managed HSM Pool + */ + @JsonProperty(value = "family", required = true) + private ManagedHsmSkuFamily family = ManagedHsmSkuFamily.B; + + /* + * SKU of the managed HSM Pool + */ + @JsonProperty(value = "name", required = true) + private ManagedHsmSkuName name; + + /** + * Get the family property: SKU Family of the managed HSM Pool. + * + * @return the family value. + */ + public ManagedHsmSkuFamily family() { + return this.family; + } + + /** + * Set the family property: SKU Family of the managed HSM Pool. + * + * @param family the family value to set. + * @return the ManagedHsmSku object itself. + */ + public ManagedHsmSku withFamily(ManagedHsmSkuFamily family) { + this.family = family; + return this; + } + + /** + * Get the name property: SKU of the managed HSM Pool. + * + * @return the name value. + */ + public ManagedHsmSkuName name() { + return this.name; + } + + /** + * Set the name property: SKU of the managed HSM Pool. + * + * @param name the name value to set. + * @return the ManagedHsmSku object itself. + */ + public ManagedHsmSku withName(ManagedHsmSkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (family() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property family in model ManagedHsmSku")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ManagedHsmSku")); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSkuFamily.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSkuFamily.java new file mode 100644 index 0000000000000..77c9badbd5a4c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSkuFamily.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedHsmSkuFamily. */ +public final class ManagedHsmSkuFamily extends ExpandableStringEnum { + /** Static value B for ManagedHsmSkuFamily. */ + public static final ManagedHsmSkuFamily B = fromString("B"); + + /** + * Creates or finds a ManagedHsmSkuFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedHsmSkuFamily. + */ + @JsonCreator + public static ManagedHsmSkuFamily fromString(String name) { + return fromString(name, ManagedHsmSkuFamily.class); + } + + /** @return known ManagedHsmSkuFamily values. */ + public static Collection values() { + return values(ManagedHsmSkuFamily.class); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSkuName.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSkuName.java new file mode 100644 index 0000000000000..a68ba80b352ac --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSkuName.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ManagedHsmSkuName. */ +public enum ManagedHsmSkuName { + /** Enum value Standard_B1. */ + STANDARD_B1("Standard_B1"), + + /** Enum value Custom_B32. */ + CUSTOM_B32("Custom_B32"); + + /** The actual serialized value for a ManagedHsmSkuName instance. */ + private final String value; + + ManagedHsmSkuName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ManagedHsmSkuName instance. + * + * @param value the serialized value to parse. + * @return the parsed ManagedHsmSkuName object, or null if unable to parse. + */ + @JsonCreator + public static ManagedHsmSkuName fromString(String value) { + ManagedHsmSkuName[] items = ManagedHsmSkuName.values(); + for (ManagedHsmSkuName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsms.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsms.java new file mode 100644 index 0000000000000..7bb8609a64516 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsms.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ManagedHsms. */ +public interface ManagedHsms { + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Deletes the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String name, Context context); + + /** + * Gets the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + ManagedHsm getByResourceGroup(String resourceGroupName, String name); + + /** + * Gets the specified managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name The name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription and within the + * specified resource group. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context); + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + PagedIterable list(); + + /** + * The List operation gets information about the managed HSM Pools associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed HSM Pools. + */ + PagedIterable list(Integer top, Context context); + + /** + * The List operation gets information about the deleted managed HSMs associated with the subscription. + * + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + PagedIterable listDeleted(); + + /** + * The List operation gets information about the deleted managed HSMs associated with the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deleted managed HSM Pools. + */ + PagedIterable listDeleted(Context context); + + /** + * Gets the specified deleted managed HSM. + * + * @param name The name of the deleted managed HSM. + * @param location The location of the deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified deleted managed HSM. + */ + DeletedManagedHsm getDeleted(String name, String location); + + /** + * Gets the specified deleted managed HSM. + * + * @param name The name of the deleted managed HSM. + * @param location The location of the deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified deleted managed HSM. + */ + Response getDeletedWithResponse(String name, String location, Context context); + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeDeleted(String name, String location); + + /** + * Permanently deletes the specified managed HSM. + * + * @param name The name of the soft-deleted managed HSM. + * @param location The location of the soft-deleted managed HSM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeDeleted(String name, String location, Context context); + + /** + * Gets the specified managed HSM Pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + ManagedHsm getById(String id); + + /** + * Gets the specified managed HSM Pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified managed HSM Pool. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified managed HSM Pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified managed HSM Pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagedHsm resource. + * + * @param name resource name. + * @return the first stage of the new ManagedHsm definition. + */ + ManagedHsm.DefinitionStages.Blank define(String name); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MetricSpecification.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MetricSpecification.java new file mode 100644 index 0000000000000..06af2f6a5ebcb --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MetricSpecification.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Metric specification of operation. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * Name of metric specification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of metric specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Display description of metric specification. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * The metric unit. Possible values include: 'Bytes', 'Count', + * 'Milliseconds'. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * The metric aggregation type. Possible values include: 'Average', + * 'Count', 'Total'. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * The supported aggregation types for the metrics. + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /* + * The supported time grain types for the metrics. + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /* + * The metric lock aggregation type. + */ + @JsonProperty(value = "lockAggregationType") + private String lockAggregationType; + + /* + * The dimensions of metric + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Property to specify whether to fill gap with zero. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * The internal metric name. + */ + @JsonProperty(value = "internalMetricName") + private String internalMetricName; + + /** + * Get the name property: Name of metric specification. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of metric specification. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of metric specification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of metric specification. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Display description of metric specification. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Display description of metric specification. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: The metric aggregation type. Possible values include: 'Average', 'Count', + * 'Total'. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: The metric aggregation type. Possible values include: 'Average', 'Count', + * 'Total'. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the supportedAggregationTypes property: The supported aggregation types for the metrics. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: The supported aggregation types for the metrics. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get the supportedTimeGrainTypes property: The supported time grain types for the metrics. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set the supportedTimeGrainTypes property: The supported time grain types for the metrics. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get the lockAggregationType property: The metric lock aggregation type. + * + * @return the lockAggregationType value. + */ + public String lockAggregationType() { + return this.lockAggregationType; + } + + /** + * Set the lockAggregationType property: The metric lock aggregation type. + * + * @param lockAggregationType the lockAggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withLockAggregationType(String lockAggregationType) { + this.lockAggregationType = lockAggregationType; + return this; + } + + /** + * Get the dimensions property: The dimensions of metric. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: The dimensions of metric. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the fillGapWithZero property: Property to specify whether to fill gap with zero. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Property to specify whether to fill gap with zero. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the internalMetricName property: The internal metric name. + * + * @return the internalMetricName value. + */ + public String internalMetricName() { + return this.internalMetricName; + } + + /** + * Set the internalMetricName property: The internal metric name. + * + * @param internalMetricName the internalMetricName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withInternalMetricName(String internalMetricName) { + this.internalMetricName = internalMetricName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmNetworkRuleSet.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmNetworkRuleSet.java new file mode 100644 index 0000000000000..e83525e581853 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmNetworkRuleSet.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A set of rules governing the network accessibility of a managed hsm pool. */ +@Fluent +public final class MhsmNetworkRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmNetworkRuleSet.class); + + /* + * Tells what traffic can bypass network rules. This can be 'AzureServices' + * or 'None'. If not specified the default is 'AzureServices'. + */ + @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. + */ + @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 the bypass property: Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If + * not specified the default is 'AzureServices'. + * + * @return the bypass value. + */ + public NetworkRuleBypassOptions bypass() { + return this.bypass; + } + + /** + * Set the bypass property: Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If + * not specified the default is 'AzureServices'. + * + * @param bypass the bypass value to set. + * @return the MhsmNetworkRuleSet object itself. + */ + public MhsmNetworkRuleSet withBypass(NetworkRuleBypassOptions bypass) { + this.bypass = bypass; + return this; + } + + /** + * Get the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. + * This is only used after the bypass property has been evaluated. + * + * @return the defaultAction value. + */ + public NetworkRuleAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. + * This is only used after the bypass property has been evaluated. + * + * @param defaultAction the defaultAction value to set. + * @return the MhsmNetworkRuleSet object itself. + */ + public MhsmNetworkRuleSet withDefaultAction(NetworkRuleAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the ipRules property: The list of IP address rules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: The list of IP address rules. + * + * @param ipRules the ipRules value to set. + * @return the MhsmNetworkRuleSet object itself. + */ + public MhsmNetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Get the virtualNetworkRules property: The list of virtual network rules. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the virtualNetworkRules property: The list of virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set. + * @return the MhsmNetworkRuleSet object itself. + */ + public MhsmNetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpoint.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpoint.java new file mode 100644 index 0000000000000..c6fb1ae25684b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint object properties. */ +@Immutable +public final class MhsmPrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateEndpoint.class); + + /* + * Full identifier of the private endpoint resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Full identifier of the private endpoint resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnection.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnection.java new file mode 100644 index 0000000000000..e0b511f186e7e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnection.java @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionInner; +import java.util.Map; + +/** An immutable client-side representation of MhsmPrivateEndpointConnection. */ +public interface MhsmPrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: SKU details. + * + * @return the sku value. + */ + ManagedHsmSku sku(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the key vault resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the etag property: Modified whenever there is a change in the state of private endpoint connection. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the privateEndpoint property: Properties of the private endpoint object. + * + * @return the privateEndpoint value. + */ + MhsmPrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @return the privateLinkServiceConnectionState value. + */ + MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + MhsmPrivateEndpointConnectionInner innerModel(); + + /** The entirety of the MhsmPrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The MhsmPrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the MhsmPrivateEndpointConnection definition. */ + interface Blank extends WithLocation { + } + /** The stage of the MhsmPrivateEndpointConnection definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the MhsmPrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, name. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @return the next definition stage. + */ + WithCreate withExistingManagedHSM(String resourceGroupName, String name); + } + /** + * The stage of the MhsmPrivateEndpointConnection definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithEtag, + DefinitionStages.WithPrivateEndpoint, + DefinitionStages.WithPrivateLinkServiceConnectionState, + DefinitionStages.WithProvisioningState { + /** + * Executes the create request. + * + * @return the created resource. + */ + MhsmPrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MhsmPrivateEndpointConnection create(Context context); + } + /** The stage of the MhsmPrivateEndpointConnection definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the MhsmPrivateEndpointConnection definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU details. + * + * @param sku SKU details. + * @return the next definition stage. + */ + WithCreate withSku(ManagedHsmSku sku); + } + /** The stage of the MhsmPrivateEndpointConnection definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Modified whenever there is a change in the state of private endpoint + * connection.. + * + * @param etag Modified whenever there is a change in the state of private endpoint connection. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the MhsmPrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: Properties of the private endpoint object.. + * + * @param privateEndpoint Properties of the private endpoint object. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(MhsmPrivateEndpoint privateEndpoint); + } + /** + * The stage of the MhsmPrivateEndpointConnection definition allowing to specify + * privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Approval state of the private link connection.. + * + * @param privateLinkServiceConnectionState Approval state of the private link connection. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + /** The stage of the MhsmPrivateEndpointConnection definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the private endpoint connection.. + * + * @param provisioningState Provisioning state of the private endpoint connection. + * @return the next definition stage. + */ + WithCreate withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState); + } + } + /** + * Begins update for the MhsmPrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + MhsmPrivateEndpointConnection.Update update(); + + /** The template for MhsmPrivateEndpointConnection update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithEtag, + UpdateStages.WithPrivateEndpoint, + UpdateStages.WithPrivateLinkServiceConnectionState, + UpdateStages.WithProvisioningState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MhsmPrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MhsmPrivateEndpointConnection apply(Context context); + } + /** The MhsmPrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the MhsmPrivateEndpointConnection update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the MhsmPrivateEndpointConnection update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SKU details. + * + * @param sku SKU details. + * @return the next definition stage. + */ + Update withSku(ManagedHsmSku sku); + } + /** The stage of the MhsmPrivateEndpointConnection update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Modified whenever there is a change in the state of private endpoint + * connection.. + * + * @param etag Modified whenever there is a change in the state of private endpoint connection. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the MhsmPrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: Properties of the private endpoint object.. + * + * @param privateEndpoint Properties of the private endpoint object. + * @return the next definition stage. + */ + Update withPrivateEndpoint(MhsmPrivateEndpoint privateEndpoint); + } + /** + * The stage of the MhsmPrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Approval state of the private link connection.. + * + * @param privateLinkServiceConnectionState Approval state of the private link connection. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + /** The stage of the MhsmPrivateEndpointConnection update allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the private endpoint connection.. + * + * @param provisioningState Provisioning state of the private endpoint connection. + * @return the next definition stage. + */ + Update withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MhsmPrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MhsmPrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionItem.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionItem.java new file mode 100644 index 0000000000000..b283e27e8ca0b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionItem.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint connection item. */ +@Fluent +public final class MhsmPrivateEndpointConnectionItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateEndpointConnectionItem.class); + + /* + * Private endpoint connection properties. + */ + @JsonProperty(value = "properties") + private MhsmPrivateEndpointConnectionProperties innerProperties; + + /** + * Get the innerProperties property: Private endpoint connection properties. + * + * @return the innerProperties value. + */ + private MhsmPrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the privateEndpoint property: Properties of the private endpoint object. + * + * @return the privateEndpoint value. + */ + public MhsmPrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: Properties of the private endpoint object. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the MhsmPrivateEndpointConnectionItem object itself. + */ + public MhsmPrivateEndpointConnectionItem withPrivateEndpoint(MhsmPrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new MhsmPrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the MhsmPrivateEndpointConnectionItem object itself. + */ + public MhsmPrivateEndpointConnectionItem withPrivateLinkServiceConnectionState( + MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new MhsmPrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: Provisioning state of the private endpoint connection. + * + * @param provisioningState the provisioningState value to set. + * @return the MhsmPrivateEndpointConnectionItem object itself. + */ + public MhsmPrivateEndpointConnectionItem withProvisioningState( + PrivateEndpointConnectionProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new MhsmPrivateEndpointConnectionProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnections.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnections.java new file mode 100644 index 0000000000000..0bdd336bc93ce --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnections.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of MhsmPrivateEndpointConnections. */ +public interface MhsmPrivateEndpointConnections { + /** + * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + PagedIterable listByResource(String resourceGroupName, String name); + + /** + * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with a managed HSM Pools. + */ + PagedIterable listByResource(String resourceGroupName, String name, Context context); + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + MhsmPrivateEndpointConnection get(String resourceGroupName, String name, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + Response getWithResponse( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + MhsmPrivateEndpointConnection delete(String resourceGroupName, String name, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm + * pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + MhsmPrivateEndpointConnection delete( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + MhsmPrivateEndpointConnection getById(String id); + + /** + * Gets the specified private endpoint connection associated with the managed HSM Pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.keyvault.generated.models.ErrorException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the managed HSM Pool. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + MhsmPrivateEndpointConnection deleteById(String id); + + /** + * Deletes the specified private endpoint connection associated with the managed hsm pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + MhsmPrivateEndpointConnection deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MhsmPrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new MhsmPrivateEndpointConnection definition. + */ + MhsmPrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsDeleteHeaders.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsDeleteHeaders.java new file mode 100644 index 0000000000000..d660ec8a1c913 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsDeleteHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MhsmPrivateEndpointConnectionsDeleteHeaders model. */ +@Fluent +public final class MhsmPrivateEndpointConnectionsDeleteHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateEndpointConnectionsDeleteHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the MhsmPrivateEndpointConnectionsDeleteHeaders object itself. + */ + public MhsmPrivateEndpointConnectionsDeleteHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the MhsmPrivateEndpointConnectionsDeleteHeaders object itself. + */ + public MhsmPrivateEndpointConnectionsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsDeleteResponse.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsDeleteResponse.java new file mode 100644 index 0000000000000..13eb426167cbb --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsDeleteResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionInner; + +/** Contains all response data for the delete operation. */ +public final class MhsmPrivateEndpointConnectionsDeleteResponse + extends ResponseBase { + /** + * Creates an instance of MhsmPrivateEndpointConnectionsDeleteResponse. + * + * @param request the request which resulted in this MhsmPrivateEndpointConnectionsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public MhsmPrivateEndpointConnectionsDeleteResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + MhsmPrivateEndpointConnectionInner value, + MhsmPrivateEndpointConnectionsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public MhsmPrivateEndpointConnectionInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsListResult.java new file mode 100644 index 0000000000000..8e3e46f64743a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connections associated with a managed HSM Pools. */ +@Fluent +public final class MhsmPrivateEndpointConnectionsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateEndpointConnectionsListResult.class); + + /* + * The private endpoint connection associated with a managed HSM Pools. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of managed HSM Pools. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The private endpoint connection associated with a managed HSM Pools. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The private endpoint connection associated with a managed HSM Pools. + * + * @param value the value value to set. + * @return the MhsmPrivateEndpointConnectionsListResult object itself. + */ + public MhsmPrivateEndpointConnectionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of managed HSM Pools. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of managed HSM Pools. + * + * @param nextLink the nextLink value to set. + * @return the MhsmPrivateEndpointConnectionsListResult object itself. + */ + public MhsmPrivateEndpointConnectionsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsPutHeaders.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsPutHeaders.java new file mode 100644 index 0000000000000..5897494f2afab --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsPutHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MhsmPrivateEndpointConnectionsPutHeaders model. */ +@Fluent +public final class MhsmPrivateEndpointConnectionsPutHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateEndpointConnectionsPutHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the MhsmPrivateEndpointConnectionsPutHeaders object itself. + */ + public MhsmPrivateEndpointConnectionsPutHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the MhsmPrivateEndpointConnectionsPutHeaders object itself. + */ + public MhsmPrivateEndpointConnectionsPutHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsPutResponse.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsPutResponse.java new file mode 100644 index 0000000000000..a9f44668b804c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsPutResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionInner; + +/** Contains all response data for the put operation. */ +public final class MhsmPrivateEndpointConnectionsPutResponse + extends ResponseBase { + /** + * Creates an instance of MhsmPrivateEndpointConnectionsPutResponse. + * + * @param request the request which resulted in this MhsmPrivateEndpointConnectionsPutResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public MhsmPrivateEndpointConnectionsPutResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + MhsmPrivateEndpointConnectionInner value, + MhsmPrivateEndpointConnectionsPutHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public MhsmPrivateEndpointConnectionInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResource.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResource.java new file mode 100644 index 0000000000000..dff8e0766be5c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResource.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A private link resource. */ +@Fluent +public final class MhsmPrivateLinkResource extends ManagedHsmResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateLinkResource.class); + + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private MhsmPrivateLinkResourceProperties innerProperties; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private MhsmPrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MhsmPrivateLinkResource withSku(ManagedHsmSku sku) { + super.withSku(sku); + return this; + } + + /** {@inheritDoc} */ + @Override + public MhsmPrivateLinkResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public MhsmPrivateLinkResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the groupId property: Group identifier of private link resource. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: Required member names of private link resource. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the MhsmPrivateLinkResource object itself. + */ + public MhsmPrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new MhsmPrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResourceListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..eb3e4434d745a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResourceListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateLinkResourceListResultInner; +import java.util.List; + +/** An immutable client-side representation of MhsmPrivateLinkResourceListResult. */ +public interface MhsmPrivateLinkResourceListResult { + /** + * Gets the value property: Array of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateLinkResourceListResultInner + * object. + * + * @return the inner object. + */ + MhsmPrivateLinkResourceListResultInner innerModel(); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResources.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResources.java new file mode 100644 index 0000000000000..c1836d55974d0 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkResources.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of MhsmPrivateLinkResources. */ +public interface MhsmPrivateLinkResources { + /** + * Gets the private link resources supported for the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the managed hsm pool. + */ + MhsmPrivateLinkResourceListResult listByMhsmResource(String resourceGroupName, String name); + + /** + * Gets the private link resources supported for the managed hsm pool. + * + * @param resourceGroupName Name of the resource group that contains the managed HSM pool. + * @param name Name of the managed HSM Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the managed hsm pool. + */ + Response listByMhsmResourceWithResponse( + String resourceGroupName, String name, Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkServiceConnectionState.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..d72cd3fc91679 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkServiceConnectionState.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that represents the approval state of the private link connection. */ +@Fluent +public final class MhsmPrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmPrivateLinkServiceConnectionState.class); + + /* + * Indicates whether the connection has been approved, rejected or removed + * by the key vault owner. + */ + @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 ActionsRequired actionsRequired; + + /** + * Get the status property: Indicates whether the connection has been approved, rejected or removed by the key vault + * owner. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been approved, rejected or removed by the key vault + * owner. + * + * @param status the status value to set. + * @return the MhsmPrivateLinkServiceConnectionState object itself. + */ + public MhsmPrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval or rejection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval or rejection. + * + * @param description the description value to set. + * @return the MhsmPrivateLinkServiceConnectionState object itself. + */ + public MhsmPrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public ActionsRequired actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the MhsmPrivateLinkServiceConnectionState object itself. + */ + public MhsmPrivateLinkServiceConnectionState withActionsRequired(ActionsRequired actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmVirtualNetworkRule.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmVirtualNetworkRule.java new file mode 100644 index 0000000000000..e12d1c9cd893e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmVirtualNetworkRule.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A rule governing the accessibility of a managed hsm pool from a specific virtual network. */ +@Fluent +public final class MhsmVirtualNetworkRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmVirtualNetworkRule.class); + + /* + * 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 the id property: 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 the id property: 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 MhsmVirtualNetworkRule object itself. + */ + public MhsmVirtualNetworkRule withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model MhsmVirtualNetworkRule")); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmipRule.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmipRule.java new file mode 100644 index 0000000000000..2371e0d858dbf --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmipRule.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A rule governing the accessibility of a managed hsm pool from a specific ip address or ip range. */ +@Fluent +public final class MhsmipRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MhsmipRule.class); + + /* + * 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 the value property: 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 the value property: 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 MhsmipRule object itself. + */ + public MhsmipRule withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model MhsmipRule")); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleAction.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleAction.java new file mode 100644 index 0000000000000..74e37e77452de --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleAction.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleBypassOptions.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleBypassOptions.java new file mode 100644 index 0000000000000..2738bd230d6b4 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleBypassOptions.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleSet.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleSet.java new file mode 100644 index 0000000000000..7f04d708f9e4f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleSet.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A set of rules governing the network accessibility of a vault. */ +@Fluent +public final class NetworkRuleSet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkRuleSet.class); + + /* + * Tells what traffic can bypass network rules. This can be 'AzureServices' + * or 'None'. If not specified the default is 'AzureServices'. + */ + @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. + */ + @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 the bypass property: Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If + * not specified the default is 'AzureServices'. + * + * @return the bypass value. + */ + public NetworkRuleBypassOptions bypass() { + return this.bypass; + } + + /** + * Set the bypass property: Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If + * not specified the default is 'AzureServices'. + * + * @param bypass the bypass value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withBypass(NetworkRuleBypassOptions bypass) { + this.bypass = bypass; + return this; + } + + /** + * Get the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. + * This is only used after the bypass property has been evaluated. + * + * @return the defaultAction value. + */ + public NetworkRuleAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. + * This is only used after the bypass property has been evaluated. + * + * @param defaultAction the defaultAction value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(NetworkRuleAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the ipRules property: The list of IP address rules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: 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 virtualNetworkRules property: The list of virtual network rules. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the virtualNetworkRules property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Operation.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Operation.java new file mode 100644 index 0000000000000..186dc0eb1c4c6 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Operation.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: Display metadata associated with the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The origin of operations. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the isDataAction property: Property to specify whether the action is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the serviceSpecification property: One property of operation, include metric specifications. + * + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/OperationDisplay.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..a9c72451ea24e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Display metadata associated with the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * 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 the provider property: Service provider: Microsoft Key Vault. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: 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 the resource property: Resource on which the operation is performed etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: 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 the operation property: Type of operation: get, read, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: 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 the description property: Description of operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/OperationListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..3740ffd4b7397 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/OperationListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set + * of results. + */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * List of Storage operations supported by the Storage resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Storage operations supported by the Storage resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Storage operations supported by the Storage resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of operations. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Operations.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Operations.java new file mode 100644 index 0000000000000..c3970b5053224 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Key Vault Rest API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + PagedIterable list(); + + /** + * Lists all of the available Key Vault Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Storage operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Permissions.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Permissions.java new file mode 100644 index 0000000000000..b38602f39047c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Permissions.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Permissions the identity has for keys, secrets, certificates and storage. */ +@Fluent +public final class Permissions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Permissions.class); + + /* + * 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 the keys property: Permissions to keys. + * + * @return the keys value. + */ + public List keys() { + return this.keys; + } + + /** + * Set the keys property: 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 the secrets property: Permissions to secrets. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: 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 the certificates property: Permissions to certificates. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: 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 the storage property: Permissions to storage accounts. + * + * @return the storage value. + */ + public List storage() { + return this.storage; + } + + /** + * Set the storage property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpoint.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..d1d9ea58ec353 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint object properties. */ +@Immutable +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * Full identifier of the private endpoint resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Full identifier of the private endpoint resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnection.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..5cf416df049c0 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionInner; +import java.util.Map; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: Modified whenever there is a change in the state of private endpoint connection. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the privateEndpoint property: Properties of the private endpoint object. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vaultName. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @return the next definition stage. + */ + WithCreate withExistingVault(String resourceGroupName, String vaultName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithEtag, + DefinitionStages.WithPrivateEndpoint, + DefinitionStages.WithPrivateLinkServiceConnectionState, + DefinitionStages.WithProvisioningState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Modified whenever there is a change in the state of private endpoint + * connection.. + * + * @param etag Modified whenever there is a change in the state of private endpoint connection. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: Properties of the private endpoint object.. + * + * @param privateEndpoint Properties of the private endpoint object. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Approval state of the private link connection.. + * + * @param privateLinkServiceConnectionState Approval state of the private link connection. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the private endpoint connection.. + * + * @param provisioningState Provisioning state of the private endpoint connection. + * @return the next definition stage. + */ + WithCreate withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithEtag, + UpdateStages.WithPrivateEndpoint, + UpdateStages.WithPrivateLinkServiceConnectionState, + UpdateStages.WithProvisioningState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the PrivateEndpointConnection update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: Modified whenever there is a change in the state of private endpoint + * connection.. + * + * @param etag Modified whenever there is a change in the state of private endpoint connection. + * @return the next definition stage. + */ + Update withEtag(String etag); + } + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: Properties of the private endpoint object.. + * + * @param privateEndpoint Properties of the private endpoint object. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Approval state of the private link connection.. + * + * @param privateLinkServiceConnectionState Approval state of the private link connection. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + /** The stage of the PrivateEndpointConnection update allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Provisioning state of the private endpoint connection.. + * + * @param provisioningState Provisioning state of the private endpoint connection. + * @return the next definition stage. + */ + Update withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionItem.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionItem.java new file mode 100644 index 0000000000000..897d833e68e9d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionItem.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint connection item. */ +@Fluent +public final class PrivateEndpointConnectionItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionItem.class); + + /* + * Id of private endpoint connection. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Modified whenever there is a change in the state of private endpoint + * connection. + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * Private endpoint connection properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /** + * Get the id property: Id of private endpoint connection. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of private endpoint connection. + * + * @param id the id value to set. + * @return the PrivateEndpointConnectionItem object itself. + */ + public PrivateEndpointConnectionItem withId(String id) { + this.id = id; + return this; + } + + /** + * Get the etag property: Modified whenever there is a change in the state of private endpoint connection. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: Modified whenever there is a change in the state of private endpoint connection. + * + * @param etag the etag value to set. + * @return the PrivateEndpointConnectionItem object itself. + */ + public PrivateEndpointConnectionItem withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the innerProperties property: Private endpoint connection properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the privateEndpoint property: Properties of the private endpoint object. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: Properties of the private endpoint object. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionItem object itself. + */ + public PrivateEndpointConnectionItem withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionItem object itself. + */ + public PrivateEndpointConnectionItem withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: Provisioning state of the private endpoint connection. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnectionItem object itself. + */ + public PrivateEndpointConnectionItem withProvisioningState( + PrivateEndpointConnectionProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..f753740c17e43 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connections. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * The list of private endpoint connections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of private endpoint connections. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of private endpoint connections. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of private endpoint connections. + * + * @param nextLink the nextLink value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionProvisioningState.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..c0b80eaf01fdc --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnections.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..304d591b98808 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnections.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + PrivateEndpointConnection delete( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); + + /** + * The List operation gets information about the private endpoint connections associated with the 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + PagedIterable listByResource(String resourceGroupName, String vaultName); + + /** + * The List operation gets information about the private endpoint connections associated with the vault. + * + * @param resourceGroupName Name of the resource group that contains the key vault. + * @param vaultName The name of the key vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections. + */ + PagedIterable listByResource( + String resourceGroupName, String vaultName, Context context); + + /** + * Gets the specified private endpoint connection associated with the key vault. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets the specified private endpoint connection associated with the key vault. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the key vault. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + PrivateEndpointConnection deleteById(String id); + + /** + * Deletes the specified private endpoint connection associated with the key vault. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private endpoint connection resource. + */ + PrivateEndpointConnection deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsDeleteHeaders.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsDeleteHeaders.java new file mode 100644 index 0000000000000..9fd0f36d495f9 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsDeleteHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionsDeleteHeaders model. */ +@Fluent +public final class PrivateEndpointConnectionsDeleteHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsDeleteHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsDeleteResponse.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsDeleteResponse.java new file mode 100644 index 0000000000000..2dd97352f0de5 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsDeleteResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionInner; + +/** Contains all response data for the delete operation. */ +public final class PrivateEndpointConnectionsDeleteResponse + extends ResponseBase { + /** + * Creates an instance of PrivateEndpointConnectionsDeleteResponse. + * + * @param request the request which resulted in this PrivateEndpointConnectionsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PrivateEndpointConnectionsDeleteResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PrivateEndpointConnectionInner value, + PrivateEndpointConnectionsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PrivateEndpointConnectionInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsPutHeaders.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsPutHeaders.java new file mode 100644 index 0000000000000..78548df4d72b7 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsPutHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionsPutHeaders model. */ +@Fluent +public final class PrivateEndpointConnectionsPutHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsPutHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the PrivateEndpointConnectionsPutHeaders object itself. + */ + public PrivateEndpointConnectionsPutHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the PrivateEndpointConnectionsPutHeaders object itself. + */ + public PrivateEndpointConnectionsPutHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsPutResponse.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsPutResponse.java new file mode 100644 index 0000000000000..f5b023e77a582 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsPutResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionInner; + +/** Contains all response data for the put operation. */ +public final class PrivateEndpointConnectionsPutResponse + extends ResponseBase { + /** + * Creates an instance of PrivateEndpointConnectionsPutResponse. + * + * @param request the request which resulted in this PrivateEndpointConnectionsPutResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PrivateEndpointConnectionsPutResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PrivateEndpointConnectionInner value, + PrivateEndpointConnectionsPutHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PrivateEndpointConnectionInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointServiceConnectionStatus.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..6e746cf083139 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResource.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..bf224921ce3db --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResource.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResource extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResource.class); + + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public PrivateLinkResource withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateLinkResource withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the groupId property: Group identifier of private link resource. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: Required member names of private link resource. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: 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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResourceListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..ac443caed06ee --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResourceListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateLinkResourceListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResourceListResult. */ +public interface PrivateLinkResourceListResult { + /** + * Gets the value property: Array of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.PrivateLinkResourceListResultInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceListResultInner innerModel(); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResources.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..4a28c84e26e34 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkResources.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the key vault. + */ + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources supported for the key vault. + */ + Response listByVaultWithResponse( + String resourceGroupName, String vaultName, Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkServiceConnectionState.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..5ee331e7e4ef3 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that represents the approval state of the private link connection. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * Indicates whether the connection has been approved, rejected or removed + * by the key vault owner. + */ + @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 ActionsRequired actionsRequired; + + /** + * Get the status property: Indicates whether the connection has been approved, rejected or removed by the key vault + * owner. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been approved, rejected or removed by the key vault + * owner. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval or rejection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: 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 the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public ActionsRequired actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: 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(ActionsRequired actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ProvisioningState.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..f6d5c32043e8c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ProvisioningState.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Provisioning for ProvisioningState. */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Activated for ProvisioningState. */ + public static final ProvisioningState ACTIVATED = fromString("Activated"); + + /** Static value SecurityDomainRestore for ProvisioningState. */ + public static final ProvisioningState SECURITY_DOMAIN_RESTORE = fromString("SecurityDomainRestore"); + + /** Static value Restoring for ProvisioningState. */ + public static final ProvisioningState RESTORING = fromString("Restoring"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PublicNetworkAccess.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..b0fbf78c54acf --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PublicNetworkAccess.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccess. */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** @return known PublicNetworkAccess values. */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Reason.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Reason.java new file mode 100644 index 0000000000000..9755de9b4376b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Reason.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.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 final 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ResourceListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ResourceListResult.java new file mode 100644 index 0000000000000..a4e4810b9fb48 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ResourceListResult.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of vault resources. */ +@Fluent +public final class ResourceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceListResult.class); + + /* + * The list of vault resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of vault resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of vault resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of vault resources. + * + * @param value the value value to set. + * @return the ResourceListResult object itself. + */ + public ResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of vault resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of vault resources. + * + * @param nextLink the nextLink value to set. + * @return the ResourceListResult object itself. + */ + public ResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/RotationPolicy.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/RotationPolicy.java new file mode 100644 index 0000000000000..8f47f8255ccad --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/RotationPolicy.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RotationPolicy model. */ +@Fluent +public final class RotationPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RotationPolicy.class); + + /* + * The attributes of key rotation policy. + */ + @JsonProperty(value = "attributes") + private KeyRotationPolicyAttributes attributes; + + /* + * The lifetimeActions for key rotation action. + */ + @JsonProperty(value = "lifetimeActions") + private List lifetimeActions; + + /** + * Get the attributes property: The attributes of key rotation policy. + * + * @return the attributes value. + */ + public KeyRotationPolicyAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: The attributes of key rotation policy. + * + * @param attributes the attributes value to set. + * @return the RotationPolicy object itself. + */ + public RotationPolicy withAttributes(KeyRotationPolicyAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the lifetimeActions property: The lifetimeActions for key rotation action. + * + * @return the lifetimeActions value. + */ + public List lifetimeActions() { + return this.lifetimeActions; + } + + /** + * Set the lifetimeActions property: The lifetimeActions for key rotation action. + * + * @param lifetimeActions the lifetimeActions value to set. + * @return the RotationPolicy object itself. + */ + public RotationPolicy withLifetimeActions(List lifetimeActions) { + this.lifetimeActions = lifetimeActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributes() != null) { + attributes().validate(); + } + if (lifetimeActions() != null) { + lifetimeActions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Secret.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Secret.java new file mode 100644 index 0000000000000..e9e4cec2d75ed --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Secret.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.SecretInner; +import java.util.Map; + +/** An immutable client-side representation of Secret. */ +public interface Secret { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Properties of the secret. + * + * @return the properties value. + */ + SecretProperties properties(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.SecretInner object. + * + * @return the inner object. + */ + SecretInner innerModel(); + + /** The entirety of the Secret definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The Secret definition stages. */ + interface DefinitionStages { + /** The first stage of the Secret definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Secret definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vaultName. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @return the next definition stage. + */ + WithProperties withExistingVault(String resourceGroupName, String vaultName); + } + /** The stage of the Secret definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the secret. + * + * @param properties Properties of the secret. + * @return the next definition stage. + */ + WithCreate withProperties(SecretProperties properties); + } + /** + * The stage of the Secret definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + Secret create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Secret create(Context context); + } + /** The stage of the Secret definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags that will be assigned to the secret. . + * + * @param tags The tags that will be assigned to the secret. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the Secret resource. + * + * @return the stage of resource update. + */ + Secret.Update update(); + + /** The template for Secret update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Secret apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Secret apply(Context context); + } + /** The Secret update stages. */ + interface UpdateStages { + /** The stage of the Secret update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags that will be assigned to the secret. . + * + * @param tags The tags that will be assigned to the secret. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Secret update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the secret. + * + * @param properties Properties of the secret. + * @return the next definition stage. + */ + Update withProperties(SecretPatchProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Secret refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Secret refresh(Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretAttributes.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretAttributes.java new file mode 100644 index 0000000000000..e04dc1feec7a2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretAttributes.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** The secret management attributes. */ +@Fluent +public final class SecretAttributes extends Attributes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretAttributes.class); + + /** {@inheritDoc} */ + @Override + public SecretAttributes withEnabled(Boolean enabled) { + super.withEnabled(enabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecretAttributes withNotBefore(Long notBefore) { + super.withNotBefore(notBefore); + return this; + } + + /** {@inheritDoc} */ + @Override + public SecretAttributes withExpires(Long expires) { + super.withExpires(expires); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretCreateOrUpdateParameters.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..24db4447603a7 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretCreateOrUpdateParameters.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for creating or updating a secret. */ +@Fluent +public final class SecretCreateOrUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretCreateOrUpdateParameters.class); + + /* + * The tags that will be assigned to the secret. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Properties of the secret + */ + @JsonProperty(value = "properties", required = true) + private SecretProperties properties; + + /** + * Get the tags property: The tags that will be assigned to the secret. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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 the properties property: Properties of the secret. + * + * @return the properties value. + */ + public SecretProperties properties() { + return this.properties; + } + + /** + * Set the properties property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model SecretCreateOrUpdateParameters")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretListResult.java new file mode 100644 index 0000000000000..e24bb4f452425 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.SecretInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of secrets. */ +@Fluent +public final class SecretListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretListResult.class); + + /* + * The list of secrets. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of secrets. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of secrets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of secrets. + * + * @param value the value value to set. + * @return the SecretListResult object itself. + */ + public SecretListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of secrets. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of secrets. + * + * @param nextLink the nextLink value to set. + * @return the SecretListResult object itself. + */ + public SecretListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPatchParameters.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPatchParameters.java new file mode 100644 index 0000000000000..b084285a820cf --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPatchParameters.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for patching a secret. */ +@Fluent +public final class SecretPatchParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretPatchParameters.class); + + /* + * The tags that will be assigned to the secret. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Properties of the secret + */ + @JsonProperty(value = "properties") + private SecretPatchProperties properties; + + /** + * Get the tags property: The tags that will be assigned to the secret. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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 the properties property: Properties of the secret. + * + * @return the properties value. + */ + public SecretPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPatchProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPatchProperties.java new file mode 100644 index 0000000000000..f575e065ecc3f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPatchProperties.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the secret. */ +@Fluent +public final class SecretPatchProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretPatchProperties.class); + + /* + * 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 property: The value of the secret. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: 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 contentType property: The content type of the secret. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: 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 property: The attributes of the secret. + * + * @return the attributes value. + */ + public SecretAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributes() != null) { + attributes().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPermissions.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPermissions.java new file mode 100644 index 0000000000000..8208bea7bff37 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPermissions.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretProperties.java new file mode 100644 index 0000000000000..c4036d5d1eab6 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the secret. */ +@Fluent +public final class SecretProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretProperties.class); + + /* + * 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 property: 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 property: 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 contentType property: The content type of the secret. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: 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 property: The attributes of the secret. + * + * @return the attributes value. + */ + public SecretAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: 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 secretUri property: The URI to retrieve the current version of the secret. + * + * @return the secretUri value. + */ + public String secretUri() { + return this.secretUri; + } + + /** + * Get the secretUriWithVersion property: The URI to retrieve the specific version of the secret. + * + * @return the secretUriWithVersion value. + */ + public String secretUriWithVersion() { + return this.secretUriWithVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributes() != null) { + attributes().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Secrets.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Secrets.java new file mode 100644 index 0000000000000..a3f2359054a93 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Secrets.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Secrets. */ +public interface Secrets { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + Secret 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + Response getWithResponse(String resourceGroupName, String vaultName, String secretName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + PagedIterable list(String resourceGroupName, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets. + */ + PagedIterable list(String resourceGroupName, String vaultName, Integer top, Context context); + + /** + * 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 id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + Secret getById(String id); + + /** + * 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 id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Secret resource. + * + * @param name resource name. + * @return the first stage of the new Secret definition. + */ + Secret.DefinitionStages.Blank define(String name); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ServiceSpecification.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ServiceSpecification.java new file mode 100644 index 0000000000000..7812970f09101 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ServiceSpecification.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** One property of operation, include log specifications. */ +@Fluent +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * Log specifications of operation. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /* + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get the logSpecifications property: Log specifications of operation. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: 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; + } + + /** + * Get the metricSpecifications property: Metric specifications of operation. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Metric specifications of operation. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Sku.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Sku.java new file mode 100644 index 0000000000000..74c880b6dc104 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Sku.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU details. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * SKU family name + */ + @JsonProperty(value = "family", required = true) + private SkuFamily family = SkuFamily.A; + + /* + * SKU name to specify whether the key vault is a standard vault or a + * premium vault. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * Get the family property: SKU family name. + * + * @return the family value. + */ + public SkuFamily family() { + return this.family; + } + + /** + * Set the family property: SKU family name. + * + * @param family the family value to set. + * @return the Sku object itself. + */ + public Sku withFamily(SkuFamily family) { + this.family = family; + return this; + } + + /** + * Get the name property: SKU name to specify whether the key vault is a standard vault or a premium vault. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: SKU name to specify whether the key vault is a standard vault or a premium vault. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (family() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property family in model Sku")); + } + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SkuFamily.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SkuFamily.java new file mode 100644 index 0000000000000..ca0bcc24c3631 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SkuFamily.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuFamily. */ +public final class SkuFamily extends ExpandableStringEnum { + /** Static value A for SkuFamily. */ + public static final SkuFamily A = fromString("A"); + + /** + * Creates or finds a SkuFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuFamily. + */ + @JsonCreator + public static SkuFamily fromString(String name) { + return fromString(name, SkuFamily.class); + } + + /** @return known SkuFamily values. */ + public static Collection values() { + return values(SkuFamily.class); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SkuName.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SkuName.java new file mode 100644 index 0000000000000..48f1853ba2ebc --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SkuName.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.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 final 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/StoragePermissions.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/StoragePermissions.java new file mode 100644 index 0000000000000..3a9bd508573e7 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/StoragePermissions.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** 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/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Trigger.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Trigger.java new file mode 100644 index 0000000000000..0bf262bf77048 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Trigger.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Trigger model. */ +@Fluent +public final class Trigger { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Trigger.class); + + /* + * The time duration after key creation to rotate the key. It only applies + * to rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'. + */ + @JsonProperty(value = "timeAfterCreate") + private String timeAfterCreate; + + /* + * The time duration before key expiring to rotate or notify. It will be in + * ISO 8601 duration format. Eg: 'P90D', 'P1Y'. + */ + @JsonProperty(value = "timeBeforeExpiry") + private String timeBeforeExpiry; + + /** + * Get the timeAfterCreate property: The time duration after key creation to rotate the key. It only applies to + * rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @return the timeAfterCreate value. + */ + public String timeAfterCreate() { + return this.timeAfterCreate; + } + + /** + * Set the timeAfterCreate property: The time duration after key creation to rotate the key. It only applies to + * rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @param timeAfterCreate the timeAfterCreate value to set. + * @return the Trigger object itself. + */ + public Trigger withTimeAfterCreate(String timeAfterCreate) { + this.timeAfterCreate = timeAfterCreate; + return this; + } + + /** + * Get the timeBeforeExpiry property: The time duration before key expiring to rotate or notify. It will be in ISO + * 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @return the timeBeforeExpiry value. + */ + public String timeBeforeExpiry() { + return this.timeBeforeExpiry; + } + + /** + * Set the timeBeforeExpiry property: The time duration before key expiring to rotate or notify. It will be in ISO + * 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @param timeBeforeExpiry the timeBeforeExpiry value to set. + * @return the Trigger object itself. + */ + public Trigger withTimeBeforeExpiry(String timeBeforeExpiry) { + this.timeBeforeExpiry = timeBeforeExpiry; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Vault.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Vault.java new file mode 100644 index 0000000000000..5ef3d5e63e906 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Vault.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultInner; +import java.util.Map; + +/** An immutable client-side representation of Vault. */ +public interface Vault { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: System metadata for the key vault. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Properties of the vault. + * + * @return the properties value. + */ + VaultProperties properties(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.VaultInner object. + * + * @return the inner object. + */ + VaultInner innerModel(); + + /** The entirety of the Vault definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The Vault definition stages. */ + interface DefinitionStages { + /** The first stage of the Vault definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Vault definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The supported Azure location where the key vault should be created. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The supported Azure location where the key vault should be created. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Vault definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the Resource Group to which the server belongs. + * @return the next definition stage. + */ + WithProperties withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Vault definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the vault. + * + * @param properties Properties of the vault. + * @return the next definition stage. + */ + WithCreate withProperties(VaultProperties properties); + } + /** + * The stage of the Vault definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + Vault create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Vault create(Context context); + } + /** The stage of the Vault definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags that will be assigned to the key vault.. + * + * @param tags The tags that will be assigned to the key vault. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the Vault resource. + * + * @return the stage of resource update. + */ + Vault.Update update(); + + /** The template for Vault update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Vault apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Vault apply(Context context); + } + /** The Vault update stages. */ + interface UpdateStages { + /** The stage of the Vault update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags that will be assigned to the key vault. . + * + * @param tags The tags that will be assigned to the key vault. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Vault update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the vault. + * + * @param properties Properties of the vault. + * @return the next definition stage. + */ + Update withProperties(VaultPatchProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Vault refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Vault refresh(Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultAccessPolicyParameters.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultAccessPolicyParameters.java new file mode 100644 index 0000000000000..2134fa91935c4 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultAccessPolicyParameters.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultAccessPolicyParametersInner; + +/** An immutable client-side representation of VaultAccessPolicyParameters. */ +public interface VaultAccessPolicyParameters { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The resource type of the access policy. + * + * @return the location value. + */ + String location(); + + /** + * Gets the properties property: Properties of the access policy. + * + * @return the properties value. + */ + VaultAccessPolicyProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.VaultAccessPolicyParametersInner + * object. + * + * @return the inner object. + */ + VaultAccessPolicyParametersInner innerModel(); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultAccessPolicyProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultAccessPolicyProperties.java new file mode 100644 index 0000000000000..937707d5bc192 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultAccessPolicyProperties.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the vault access policy. */ +@Fluent +public final class VaultAccessPolicyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultAccessPolicyProperties.class); + + /* + * 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 the accessPolicies property: 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 the accessPolicies property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessPolicies() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property accessPolicies in model VaultAccessPolicyProperties")); + } else { + accessPolicies().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultCheckNameAvailabilityParameters.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultCheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..2e30bcb90140f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultCheckNameAvailabilityParameters.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used to check the availability of the vault name. */ +@Fluent +public final class VaultCheckNameAvailabilityParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCheckNameAvailabilityParameters.class); + + /* + * 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 = "Microsoft.KeyVault/vaults"; + + /** Creates an instance of VaultCheckNameAvailabilityParameters class. */ + public VaultCheckNameAvailabilityParameters() { + type = "Microsoft.KeyVault/vaults"; + } + + /** + * Get the name property: The vault name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 property: The type of resource, Microsoft.KeyVault/vaults. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model VaultCheckNameAvailabilityParameters")); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultCreateOrUpdateParameters.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..258f215182439 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultCreateOrUpdateParameters.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for creating or updating a vault. */ +@Fluent +public final class VaultCreateOrUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCreateOrUpdateParameters.class); + + /* + * 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") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Properties of the vault + */ + @JsonProperty(value = "properties", required = true) + private VaultProperties properties; + + /** + * Get the location property: The supported Azure location where the key vault should be created. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: 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 property: The tags that will be assigned to the key vault. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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 the properties property: Properties of the vault. + * + * @return the properties value. + */ + public VaultProperties properties() { + return this.properties; + } + + /** + * Set the properties property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property location in model VaultCreateOrUpdateParameters")); + } + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model VaultCreateOrUpdateParameters")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultListResult.java new file mode 100644 index 0000000000000..4f411793853b2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of vaults. */ +@Fluent +public final class VaultListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultListResult.class); + + /* + * The list of vaults. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of vaults. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of vaults. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of vaults. + * + * @param value the value value to set. + * @return the VaultListResult object itself. + */ + public VaultListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of vaults. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of vaults. + * + * @param nextLink the nextLink value to set. + * @return the VaultListResult object itself. + */ + public VaultListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultPatchParameters.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultPatchParameters.java new file mode 100644 index 0000000000000..63b1ca0e2ed99 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultPatchParameters.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for creating or updating a vault. */ +@Fluent +public final class VaultPatchParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultPatchParameters.class); + + /* + * The tags that will be assigned to the key vault. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Properties of the vault + */ + @JsonProperty(value = "properties") + private VaultPatchProperties properties; + + /** + * Get the tags property: The tags that will be assigned to the key vault. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: 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 the properties property: Properties of the vault. + * + * @return the properties value. + */ + public VaultPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultPatchProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultPatchProperties.java new file mode 100644 index 0000000000000..7075b4e916218 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultPatchProperties.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** Properties of the vault. */ +@Fluent +public final class VaultPatchProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultPatchProperties.class); + + /* + * 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. + */ + @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; + + /* + * Property to specify whether the vault will accept traffic from public + * internet. If set to 'disabled' all traffic except private endpoint + * traffic and that that originates from trusted services will be blocked. + * This will override the set firewall rules, meaning that even if the + * firewall rules are present we will not honor the rules. + */ + @JsonProperty(value = "publicNetworkAccess") + private String publicNetworkAccess; + + /** + * Get the tenantId property: 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 tenantId property: 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 the sku property: SKU details. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: 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 the accessPolicies property: 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 the accessPolicies property: 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 the enabledForDeployment property: 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 the enabledForDeployment property: 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 the enabledForDiskEncryption property: 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 the enabledForDiskEncryption property: 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 the enabledForTemplateDeployment property: 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 the enabledForTemplateDeployment property: 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 the enableSoftDelete property: 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 the enableSoftDelete property: 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 the enableRbacAuthorization property: 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 the enableRbacAuthorization property: 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 the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. + * + * @return the softDeleteRetentionInDays value. + */ + public Integer softDeleteRetentionInDays() { + return this.softDeleteRetentionInDays; + } + + /** + * Set the softDeleteRetentionInDays property: 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 createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. + * + * @return the createMode value. + */ + public CreateMode createMode() { + return this.createMode; + } + + /** + * Set the createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. + * + * @param createMode the createMode value to set. + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withCreateMode(CreateMode createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get the enablePurgeProtection property: 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 the enablePurgeProtection property: 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 the networkAcls property: 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 the networkAcls property: 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; + } + + /** + * Get the publicNetworkAccess property: Property to specify whether the vault will accept traffic from public + * internet. If set to 'disabled' all traffic except private endpoint traffic and that that originates from trusted + * services will be blocked. This will override the set firewall rules, meaning that even if the firewall rules are + * present we will not honor the rules. + * + * @return the publicNetworkAccess value. + */ + public String publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Property to specify whether the vault will accept traffic from public + * internet. If set to 'disabled' all traffic except private endpoint traffic and that that originates from trusted + * services will be blocked. This will override the set firewall rules, meaning that even if the firewall rules are + * present we will not honor the rules. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the VaultPatchProperties object itself. + */ + public VaultPatchProperties withPublicNetworkAccess(String publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (accessPolicies() != null) { + accessPolicies().forEach(e -> e.validate()); + } + if (networkAcls() != null) { + networkAcls().validate(); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultProperties.java new file mode 100644 index 0000000000000..253b0ca1fcbb0 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultProperties.java @@ -0,0 +1,535 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** Properties of the vault. */ +@Fluent +public final class VaultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultProperties.class); + + /* + * 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; + + /* + * The resource id of HSM Pool. + */ + @JsonProperty(value = "hsmPoolResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String hsmPoolResourceId; + + /* + * 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. + */ + @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 VaultProvisioningState provisioningState; + + /* + * List of private endpoint connections associated with the key vault. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Property to specify whether the vault will accept traffic from public + * internet. If set to 'disabled' all traffic except private endpoint + * traffic and that that originates from trusted services will be blocked. + * This will override the set firewall rules, meaning that even if the + * firewall rules are present we will not honor the rules. + */ + @JsonProperty(value = "publicNetworkAccess") + private String publicNetworkAccess; + + /** + * Get the tenantId property: 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 tenantId property: 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 the sku property: SKU details. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: 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 the accessPolicies property: 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 the accessPolicies property: 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 vaultUri property: The URI of the vault for performing operations on keys and secrets. + * + * @return the vaultUri value. + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set the vaultUri property: 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 the hsmPoolResourceId property: The resource id of HSM Pool. + * + * @return the hsmPoolResourceId value. + */ + public String hsmPoolResourceId() { + return this.hsmPoolResourceId; + } + + /** + * Get the enabledForDeployment property: 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 the enabledForDeployment property: 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 the enabledForDiskEncryption property: 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 the enabledForDiskEncryption property: 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 the enabledForTemplateDeployment property: 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 the enabledForTemplateDeployment property: 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 the enableSoftDelete property: 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 the enableSoftDelete property: 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 the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. + * + * @return the softDeleteRetentionInDays value. + */ + public Integer softDeleteRetentionInDays() { + return this.softDeleteRetentionInDays; + } + + /** + * Set the softDeleteRetentionInDays property: 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 the enableRbacAuthorization property: 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 the enableRbacAuthorization property: 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 createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. + * + * @return the createMode value. + */ + public CreateMode createMode() { + return this.createMode; + } + + /** + * Set the createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. + * + * @param createMode the createMode value to set. + * @return the VaultProperties object itself. + */ + public VaultProperties withCreateMode(CreateMode createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get the enablePurgeProtection property: 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 the enablePurgeProtection property: 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 the networkAcls property: Rules governing the accessibility of the key vault from specific network locations. + * + * @return the networkAcls value. + */ + public NetworkRuleSet networkAcls() { + return this.networkAcls; + } + + /** + * Set the networkAcls property: 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 the provisioningState property: Provisioning state of the vault. + * + * @return the provisioningState value. + */ + public VaultProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Provisioning state of the vault. + * + * @param provisioningState the provisioningState value to set. + * @return the VaultProperties object itself. + */ + public VaultProperties withProvisioningState(VaultProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the key vault. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the publicNetworkAccess property: Property to specify whether the vault will accept traffic from public + * internet. If set to 'disabled' all traffic except private endpoint traffic and that that originates from trusted + * services will be blocked. This will override the set firewall rules, meaning that even if the firewall rules are + * present we will not honor the rules. + * + * @return the publicNetworkAccess value. + */ + public String publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Property to specify whether the vault will accept traffic from public + * internet. If set to 'disabled' all traffic except private endpoint traffic and that that originates from trusted + * services will be blocked. This will override the set firewall rules, meaning that even if the firewall rules are + * present we will not honor the rules. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the VaultProperties object itself. + */ + public VaultProperties withPublicNetworkAccess(String publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tenantId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property tenantId in model VaultProperties")); + } + if (sku() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model VaultProperties")); + } else { + sku().validate(); + } + if (accessPolicies() != null) { + accessPolicies().forEach(e -> e.validate()); + } + if (networkAcls() != null) { + networkAcls().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultProvisioningState.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultProvisioningState.java new file mode 100644 index 0000000000000..c99158548e61f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultProvisioningState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VaultProvisioningState. */ +public final class VaultProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for VaultProvisioningState. */ + public static final VaultProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value RegisteringDns for VaultProvisioningState. */ + public static final VaultProvisioningState REGISTERING_DNS = fromString("RegisteringDns"); + + /** + * Creates or finds a VaultProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VaultProvisioningState. + */ + @JsonCreator + public static VaultProvisioningState fromString(String name) { + return fromString(name, VaultProvisioningState.class); + } + + /** @return known VaultProvisioningState values. */ + public static Collection values() { + return values(VaultProvisioningState.class); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Vaults.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Vaults.java new file mode 100644 index 0000000000000..a00889ecef25d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Vaults.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultAccessPolicyParametersInner; + +/** Resource collection API of Vaults. */ +public interface Vaults { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + Vault getByResourceGroup(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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, Context context); + + /** + * 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. + * @param parameters Access policy to merge into the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters for updating the access policy in a vault. + */ + VaultAccessPolicyParameters updateAccessPolicy( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters); + + /** + * 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. + * @param parameters Access policy to merge into the vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters for updating the access policy in a vault. + */ + Response updateAccessPolicyWithResponse( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + PagedIterable listByResourceGroup(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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + PagedIterable listBySubscription(); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vaults. + */ + PagedIterable listBySubscription(Integer top, Context context); + + /** + * Gets information about the deleted vaults in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the deleted vaults in a subscription. + */ + PagedIterable listDeleted(); + + /** + * Gets information about the deleted vaults in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about the deleted vaults in a subscription. + */ + PagedIterable listDeleted(Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deleted Azure key vault. + */ + DeletedVault 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deleted Azure key vault. + */ + Response getDeletedWithResponse(String vaultName, String location, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void purgeDeleted(String vaultName, String location, Context context); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + PagedIterable list(); + + /** + * The List operation gets information about the vaults associated with the subscription. + * + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of vault resources. + */ + PagedIterable list(Integer top, Context context); + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + CheckNameAvailabilityResult checkNameAvailability(VaultCheckNameAvailabilityParameters vaultName); + + /** + * Checks that the vault name is valid and is not already in use. + * + * @param vaultName The name of the vault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + Response checkNameAvailabilityWithResponse( + VaultCheckNameAvailabilityParameters vaultName, Context context); + + /** + * Gets the specified Azure key vault. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + Vault getById(String id); + + /** + * Gets the specified Azure key vault. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Azure key vault. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified Azure key vault. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified Azure key vault. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Vault resource. + * + * @param name resource name. + * @return the first stage of the new Vault definition. + */ + Vault.DefinitionStages.Blank define(String name); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VirtualNetworkRule.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VirtualNetworkRule.java new file mode 100644 index 0000000000000..29be89e31e0e6 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VirtualNetworkRule.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A rule governing the accessibility of a vault from a specific virtual network. */ +@Fluent +public final class VirtualNetworkRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkRule.class); + + /* + * 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; + + /* + * Property to specify whether NRP will ignore the check if parent subnet + * has serviceEndpoints configured. + */ + @JsonProperty(value = "ignoreMissingVnetServiceEndpoint") + private Boolean ignoreMissingVnetServiceEndpoint; + + /** + * Get the id property: 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 the id property: 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; + } + + /** + * Get the ignoreMissingVnetServiceEndpoint property: Property to specify whether NRP will ignore the check if + * parent subnet has serviceEndpoints configured. + * + * @return the ignoreMissingVnetServiceEndpoint value. + */ + public Boolean ignoreMissingVnetServiceEndpoint() { + return this.ignoreMissingVnetServiceEndpoint; + } + + /** + * Set the ignoreMissingVnetServiceEndpoint property: Property to specify whether NRP will ignore the check if + * parent subnet has serviceEndpoints configured. + * + * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { + this.ignoreMissingVnetServiceEndpoint = ignoreMissingVnetServiceEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model VirtualNetworkRule")); + } + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/package-info.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/package-info.java new file mode 100644 index 0000000000000..cc3efbc07d2e9 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for KeyVaultManagementClient. The Azure management API provides a RESTful set of + * web services that interact with Azure Key Vault. + */ +package com.azure.resourcemanager.keyvault.generated.models; diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/package-info.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/package-info.java new file mode 100644 index 0000000000000..d6abb864e7ab6 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for KeyVaultManagementClient. The Azure management API provides a RESTful set of web + * services that interact with Azure Key Vault. + */ +package com.azure.resourcemanager.keyvault.generated; diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/module-info.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..7694bb004dc40 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.keyvault.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.keyvault.generated; + exports com.azure.resourcemanager.keyvault.generated.fluent; + exports com.azure.resourcemanager.keyvault.generated.fluent.models; + exports com.azure.resourcemanager.keyvault.generated.models; + + opens com.azure.resourcemanager.keyvault.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.keyvault.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysCreateIfNotExistSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysCreateIfNotExistSamples.java new file mode 100644 index 0000000000000..aea8ecd05e5d6 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysCreateIfNotExistSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.resourcemanager.keyvault.generated.fluent.models.KeyProperties; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyType; + +/** Samples for Keys CreateIfNotExist. */ +public final class KeysCreateIfNotExistSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/createKey.json + */ + /** + * Sample code: Create a key. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createAKey(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .keys() + .define("sample-key-name") + .withExistingVault("sample-group", "sample-vault-name") + .withProperties(new KeyProperties().withKty(JsonWebKeyType.RSA)) + .create(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysGetSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysGetSamples.java new file mode 100644 index 0000000000000..07e2d0323cbb1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Keys Get. */ +public final class KeysGetSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getKey.json + */ + /** + * Sample code: Get a key. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void getAKey(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.keys().getWithResponse("sample-group", "sample-vault-name", "sample-key-name", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysGetVersionSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysGetVersionSamples.java new file mode 100644 index 0000000000000..898e94df77318 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysGetVersionSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Keys GetVersion. */ +public final class KeysGetVersionSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getKeyVersion.json + */ + /** + * Sample code: Get a key version. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void getAKeyVersion(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .keys() + .getVersionWithResponse( + "sample-group", + "sample-vault-name", + "sample-key-name", + "fd618d9519b74f9aae94ade66b876acc", + Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysListSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysListSamples.java new file mode 100644 index 0000000000000..b326a7e1d6588 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Keys List. */ +public final class KeysListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listKeys.json + */ + /** + * Sample code: List keys in the vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listKeysInTheVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.keys().list("sample-group", "sample-vault-name", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysListVersionsSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysListVersionsSamples.java new file mode 100644 index 0000000000000..aba64110a87ed --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/KeysListVersionsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Keys ListVersions. */ +public final class KeysListVersionsSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listKeyVersions.json + */ + /** + * Sample code: List key versions in the vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listKeyVersionsInTheVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.keys().listVersions("sample-group", "sample-vault-name", "sample-key-name", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsCreateOrUpdateSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..6ec71eaf41d85 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsCreateOrUpdateSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmProperties; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmSku; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmSkuFamily; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmSkuName; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +/** Samples for ManagedHsms CreateOrUpdate. */ +public final class ManagedHsmsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_CreateOrUpdate.json + */ + /** + * Sample code: Create a new managed HSM Pool or update an existing managed HSM Pool. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createANewManagedHSMPoolOrUpdateAnExistingManagedHSMPool( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .managedHsms() + .define("hsm1") + .withRegion("westus") + .withExistingResourceGroup("hsm-group") + .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) + .withSku(new ManagedHsmSku().withFamily(ManagedHsmSkuFamily.B).withName(ManagedHsmSkuName.STANDARD_B1)) + .withProperties( + new ManagedHsmProperties() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withInitialAdminObjectIds(Arrays.asList("00000000-0000-0000-0000-000000000000")) + .withEnableSoftDelete(true) + .withSoftDeleteRetentionInDays(90) + .withEnablePurgeProtection(true)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsDeleteSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsDeleteSamples.java new file mode 100644 index 0000000000000..e44b648a1b484 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedHsms Delete. */ +public final class ManagedHsmsDeleteSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_Delete.json + */ + /** + * Sample code: Delete a managed HSM Pool. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void deleteAManagedHSMPool(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().delete("hsm-group", "hsm1", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsGetByResourceGroupSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..e98ae3f341c4a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedHsms GetByResourceGroup. */ +public final class ManagedHsmsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_Get.json + */ + /** + * Sample code: Retrieve a managed HSM Pool. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void retrieveAManagedHSMPool(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().getByResourceGroupWithResponse("hsm-group", "hsm1", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsGetDeletedSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsGetDeletedSamples.java new file mode 100644 index 0000000000000..efb0f0bb78446 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsGetDeletedSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedHsms GetDeleted. */ +public final class ManagedHsmsGetDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/DeletedManagedHsm_Get.json + */ + /** + * Sample code: Retrieve a deleted managed HSM. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void retrieveADeletedManagedHSM( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().getDeletedWithResponse("hsm1", "westus", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListByResourceGroupSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..e45b38af7f9a4 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedHsms ListByResourceGroup. */ +public final class ManagedHsmsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_ListByResourceGroup.json + */ + /** + * Sample code: List managed HSM Pools in a resource group. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listManagedHSMPoolsInAResourceGroup( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().listByResourceGroup("hsm-group", null, Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListDeletedSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListDeletedSamples.java new file mode 100644 index 0000000000000..7e2d4a70762d8 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListDeletedSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedHsms ListDeleted. */ +public final class ManagedHsmsListDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/DeletedManagedHsm_List.json + */ + /** + * Sample code: List deleted managed HSMs in the specified subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listDeletedManagedHSMsInTheSpecifiedSubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().listDeleted(Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListSamples.java new file mode 100644 index 0000000000000..b973abfdbe24c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedHsms List. */ +public final class ManagedHsmsListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_ListBySubscription.json + */ + /** + * Sample code: List managed HSM Pools in a subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listManagedHSMPoolsInASubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().list(null, Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsPurgeDeletedSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsPurgeDeletedSamples.java new file mode 100644 index 0000000000000..2458f5182c84a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsPurgeDeletedSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedHsms PurgeDeleted. */ +public final class ManagedHsmsPurgeDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/DeletedManagedHsm_Purge.json + */ + /** + * Sample code: Purge a managed HSM Pool. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void purgeAManagedHSMPool(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsms().purgeDeleted("hsm1", "westus", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsUpdateSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsUpdateSamples.java new file mode 100644 index 0000000000000..fff3eb2d9f56a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsm; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedHsms Update. */ +public final class ManagedHsmsUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_Update.json + */ + /** + * Sample code: Update an existing managed HSM Pool. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void updateAnExistingManagedHSMPool( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + ManagedHsm resource = + manager.managedHsms().getByResourceGroupWithResponse("hsm-group", "hsm1", Context.NONE).getValue(); + resource.update().withTags(mapOf("Dept", "hsm", "Environment", "dogfood", "Slice", "A")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsDeleteSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..d2a395808edb5 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for MhsmPrivateEndpointConnections Delete. */ +public final class MhsmPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_deletePrivateEndpointConnection.json + */ + /** + * Sample code: ManagedHsmDeletePrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void managedHsmDeletePrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.mhsmPrivateEndpointConnections().delete("sample-group", "sample-mhsm", "sample-pec", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsGetSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..b90bcd2e6d10b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for MhsmPrivateEndpointConnections Get. */ +public final class MhsmPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_getPrivateEndpointConnection.json + */ + /** + * Sample code: ManagedHsmGetPrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void managedHsmGetPrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .mhsmPrivateEndpointConnections() + .getWithResponse("sample-group", "sample-mhsm", "sample-pec", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsListByResourceSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsListByResourceSamples.java new file mode 100644 index 0000000000000..bb76fdea8d9cd --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsListByResourceSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for MhsmPrivateEndpointConnections ListByResource. */ +public final class MhsmPrivateEndpointConnectionsListByResourceSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json + */ + /** + * Sample code: List managed HSM Pools in a subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listManagedHSMPoolsInASubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.mhsmPrivateEndpointConnections().listByResource("sample-group", "sample-mhsm", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsPutSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsPutSamples.java new file mode 100644 index 0000000000000..c6eb4bd684bce --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateEndpointConnectionsPutSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.resourcemanager.keyvault.generated.models.MhsmPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointServiceConnectionStatus; + +/** Samples for MhsmPrivateEndpointConnections Put. */ +public final class MhsmPrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_putPrivateEndpointConnection.json + */ + /** + * Sample code: ManagedHsmPutPrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void managedHsmPutPrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .mhsmPrivateEndpointConnections() + .define("sample-pec") + .withRegion((String) null) + .withExistingManagedHSM("sample-group", "sample-mhsm") + .withPrivateLinkServiceConnectionState( + new MhsmPrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("My name is Joe and I'm approving this.")) + .create(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateLinkResourcesListByMhsmResourceSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateLinkResourcesListByMhsmResourceSamples.java new file mode 100644 index 0000000000000..d58633aec9fc2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/MhsmPrivateLinkResourcesListByMhsmResourceSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for MhsmPrivateLinkResources ListByMhsmResource. */ +public final class MhsmPrivateLinkResourcesListByMhsmResourceSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/ManagedHsm_listPrivateLinkResources.json + */ + /** + * Sample code: KeyVaultListPrivateLinkResources. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultListPrivateLinkResources( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.mhsmPrivateLinkResources().listByMhsmResourceWithResponse("sample-group", "sample-mhsm", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/OperationsListSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..4369d1a9fdc70 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listOperations.json + */ + /** + * Sample code: Lists available Rest API operations. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listsAvailableRestAPIOperations( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..5b99ca762ab91 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/deletePrivateEndpointConnection.json + */ + /** + * Sample code: KeyVaultDeletePrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultDeletePrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.privateEndpointConnections().delete("sample-group", "sample-vault", "sample-pec", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..2eb21584f46c8 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getPrivateEndpointConnection.json + */ + /** + * Sample code: KeyVaultGetPrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultGetPrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("sample-group", "sample-vault", "sample-pec", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsListByResourceSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsListByResourceSamples.java new file mode 100644 index 0000000000000..a57372a2bf305 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsListByResourceSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByResource. */ +public final class PrivateEndpointConnectionsListByResourceSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listPrivateEndpointConnection.json + */ + /** + * Sample code: KeyVaultListPrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultListPrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.privateEndpointConnections().listByResource("sample-group", "sample-vault", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsPutSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsPutSamples.java new file mode 100644 index 0000000000000..5314ed00eb72e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateEndpointConnectionsPutSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.resourcemanager.keyvault.generated.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.keyvault.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Put. */ +public final class PrivateEndpointConnectionsPutSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/putPrivateEndpointConnection.json + */ + /** + * Sample code: KeyVaultPutPrivateEndpointConnection. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultPutPrivateEndpointConnection( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .privateEndpointConnections() + .define("sample-pec") + .withRegion((String) null) + .withExistingVault("sample-group", "sample-vault") + .withEtag("") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("My name is Joe and I'm approving this.")) + .create(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateLinkResourcesListByVaultSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateLinkResourcesListByVaultSamples.java new file mode 100644 index 0000000000000..0af331cb47b2a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/PrivateLinkResourcesListByVaultSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByVault. */ +public final class PrivateLinkResourcesListByVaultSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listPrivateLinkResources.json + */ + /** + * Sample code: KeyVaultListPrivateLinkResources. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void keyVaultListPrivateLinkResources( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.privateLinkResources().listByVaultWithResponse("sample-group", "sample-vault", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsCreateOrUpdateSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..2af484dbbae6a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsCreateOrUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.resourcemanager.keyvault.generated.models.SecretProperties; + +/** Samples for Secrets CreateOrUpdate. */ +public final class SecretsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/createSecret.json + */ + /** + * Sample code: Create a secret. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createASecret(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .secrets() + .define("secret-name") + .withExistingVault("sample-group", "sample-vault") + .withProperties(new SecretProperties().withValue("secret-value")) + .create(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsGetSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsGetSamples.java new file mode 100644 index 0000000000000..d8f20df8a5349 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets Get. */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getSecret.json + */ + /** + * Sample code: Get a secret. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void getASecret(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.secrets().getWithResponse("sample-group", "sample-vault", "secret-name", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsListSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsListSamples.java new file mode 100644 index 0000000000000..15b5e9f3e9026 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Secrets List. */ +public final class SecretsListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listSecrets.json + */ + /** + * Sample code: List secrets in the vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listSecretsInTheVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.secrets().list("sample-group", "sample-vault", null, Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsUpdateSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsUpdateSamples.java new file mode 100644 index 0000000000000..c83f1474ab04b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/SecretsUpdateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.models.Secret; +import com.azure.resourcemanager.keyvault.generated.models.SecretPatchProperties; + +/** Samples for Secrets Update. */ +public final class SecretsUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/updateSecret.json + */ + /** + * Sample code: Update a secret. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void updateASecret(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + Secret resource = + manager.secrets().getWithResponse("sample-group", "sample-vault", "secret-name", Context.NONE).getValue(); + resource.update().withProperties(new SecretPatchProperties().withValue("secret-value2")).apply(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsCheckNameAvailabilitySamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..0eca3ca8557e3 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsCheckNameAvailabilitySamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.models.VaultCheckNameAvailabilityParameters; + +/** Samples for Vaults CheckNameAvailability. */ +public final class VaultsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/checkVaultNameAvailability.json + */ + /** + * Sample code: Validate a vault name. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void validateAVaultName(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .vaults() + .checkNameAvailabilityWithResponse( + new VaultCheckNameAvailabilityParameters().withName("sample-vault"), Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsCreateOrUpdateSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..4a4ce03884eb1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsCreateOrUpdateSamples.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyEntry; +import com.azure.resourcemanager.keyvault.generated.models.CertificatePermissions; +import com.azure.resourcemanager.keyvault.generated.models.IpRule; +import com.azure.resourcemanager.keyvault.generated.models.KeyPermissions; +import com.azure.resourcemanager.keyvault.generated.models.NetworkRuleAction; +import com.azure.resourcemanager.keyvault.generated.models.NetworkRuleBypassOptions; +import com.azure.resourcemanager.keyvault.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.keyvault.generated.models.Permissions; +import com.azure.resourcemanager.keyvault.generated.models.SecretPermissions; +import com.azure.resourcemanager.keyvault.generated.models.Sku; +import com.azure.resourcemanager.keyvault.generated.models.SkuFamily; +import com.azure.resourcemanager.keyvault.generated.models.SkuName; +import com.azure.resourcemanager.keyvault.generated.models.VaultProperties; +import com.azure.resourcemanager.keyvault.generated.models.VirtualNetworkRule; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for Vaults CreateOrUpdate. */ +public final class VaultsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/createVaultWithNetworkAcls.json + */ + /** + * Sample code: Create or update a vault with network acls. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createOrUpdateAVaultWithNetworkAcls( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .vaults() + .define("sample-vault") + .withRegion("westus") + .withExistingResourceGroup("sample-resource-group") + .withProperties( + new VaultProperties() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) + .withEnabledForDeployment(true) + .withEnabledForDiskEncryption(true) + .withEnabledForTemplateDeployment(true) + .withNetworkAcls( + new NetworkRuleSet() + .withBypass(NetworkRuleBypassOptions.AZURE_SERVICES) + .withDefaultAction(NetworkRuleAction.DENY) + .withIpRules( + Arrays + .asList( + new IpRule().withValue("124.56.78.91"), + new IpRule().withValue("'10.91.4.0/24'"))) + .withVirtualNetworkRules( + Arrays + .asList( + new VirtualNetworkRule() + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"))))) + .create(); + } + + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/createVault.json + */ + /** + * Sample code: Create a new vault or update an existing vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createANewVaultOrUpdateAnExistingVault( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .vaults() + .define("sample-vault") + .withRegion("westus") + .withExistingResourceGroup("sample-resource-group") + .withProperties( + new VaultProperties() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) + .withAccessPolicies( + Arrays + .asList( + new AccessPolicyEntry() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withObjectId("00000000-0000-0000-0000-000000000000") + .withPermissions( + new Permissions() + .withKeys( + Arrays + .asList( + KeyPermissions.ENCRYPT, + KeyPermissions.DECRYPT, + KeyPermissions.WRAP_KEY, + KeyPermissions.UNWRAP_KEY, + KeyPermissions.SIGN, + KeyPermissions.VERIFY, + KeyPermissions.GET, + KeyPermissions.LIST, + KeyPermissions.CREATE, + KeyPermissions.UPDATE, + KeyPermissions.IMPORT, + KeyPermissions.DELETE, + KeyPermissions.BACKUP, + KeyPermissions.RESTORE, + KeyPermissions.RECOVER, + KeyPermissions.PURGE)) + .withSecrets( + Arrays + .asList( + SecretPermissions.GET, + SecretPermissions.LIST, + SecretPermissions.SET, + SecretPermissions.DELETE, + SecretPermissions.BACKUP, + SecretPermissions.RESTORE, + SecretPermissions.RECOVER, + SecretPermissions.PURGE)) + .withCertificates( + Arrays + .asList( + CertificatePermissions.GET, + CertificatePermissions.LIST, + CertificatePermissions.DELETE, + CertificatePermissions.CREATE, + CertificatePermissions.IMPORT, + CertificatePermissions.UPDATE, + CertificatePermissions.MANAGECONTACTS, + CertificatePermissions.GETISSUERS, + CertificatePermissions.LISTISSUERS, + CertificatePermissions.SETISSUERS, + CertificatePermissions.DELETEISSUERS, + CertificatePermissions.MANAGEISSUERS, + CertificatePermissions.RECOVER, + CertificatePermissions.PURGE))))) + .withEnabledForDeployment(true) + .withEnabledForDiskEncryption(true) + .withEnabledForTemplateDeployment(true) + .withPublicNetworkAccess("Enabled")) + .create(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsDeleteSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsDeleteSamples.java new file mode 100644 index 0000000000000..0e7b0d7890590 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults Delete. */ +public final class VaultsDeleteSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/deleteVault.json + */ + /** + * Sample code: Delete a vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void deleteAVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().deleteWithResponse("sample-resource-group", "sample-vault", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsGetByResourceGroupSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..fba182be5bc2b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults GetByResourceGroup. */ +public final class VaultsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getVault.json + */ + /** + * Sample code: Retrieve a vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void retrieveAVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().getByResourceGroupWithResponse("sample-resource-group", "sample-vault", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsGetDeletedSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsGetDeletedSamples.java new file mode 100644 index 0000000000000..99f58bfe60364 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsGetDeletedSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults GetDeleted. */ +public final class VaultsGetDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/getDeletedVault.json + */ + /** + * Sample code: Retrieve a deleted vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void retrieveADeletedVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().getDeletedWithResponse("sample-vault", "westus", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListByResourceGroupSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..5c2d9e4b744bd --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults ListByResourceGroup. */ +public final class VaultsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listVaultByResourceGroup.json + */ + /** + * Sample code: List vaults in the specified resource group. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listVaultsInTheSpecifiedResourceGroup( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().listByResourceGroup("sample-group", 1, Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListBySubscriptionSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListBySubscriptionSamples.java new file mode 100644 index 0000000000000..e83dddae158b2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListBySubscriptionSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults ListBySubscription. */ +public final class VaultsListBySubscriptionSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listVaultBySubscription.json + */ + /** + * Sample code: List vaults in the specified subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listVaultsInTheSpecifiedSubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().listBySubscription(1, Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListDeletedSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListDeletedSamples.java new file mode 100644 index 0000000000000..370a2716f399c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListDeletedSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults ListDeleted. */ +public final class VaultsListDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listDeletedVaults.json + */ + /** + * Sample code: List deleted vaults in the specified subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listDeletedVaultsInTheSpecifiedSubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().listDeleted(Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListSamples.java new file mode 100644 index 0000000000000..f4c51c5a2097e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults List. */ +public final class VaultsListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/listVault.json + */ + /** + * Sample code: List vaults in the specified subscription. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listVaultsInTheSpecifiedSubscription( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().list(1, Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsPurgeDeletedSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsPurgeDeletedSamples.java new file mode 100644 index 0000000000000..a8c9a748e5178 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsPurgeDeletedSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Vaults PurgeDeleted. */ +public final class VaultsPurgeDeletedSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/purgeDeletedVault.json + */ + /** + * Sample code: Purge a deleted vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void purgeADeletedVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.vaults().purgeDeleted("sample-vault", "westus", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsUpdateAccessPolicySamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsUpdateAccessPolicySamples.java new file mode 100644 index 0000000000000..46f0e14a74d2b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsUpdateAccessPolicySamples.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.VaultAccessPolicyParametersInner; +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyEntry; +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyUpdateKind; +import com.azure.resourcemanager.keyvault.generated.models.CertificatePermissions; +import com.azure.resourcemanager.keyvault.generated.models.KeyPermissions; +import com.azure.resourcemanager.keyvault.generated.models.Permissions; +import com.azure.resourcemanager.keyvault.generated.models.SecretPermissions; +import com.azure.resourcemanager.keyvault.generated.models.VaultAccessPolicyProperties; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for Vaults UpdateAccessPolicy. */ +public final class VaultsUpdateAccessPolicySamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/updateAccessPoliciesAdd.json + */ + /** + * Sample code: Add an access policy, or update an access policy with new permissions. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void addAnAccessPolicyOrUpdateAnAccessPolicyWithNewPermissions( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .vaults() + .updateAccessPolicyWithResponse( + "sample-group", + "sample-vault", + AccessPolicyUpdateKind.ADD, + new VaultAccessPolicyParametersInner() + .withProperties( + new VaultAccessPolicyProperties() + .withAccessPolicies( + Arrays + .asList( + new AccessPolicyEntry() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withObjectId("00000000-0000-0000-0000-000000000000") + .withPermissions( + new Permissions() + .withKeys(Arrays.asList(KeyPermissions.ENCRYPT)) + .withSecrets(Arrays.asList(SecretPermissions.GET)) + .withCertificates(Arrays.asList(CertificatePermissions.GET)))))), + Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsUpdateSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsUpdateSamples.java new file mode 100644 index 0000000000000..44f70440eccd3 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/VaultsUpdateSamples.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.models.AccessPolicyEntry; +import com.azure.resourcemanager.keyvault.generated.models.CertificatePermissions; +import com.azure.resourcemanager.keyvault.generated.models.KeyPermissions; +import com.azure.resourcemanager.keyvault.generated.models.Permissions; +import com.azure.resourcemanager.keyvault.generated.models.SecretPermissions; +import com.azure.resourcemanager.keyvault.generated.models.Sku; +import com.azure.resourcemanager.keyvault.generated.models.SkuFamily; +import com.azure.resourcemanager.keyvault.generated.models.SkuName; +import com.azure.resourcemanager.keyvault.generated.models.Vault; +import com.azure.resourcemanager.keyvault.generated.models.VaultPatchProperties; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for Vaults Update. */ +public final class VaultsUpdateSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-06-01-preview/examples/updateVault.json + */ + /** + * Sample code: Update an existing vault. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void updateAnExistingVault(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + Vault resource = + manager + .vaults() + .getByResourceGroupWithResponse("sample-resource-group", "sample-vault", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new VaultPatchProperties() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) + .withAccessPolicies( + Arrays + .asList( + new AccessPolicyEntry() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withObjectId("00000000-0000-0000-0000-000000000000") + .withPermissions( + new Permissions() + .withKeys( + Arrays + .asList( + KeyPermissions.ENCRYPT, + KeyPermissions.DECRYPT, + KeyPermissions.WRAP_KEY, + KeyPermissions.UNWRAP_KEY, + KeyPermissions.SIGN, + KeyPermissions.VERIFY, + KeyPermissions.GET, + KeyPermissions.LIST, + KeyPermissions.CREATE, + KeyPermissions.UPDATE, + KeyPermissions.IMPORT, + KeyPermissions.DELETE, + KeyPermissions.BACKUP, + KeyPermissions.RESTORE, + KeyPermissions.RECOVER, + KeyPermissions.PURGE)) + .withSecrets( + Arrays + .asList( + SecretPermissions.GET, + SecretPermissions.LIST, + SecretPermissions.SET, + SecretPermissions.DELETE, + SecretPermissions.BACKUP, + SecretPermissions.RESTORE, + SecretPermissions.RECOVER, + SecretPermissions.PURGE)) + .withCertificates( + Arrays + .asList( + CertificatePermissions.GET, + CertificatePermissions.LIST, + CertificatePermissions.DELETE, + CertificatePermissions.CREATE, + CertificatePermissions.IMPORT, + CertificatePermissions.UPDATE, + CertificatePermissions.MANAGECONTACTS, + CertificatePermissions.GETISSUERS, + CertificatePermissions.LISTISSUERS, + CertificatePermissions.SETISSUERS, + CertificatePermissions.DELETEISSUERS, + CertificatePermissions.MANAGEISSUERS, + CertificatePermissions.RECOVER, + CertificatePermissions.PURGE))))) + .withEnabledForDeployment(true) + .withEnabledForDiskEncryption(true) + .withEnabledForTemplateDeployment(true) + .withPublicNetworkAccess("Enabled")) + .apply(); + } +} diff --git a/sdk/keyvault/ci.yml b/sdk/keyvault/ci.yml index d286a80043250..2cedd6e322363 100644 --- a/sdk/keyvault/ci.yml +++ b/sdk/keyvault/ci.yml @@ -73,3 +73,6 @@ extends: - name: azure-security-keyvault-secrets groupId: com.azure safeName: azuresecuritykeyvaultsecrets + - name: azure-resourcemanager-keyvault-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerkeyvaultgenerated diff --git a/sdk/keyvault/pom.xml b/sdk/keyvault/pom.xml index f8be32f059d76..ca412c97fb39f 100644 --- a/sdk/keyvault/pom.xml +++ b/sdk/keyvault/pom.xml @@ -70,20 +70,21 @@ true - microsoft-azure-keyvault-webkey + azure-resourcemanager-keyvault-generated + azure-security-keyvault-administration + azure-security-keyvault-certificates + azure-security-keyvault-jca + azure-security-keyvault-keys + azure-security-keyvault-perf + azure-security-keyvault-secrets + azure-security-test-keyvault-jca microsoft-azure-keyvault microsoft-azure-keyvault-complete microsoft-azure-keyvault-core microsoft-azure-keyvault-cryptography microsoft-azure-keyvault-extensions microsoft-azure-keyvault-test - azure-security-test-keyvault-jca - azure-security-keyvault-administration - azure-security-keyvault-certificates - azure-security-keyvault-jca - azure-security-keyvault-keys - azure-security-keyvault-secrets - azure-security-keyvault-perf + microsoft-azure-keyvault-webkey