From b158c68156f3122b9805d64586cf4373353441ab Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 21 Oct 2022 22:32:28 +0000 Subject: [PATCH] CodeGen from PR 20839 in Azure/azure-rest-api-specs Merge 232932c01264234b5b3ca4a94d8098ffaf9c0739 into 7b7f4b52c549d6ba62c387f569477ececf45f9f3 --- eng/versioning/version_client.txt | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 + .../SAMPLE.md | 1445 +++++++++ .../pom.xml | 55 + .../keyvault/generated/KeyVaultManager.java | 432 +++ .../fluent/KeyVaultManagementClient.java | 117 + .../keyvault/generated/fluent/KeysClient.java | 172 ++ .../fluent/ManagedHsmKeysClient.java | 184 ++ .../generated/fluent/ManagedHsmsClient.java | 423 +++ .../MhsmPrivateEndpointConnectionsClient.java | 193 ++ .../MhsmPrivateLinkResourcesClient.java | 42 + .../generated/fluent/OperationsClient.java | 36 + .../PrivateEndpointConnectionsClient.java | 179 ++ .../fluent/PrivateLinkResourcesClient.java | 42 + .../generated/fluent/SecretsClient.java | 158 + .../generated/fluent/VaultsClient.java | 410 +++ .../CheckMhsmNameAvailabilityResultInner.java | 74 + .../CheckNameAvailabilityResultInner.java | 73 + .../fluent/models/DeletedManagedHsmInner.java | 99 + .../fluent/models/DeletedVaultInner.java | 99 + .../generated/fluent/models/KeyInner.java | 255 ++ .../fluent/models/KeyProperties.java | 256 ++ .../fluent/models/ManagedHsmInner.java | 80 + .../fluent/models/ManagedHsmKeyInner.java | 251 ++ .../models/ManagedHsmKeyProperties.java | 256 ++ .../MhsmPrivateEndpointConnectionInner.java | 168 ++ ...smPrivateEndpointConnectionProperties.java | 113 + ...hsmPrivateLinkResourceListResultInner.java | 55 + .../MhsmPrivateLinkResourceProperties.java | 81 + .../fluent/models/OperationInner.java | 174 ++ .../fluent/models/OperationProperties.java | 54 + .../PrivateEndpointConnectionInner.java | 158 + .../PrivateEndpointConnectionProperties.java | 113 + .../PrivateLinkResourceListResultInner.java | 55 + .../models/PrivateLinkResourceProperties.java | 81 + .../generated/fluent/models/SecretInner.java | 77 + .../VaultAccessPolicyParametersInner.java | 78 + .../generated/fluent/models/VaultInner.java | 93 + .../generated/fluent/models/package-info.java | 9 + .../generated/fluent/package-info.java | 9 + .../CheckMhsmNameAvailabilityResultImpl.java | 42 + .../CheckNameAvailabilityResultImpl.java | 42 + .../implementation/DeletedManagedHsmImpl.java | 46 + .../implementation/DeletedVaultImpl.java | 45 + .../generated/implementation/KeyImpl.java | 185 ++ .../KeyVaultManagementClientBuilder.java | 146 + .../KeyVaultManagementClientImpl.java | 421 +++ .../implementation/KeysClientImpl.java | 1196 ++++++++ .../generated/implementation/KeysImpl.java | 161 + .../implementation/ManagedHsmImpl.java | 183 ++ .../implementation/ManagedHsmKeyImpl.java | 173 ++ .../ManagedHsmKeysClientImpl.java | 1221 ++++++++ .../implementation/ManagedHsmKeysImpl.java | 163 + .../implementation/ManagedHsmsClientImpl.java | 2366 +++++++++++++++ .../implementation/ManagedHsmsImpl.java | 238 ++ .../MhsmPrivateEndpointConnectionImpl.java | 232 ++ ...mPrivateEndpointConnectionsClientImpl.java | 1070 +++++++ .../MhsmPrivateEndpointConnectionsImpl.java | 219 ++ ...MhsmPrivateLinkResourceListResultImpl.java | 41 + .../MhsmPrivateLinkResourcesClientImpl.java | 215 ++ .../MhsmPrivateLinkResourcesImpl.java | 61 + .../implementation/OperationImpl.java | 50 + .../implementation/OperationsClientImpl.java | 272 ++ .../implementation/OperationsImpl.java | 45 + .../PrivateEndpointConnectionImpl.java | 217 ++ .../PrivateEndpointConnectionsClientImpl.java | 1042 +++++++ .../PrivateEndpointConnectionsImpl.java | 221 ++ .../PrivateLinkResourceListResultImpl.java | 41 + .../PrivateLinkResourcesClientImpl.java | 214 ++ .../PrivateLinkResourcesImpl.java | 61 + .../generated/implementation/SecretImpl.java | 191 ++ .../implementation/SecretsClientImpl.java | 967 ++++++ .../generated/implementation/SecretsImpl.java | 127 + .../generated/implementation/Utils.java | 204 ++ .../VaultAccessPolicyParametersImpl.java | 50 + .../generated/implementation/VaultImpl.java | 200 ++ .../implementation/VaultsClientImpl.java | 2641 +++++++++++++++++ .../generated/implementation/VaultsImpl.java | 285 ++ .../implementation/package-info.java | 9 + .../generated/models/AccessPolicyEntry.java | 157 + .../models/AccessPolicyUpdateKind.java | 54 + .../keyvault/generated/models/Action.java | 50 + .../generated/models/ActionsRequired.java | 35 + .../keyvault/generated/models/Attributes.java | 132 + .../models/CertificatePermissions.java | 83 + .../CheckMhsmNameAvailabilityParameters.java | 59 + .../CheckMhsmNameAvailabilityResult.java | 41 + .../models/CheckNameAvailabilityResult.java | 41 + .../keyvault/generated/models/CreateMode.java | 51 + .../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 | 49 + .../generated/models/DimensionProperties.java | 104 + .../keyvault/generated/models/Error.java | 43 + .../generated/models/ErrorException.java | 38 + .../keyvault/generated/models/IpRule.java | 60 + .../generated/models/JsonWebKeyCurveName.java | 44 + .../generated/models/JsonWebKeyOperation.java | 56 + .../generated/models/JsonWebKeyType.java | 44 + .../keyvault/generated/models/Key.java | 215 ++ .../generated/models/KeyAttributes.java | 177 ++ .../generated/models/KeyCreateParameters.java | 90 + .../generated/models/KeyListResult.java | 81 + .../generated/models/KeyPermissions.java | 95 + .../generated/models/KeyReleasePolicy.java | 85 + .../models/KeyRotationPolicyActionType.java | 51 + .../models/KeyRotationPolicyAttributes.java | 82 + .../keyvault/generated/models/Keys.java | 152 + .../generated/models/LifetimeAction.java | 82 + .../generated/models/LogSpecification.java | 102 + .../keyvault/generated/models/ManagedHsm.java | 262 ++ .../generated/models/ManagedHsmAction.java | 50 + .../generated/models/ManagedHsmKey.java | 193 ++ .../models/ManagedHsmKeyAttributes.java | 177 ++ .../models/ManagedHsmKeyCreateParameters.java | 91 + .../models/ManagedHsmKeyListResult.java | 81 + .../models/ManagedHsmKeyReleasePolicy.java | 85 + ...ManagedHsmKeyRotationPolicyAttributes.java | 82 + .../generated/models/ManagedHsmKeys.java | 158 + .../models/ManagedHsmLifetimeAction.java | 82 + .../models/ManagedHsmListResult.java | 81 + .../models/ManagedHsmProperties.java | 338 +++ .../generated/models/ManagedHsmResource.java | 85 + .../models/ManagedHsmRotationPolicy.java | 83 + .../generated/models/ManagedHsmSku.java | 89 + .../generated/models/ManagedHsmSkuFamily.java | 35 + .../generated/models/ManagedHsmSkuName.java | 51 + .../generated/models/ManagedHsmTrigger.java | 82 + .../generated/models/ManagedHsms.java | 269 ++ .../generated/models/MetricSpecification.java | 316 ++ .../generated/models/MhsmNetworkRuleSet.java | 141 + .../generated/models/MhsmPrivateEndpoint.java | 39 + .../models/MhsmPrivateEndpointConnection.java | 365 +++ .../MhsmPrivateEndpointConnectionItem.java | 166 ++ .../MhsmPrivateEndpointConnections.java | 162 + ...mPrivateEndpointConnectionsListResult.java | 81 + ...mPrivateEndpointConnectionsPutHeaders.java | 87 + ...PrivateEndpointConnectionsPutResponse.java | 42 + .../models/MhsmPrivateLinkResource.java | 109 + .../MhsmPrivateLinkResourceListResult.java | 26 + .../models/MhsmPrivateLinkResources.java | 37 + ...MhsmPrivateLinkServiceConnectionState.java | 106 + .../models/MhsmVirtualNetworkRule.java | 61 + .../keyvault/generated/models/MhsmipRule.java | 61 + .../generated/models/NetworkRuleAction.java | 41 + .../models/NetworkRuleBypassOptions.java | 41 + .../generated/models/NetworkRuleSet.java | 141 + .../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 | 324 ++ .../models/PrivateEndpointConnectionItem.java | 166 ++ .../PrivateEndpointConnectionListResult.java | 81 + ...teEndpointConnectionProvisioningState.java | 51 + .../models/PrivateEndpointConnections.java | 148 + .../PrivateEndpointConnectionsPutHeaders.java | 87 + ...PrivateEndpointConnectionsPutResponse.java | 42 + ...rivateEndpointServiceConnectionStatus.java | 45 + .../generated/models/PrivateLinkResource.java | 101 + .../models/PrivateLinkResourceListResult.java | 26 + .../models/PrivateLinkResources.java | 37 + .../PrivateLinkServiceConnectionState.java | 106 + .../generated/models/ProvisioningState.java | 56 + .../ProxyResourceWithoutSystemData.java | 58 + .../generated/models/PublicNetworkAccess.java | 38 + .../keyvault/generated/models/Reason.java | 51 + .../generated/models/ResourceListResult.java | 78 + .../generated/models/RotationPolicy.java | 83 + .../keyvault/generated/models/Secret.java | 209 ++ .../generated/models/SecretAttributes.java | 46 + .../SecretCreateOrUpdateParameters.java | 90 + .../generated/models/SecretListResult.java | 81 + .../models/SecretPatchParameters.java | 82 + .../models/SecretPatchProperties.java | 105 + .../generated/models/SecretPermissions.java | 59 + .../generated/models/SecretProperties.java | 141 + .../keyvault/generated/models/Secrets.java | 102 + .../models/ServiceSpecification.java | 83 + .../keyvault/generated/models/Sku.java | 87 + .../keyvault/generated/models/SkuFamily.java | 35 + .../keyvault/generated/models/SkuName.java | 51 + .../generated/models/StoragePermissions.java | 77 + .../keyvault/generated/models/Trigger.java | 82 + .../keyvault/generated/models/Vault.java | 235 ++ .../models/VaultAccessPolicyParameters.java | 53 + .../models/VaultAccessPolicyProperties.java | 65 + .../VaultCheckNameAvailabilityParameters.java | 86 + .../models/VaultCreateOrUpdateParameters.java | 122 + .../generated/models/VaultListResult.java | 81 + .../models/VaultPatchParameters.java | 82 + .../models/VaultPatchProperties.java | 423 +++ .../generated/models/VaultProperties.java | 526 ++++ .../models/VaultProvisioningState.java | 38 + .../keyvault/generated/models/Vaults.java | 314 ++ .../generated/models/VirtualNetworkRule.java | 89 + .../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 + ...ManagedHsmKeysCreateIfNotExistSamples.java | 28 + .../generated/ManagedHsmKeysGetSamples.java | 24 + .../ManagedHsmKeysGetVersionSamples.java | 29 + .../generated/ManagedHsmKeysListSamples.java | 22 + .../ManagedHsmKeysListVersionsSamples.java | 25 + ...dHsmsCheckMhsmNameAvailabilitySamples.java | 26 + .../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 | 52 +- sdk/keyvault/pom.xml | 23 +- 255 files changed, 36273 insertions(+), 34 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/ManagedHsmKeysClient.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/CheckMhsmNameAvailabilityResultInner.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/ManagedHsmKeyInner.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/ManagedHsmKeyProperties.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/CheckMhsmNameAvailabilityResultImpl.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/ManagedHsmKeyImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmKeysClientImpl.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmKeysImpl.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/CheckMhsmNameAvailabilityParameters.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CheckMhsmNameAvailabilityResult.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/ManagedHsmAction.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKey.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyAttributes.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyCreateParameters.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyListResult.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyReleasePolicy.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyRotationPolicyAttributes.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeys.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmLifetimeAction.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/ManagedHsmRotationPolicy.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/ManagedHsmTrigger.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/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/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/ProxyResourceWithoutSystemData.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/ManagedHsmKeysCreateIfNotExistSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysGetSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysGetVersionSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysListSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysListVersionsSamples.java create mode 100644 sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsCheckMhsmNameAvailabilitySamples.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 d9903cba13ba5..05b53b17dba48 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -383,6 +383,7 @@ com.azure.resourcemanager:azure-resourcemanager-devhub;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-elasticsan;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hybridcontainerservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securitydevops;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 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 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..99238dcc1dd9e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-10-21) + +- 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-2022-11. 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..3799380ff30de --- /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-2022-11. 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..795bb60d2732e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/SAMPLE.md @@ -0,0 +1,1445 @@ +# Code snippets and samples + + +## Keys + +- [CreateIfNotExist](#keys_createifnotexist) +- [Get](#keys_get) +- [GetVersion](#keys_getversion) +- [List](#keys_list) +- [ListVersions](#keys_listversions) + +## ManagedHsmKeys + +- [CreateIfNotExist](#managedhsmkeys_createifnotexist) +- [Get](#managedhsmkeys_get) +- [GetVersion](#managedhsmkeys_getversion) +- [List](#managedhsmkeys_list) +- [ListVersions](#managedhsmkeys_listversions) + +## ManagedHsms + +- [CheckMhsmNameAvailability](#managedhsms_checkmhsmnameavailability) +- [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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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); + } +} +``` + +### ManagedHsmKeys_CreateIfNotExist + +```java +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmKeyProperties; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyType; + +/** Samples for ManagedHsmKeys CreateIfNotExist. */ +public final class ManagedHsmKeysCreateIfNotExistSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/managedHsmCreateKey.json + */ + /** + * Sample code: Create a key. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createAKey(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .managedHsmKeys() + .define("sample-key-name") + .withExistingManagedHSM("sample-group", "sample-managedhsm-name") + .withProperties(new ManagedHsmKeyProperties().withKty(JsonWebKeyType.RSA)) + .create(); + } +} +``` + +### ManagedHsmKeys_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsmKeys Get. */ +public final class ManagedHsmKeysGetSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/managedHsmGetKey.json + */ + /** + * Sample code: Get a key. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void getAKey(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .managedHsmKeys() + .getWithResponse("sample-group", "sample-managedhsm-name", "sample-key-name", Context.NONE); + } +} +``` + +### ManagedHsmKeys_GetVersion + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsmKeys GetVersion. */ +public final class ManagedHsmKeysGetVersionSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/managedHsmGetKeyVersion.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 + .managedHsmKeys() + .getVersionWithResponse( + "sample-group", + "sample-managedhsm-name", + "sample-key-name", + "fd618d9519b74f9aae94ade66b876acc", + Context.NONE); + } +} +``` + +### ManagedHsmKeys_List + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsmKeys List. */ +public final class ManagedHsmKeysListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/managedHsmListKeys.json + */ + /** + * Sample code: List keys in the managed HSM. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listKeysInTheManagedHSM(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsmKeys().list("sample-group", "sample-managedhsm-name", Context.NONE); + } +} +``` + +### ManagedHsmKeys_ListVersions + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedHsmKeys ListVersions. */ +public final class ManagedHsmKeysListVersionsSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/managedHsmListKeyVersions.json + */ + /** + * Sample code: List key versions in the managed HSM. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listKeyVersionsInTheManagedHSM( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .managedHsmKeys() + .listVersions("sample-group", "sample-managedhsm-name", "sample-key-name", Context.NONE); + } +} +``` + +### ManagedHsms_CheckMhsmNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.generated.models.CheckMhsmNameAvailabilityParameters; + +/** Samples for ManagedHsms CheckMhsmNameAvailability. */ +public final class ManagedHsmsCheckMhsmNameAvailabilitySamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/ManagedHsm_checkMhsmNameAvailability.json + */ + /** + * Sample code: Validate a managed hsm name. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void validateAManagedHsmName(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .managedHsms() + .checkMhsmNameAvailabilityWithResponse( + new CheckMhsmNameAvailabilityParameters().withName("sample-mhsm"), 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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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().deleteByResourceGroupWithResponse("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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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/stable/2022-11-01/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..c7421fcdc0822 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/pom.xml @@ -0,0 +1,55 @@ + + 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-2022-11. + 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 + + + + com.azure + azure-core + 1.33.0 + + + com.azure + azure-core-management + 1.8.1 + + + 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..cd4a84715b9ff --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/KeyVaultManager.java @@ -0,0 +1,432 @@ +// 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.AddHeadersFromContextPolicy; +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.RetryOptions; +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.ManagedHsmKeysImpl; +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.ManagedHsmKeys; +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 ManagedHsmKeys managedHsmKeys; + + 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); + } + + /** + * Creates an instance of KeyVault service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the KeyVault service API instance. + */ + public static KeyVaultManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new KeyVaultManager(httpPipeline, profile, null); + } + + /** + * 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 static 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 RetryOptions retryOptions; + 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 retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' 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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + 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); + } + } + + /** + * Gets the resource collection API of Keys. It manages Key. + * + * @return Resource collection API of Keys. + */ + public Keys keys() { + if (this.keys == null) { + this.keys = new KeysImpl(clientObject.getKeys(), this); + } + return keys; + } + + /** + * Gets the resource collection API of Vaults. It manages Vault. + * + * @return Resource collection API of Vaults. + */ + public Vaults vaults() { + if (this.vaults == null) { + this.vaults = new VaultsImpl(clientObject.getVaults(), this); + } + return vaults; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of ManagedHsms. It manages ManagedHsm. + * + * @return Resource collection API of ManagedHsms. + */ + public ManagedHsms managedHsms() { + if (this.managedHsms == null) { + this.managedHsms = new ManagedHsmsImpl(clientObject.getManagedHsms(), this); + } + return managedHsms; + } + + /** + * Gets the resource collection API of MhsmPrivateEndpointConnections. It manages MhsmPrivateEndpointConnection. + * + * @return Resource collection API of MhsmPrivateEndpointConnections. + */ + public MhsmPrivateEndpointConnections mhsmPrivateEndpointConnections() { + if (this.mhsmPrivateEndpointConnections == null) { + this.mhsmPrivateEndpointConnections = + new MhsmPrivateEndpointConnectionsImpl(clientObject.getMhsmPrivateEndpointConnections(), this); + } + return mhsmPrivateEndpointConnections; + } + + /** + * Gets the resource collection API of MhsmPrivateLinkResources. + * + * @return Resource collection API of MhsmPrivateLinkResources. + */ + public MhsmPrivateLinkResources mhsmPrivateLinkResources() { + if (this.mhsmPrivateLinkResources == null) { + this.mhsmPrivateLinkResources = + new MhsmPrivateLinkResourcesImpl(clientObject.getMhsmPrivateLinkResources(), this); + } + return mhsmPrivateLinkResources; + } + + /** + * Gets the resource collection API of ManagedHsmKeys. It manages ManagedHsmKey. + * + * @return Resource collection API of ManagedHsmKeys. + */ + public ManagedHsmKeys managedHsmKeys() { + if (this.managedHsmKeys == null) { + this.managedHsmKeys = new ManagedHsmKeysImpl(clientObject.getManagedHsmKeys(), this); + } + return managedHsmKeys; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Secrets. It manages Secret. + * + * @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..fbee2a3d88d10 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/KeyVaultManagementClient.java @@ -0,0 +1,117 @@ +// 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 ManagedHsmKeysClient object to access its operations. + * + * @return the ManagedHsmKeysClient object. + */ + ManagedHsmKeysClient getManagedHsmKeys(); + + /** + * 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..d364645421dac --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/KeysClient.java @@ -0,0 +1,172 @@ +// 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. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createIfNotExistWithResponse( + String resourceGroupName, String vaultName, String keyName, KeyCreateParameters parameters, 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. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, String keyName, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVersionWithResponse( + String resourceGroupName, String vaultName, String keyName, String keyVersion, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/ManagedHsmKeysClient.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/ManagedHsmKeysClient.java new file mode 100644 index 0000000000000..19746a2f228b4 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/ManagedHsmKeysClient.java @@ -0,0 +1,184 @@ +// 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.ManagedHsmKeyInner; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmKeyCreateParameters; + +/** An instance of this class provides access to all the operations defined in ManagedHsmKeysClient. */ +public interface ManagedHsmKeysClient { + /** + * 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. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createIfNotExistWithResponse( + String resourceGroupName, + String name, + String keyName, + ManagedHsmKeyCreateParameters parameters, + 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. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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) + ManagedHsmKeyInner createIfNotExist( + String resourceGroupName, String name, String keyName, ManagedHsmKeyCreateParameters parameters); + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String name, String keyName, Context context); + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedHsmKeyInner get(String resourceGroupName, String name, String keyName); + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String name); + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String name, Context context); + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVersionWithResponse( + String resourceGroupName, String name, String keyName, String keyVersion, Context context); + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedHsmKeyInner getVersion(String resourceGroupName, String name, String keyName, String keyVersion); + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String resourceGroupName, String name, String keyName); + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions( + String resourceGroupName, String name, 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..de5df824e1d25 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/ManagedHsmsClient.java @@ -0,0 +1,423 @@ +// 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.CheckMhsmNameAvailabilityResultInner; +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.CheckMhsmNameAvailabilityParameters; + +/** 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDeletedWithResponse(String name, String location, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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); + + /** + * Checks that the managed hsm name is valid and is not already in use. + * + * @param mhsmName The name of the managed hsm. + * @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 CheckMhsmNameAvailability operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkMhsmNameAvailabilityWithResponse( + CheckMhsmNameAvailabilityParameters mhsmName, Context context); + + /** + * Checks that the managed hsm name is valid and is not already in use. + * + * @param mhsmName The name of the managed hsm. + * @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 CheckMhsmNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckMhsmNameAvailabilityResultInner checkMhsmNameAvailability(CheckMhsmNameAvailabilityParameters mhsmName); +} 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..8ad25a28cf499 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/MhsmPrivateEndpointConnectionsClient.java @@ -0,0 +1,193 @@ +// 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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. + * @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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String name, String privateEndpointConnectionName, 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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..e2670563f617e --- /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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByMhsmResourceWithResponse( + String resourceGroupName, String name, 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 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); +} 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..d052731fcdc26 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..701d30c70e0fc --- /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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, 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 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..d3b80b5eaeb7a --- /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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByVaultWithResponse( + String resourceGroupName, String vaultName, 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 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); +} 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..33b141c7c674e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/SecretsClient.java @@ -0,0 +1,158 @@ +// 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. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String vaultName, + String secretName, + SecretCreateOrUpdateParameters parameters, + 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. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String vaultName, + String secretName, + SecretPatchParameters 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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String vaultName, String secretName, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..771323b12e43a --- /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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String vaultName, VaultPatchParameters 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); + + /** + * 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String vaultName, 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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateAccessPolicyWithResponse( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters, + 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDeletedWithResponse(String vaultName, String location, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + VaultCheckNameAvailabilityParameters vaultName, 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); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/CheckMhsmNameAvailabilityResultInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/CheckMhsmNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..639ce631d4040 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/CheckMhsmNameAvailabilityResultInner.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.Immutable; +import com.azure.resourcemanager.keyvault.generated.models.Reason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CheckMhsmNameAvailability operation response. */ +@Immutable +public final class CheckMhsmNameAvailabilityResultInner { + /* + * 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 managed hsm 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; + + /** Creates an instance of CheckMhsmNameAvailabilityResultInner class. */ + public CheckMhsmNameAvailabilityResultInner() { + } + + /** + * 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 managed hsm 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/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..76d650f79da6b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/CheckNameAvailabilityResultInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.keyvault.generated.models.Reason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CheckNameAvailability operation response. */ +@Immutable +public final class CheckNameAvailabilityResultInner { + /* + * 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; + + /** Creates an instance of CheckNameAvailabilityResultInner class. */ + public CheckNameAvailabilityResultInner() { + } + + /** + * 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..070129530d957 --- /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.resourcemanager.keyvault.generated.models.DeletedManagedHsmProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DeletedManagedHsm model. */ +@Fluent +public final class DeletedManagedHsmInner { + /* + * 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; + + /** Creates an instance of DeletedManagedHsmInner class. */ + public DeletedManagedHsmInner() { + } + + /** + * 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..b83b059235aa5 --- /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.resourcemanager.keyvault.generated.models.DeletedVaultProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deleted vault information with extended details. */ +@Fluent +public final class DeletedVaultInner { + /* + * 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; + + /** Creates an instance of DeletedVaultInner class. */ + public DeletedVaultInner() { + } + + /** + * 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..252a133e77973 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/KeyInner.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.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.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The key resource. */ +@Fluent +public final class KeyInner extends Resource { + /* + * The properties of the key. + */ + @JsonProperty(value = "properties", required = true) + private KeyProperties innerProperties = new KeyProperties(); + + /** Creates an instance of KeyInner class. */ + public KeyInner() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyInner.class); +} 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..92755c73c4902 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/KeyProperties.java @@ -0,0 +1,256 @@ +// 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.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.JsonProperty; +import java.util.List; + +/** The properties of the key. */ +@Fluent +public final class KeyProperties { + /* + * 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; + + /** Creates an instance of KeyProperties class. */ + public KeyProperties() { + } + + /** + * 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..b9ff96d6e260c --- /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.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.JsonProperty; +import java.util.Map; + +/** Resource information with extended details. */ +@Fluent +public final class ManagedHsmInner extends ManagedHsmResource { + /* + * Properties of the managed HSM + */ + @JsonProperty(value = "properties") + private ManagedHsmProperties properties; + + /** Creates an instance of ManagedHsmInner class. */ + public ManagedHsmInner() { + } + + /** + * 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/ManagedHsmKeyInner.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/ManagedHsmKeyInner.java new file mode 100644 index 0000000000000..925df803020a7 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/ManagedHsmKeyInner.java @@ -0,0 +1,251 @@ +// 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.ManagedHsmKeyAttributes; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmKeyReleasePolicy; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmRotationPolicy; +import com.azure.resourcemanager.keyvault.generated.models.ProxyResourceWithoutSystemData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The key resource. */ +@Fluent +public final class ManagedHsmKeyInner extends ProxyResourceWithoutSystemData { + /* + * The properties of the key. + */ + @JsonProperty(value = "properties", required = true) + private ManagedHsmKeyProperties innerProperties = new ManagedHsmKeyProperties(); + + /** Creates an instance of ManagedHsmKeyInner class. */ + public ManagedHsmKeyInner() { + } + + /** + * Get the innerProperties property: The properties of the key. + * + * @return the innerProperties value. + */ + private ManagedHsmKeyProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ManagedHsmKeyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the attributes property: The attributes of the key. + * + * @return the attributes value. + */ + public ManagedHsmKeyAttributes 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 ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withAttributes(ManagedHsmKeyAttributes attributes) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + 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 ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withKty(JsonWebKeyType kty) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + 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 ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withKeyOps(List keyOps) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + 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 ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withKeySize(Integer keySize) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + 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 ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withCurveName(JsonWebKeyCurveName curveName) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + 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 ManagedHsmRotationPolicy 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 ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withRotationPolicy(ManagedHsmRotationPolicy rotationPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + 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 ManagedHsmKeyReleasePolicy 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 ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withReleasePolicy(ManagedHsmKeyReleasePolicy releasePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + this.innerProperties().withReleasePolicy(releasePolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ManagedHsmKeyInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedHsmKeyInner.class); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/ManagedHsmKeyProperties.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/ManagedHsmKeyProperties.java new file mode 100644 index 0000000000000..515aeb0ca8b32 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/ManagedHsmKeyProperties.java @@ -0,0 +1,256 @@ +// 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.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.ManagedHsmKeyAttributes; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmKeyReleasePolicy; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmRotationPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of the key. */ +@Fluent +public final class ManagedHsmKeyProperties { + /* + * The attributes of the key. + */ + @JsonProperty(value = "attributes") + private ManagedHsmKeyAttributes 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 ManagedHsmRotationPolicy rotationPolicy; + + /* + * Key release policy in response. It will be used for both output and input. Omitted if empty + */ + @JsonProperty(value = "release_policy") + private ManagedHsmKeyReleasePolicy releasePolicy; + + /** Creates an instance of ManagedHsmKeyProperties class. */ + public ManagedHsmKeyProperties() { + } + + /** + * Get the attributes property: The attributes of the key. + * + * @return the attributes value. + */ + public ManagedHsmKeyAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: The attributes of the key. + * + * @param attributes the attributes value to set. + * @return the ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties withAttributes(ManagedHsmKeyAttributes 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 ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties 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 ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties 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 ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties 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 ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties 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 ManagedHsmRotationPolicy 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 ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties withRotationPolicy(ManagedHsmRotationPolicy 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 ManagedHsmKeyReleasePolicy 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 ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties withReleasePolicy(ManagedHsmKeyReleasePolicy 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/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..2b4ad46d3836e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/MhsmPrivateEndpointConnectionInner.java @@ -0,0 +1,168 @@ +// 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.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.JsonProperty; +import java.util.Map; + +/** Private endpoint connection resource. */ +@Fluent +public final class MhsmPrivateEndpointConnectionInner extends ManagedHsmResource { + /* + * 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; + + /** Creates an instance of MhsmPrivateEndpointConnectionInner class. */ + public MhsmPrivateEndpointConnectionInner() { + } + + /** + * 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..becd63a6e3b1b --- /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.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.JsonProperty; + +/** Properties of the private endpoint connection resource. */ +@Fluent +public final class MhsmPrivateEndpointConnectionProperties { + /* + * 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; + + /** Creates an instance of MhsmPrivateEndpointConnectionProperties class. */ + public MhsmPrivateEndpointConnectionProperties() { + } + + /** + * 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..700e1095d8b34 --- /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.resourcemanager.keyvault.generated.models.MhsmPrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class MhsmPrivateLinkResourceListResultInner { + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of MhsmPrivateLinkResourceListResultInner class. */ + public MhsmPrivateLinkResourceListResultInner() { + } + + /** + * 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..951d8684d8097 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class MhsmPrivateLinkResourceProperties { + /* + * 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; + + /** Creates an instance of MhsmPrivateLinkResourceProperties class. */ + public MhsmPrivateLinkResourceProperties() { + } + + /** + * 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..328b1f784217e --- /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.resourcemanager.keyvault.generated.models.OperationDisplay; +import com.azure.resourcemanager.keyvault.generated.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key Vault REST API operation definition. */ +@Fluent +public final class OperationInner { + /* + * 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; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * 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..77bd6d678cc68 --- /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.resourcemanager.keyvault.generated.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of operation, include metric specifications. */ +@Fluent +public final class OperationProperties { + /* + * One property of operation, include metric specifications. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** Creates an instance of OperationProperties class. */ + public OperationProperties() { + } + + /** + * 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..a07004704384b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,158 @@ +// 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.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.JsonProperty; +import java.util.Map; + +/** Private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends Resource { + /* + * 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; + + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + + /** + * 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..c6cc33220be38 --- /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.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.JsonProperty; + +/** Properties of the private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * 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; + + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + + /** + * 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..8cdbb1df2fef6 --- /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.resourcemanager.keyvault.generated.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of PrivateLinkResourceListResultInner class. */ + public PrivateLinkResourceListResultInner() { + } + + /** + * 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..fe052d5113be6 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * 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; + + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + + /** + * 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..bc09500ffcedd --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/SecretInner.java @@ -0,0 +1,77 @@ +// 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.JsonProperty; +import java.util.Map; + +/** Resource information with extended details. */ +@Fluent +public final class SecretInner extends Resource { + /* + * Properties of the secret + */ + @JsonProperty(value = "properties", required = true) + private SecretProperties properties; + + /** Creates an instance of SecretInner class. */ + public SecretInner() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretInner.class); +} 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..d549af86516d4 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/VaultAccessPolicyParametersInner.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.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.JsonProperty; + +/** Parameters for updating the access policy in a vault. */ +@Fluent +public final class VaultAccessPolicyParametersInner extends ProxyResource { + /* + * The resource type of the access policy. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Properties of the access policy + */ + @JsonProperty(value = "properties", required = true) + private VaultAccessPolicyProperties properties; + + /** Creates an instance of VaultAccessPolicyParametersInner class. */ + public VaultAccessPolicyParametersInner() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VaultAccessPolicyParametersInner.class); +} 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..629d51dc4fd6d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/fluent/models/VaultInner.java @@ -0,0 +1,93 @@ +// 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.JsonProperty; +import java.util.Map; + +/** Resource information with extended details. */ +@Fluent +public final class VaultInner extends Resource { + /* + * 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; + + /** Creates an instance of VaultInner class. */ + public VaultInner() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VaultInner.class); +} 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/CheckMhsmNameAvailabilityResultImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/CheckMhsmNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..ed4582b751781 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/CheckMhsmNameAvailabilityResultImpl.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.CheckMhsmNameAvailabilityResultInner; +import com.azure.resourcemanager.keyvault.generated.models.CheckMhsmNameAvailabilityResult; +import com.azure.resourcemanager.keyvault.generated.models.Reason; + +public final class CheckMhsmNameAvailabilityResultImpl implements CheckMhsmNameAvailabilityResult { + private CheckMhsmNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + CheckMhsmNameAvailabilityResultImpl( + CheckMhsmNameAvailabilityResultInner 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 CheckMhsmNameAvailabilityResultInner 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/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..8fe50c7697268 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyVaultManagementClientBuilder.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.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.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 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 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 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() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + KeyVaultManagementClientImpl client = + new KeyVaultManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + 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..49c34e324e66d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeyVaultManagementClientImpl.java @@ -0,0 +1,421 @@ +// 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.CoreUtils; +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.ManagedHsmKeysClient; +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 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 { + /** + * 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 ManagedHsmKeysClient object to access its operations. */ + private final ManagedHsmKeysClient managedHsmKeys; + + /** + * Gets the ManagedHsmKeysClient object to access its operations. + * + * @return the ManagedHsmKeysClient object. + */ + public ManagedHsmKeysClient getManagedHsmKeys() { + return this.managedHsmKeys; + } + + /** 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 = "2022-11-01"; + 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.managedHsmKeys = new ManagedHsmKeysClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), 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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultManagementClientImpl.class); +} 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..a8a697e4d850c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeysClientImpl.java @@ -0,0 +1,1196 @@ +// 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.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 { + /** 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. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIfNotExistAsync( + String resourceGroupName, String vaultName, String keyName, KeyCreateParameters parameters) { + return createIfNotExistWithResponseAsync(resourceGroupName, vaultName, keyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response}. + */ + @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(); + } + + /** + * 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. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 createIfNotExistWithResponse(resourceGroupName, vaultName, keyName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String keyName) { + return getWithResponseAsync(resourceGroupName, vaultName, keyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String keyName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, keyName, 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) + public KeyInner get(String resourceGroupName, String vaultName, String keyName) { + return getWithResponse(resourceGroupName, vaultName, keyName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVersionAsync( + String resourceGroupName, String vaultName, String keyName, String keyVersion) { + return getVersionWithResponseAsync(resourceGroupName, vaultName, keyName, keyVersion) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 getVersionWithResponse(resourceGroupName, vaultName, keyName, keyVersion, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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..c5c27037a1eb7 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/KeysImpl.java @@ -0,0 +1,161 @@ +// 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; + +public final class KeysImpl implements Keys { + private static 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 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 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 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 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 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 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..952552af79c43 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmImpl.java @@ -0,0 +1,183 @@ +// 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 String resourceGroupName() { + return resourceGroupName; + } + + 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/ManagedHsmKeyImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmKeyImpl.java new file mode 100644 index 0000000000000..366802a7dd197 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmKeyImpl.java @@ -0,0 +1,173 @@ +// 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.util.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmKeyInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmKeyProperties; +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.ManagedHsmKey; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmKeyAttributes; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmKeyCreateParameters; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmKeyReleasePolicy; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmRotationPolicy; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ManagedHsmKeyImpl implements ManagedHsmKey, ManagedHsmKey.Definition { + private ManagedHsmKeyInner innerObject; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + ManagedHsmKeyImpl( + ManagedHsmKeyInner 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 Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedHsmKeyAttributes 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 ManagedHsmRotationPolicy rotationPolicy() { + return this.innerModel().rotationPolicy(); + } + + public ManagedHsmKeyReleasePolicy releasePolicy() { + return this.innerModel().releasePolicy(); + } + + public ManagedHsmKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private String keyName; + + private ManagedHsmKeyCreateParameters createParameters; + + public ManagedHsmKeyImpl withExistingManagedHSM(String resourceGroupName, String name) { + this.resourceGroupName = resourceGroupName; + this.name = name; + return this; + } + + public ManagedHsmKey create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedHsmKeys() + .createIfNotExistWithResponse(resourceGroupName, name, keyName, createParameters, Context.NONE) + .getValue(); + return this; + } + + public ManagedHsmKey create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedHsmKeys() + .createIfNotExistWithResponse(resourceGroupName, name, keyName, createParameters, context) + .getValue(); + return this; + } + + ManagedHsmKeyImpl(String name, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerObject = new ManagedHsmKeyInner(); + this.serviceManager = serviceManager; + this.keyName = name; + this.createParameters = new ManagedHsmKeyCreateParameters(); + } + + public ManagedHsmKey refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedHsmKeys() + .getWithResponse(resourceGroupName, name, keyName, Context.NONE) + .getValue(); + return this; + } + + public ManagedHsmKey refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedHsmKeys() + .getWithResponse(resourceGroupName, name, keyName, context) + .getValue(); + return this; + } + + public ManagedHsmKeyImpl withProperties(ManagedHsmKeyProperties properties) { + this.createParameters.withProperties(properties); + return this; + } + + public ManagedHsmKeyImpl 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/ManagedHsmKeysClientImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmKeysClientImpl.java new file mode 100644 index 0000000000000..c8282d7f45c2c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmKeysClientImpl.java @@ -0,0 +1,1221 @@ +// 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.resourcemanager.keyvault.generated.fluent.ManagedHsmKeysClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmKeyInner; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmKeyCreateParameters; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmKeyListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedHsmKeysClient. */ +public final class ManagedHsmKeysClientImpl implements ManagedHsmKeysClient { + /** The proxy service used to perform REST calls. */ + private final ManagedHsmKeysService service; + + /** The service client containing this operation class. */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of ManagedHsmKeysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedHsmKeysClientImpl(KeyVaultManagementClientImpl client) { + this.service = + RestProxy.create(ManagedHsmKeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientManagedHsmKeys to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + private interface ManagedHsmKeysService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}/keys/{keyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createIfNotExist( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @PathParam("keyName") String keyName, + @BodyParam("application/json") ManagedHsmKeyCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}/keys/{keyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @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" + + "/managedHSMs/{name}/keys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @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); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault" + + "/managedHSMs/{name}/keys/{keyName}/versions/{keyVersion}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVersion( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @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" + + "/managedHSMs/{name}/keys/{keyName}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVersions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @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. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createIfNotExistWithResponseAsync( + String resourceGroupName, String name, String keyName, ManagedHsmKeyCreateParameters 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + this.client.getApiVersion(), + keyName, + 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. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createIfNotExistWithResponseAsync( + String resourceGroupName, + String name, + String keyName, + ManagedHsmKeyCreateParameters 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + this.client.getApiVersion(), + keyName, + 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. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createIfNotExistAsync( + String resourceGroupName, String name, String keyName, ManagedHsmKeyCreateParameters parameters) { + return createIfNotExistWithResponseAsync(resourceGroupName, name, keyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createIfNotExistWithResponse( + String resourceGroupName, + String name, + String keyName, + ManagedHsmKeyCreateParameters parameters, + Context context) { + return createIfNotExistWithResponseAsync(resourceGroupName, name, keyName, parameters, context).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. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 ManagedHsmKeyInner createIfNotExist( + String resourceGroupName, String name, String keyName, ManagedHsmKeyCreateParameters parameters) { + return createIfNotExistWithResponse(resourceGroupName, name, keyName, parameters, Context.NONE).getValue(); + } + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + 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 managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + keyName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String name, String keyName) { + return getWithResponseAsync(resourceGroupName, name, keyName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String name, String keyName, Context context) { + return getWithResponseAsync(resourceGroupName, name, keyName, context).block(); + } + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedHsmKeyInner get(String resourceGroupName, String name, String keyName) { + return getWithResponse(resourceGroupName, name, keyName, Context.NONE).getValue(); + } + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + 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 managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + 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 + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + 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 managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String name) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, name), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String name, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, name, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String name) { + return new PagedIterable<>(listAsync(resourceGroupName, name)); + } + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String name, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, name, context)); + } + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVersionWithResponseAsync( + String resourceGroupName, String name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + 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 managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVersionWithResponseAsync( + String resourceGroupName, String name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + keyName, + keyVersion, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVersionAsync( + String resourceGroupName, String name, String keyName, String keyVersion) { + return getVersionWithResponseAsync(resourceGroupName, name, keyName, keyVersion) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVersionWithResponse( + String resourceGroupName, String name, String keyName, String keyVersion, Context context) { + return getVersionWithResponseAsync(resourceGroupName, name, keyName, keyVersion, context).block(); + } + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedHsmKeyInner getVersion(String resourceGroupName, String name, String keyName, String keyVersion) { + return getVersionWithResponse(resourceGroupName, name, keyName, keyVersion, Context.NONE).getValue(); + } + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsSinglePageAsync( + String resourceGroupName, String name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + 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 managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsSinglePageAsync( + String resourceGroupName, String name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + 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 managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVersionsAsync(String resourceGroupName, String name, String keyName) { + return new PagedFlux<>( + () -> listVersionsSinglePageAsync(resourceGroupName, name, keyName), + nextLink -> listVersionsNextSinglePageAsync(nextLink)); + } + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVersionsAsync( + String resourceGroupName, String name, String keyName, Context context) { + return new PagedFlux<>( + () -> listVersionsSinglePageAsync(resourceGroupName, name, keyName, context), + nextLink -> listVersionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String resourceGroupName, String name, String keyName) { + return new PagedIterable<>(listVersionsAsync(resourceGroupName, name, keyName)); + } + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions( + String resourceGroupName, String name, String keyName, Context context) { + return new PagedIterable<>(listVersionsAsync(resourceGroupName, name, keyName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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/ManagedHsmKeysImpl.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmKeysImpl.java new file mode 100644 index 0000000000000..5235cb8a798fa --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmKeysImpl.java @@ -0,0 +1,163 @@ +// 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.ManagedHsmKeysClient; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmKeyInner; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmKey; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsmKeys; + +public final class ManagedHsmKeysImpl implements ManagedHsmKeys { + private static final ClientLogger LOGGER = new ClientLogger(ManagedHsmKeysImpl.class); + + private final ManagedHsmKeysClient innerClient; + + private final com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager; + + public ManagedHsmKeysImpl( + ManagedHsmKeysClient innerClient, com.azure.resourcemanager.keyvault.generated.KeyVaultManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String name, String keyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, name, keyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedHsmKeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ManagedHsmKey get(String resourceGroupName, String name, String keyName) { + ManagedHsmKeyInner inner = this.serviceClient().get(resourceGroupName, name, keyName); + if (inner != null) { + return new ManagedHsmKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String name) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, name); + return Utils.mapPage(inner, inner1 -> new ManagedHsmKeyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String name, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, name, context); + return Utils.mapPage(inner, inner1 -> new ManagedHsmKeyImpl(inner1, this.manager())); + } + + public Response getVersionWithResponse( + String resourceGroupName, String name, String keyName, String keyVersion, Context context) { + Response inner = + this.serviceClient().getVersionWithResponse(resourceGroupName, name, keyName, keyVersion, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedHsmKeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ManagedHsmKey getVersion(String resourceGroupName, String name, String keyName, String keyVersion) { + ManagedHsmKeyInner inner = this.serviceClient().getVersion(resourceGroupName, name, keyName, keyVersion); + if (inner != null) { + return new ManagedHsmKeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listVersions(String resourceGroupName, String name, String keyName) { + PagedIterable inner = this.serviceClient().listVersions(resourceGroupName, name, keyName); + return Utils.mapPage(inner, inner1 -> new ManagedHsmKeyImpl(inner1, this.manager())); + } + + public PagedIterable listVersions( + String resourceGroupName, String name, String keyName, Context context) { + PagedIterable inner = + this.serviceClient().listVersions(resourceGroupName, name, keyName, context); + return Utils.mapPage(inner, inner1 -> new ManagedHsmKeyImpl(inner1, this.manager())); + } + + public ManagedHsmKey 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 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, name, 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 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 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, name, keyName, context); + } + + private ManagedHsmKeysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager() { + return this.serviceManager; + } + + public ManagedHsmKeyImpl define(String name) { + return new ManagedHsmKeyImpl(name, this.manager()); + } +} 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..013b520019556 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmsClientImpl.java @@ -0,0 +1,2366 @@ +// 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.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.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.CheckMhsmNameAvailabilityResultInner; +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.CheckMhsmNameAvailabilityParameters; +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 { + /** 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, 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"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkMhsmNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkMhsmNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckMhsmNameAvailabilityParameters mhsmName, + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 the {@link PollerFlux} for polling of 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 the {@link PollerFlux} for polling of 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(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) + public ManagedHsmInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDeletedAsync(String name, String location) { + return getDeletedWithResponseAsync(name, location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeletedWithResponse(String name, String location, Context context) { + return getDeletedWithResponseAsync(name, location, context).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. + * @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 getDeletedWithResponse(name, location, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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(); + } + + /** + * Checks that the managed hsm name is valid and is not already in use. + * + * @param mhsmName The name of the managed hsm. + * @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 CheckMhsmNameAvailability operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkMhsmNameAvailabilityWithResponseAsync( + CheckMhsmNameAvailabilityParameters mhsmName) { + 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 (mhsmName == null) { + return Mono.error(new IllegalArgumentException("Parameter mhsmName is required and cannot be null.")); + } else { + mhsmName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkMhsmNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + mhsmName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the managed hsm name is valid and is not already in use. + * + * @param mhsmName The name of the managed hsm. + * @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 CheckMhsmNameAvailability operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkMhsmNameAvailabilityWithResponseAsync( + CheckMhsmNameAvailabilityParameters mhsmName, 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 (mhsmName == null) { + return Mono.error(new IllegalArgumentException("Parameter mhsmName is required and cannot be null.")); + } else { + mhsmName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkMhsmNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + mhsmName, + accept, + context); + } + + /** + * Checks that the managed hsm name is valid and is not already in use. + * + * @param mhsmName The name of the managed hsm. + * @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 CheckMhsmNameAvailability operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkMhsmNameAvailabilityAsync( + CheckMhsmNameAvailabilityParameters mhsmName) { + return checkMhsmNameAvailabilityWithResponseAsync(mhsmName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks that the managed hsm name is valid and is not already in use. + * + * @param mhsmName The name of the managed hsm. + * @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 CheckMhsmNameAvailability operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkMhsmNameAvailabilityWithResponse( + CheckMhsmNameAvailabilityParameters mhsmName, Context context) { + return checkMhsmNameAvailabilityWithResponseAsync(mhsmName, context).block(); + } + + /** + * Checks that the managed hsm name is valid and is not already in use. + * + * @param mhsmName The name of the managed hsm. + * @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 CheckMhsmNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckMhsmNameAvailabilityResultInner checkMhsmNameAvailability( + CheckMhsmNameAvailabilityParameters mhsmName) { + return checkMhsmNameAvailabilityWithResponse(mhsmName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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..421f0b8336fd9 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/ManagedHsmsImpl.java @@ -0,0 +1,238 @@ +// 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.CheckMhsmNameAvailabilityResultInner; +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.CheckMhsmNameAvailabilityParameters; +import com.azure.resourcemanager.keyvault.generated.models.CheckMhsmNameAvailabilityResult; +import com.azure.resourcemanager.keyvault.generated.models.DeletedManagedHsm; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsm; +import com.azure.resourcemanager.keyvault.generated.models.ManagedHsms; + +public final class ManagedHsmsImpl implements ManagedHsms { + private static 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 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 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 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 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 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 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 Response checkMhsmNameAvailabilityWithResponse( + CheckMhsmNameAvailabilityParameters mhsmName, Context context) { + Response inner = + this.serviceClient().checkMhsmNameAvailabilityWithResponse(mhsmName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckMhsmNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckMhsmNameAvailabilityResult checkMhsmNameAvailability(CheckMhsmNameAvailabilityParameters mhsmName) { + CheckMhsmNameAvailabilityResultInner inner = this.serviceClient().checkMhsmNameAvailability(mhsmName); + if (inner != null) { + return new CheckMhsmNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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..7e4580ca0d3f1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionImpl.java @@ -0,0 +1,232 @@ +// 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 String resourceGroupName() { + return resourceGroupName; + } + + 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..bd4295b701960 --- /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.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 { + /** 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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String name, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, context).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. + * @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 getWithResponse(resourceGroupName, name, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + MhsmPrivateEndpointConnectionInner properties) { + return putWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 putWithResponse(resourceGroupName, name, privateEndpointConnectionName, properties, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 the {@link PollerFlux} for polling of 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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..f731e168cfa62 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateEndpointConnectionsImpl.java @@ -0,0 +1,219 @@ +// 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; + +public final class MhsmPrivateEndpointConnectionsImpl implements MhsmPrivateEndpointConnections { + private static 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 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 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 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..b21eb885cfdb1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourcesClientImpl.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.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.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 { + /** 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByMhsmResourceAsync( + String resourceGroupName, String name) { + return listByMhsmResourceWithResponseAsync(resourceGroupName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByMhsmResourceWithResponse( + String resourceGroupName, String name, Context context) { + return listByMhsmResourceWithResponseAsync(resourceGroupName, name, context).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. + * @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 listByMhsmResourceWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } +} 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..d33f83e350638 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/MhsmPrivateLinkResourcesImpl.java @@ -0,0 +1,61 @@ +// 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; + +public final class MhsmPrivateLinkResourcesImpl implements MhsmPrivateLinkResources { + private static 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 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; + } + } + + 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; + } + } + + 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..9d7ca2330b858 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,272 @@ +// 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.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 { + /** 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..e9049940c6121 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/OperationsImpl.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.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; + +public final class OperationsImpl implements Operations { + private static 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..cf09951d58746 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,217 @@ +// 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 String resourceGroupName() { + return resourceGroupName; + } + + 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..50b8ce2500209 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1042 @@ +// 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.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 { + /** 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context).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. + * @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 getWithResponse(resourceGroupName, vaultName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync( + String resourceGroupName, + String vaultName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return putWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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(); + } + + /** + * 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 putWithResponse(resourceGroupName, vaultName, privateEndpointConnectionName, properties, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 the {@link PollerFlux} for polling of 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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..cdeca2b3518cc --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,221 @@ +// 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; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static 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 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 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 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..a01a1e5534bf7 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,214 @@ +// 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.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 { + /** 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByVaultAsync(String resourceGroupName, String vaultName) { + return listByVaultWithResponseAsync(resourceGroupName, vaultName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByVaultWithResponse( + String resourceGroupName, String vaultName, Context context) { + return listByVaultWithResponseAsync(resourceGroupName, vaultName, context).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. + * @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 listByVaultWithResponse(resourceGroupName, vaultName, Context.NONE).getValue(); + } +} 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..6d0e787140fc6 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,61 @@ +// 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; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static 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 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; + } + } + + 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; + } + } + + 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..04fc9c9ec47f6 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretImpl.java @@ -0,0 +1,191 @@ +// 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 String resourceGroupName() { + return resourceGroupName; + } + + 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..08114f6e8c9d4 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretsClientImpl.java @@ -0,0 +1,967 @@ +// 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.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 { + /** 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. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String vaultName, String secretName, SecretCreateOrUpdateParameters parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, secretName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @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 along with {@link Response}. + */ + @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(); + } + + /** + * 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. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @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 createOrUpdateWithResponse(resourceGroupName, vaultName, secretName, parameters, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters) { + return updateWithResponseAsync(resourceGroupName, vaultName, secretName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 updateWithResponse(resourceGroupName, vaultName, secretName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String secretName) { + return getWithResponseAsync(resourceGroupName, vaultName, secretName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String vaultName, String secretName, Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, secretName, 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) + public SecretInner get(String resourceGroupName, String vaultName, String secretName) { + return getWithResponse(resourceGroupName, vaultName, secretName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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..504731409e678 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/SecretsImpl.java @@ -0,0 +1,127 @@ +// 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; + +public final class SecretsImpl implements Secrets { + private static 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 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 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 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..64eeccedbaa58 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultImpl.java @@ -0,0 +1,200 @@ +// 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 String resourceGroupName() { + return resourceGroupName; + } + + 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..a85adcae84938 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/implementation/VaultsClientImpl.java @@ -0,0 +1,2641 @@ +// 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.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 { + /** 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 the {@link PollerFlux} for polling of 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of 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 the {@link SyncPoller} for polling of 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 the {@link SyncPoller} for polling of 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String vaultName, VaultPatchParameters parameters) { + return updateWithResponseAsync(resourceGroupName, vaultName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String vaultName, VaultPatchParameters parameters, Context context) { + return updateWithResponseAsync(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) + public VaultInner update(String resourceGroupName, String vaultName, VaultPatchParameters parameters) { + return updateWithResponse(resourceGroupName, vaultName, parameters, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vaultName) { + return deleteWithResponseAsync(resourceGroupName, vaultName).flatMap(ignored -> 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. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String vaultName, Context context) { + return deleteWithResponseAsync(resourceGroupName, vaultName, 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String vaultName) { + deleteWithResponse(resourceGroupName, vaultName, Context.NONE); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String vaultName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context) { + return getByResourceGroupWithResponseAsync(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) + public VaultInner getByResourceGroup(String resourceGroupName, String vaultName) { + return getByResourceGroupWithResponse(resourceGroupName, vaultName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAccessPolicyAsync( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters) { + return updateAccessPolicyWithResponseAsync(resourceGroupName, vaultName, operationKind, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 updateAccessPolicyWithResponse(resourceGroupName, vaultName, operationKind, parameters, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDeletedAsync(String vaultName, String location) { + return getDeletedWithResponseAsync(vaultName, location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeletedWithResponse(String vaultName, String location, Context context) { + return getDeletedWithResponseAsync(vaultName, location, context).block(); + } + + /** + * 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 getDeletedWithResponse(vaultName, location, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + VaultCheckNameAvailabilityParameters vaultName) { + return checkNameAvailabilityWithResponseAsync(vaultName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + VaultCheckNameAvailabilityParameters vaultName, Context context) { + return checkNameAvailabilityWithResponseAsync(vaultName, context).block(); + } + + /** + * 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 checkNameAvailabilityWithResponse(vaultName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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..852f710877dfa --- /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; + +public final class VaultsImpl implements Vaults { + private static 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 Response deleteByResourceGroupWithResponse( + String resourceGroupName, String vaultName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, vaultName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String vaultName) { + this.serviceClient().delete(resourceGroupName, vaultName); + } + + 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 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 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 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 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 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 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 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 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 CheckNameAvailabilityResult checkNameAvailability(VaultCheckNameAvailabilityParameters vaultName) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(vaultName); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, 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.deleteByResourceGroupWithResponse(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.deleteByResourceGroupWithResponse(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..1cb5d550396fb --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/AccessPolicyEntry.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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 { + /* + * 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; + + /** Creates an instance of AccessPolicyEntry class. */ + public AccessPolicyEntry() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccessPolicyEntry.class); +} 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..ca558d3a0be13 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/AccessPolicyUpdateKind.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.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) { + if (value == null) { + return null; + } + AccessPolicyUpdateKind[] items = AccessPolicyUpdateKind.values(); + for (AccessPolicyUpdateKind item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..c77f59d98d0b4 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The Action model. */ +@Fluent +public final class Action { + /* + * The type of action. + */ + @JsonProperty(value = "type") + private KeyRotationPolicyActionType type; + + /** Creates an instance of Action class. */ + public Action() { + } + + /** + * 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..2191548430058 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ActionsRequired.java @@ -0,0 +1,35 @@ +// 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; + +/** A message indicating if changes on the service provider require any updates on the consumer. */ +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); + } + + /** + * Gets known ActionsRequired values. + * + * @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..690e919ba5ca1 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The object attributes managed by the KeyVault service. */ +@Fluent +public class Attributes { + /* + * Determines whether the object is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Not before date in seconds since 1970-01-01T00:00:00Z. + */ + @JsonProperty(value = "nbf") + private Long notBefore; + + /* + * Expiry date in seconds since 1970-01-01T00:00:00Z. + */ + @JsonProperty(value = "exp") + private Long expires; + + /* + * Creation time in seconds since 1970-01-01T00:00:00Z. + */ + @JsonProperty(value = "created", access = JsonProperty.Access.WRITE_ONLY) + private Long created; + + /* + * Last updated time in seconds since 1970-01-01T00:00:00Z. + */ + @JsonProperty(value = "updated", access = JsonProperty.Access.WRITE_ONLY) + private Long updated; + + /** Creates an instance of Attributes class. */ + public Attributes() { + } + + /** + * 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..340d1736f3ba1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CertificatePermissions.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.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); + } + + /** + * Gets known CertificatePermissions values. + * + * @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/CheckMhsmNameAvailabilityParameters.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CheckMhsmNameAvailabilityParameters.java new file mode 100644 index 0000000000000..36e0cac22ff3d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CheckMhsmNameAvailabilityParameters.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.JsonProperty; + +/** The parameters used to check the availability of the managed hsm name. */ +@Fluent +public final class CheckMhsmNameAvailabilityParameters { + /* + * The managed hsm name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** Creates an instance of CheckMhsmNameAvailabilityParameters class. */ + public CheckMhsmNameAvailabilityParameters() { + } + + /** + * Get the name property: The managed hsm name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The managed hsm name. + * + * @param name the name value to set. + * @return the CheckMhsmNameAvailabilityParameters object itself. + */ + public CheckMhsmNameAvailabilityParameters withName(String name) { + this.name = name; + 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 CheckMhsmNameAvailabilityParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckMhsmNameAvailabilityParameters.class); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CheckMhsmNameAvailabilityResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CheckMhsmNameAvailabilityResult.java new file mode 100644 index 0000000000000..774799aec6a50 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CheckMhsmNameAvailabilityResult.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.CheckMhsmNameAvailabilityResultInner; + +/** An immutable client-side representation of CheckMhsmNameAvailabilityResult. */ +public interface CheckMhsmNameAvailabilityResult { + /** + * 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 managed hsm 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.CheckMhsmNameAvailabilityResultInner + * object. + * + * @return the inner object. + */ + CheckMhsmNameAvailabilityResultInner innerModel(); +} 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..db0eb82c72d74 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/CreateMode.java @@ -0,0 +1,51 @@ +// 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; + +/** The vault's create mode to indicate whether the vault need to be recovered or not. */ +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) { + if (value == null) { + return null; + } + CreateMode[] items = CreateMode.values(); + for (CreateMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..c9a919ab44004 --- /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.resourcemanager.keyvault.generated.fluent.models.DeletedManagedHsmInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of deleted managed HSM Pools. */ +@Fluent +public final class DeletedManagedHsmListResult { + /* + * 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; + + /** Creates an instance of DeletedManagedHsmListResult class. */ + public DeletedManagedHsmListResult() { + } + + /** + * 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..26b67208e717a --- /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.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 { + /* + * 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; + + /** Creates an instance of DeletedManagedHsmProperties class. */ + public DeletedManagedHsmProperties() { + } + + /** + * 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..5c15c587e6264 --- /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.resourcemanager.keyvault.generated.fluent.models.DeletedVaultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of vaults. */ +@Fluent +public final class DeletedVaultListResult { + /* + * 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; + + /** Creates an instance of DeletedVaultListResult class. */ + public DeletedVaultListResult() { + } + + /** + * 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..a926661e4960a --- /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.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 { + /* + * 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; + + /** Creates an instance of DeletedVaultProperties class. */ + public DeletedVaultProperties() { + } + + /** + * 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..90749b251083f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DeletionRecoveryLevel.java @@ -0,0 +1,49 @@ +// 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; + +/** + * 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. + */ +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); + } + + /** + * Gets known DeletionRecoveryLevel values. + * + * @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..c069b6375a3d2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/DimensionProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Type of operation: get, read, delete, etc. */ +@Fluent +public final class DimensionProperties { + /* + * 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; + + /** Creates an instance of DimensionProperties class. */ + public DimensionProperties() { + } + + /** + * 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..3d84355369972 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The error exception. */ +@Immutable +public final class Error extends ManagementError { + /* + * The inner error, contains a more specific error code. + */ + @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) + private Error innerError; + + /** Creates an instance of Error class. */ + public Error() { + } + + /** + * 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..ff4fcdd8d59c2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ErrorException.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.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); + } + + /** {@inheritDoc} */ + @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..50965279a9df1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/IpRule.java @@ -0,0 +1,60 @@ +// 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.JsonProperty; + +/** A rule governing the accessibility of a vault from a specific ip address or ip range. */ +@Fluent +public final class IpRule { + /* + * An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all + * addresses that start with 124.56.78). + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** Creates an instance of IpRule class. */ + public IpRule() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpRule.class); +} 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..dd7645141626e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyCurveName.java @@ -0,0 +1,44 @@ +// 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; + +/** The elliptic curve name. For valid values, see 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); + } + + /** + * Gets known JsonWebKeyCurveName values. + * + * @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..de821bec56230 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyOperation.java @@ -0,0 +1,56 @@ +// 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; + +/** The permitted JSON web key operations of the key. For more information, see 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); + } + + /** + * Gets known JsonWebKeyOperation values. + * + * @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..f632a2c121442 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/JsonWebKeyType.java @@ -0,0 +1,44 @@ +// 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; + +/** The type of the key. For valid values, see 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); + } + + /** + * Gets known JsonWebKeyType values. + * + * @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..ce607b4b87660 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyAttributes.java @@ -0,0 +1,177 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The object attributes managed by the Azure Key Vault service. */ +@Fluent +public final class KeyAttributes { + /* + * 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; + + /** Creates an instance of KeyAttributes class. */ + public KeyAttributes() { + } + + /** + * 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..ae914d754e1b1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyCreateParameters.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.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.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters used to create a key. */ +@Fluent +public final class KeyCreateParameters { + /* + * 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; + + /** Creates an instance of KeyCreateParameters class. */ + public KeyCreateParameters() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyCreateParameters.class); +} 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..f36945925ecc9 --- /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.resourcemanager.keyvault.generated.fluent.models.KeyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The page of keys. */ +@Fluent +public final class KeyListResult { + /* + * The key resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next page of keys. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of KeyListResult class. */ + public KeyListResult() { + } + + /** + * 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..0b91e92f6d494 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyPermissions.java @@ -0,0 +1,95 @@ +// 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 release for KeyPermissions. */ + public static final KeyPermissions RELEASE = fromString("release"); + + /** 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"); + + /** + * 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); + } + + /** + * Gets known KeyPermissions values. + * + * @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..b447f3de492e6 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The KeyReleasePolicy model. */ +@Fluent +public final class KeyReleasePolicy { + /* + * 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; + + /** Creates an instance of KeyReleasePolicy class. */ + public KeyReleasePolicy() { + } + + /** + * 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..a31ffe22953c1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyRotationPolicyActionType.java @@ -0,0 +1,51 @@ +// 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; + +/** The type of action. */ +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) { + if (value == null) { + return null; + } + KeyRotationPolicyActionType[] items = KeyRotationPolicyActionType.values(); + for (KeyRotationPolicyActionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..448041aca3586 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/KeyRotationPolicyAttributes.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.fasterxml.jackson.annotation.JsonProperty; + +/** The KeyRotationPolicyAttributes model. */ +@Fluent +public final class KeyRotationPolicyAttributes { + /* + * 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; + + /** Creates an instance of KeyRotationPolicyAttributes class. */ + public KeyRotationPolicyAttributes() { + } + + /** + * 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..269e48df59b6d --- /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. + * @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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, String keyName, 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. + */ + Key get(String resourceGroupName, String vaultName, String keyName); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getVersionWithResponse( + String resourceGroupName, String vaultName, String keyName, String keyVersion, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..ee6d3fd8a0d78 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The LifetimeAction model. */ +@Fluent +public final class LifetimeAction { + /* + * 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; + + /** Creates an instance of LifetimeAction class. */ + public LifetimeAction() { + } + + /** + * 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..2bdcbf9226115 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Log specification of operation. */ +@Fluent +public final class LogSpecification { + /* + * Name of log specification. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of log specification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Blob duration of specification. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** Creates an instance of LogSpecification class. */ + public LogSpecification() { + } + + /** + * 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..695173bb83a4f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsm.java @@ -0,0 +1,262 @@ +// 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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/ManagedHsmAction.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmAction.java new file mode 100644 index 0000000000000..64a99353f5cc5 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmAction.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.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedHsmAction model. */ +@Fluent +public final class ManagedHsmAction { + /* + * The type of action. + */ + @JsonProperty(value = "type") + private KeyRotationPolicyActionType type; + + /** Creates an instance of ManagedHsmAction class. */ + public ManagedHsmAction() { + } + + /** + * 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 ManagedHsmAction object itself. + */ + public ManagedHsmAction 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/ManagedHsmKey.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKey.java new file mode 100644 index 0000000000000..864349160c7f2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKey.java @@ -0,0 +1,193 @@ +// 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.Context; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmKeyInner; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmKeyProperties; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ManagedHsmKey. */ +public interface ManagedHsmKey { + /** + * 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 tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the attributes property: The attributes of the key. + * + * @return the attributes value. + */ + ManagedHsmKeyAttributes 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. + */ + ManagedHsmRotationPolicy 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. + */ + ManagedHsmKeyReleasePolicy releasePolicy(); + + /** + * Gets the inner com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmKeyInner object. + * + * @return the inner object. + */ + ManagedHsmKeyInner innerModel(); + + /** The entirety of the ManagedHsmKey definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The ManagedHsmKey definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedHsmKey definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ManagedHsmKey definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @return the next definition stage. + */ + WithProperties withExistingManagedHSM(String resourceGroupName, String name); + } + /** The stage of the ManagedHsmKey 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(ManagedHsmKeyProperties properties); + } + /** + * The stage of the ManagedHsmKey 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. + */ + ManagedHsmKey create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedHsmKey create(Context context); + } + /** The stage of the ManagedHsmKey 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. + */ + ManagedHsmKey refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedHsmKey refresh(Context context); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyAttributes.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyAttributes.java new file mode 100644 index 0000000000000..8d6f78c02400a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyAttributes.java @@ -0,0 +1,177 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The object attributes managed by the Azure Key Vault service. */ +@Fluent +public final class ManagedHsmKeyAttributes { + /* + * 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; + + /** Creates an instance of ManagedHsmKeyAttributes class. */ + public ManagedHsmKeyAttributes() { + } + + /** + * 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 ManagedHsmKeyAttributes object itself. + */ + public ManagedHsmKeyAttributes 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 ManagedHsmKeyAttributes object itself. + */ + public ManagedHsmKeyAttributes 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 ManagedHsmKeyAttributes object itself. + */ + public ManagedHsmKeyAttributes 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 ManagedHsmKeyAttributes object itself. + */ + public ManagedHsmKeyAttributes 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/ManagedHsmKeyCreateParameters.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyCreateParameters.java new file mode 100644 index 0000000000000..d8e1a61e7c992 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyCreateParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.keyvault.generated.fluent.models.ManagedHsmKeyProperties; +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 ManagedHsmKeyCreateParameters { + /* + * 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 ManagedHsmKeyProperties properties; + + /** Creates an instance of ManagedHsmKeyCreateParameters class. */ + public ManagedHsmKeyCreateParameters() { + } + + /** + * 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 ManagedHsmKeyCreateParameters object itself. + */ + public ManagedHsmKeyCreateParameters 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 ManagedHsmKeyProperties 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 ManagedHsmKeyCreateParameters object itself. + */ + public ManagedHsmKeyCreateParameters withProperties(ManagedHsmKeyProperties 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 ManagedHsmKeyCreateParameters")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedHsmKeyCreateParameters.class); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyListResult.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyListResult.java new file mode 100644 index 0000000000000..8d5ddd66aa4e8 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyListResult.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.resourcemanager.keyvault.generated.fluent.models.ManagedHsmKeyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The page of keys. */ +@Fluent +public final class ManagedHsmKeyListResult { + /* + * The key resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next page of keys. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ManagedHsmKeyListResult class. */ + public ManagedHsmKeyListResult() { + } + + /** + * 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 ManagedHsmKeyListResult object itself. + */ + public ManagedHsmKeyListResult 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 ManagedHsmKeyListResult object itself. + */ + public ManagedHsmKeyListResult 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/ManagedHsmKeyReleasePolicy.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyReleasePolicy.java new file mode 100644 index 0000000000000..60e913d8ef5af --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyReleasePolicy.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.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedHsmKeyReleasePolicy model. */ +@Fluent +public final class ManagedHsmKeyReleasePolicy { + /* + * 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; + + /** Creates an instance of ManagedHsmKeyReleasePolicy class. */ + public ManagedHsmKeyReleasePolicy() { + } + + /** + * 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 ManagedHsmKeyReleasePolicy object itself. + */ + public ManagedHsmKeyReleasePolicy 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 ManagedHsmKeyReleasePolicy object itself. + */ + public ManagedHsmKeyReleasePolicy 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/ManagedHsmKeyRotationPolicyAttributes.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyRotationPolicyAttributes.java new file mode 100644 index 0000000000000..6073807889735 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeyRotationPolicyAttributes.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.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedHsmKeyRotationPolicyAttributes model. */ +@Fluent +public final class ManagedHsmKeyRotationPolicyAttributes { + /* + * 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; + + /** Creates an instance of ManagedHsmKeyRotationPolicyAttributes class. */ + public ManagedHsmKeyRotationPolicyAttributes() { + } + + /** + * 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 ManagedHsmKeyRotationPolicyAttributes object itself. + */ + public ManagedHsmKeyRotationPolicyAttributes 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/ManagedHsmKeys.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeys.java new file mode 100644 index 0000000000000..25ea647ab5c79 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmKeys.java @@ -0,0 +1,158 @@ +// 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 ManagedHsmKeys. */ +public interface ManagedHsmKeys { + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String name, String keyName, Context context); + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM. + */ + ManagedHsmKey get(String resourceGroupName, String name, String keyName); + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String name); + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String name, Context context); + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM along with {@link Response}. + */ + Response getVersionWithResponse( + String resourceGroupName, String name, String keyName, String keyVersion, Context context); + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 managed HSM. + */ + ManagedHsmKey getVersion(String resourceGroupName, String name, String keyName, String keyVersion); + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listVersions(String resourceGroupName, String name, String keyName); + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listVersions(String resourceGroupName, String name, String keyName, Context context); + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @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 managed HSM along with {@link Response}. + */ + ManagedHsmKey getById(String id); + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @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 managed HSM along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagedHsmKey resource. + * + * @param name resource name. + * @return the first stage of the new ManagedHsmKey definition. + */ + ManagedHsmKey.DefinitionStages.Blank define(String name); +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmLifetimeAction.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmLifetimeAction.java new file mode 100644 index 0000000000000..5135a85d71471 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmLifetimeAction.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.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedHsmLifetimeAction model. */ +@Fluent +public final class ManagedHsmLifetimeAction { + /* + * The trigger of key rotation policy lifetimeAction. + */ + @JsonProperty(value = "trigger") + private ManagedHsmTrigger trigger; + + /* + * The action of key rotation policy lifetimeAction. + */ + @JsonProperty(value = "action") + private ManagedHsmAction action; + + /** Creates an instance of ManagedHsmLifetimeAction class. */ + public ManagedHsmLifetimeAction() { + } + + /** + * Get the trigger property: The trigger of key rotation policy lifetimeAction. + * + * @return the trigger value. + */ + public ManagedHsmTrigger trigger() { + return this.trigger; + } + + /** + * Set the trigger property: The trigger of key rotation policy lifetimeAction. + * + * @param trigger the trigger value to set. + * @return the ManagedHsmLifetimeAction object itself. + */ + public ManagedHsmLifetimeAction withTrigger(ManagedHsmTrigger trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the action property: The action of key rotation policy lifetimeAction. + * + * @return the action value. + */ + public ManagedHsmAction action() { + return this.action; + } + + /** + * Set the action property: The action of key rotation policy lifetimeAction. + * + * @param action the action value to set. + * @return the ManagedHsmLifetimeAction object itself. + */ + public ManagedHsmLifetimeAction withAction(ManagedHsmAction 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/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..a0228f7c3679b --- /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.resourcemanager.keyvault.generated.fluent.models.ManagedHsmInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of managed HSM Pools. */ +@Fluent +public final class ManagedHsmListResult { + /* + * 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; + + /** Creates an instance of ManagedHsmListResult class. */ + public ManagedHsmListResult() { + } + + /** + * 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..66fcf4a00ff40 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmProperties.java @@ -0,0 +1,338 @@ +// 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.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 { + /* + * 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; + + /** Creates an instance of ManagedHsmProperties class. */ + public ManagedHsmProperties() { + } + + /** + * 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..770d3137f670b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmResource.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.management.Resource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed HSM resource. */ +@Fluent +public class ManagedHsmResource extends Resource { + /* + * 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; + + /** Creates an instance of ManagedHsmResource class. */ + public ManagedHsmResource() { + } + + /** + * 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/ManagedHsmRotationPolicy.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmRotationPolicy.java new file mode 100644 index 0000000000000..6e7e561eff7ff --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmRotationPolicy.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ManagedHsmRotationPolicy model. */ +@Fluent +public final class ManagedHsmRotationPolicy { + /* + * The attributes of key rotation policy. + */ + @JsonProperty(value = "attributes") + private ManagedHsmKeyRotationPolicyAttributes attributes; + + /* + * The lifetimeActions for key rotation action. + */ + @JsonProperty(value = "lifetimeActions") + private List lifetimeActions; + + /** Creates an instance of ManagedHsmRotationPolicy class. */ + public ManagedHsmRotationPolicy() { + } + + /** + * Get the attributes property: The attributes of key rotation policy. + * + * @return the attributes value. + */ + public ManagedHsmKeyRotationPolicyAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: The attributes of key rotation policy. + * + * @param attributes the attributes value to set. + * @return the ManagedHsmRotationPolicy object itself. + */ + public ManagedHsmRotationPolicy withAttributes(ManagedHsmKeyRotationPolicyAttributes 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 ManagedHsmRotationPolicy object itself. + */ + public ManagedHsmRotationPolicy 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/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..3395025e7edfb --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSku.java @@ -0,0 +1,89 @@ +// 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.JsonProperty; + +/** SKU details. */ +@Fluent +public final class ManagedHsmSku { + /* + * 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; + + /** Creates an instance of ManagedHsmSku class. */ + public ManagedHsmSku() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedHsmSku.class); +} 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..33c3091c4a3ff --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSkuFamily.java @@ -0,0 +1,35 @@ +// 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; + +/** SKU Family of the managed HSM Pool. */ +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); + } + + /** + * Gets known ManagedHsmSkuFamily values. + * + * @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..7af95fc8c1c1b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmSkuName.java @@ -0,0 +1,51 @@ +// 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; + +/** SKU of the managed HSM Pool. */ +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) { + if (value == null) { + return null; + } + ManagedHsmSkuName[] items = ManagedHsmSkuName.values(); + for (ManagedHsmSkuName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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/ManagedHsmTrigger.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmTrigger.java new file mode 100644 index 0000000000000..5fdd5e3e9c262 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsmTrigger.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.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedHsmTrigger model. */ +@Fluent +public final class ManagedHsmTrigger { + /* + * 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; + + /** Creates an instance of ManagedHsmTrigger class. */ + public ManagedHsmTrigger() { + } + + /** + * 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 ManagedHsmTrigger object itself. + */ + public ManagedHsmTrigger 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 ManagedHsmTrigger object itself. + */ + public ManagedHsmTrigger 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/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..9903663c959aa --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ManagedHsms.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getDeletedWithResponse(String name, String location, 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); + + /** + * 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); + + /** + * Checks that the managed hsm name is valid and is not already in use. + * + * @param mhsmName The name of the managed hsm. + * @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 CheckMhsmNameAvailability operation response along with {@link Response}. + */ + Response checkMhsmNameAvailabilityWithResponse( + CheckMhsmNameAvailabilityParameters mhsmName, Context context); + + /** + * Checks that the managed hsm name is valid and is not already in use. + * + * @param mhsmName The name of the managed hsm. + * @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 CheckMhsmNameAvailability operation response. + */ + CheckMhsmNameAvailabilityResult checkMhsmNameAvailability(CheckMhsmNameAvailabilityParameters mhsmName); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..9709dc11cda86 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MetricSpecification.java @@ -0,0 +1,316 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Metric specification of operation. */ +@Fluent +public final class MetricSpecification { + /* + * 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; + + /** Creates an instance of MetricSpecification class. */ + public MetricSpecification() { + } + + /** + * 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..996547c58fa27 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmNetworkRuleSet.java @@ -0,0 +1,141 @@ +// 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.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 { + /* + * 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; + + /** Creates an instance of MhsmNetworkRuleSet class. */ + public MhsmNetworkRuleSet() { + } + + /** + * 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..ec42d3907f319 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint object properties. */ +@Immutable +public final class MhsmPrivateEndpoint { + /* + * Full identifier of the private endpoint resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of MhsmPrivateEndpoint class. */ + public MhsmPrivateEndpoint() { + } + + /** + * 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..305362f0fb8cb --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnection.java @@ -0,0 +1,365 @@ +// 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..24e592338aee1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionItem.java @@ -0,0 +1,166 @@ +// 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.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint connection item. */ +@Fluent +public final class MhsmPrivateEndpointConnectionItem { + /* + * 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 MhsmPrivateEndpointConnectionProperties innerProperties; + + /** Creates an instance of MhsmPrivateEndpointConnectionItem class. */ + public MhsmPrivateEndpointConnectionItem() { + } + + /** + * 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 MhsmPrivateEndpointConnectionItem object itself. + */ + public MhsmPrivateEndpointConnectionItem 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 MhsmPrivateEndpointConnectionItem object itself. + */ + public MhsmPrivateEndpointConnectionItem withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * 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..4b680d37ca55b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnections.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.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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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. + * @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 along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, String name, String privateEndpointConnectionName, 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); + + /** + * 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 along with {@link + * Response}. + */ + 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 along with {@link + * Response}. + */ + 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/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..0413d14382374 --- /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.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateEndpointConnectionInner; +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 { + /* + * 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; + + /** Creates an instance of MhsmPrivateEndpointConnectionsListResult class. */ + public MhsmPrivateEndpointConnectionsListResult() { + } + + /** + * 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..ee862f220a51c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsPutHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The MhsmPrivateEndpointConnectionsPutHeaders model. */ +@Fluent +public final class MhsmPrivateEndpointConnectionsPutHeaders { + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of MhsmPrivateEndpointConnectionsPutHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public MhsmPrivateEndpointConnectionsPutHeaders(HttpHeaders rawHeaders) { + String retryAfter = rawHeaders.getValue("Retry-After"); + if (retryAfter != null) { + this.retryAfter = Integer.parseInt(retryAfter); + } + this.azureAsyncOperation = rawHeaders.getValue("Azure-AsyncOperation"); + } + + /** + * 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..c897af0eb7801 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateEndpointConnectionsPutResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..03a72c29bf407 --- /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.resourcemanager.keyvault.generated.fluent.models.MhsmPrivateLinkResourceProperties; +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 { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private MhsmPrivateLinkResourceProperties innerProperties; + + /** Creates an instance of MhsmPrivateLinkResource class. */ + public MhsmPrivateLinkResource() { + } + + /** + * 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..54b4d09655f72 --- /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. + * @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 along with {@link Response}. + */ + Response listByMhsmResourceWithResponse( + String resourceGroupName, String name, 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 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); +} 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..993f2bc0ddcc0 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmPrivateLinkServiceConnectionState.java @@ -0,0 +1,106 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** An object that represents the approval state of the private link connection. */ +@Fluent +public final class MhsmPrivateLinkServiceConnectionState { + /* + * 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; + + /** Creates an instance of MhsmPrivateLinkServiceConnectionState class. */ + public MhsmPrivateLinkServiceConnectionState() { + } + + /** + * 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..05f8048b4e780 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmVirtualNetworkRule.java @@ -0,0 +1,61 @@ +// 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.JsonProperty; + +/** A rule governing the accessibility of a managed hsm pool from a specific virtual network. */ +@Fluent +public final class MhsmVirtualNetworkRule { + /* + * 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; + + /** Creates an instance of MhsmVirtualNetworkRule class. */ + public MhsmVirtualNetworkRule() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MhsmVirtualNetworkRule.class); +} 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..4958ef68b4f4d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/MhsmipRule.java @@ -0,0 +1,61 @@ +// 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.JsonProperty; + +/** A rule governing the accessibility of a managed HSM pool from a specific IP address or IP range. */ +@Fluent +public final class MhsmipRule { + /* + * 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; + + /** Creates an instance of MhsmipRule class. */ + public MhsmipRule() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MhsmipRule.class); +} 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..b418d9bf985a3 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleAction.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; + +/** + * The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass + * property has been evaluated. + */ +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); + } + + /** + * Gets known NetworkRuleAction values. + * + * @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..f9443c606d7d1 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleBypassOptions.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; + +/** + * Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default is + * 'AzureServices'. + */ +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); + } + + /** + * Gets known NetworkRuleBypassOptions values. + * + * @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..fb7fd74643587 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/NetworkRuleSet.java @@ -0,0 +1,141 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A set of rules governing the network accessibility of a vault. */ +@Fluent +public final class NetworkRuleSet { + /* + * 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; + + /** Creates an instance of NetworkRuleSet class. */ + public NetworkRuleSet() { + } + + /** + * 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..9a2fa20de9c8a --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Display metadata associated with the operation. */ +@Fluent +public final class OperationDisplay { + /* + * Service provider: Microsoft Key Vault. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of operation. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * 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..098ceb1ba19b3 --- /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.resourcemanager.keyvault.generated.fluent.models.OperationInner; +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 { + /* + * 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; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * 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..5649408ff97ca --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..b5e84938d639e --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Permissions the identity has for keys, secrets, certificates and storage. */ +@Fluent +public final class Permissions { + /* + * Permissions to keys + */ + @JsonProperty(value = "keys") + private List keys; + + /* + * Permissions to secrets + */ + @JsonProperty(value = "secrets") + private List secrets; + + /* + * Permissions to certificates + */ + @JsonProperty(value = "certificates") + private List certificates; + + /* + * Permissions to storage accounts + */ + @JsonProperty(value = "storage") + private List storage; + + /** Creates an instance of Permissions class. */ + public Permissions() { + } + + /** + * 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..3a49822d1c97a --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint object properties. */ +@Immutable +public final class PrivateEndpoint { + /* + * Full identifier of the private endpoint resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + + /** + * 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..b73273337614e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,324 @@ +// 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..2972bc2a7fc5d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionItem.java @@ -0,0 +1,166 @@ +// 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.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint connection item. */ +@Fluent +public final class PrivateEndpointConnectionItem { + /* + * 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; + + /** Creates an instance of PrivateEndpointConnectionItem class. */ + public PrivateEndpointConnectionItem() { + } + + /** + * 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..e153a95cba1f5 --- /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.resourcemanager.keyvault.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connections. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + /* + * 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; + + /** Creates an instance of PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + + /** + * 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..d87abc45ab17a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,51 @@ +// 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; + +/** The current provisioning state. */ +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); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @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..3906c59a9a0fa --- /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. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String vaultName, String privateEndpointConnectionName, 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 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/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..bb4ee0309de7f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsPutHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionsPutHeaders model. */ +@Fluent +public final class PrivateEndpointConnectionsPutHeaders { + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of PrivateEndpointConnectionsPutHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public PrivateEndpointConnectionsPutHeaders(HttpHeaders rawHeaders) { + String retryAfter = rawHeaders.getValue("Retry-After"); + if (retryAfter != null) { + this.retryAfter = Integer.parseInt(retryAfter); + } + this.azureAsyncOperation = rawHeaders.getValue("Azure-AsyncOperation"); + } + + /** + * 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..4612d5825548e --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointConnectionsPutResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..2952ac4428d43 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateEndpointServiceConnectionStatus.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The private endpoint connection status. */ +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); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @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..46dcfa43fb96b --- /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.resourcemanager.keyvault.generated.fluent.models.PrivateLinkResourceProperties; +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 { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /** Creates an instance of PrivateLinkResource class. */ + public PrivateLinkResource() { + } + + /** + * 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..2f1abe6dbc2b1 --- /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. + * @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 along with {@link Response}. + */ + Response listByVaultWithResponse( + String resourceGroupName, String vaultName, 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 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); +} 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..f97490798660f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,106 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** An object that represents the approval state of the private link connection. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * 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; + + /** Creates an instance of PrivateLinkServiceConnectionState class. */ + public PrivateLinkServiceConnectionState() { + } + + /** + * 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..a534fd339ed1f --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ProvisioningState.java @@ -0,0 +1,56 @@ +// 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; + +/** Provisioning state. */ +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); + } + + /** + * Gets known ProvisioningState values. + * + * @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/ProxyResourceWithoutSystemData.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ProxyResourceWithoutSystemData.java new file mode 100644 index 0000000000000..78f7d4d9f7f2d --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/ProxyResourceWithoutSystemData.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.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * Resource + * + *

Common fields that are returned in the response for all Azure Resource Manager resources. + */ +@Fluent +public class ProxyResourceWithoutSystemData extends ProxyResource { + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ProxyResourceWithoutSystemData class. */ + public ProxyResourceWithoutSystemData() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ProxyResourceWithoutSystemData object itself. + */ + public ProxyResourceWithoutSystemData withTags(Map tags) { + this.tags = tags; + 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/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..4a7cf4b4463a2 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/PublicNetworkAccess.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Control permission for data plane traffic coming from public networks while private endpoint is enabled. */ +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); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @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..9ccf03864ab67 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Reason.java @@ -0,0 +1,51 @@ +// 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; + +/** The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. */ +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) { + if (value == null) { + return null; + } + Reason[] items = Reason.values(); + for (Reason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..7335f9c937f2f --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of vault resources. */ +@Fluent +public final class ResourceListResult { + /* + * 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; + + /** Creates an instance of ResourceListResult class. */ + public ResourceListResult() { + } + + /** + * 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..52e97e0d83bbd --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The RotationPolicy model. */ +@Fluent +public final class RotationPolicy { + /* + * The attributes of key rotation policy. + */ + @JsonProperty(value = "attributes") + private KeyRotationPolicyAttributes attributes; + + /* + * The lifetimeActions for key rotation action. + */ + @JsonProperty(value = "lifetimeActions") + private List lifetimeActions; + + /** Creates an instance of RotationPolicy class. */ + public RotationPolicy() { + } + + /** + * 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..ae194e94c3166 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Secret.java @@ -0,0 +1,209 @@ +// 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..103721090b3fa --- /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; + +/** The secret management attributes. */ +@Fluent +public final class SecretAttributes extends Attributes { + /** Creates an instance of SecretAttributes class. */ + public SecretAttributes() { + } + + /** {@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..9b1937d13eab6 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretCreateOrUpdateParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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 { + /* + * 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; + + /** Creates an instance of SecretCreateOrUpdateParameters class. */ + public SecretCreateOrUpdateParameters() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretCreateOrUpdateParameters.class); +} 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..997fdae53e275 --- /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.resourcemanager.keyvault.generated.fluent.models.SecretInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of secrets. */ +@Fluent +public final class SecretListResult { + /* + * 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; + + /** Creates an instance of SecretListResult class. */ + public SecretListResult() { + } + + /** + * 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..6975d2ff0e1c7 --- /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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for patching a secret. */ +@Fluent +public final class SecretPatchParameters { + /* + * 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; + + /** Creates an instance of SecretPatchParameters class. */ + public SecretPatchParameters() { + } + + /** + * 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..e45d8010e4ff6 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the secret. */ +@Fluent +public final class SecretPatchProperties { + /* + * The value of the secret. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The content type of the secret. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /* + * The attributes of the secret. + */ + @JsonProperty(value = "attributes") + private SecretAttributes attributes; + + /** Creates an instance of SecretPatchProperties class. */ + public SecretPatchProperties() { + } + + /** + * 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..5486c609e9f33 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretPermissions.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.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); + } + + /** + * Gets known SecretPermissions values. + * + * @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..d98c9d41688a5 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SecretProperties.java @@ -0,0 +1,141 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the secret. */ +@Fluent +public final class SecretProperties { + /* + * The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is + * intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with + * vault secrets. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The content type of the secret. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /* + * The attributes of the secret. + */ + @JsonProperty(value = "attributes") + private SecretAttributes attributes; + + /* + * The URI to retrieve the current version of the secret. + */ + @JsonProperty(value = "secretUri", access = JsonProperty.Access.WRITE_ONLY) + private String secretUri; + + /* + * The URI to retrieve the specific version of the secret. + */ + @JsonProperty(value = "secretUriWithVersion", access = JsonProperty.Access.WRITE_ONLY) + private String secretUriWithVersion; + + /** Creates an instance of SecretProperties class. */ + public SecretProperties() { + } + + /** + * 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..83a6524e1dc02 --- /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. + * @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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, String secretName, 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. + */ + Secret get(String resourceGroupName, String vaultName, String secretName); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..7ee259b772c35 --- /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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** One property of operation, include log specifications. */ +@Fluent +public final class ServiceSpecification { + /* + * Log specifications of operation. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /* + * Metric specifications of operation. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** Creates an instance of ServiceSpecification class. */ + public ServiceSpecification() { + } + + /** + * 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..98e56c9d13aaf --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Sku.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.JsonProperty; + +/** SKU details. */ +@Fluent +public final class Sku { + /* + * 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; + + /** Creates an instance of Sku class. */ + public Sku() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); +} 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..2d46ff77ac38c --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SkuFamily.java @@ -0,0 +1,35 @@ +// 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; + +/** SKU family name. */ +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); + } + + /** + * Gets known SkuFamily values. + * + * @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..6bd69fc4854cf --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/SkuName.java @@ -0,0 +1,51 @@ +// 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; + +/** SKU name to specify whether the key vault is a standard vault or a premium vault. */ +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) { + if (value == null) { + return null; + } + SkuName[] items = SkuName.values(); + for (SkuName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..3045e096b037a --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/StoragePermissions.java @@ -0,0 +1,77 @@ +// 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); + } + + /** + * Gets known StoragePermissions values. + * + * @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..d42419007ca12 --- /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.fasterxml.jackson.annotation.JsonProperty; + +/** The Trigger model. */ +@Fluent +public final class Trigger { + /* + * 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; + + /** Creates an instance of Trigger class. */ + public Trigger() { + } + + /** + * 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..6e917dfe03f40 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/Vault.java @@ -0,0 +1,235 @@ +// 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..6d0f679140c88 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultAccessPolicyProperties.java @@ -0,0 +1,65 @@ +// 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.JsonProperty; +import java.util.List; + +/** Properties of the vault access policy. */ +@Fluent +public final class VaultAccessPolicyProperties { + /* + * An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same + * tenant ID as the key vault's tenant ID. + */ + @JsonProperty(value = "accessPolicies", required = true) + private List accessPolicies; + + /** Creates an instance of VaultAccessPolicyProperties class. */ + public VaultAccessPolicyProperties() { + } + + /** + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VaultAccessPolicyProperties.class); +} 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..81b9db33015d6 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultCheckNameAvailabilityParameters.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.JsonProperty; + +/** The parameters used to check the availability of the vault name. */ +@Fluent +public final class VaultCheckNameAvailabilityParameters { + /* + * The vault name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, Microsoft.KeyVault/vaults + */ + @JsonProperty(value = "type", required = true) + private String type = "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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VaultCheckNameAvailabilityParameters.class); +} 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..a4cb2de071d64 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultCreateOrUpdateParameters.java @@ -0,0 +1,122 @@ +// 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.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for creating or updating a vault. */ +@Fluent +public final class VaultCreateOrUpdateParameters { + /* + * The supported Azure location where the key vault should be created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * The tags that will be assigned to the key vault. + */ + @JsonProperty(value = "tags") + @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; + + /** Creates an instance of VaultCreateOrUpdateParameters class. */ + public VaultCreateOrUpdateParameters() { + } + + /** + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VaultCreateOrUpdateParameters.class); +} 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..38bc0d3deaccf --- /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.resourcemanager.keyvault.generated.fluent.models.VaultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of vaults. */ +@Fluent +public final class VaultListResult { + /* + * 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; + + /** Creates an instance of VaultListResult class. */ + public VaultListResult() { + } + + /** + * 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..3de2cdbd327a5 --- /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.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 { + /* + * 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; + + /** Creates an instance of VaultPatchParameters class. */ + public VaultPatchParameters() { + } + + /** + * 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..329a1b884bee0 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultPatchProperties.java @@ -0,0 +1,423 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** Properties of the vault. */ +@Fluent +public final class VaultPatchProperties { + /* + * The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + */ + @JsonProperty(value = "tenantId") + private UUID tenantId; + + /* + * SKU details + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same + * tenant ID as the key vault's tenant ID. + */ + @JsonProperty(value = "accessPolicies") + private List accessPolicies; + + /* + * Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from + * the key vault. + */ + @JsonProperty(value = "enabledForDeployment") + private Boolean enabledForDeployment; + + /* + * Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap + * keys. + */ + @JsonProperty(value = "enabledForDiskEncryption") + private Boolean enabledForDiskEncryption; + + /* + * Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. + */ + @JsonProperty(value = "enabledForTemplateDeployment") + private Boolean enabledForTemplateDeployment; + + /* + * Property to specify whether the 'soft delete' functionality is enabled for this key vault. Once set to true, it + * cannot be reverted to false. + */ + @JsonProperty(value = "enableSoftDelete") + private Boolean enableSoftDelete; + + /* + * Property that controls how data actions are authorized. When true, the key vault will use Role Based Access + * Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be + * ignored. 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; + + /** Creates an instance of VaultPatchProperties class. */ + public VaultPatchProperties() { + } + + /** + * 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. 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. 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..8e994dc1d7286 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultProperties.java @@ -0,0 +1,526 @@ +// 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.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** Properties of the vault. */ +@Fluent +public final class VaultProperties { + /* + * The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. + */ + @JsonProperty(value = "tenantId", required = true) + private UUID tenantId; + + /* + * SKU details + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * An array of 0 to 1024 identities that have access to the key vault. All identities in the array must use the + * same tenant ID as the key vault's tenant ID. When `createMode` is set to `recover`, access policies are not + * required. Otherwise, access policies are required. + */ + @JsonProperty(value = "accessPolicies") + private List accessPolicies; + + /* + * The URI of the vault for performing operations on keys and secrets. + */ + @JsonProperty(value = "vaultUri") + private String vaultUri; + + /* + * 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. 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; + + /** Creates an instance of VaultProperties class. */ + public VaultProperties() { + } + + /** + * 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. 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. 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VaultProperties.class); +} 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..d0603e36c706b --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VaultProvisioningState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the vault. */ +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); + } + + /** + * Gets known VaultProvisioningState values. + * + * @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..dd31ca6ea2d8a --- /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. + * @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 {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String vaultName, 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. + */ + void deleteByResourceGroup(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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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); + + /** + * 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 along with {@link Response}. + */ + Response updateAccessPolicyWithResponse( + String resourceGroupName, + String vaultName, + AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters, + 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getDeletedWithResponse(String vaultName, String location, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + VaultCheckNameAvailabilityParameters vaultName, 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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 {@link 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..9657b11f9aab9 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/main/java/com/azure/resourcemanager/keyvault/generated/models/VirtualNetworkRule.java @@ -0,0 +1,89 @@ +// 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.JsonProperty; + +/** A rule governing the accessibility of a vault from a specific virtual network. */ +@Fluent +public final class VirtualNetworkRule { + /* + * Full resource id of a vnet subnet, such as + * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /* + * Property to specify whether NRP will ignore the check if parent subnet has serviceEndpoints configured. + */ + @JsonProperty(value = "ignoreMissingVnetServiceEndpoint") + private Boolean ignoreMissingVnetServiceEndpoint; + + /** Creates an instance of VirtualNetworkRule class. */ + public VirtualNetworkRule() { + } + + /** + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRule.class); +} 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..437a62e04b89a --- /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/stable/2022-11-01/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..6502cf46b5f11 --- /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/stable/2022-11-01/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..a97129a9b6c25 --- /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/stable/2022-11-01/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..ca7f7e4a7d519 --- /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/stable/2022-11-01/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..c50a41decb3aa --- /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/stable/2022-11-01/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/ManagedHsmKeysCreateIfNotExistSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysCreateIfNotExistSamples.java new file mode 100644 index 0000000000000..f6154b6c692f0 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysCreateIfNotExistSamples.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.ManagedHsmKeyProperties; +import com.azure.resourcemanager.keyvault.generated.models.JsonWebKeyType; + +/** Samples for ManagedHsmKeys CreateIfNotExist. */ +public final class ManagedHsmKeysCreateIfNotExistSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/managedHsmCreateKey.json + */ + /** + * Sample code: Create a key. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void createAKey(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .managedHsmKeys() + .define("sample-key-name") + .withExistingManagedHSM("sample-group", "sample-managedhsm-name") + .withProperties(new ManagedHsmKeyProperties().withKty(JsonWebKeyType.RSA)) + .create(); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysGetSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysGetSamples.java new file mode 100644 index 0000000000000..c7070fae7af63 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysGetSamples.java @@ -0,0 +1,24 @@ +// 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 ManagedHsmKeys Get. */ +public final class ManagedHsmKeysGetSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/managedHsmGetKey.json + */ + /** + * Sample code: Get a key. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void getAKey(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .managedHsmKeys() + .getWithResponse("sample-group", "sample-managedhsm-name", "sample-key-name", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysGetVersionSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysGetVersionSamples.java new file mode 100644 index 0000000000000..4cab925afb342 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysGetVersionSamples.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 ManagedHsmKeys GetVersion. */ +public final class ManagedHsmKeysGetVersionSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/managedHsmGetKeyVersion.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 + .managedHsmKeys() + .getVersionWithResponse( + "sample-group", + "sample-managedhsm-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/ManagedHsmKeysListSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysListSamples.java new file mode 100644 index 0000000000000..dd520f576ff67 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysListSamples.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 ManagedHsmKeys List. */ +public final class ManagedHsmKeysListSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/managedHsmListKeys.json + */ + /** + * Sample code: List keys in the managed HSM. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listKeysInTheManagedHSM(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager.managedHsmKeys().list("sample-group", "sample-managedhsm-name", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysListVersionsSamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysListVersionsSamples.java new file mode 100644 index 0000000000000..19f89330e19f3 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmKeysListVersionsSamples.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 ManagedHsmKeys ListVersions. */ +public final class ManagedHsmKeysListVersionsSamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/managedHsmListKeyVersions.json + */ + /** + * Sample code: List key versions in the managed HSM. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void listKeyVersionsInTheManagedHSM( + com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .managedHsmKeys() + .listVersions("sample-group", "sample-managedhsm-name", "sample-key-name", Context.NONE); + } +} diff --git a/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsCheckMhsmNameAvailabilitySamples.java b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsCheckMhsmNameAvailabilitySamples.java new file mode 100644 index 0000000000000..bd0dc8e7ecda9 --- /dev/null +++ b/sdk/keyvault/azure-resourcemanager-keyvault-generated/src/samples/java/com/azure/resourcemanager/keyvault/generated/generated/ManagedHsmsCheckMhsmNameAvailabilitySamples.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.CheckMhsmNameAvailabilityParameters; + +/** Samples for ManagedHsms CheckMhsmNameAvailability. */ +public final class ManagedHsmsCheckMhsmNameAvailabilitySamples { + /* + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2022-11-01/examples/ManagedHsm_checkMhsmNameAvailability.json + */ + /** + * Sample code: Validate a managed hsm name. + * + * @param manager Entry point to KeyVaultManager. + */ + public static void validateAManagedHsmName(com.azure.resourcemanager.keyvault.generated.KeyVaultManager manager) { + manager + .managedHsms() + .checkMhsmNameAvailabilityWithResponse( + new CheckMhsmNameAvailabilityParameters().withName("sample-mhsm"), 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..711adc38aba5c --- /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/stable/2022-11-01/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..cec704958bab5 --- /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/stable/2022-11-01/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..b6802bbc6d34a --- /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/stable/2022-11-01/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..6a248fcdb3817 --- /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/stable/2022-11-01/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..b913bd6af53cc --- /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/stable/2022-11-01/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..400fff88c7195 --- /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/stable/2022-11-01/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..cb033395a726f --- /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/stable/2022-11-01/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..f4231991f8017 --- /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/stable/2022-11-01/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..3a86ad0c6b53f --- /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/stable/2022-11-01/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..1e4ed66cae42b --- /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/stable/2022-11-01/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..3084f6913170f --- /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/stable/2022-11-01/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..a2f1b26dfa814 --- /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/stable/2022-11-01/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..04cf724a18413 --- /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/stable/2022-11-01/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..f7b1796ecccd1 --- /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/stable/2022-11-01/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..148b806a2a9c8 --- /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/stable/2022-11-01/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..eec78ee8a2846 --- /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/stable/2022-11-01/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..d55265da9569a --- /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/stable/2022-11-01/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..7b21c49af8265 --- /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/stable/2022-11-01/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..800aeccde2d30 --- /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/stable/2022-11-01/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..a227c5ad51d8a --- /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/stable/2022-11-01/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..452728424bbea --- /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/stable/2022-11-01/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..27ec08ff7e969 --- /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/stable/2022-11-01/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..7e1c58ac23575 --- /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/stable/2022-11-01/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..17f1f077be8e7 --- /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/stable/2022-11-01/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..09b4f2f085c55 --- /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/stable/2022-11-01/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..3bf4c7a8dd3d2 --- /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/stable/2022-11-01/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/stable/2022-11-01/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..f3b590e4c6037 --- /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/stable/2022-11-01/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().deleteByResourceGroupWithResponse("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..1596422c27382 --- /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/stable/2022-11-01/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..648faa4d67643 --- /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/stable/2022-11-01/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..76deebde55f3f --- /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/stable/2022-11-01/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..fda5dd166e0b2 --- /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/stable/2022-11-01/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..530da70f80cf5 --- /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/stable/2022-11-01/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..a4fa64df76eea --- /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/stable/2022-11-01/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..a3b94f096f29a --- /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/stable/2022-11-01/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..c127d98b031d0 --- /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/stable/2022-11-01/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..3e0c4e1e0c618 --- /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/stable/2022-11-01/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 02679a8b049df..3b9cf781f063f 100644 --- a/sdk/keyvault/ci.yml +++ b/sdk/keyvault/ci.yml @@ -54,34 +54,37 @@ pr: - sdk/keyvault/azure-security-test-keyvault-jca/pom.xml parameters: -- name: release_azuresecuritykeyvaultadministration - displayName: 'azure-security-keyvault-administration' - type: boolean - default: true -- name: release_azuresecuritykeyvaultcertificates - displayName: 'azure-security-keyvault-certificates' - type: boolean - default: true -- name: release_azuresecuritykeyvaultjca - displayName: 'azure-security-keyvault-jca' - type: boolean - default: true -- name: release_azuresecuritykeyvaultkeys - displayName: 'azure-security-keyvault-keys' - type: boolean - default: true -- name: release_azuresecuritykeyvaultsecrets - displayName: 'azure-security-keyvault-secrets' - type: boolean - default: true - + - name: release_azuresecuritykeyvaultadministration + displayName: azure-security-keyvault-administration + type: boolean + default: true + - name: release_azuresecuritykeyvaultcertificates + displayName: azure-security-keyvault-certificates + type: boolean + default: true + - name: release_azuresecuritykeyvaultjca + displayName: azure-security-keyvault-jca + type: boolean + default: true + - name: release_azuresecuritykeyvaultkeys + displayName: azure-security-keyvault-keys + type: boolean + default: true + - name: release_azuresecuritykeyvaultsecrets + displayName: azure-security-keyvault-secrets + type: boolean + default: true + - name: release_azureresourcemanagerkeyvaultgenerated + displayName: azure-resourcemanager-keyvault-generated + type: boolean + default: false extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: keyvault EnableBatchRelease: true - AdditionalLintingOptions: '-DcreateSourcesJar=false' + AdditionalLintingOptions: -DcreateSourcesJar=false Artifacts: - name: azure-security-keyvault-administration groupId: com.azure @@ -103,9 +106,12 @@ extends: groupId: com.azure safeName: azuresecuritykeyvaultsecrets releaseInBatch: ${{ parameters.release_azuresecuritykeyvaultsecrets }} + - name: azure-resourcemanager-keyvault-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerkeyvaultgenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagerkeyvaultgenerated }} AdditionalModules: - name: azure-security-keyvault-perf groupId: com.azure - # required by the above perf library - name: perf-test-core groupId: com.azure diff --git a/sdk/keyvault/pom.xml b/sdk/keyvault/pom.xml index 2a0aaae574e1c..3a416cfdd4141 100644 --- a/sdk/keyvault/pom.xml +++ b/sdk/keyvault/pom.xml @@ -9,20 +9,21 @@ 1.0.0 - microsoft-azure-keyvault-webkey - 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-resourcemanager-keyvault-generated + azure-security-keyvault-administration + azure-security-keyvault-certificates azure-security-keyvault-jca azure-security-keyvault-keys - azure-security-keyvault-secrets 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 + microsoft-azure-keyvault-webkey