diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md index e36affd5a95d..f4e5443ec51b 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md @@ -1,14 +1,74 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-02-21) + +- Azure Resource Manager AppConfiguration client library for Java. This package contains Microsoft Azure SDK for AppConfiguration Management SDK. Package tag package-preview-2024-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.SasTokenGenerationParameters` was added + +* `models.SasKindInfo` was added + +* `models.SasStatus` was added + +* `models.TelemetryProperties` was added + +* `models.ExperimentationProperties` was added + +* `models.ResourceType` was added + +* `models.SasTokenScope` was added + +* `models.SnapshotSasTokenScope` was added + +* `models.KvSasTokenScope` was added + +* `models.SasKind` was added + +* `models.ResetSasKindParameters` was added + +* `models.SasTokenGenerationResult` was added + +* `models.SasProperties` was added -### Bugs Fixed +#### `models.ConfigurationStoreUpdateParameters` was modified + +* `sas()` was added +* `withExperimentation(models.ExperimentationProperties)` was added +* `withTelemetry(models.TelemetryProperties)` was added +* `withSas(models.SasProperties)` was added +* `experimentation()` was added +* `telemetry()` was added + +#### `models.ConfigurationStores` was modified + +* `generateSasTokenWithResponse(java.lang.String,java.lang.String,models.SasTokenGenerationParameters,com.azure.core.util.Context)` was added +* `resetSasKindWithResponse(java.lang.String,java.lang.String,models.ResetSasKindParameters,com.azure.core.util.Context)` was added +* `generateSasToken(java.lang.String,java.lang.String,models.SasTokenGenerationParameters)` was added +* `resetSasKind(java.lang.String,java.lang.String,models.ResetSasKindParameters)` was added + +#### `models.ConfigurationStore$Definition` was modified + +* `withSas(models.SasProperties)` was added +* `withExperimentation(models.ExperimentationProperties)` was added +* `withTelemetry(models.TelemetryProperties)` was added + +#### `models.ConfigurationStore$Update` was modified + +* `withSas(models.SasProperties)` was added +* `withExperimentation(models.ExperimentationProperties)` was added +* `withTelemetry(models.TelemetryProperties)` was added + +#### `models.ConfigurationStore` was modified -### Other Changes +* `generateSasToken(models.SasTokenGenerationParameters)` was added +* `telemetry()` was added +* `resetSasKindWithResponse(models.ResetSasKindParameters,com.azure.core.util.Context)` was added +* `experimentation()` was added +* `resetSasKind(models.ResetSasKindParameters)` was added +* `generateSasTokenWithResponse(models.SasTokenGenerationParameters,com.azure.core.util.Context)` was added +* `sas()` was added ## 1.0.0 (2024-11-20) diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md index 2c7094dfb0c3..c8f7b1971304 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AppConfiguration client library for Java. -This package contains Microsoft Azure SDK for AppConfiguration Management SDK. Package tag package-2024-05-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for AppConfiguration Management SDK. Package tag package-preview-2024-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-appconfiguration - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ AppConfigurationManager manager = AppConfigurationManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/SAMPLE.md b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/SAMPLE.md index 598d916e82b5..d50fb6d49b86 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/SAMPLE.md +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/SAMPLE.md @@ -5,6 +5,7 @@ - [Create](#configurationstores_create) - [Delete](#configurationstores_delete) +- [GenerateSasToken](#configurationstores_generatesastoken) - [GetByResourceGroup](#configurationstores_getbyresourcegroup) - [GetDeleted](#configurationstores_getdeleted) - [List](#configurationstores_list) @@ -13,6 +14,7 @@ - [ListKeys](#configurationstores_listkeys) - [PurgeDeleted](#configurationstores_purgedeleted) - [RegenerateKey](#configurationstores_regeneratekey) +- [ResetSasKind](#configurationstores_resetsaskind) - [Update](#configurationstores_update) ## KeyValues @@ -55,10 +57,14 @@ ```java import com.azure.resourcemanager.appconfiguration.models.AuthenticationMode; import com.azure.resourcemanager.appconfiguration.models.DataPlaneProxyProperties; +import com.azure.resourcemanager.appconfiguration.models.ExperimentationProperties; import com.azure.resourcemanager.appconfiguration.models.IdentityType; import com.azure.resourcemanager.appconfiguration.models.PrivateLinkDelegation; import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; +import com.azure.resourcemanager.appconfiguration.models.SasProperties; +import com.azure.resourcemanager.appconfiguration.models.SasStatus; import com.azure.resourcemanager.appconfiguration.models.Sku; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; import com.azure.resourcemanager.appconfiguration.models.UserIdentity; import java.util.HashMap; import java.util.Map; @@ -69,7 +75,7 @@ import java.util.Map; public final class ConfigurationStoresCreateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreate.json */ /** @@ -90,7 +96,7 @@ public final class ConfigurationStoresCreateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateWithIdentity.json */ /** @@ -115,7 +121,7 @@ public final class ConfigurationStoresCreateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateWithDataPlaneProxy.json */ /** @@ -137,7 +143,7 @@ public final class ConfigurationStoresCreateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateWithLocalAuthDisabled.json */ /** @@ -156,6 +162,53 @@ public final class ConfigurationStoresCreateSamples { .create(); } + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ + * ConfigurationStoresCreateWithTelemetryAndExperimentation.json + */ + /** + * Sample code: ConfigurationStores_Create_With_Telemetry_And_Experimentation. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresCreateWithTelemetryAndExperimentation( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .define("contoso") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard")) + .withTags(mapOf("myTag", "myTagValue")) + .withTelemetry(new TelemetryProperties().withResourceId( + "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/microsoft.insights/components/appInsightsName")) + .withExperimentation(new ExperimentationProperties().withResourceId( + "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/SplitIO.Experimentation/experimentationWorkspaces/myWorkspaceName") + .withDataPlaneEndpoint("https://asi.eu.az.split.io")) + .create(); + } + + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ + * ConfigurationStoresCreateWithSasEnabled.json + */ + /** + * Sample code: ConfigurationStores_Create_With_Sas_Auth_Enabled. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresCreateWithSasAuthEnabled( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .define("contoso") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard")) + .withSas(new SasProperties().withStatus(SasStatus.ENABLED)) + .create(); + } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { @@ -179,7 +232,7 @@ public final class ConfigurationStoresCreateSamples { public final class ConfigurationStoresDeleteSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresDelete.json */ /** @@ -194,6 +247,45 @@ public final class ConfigurationStoresDeleteSamples { } ``` +### ConfigurationStores_GenerateSasToken + +```java +import com.azure.resourcemanager.appconfiguration.models.KvSasTokenScope; +import com.azure.resourcemanager.appconfiguration.models.SasKind; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for ConfigurationStores GenerateSasToken. + */ +public final class ConfigurationStoresGenerateSasTokenSamples { + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ + * ConfigurationStoresGenerateSasToken.json + */ + /** + * Sample code: ConfigurationStores_GenerateSasToken. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresGenerateSasToken( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .generateSasTokenWithResponse("myResourceGroup", "contoso", + new SasTokenGenerationParameters() + .withSasTokenScope(new KvSasTokenScope().withKey("fakeTokenPlaceholder") + .withLabel("prod") + .withTags(Arrays.asList("group=test-group", "region=eastus"))) + .withExpires(OffsetDateTime.parse("2024-09-01T00:00:00.0000000Z")) + .withCacheControlMaxAge(3600.0F) + .withKind(SasKind.PRIMARY), + com.azure.core.util.Context.NONE); + } +} +``` + ### ConfigurationStores_GetByResourceGroup ```java @@ -203,7 +295,7 @@ public final class ConfigurationStoresDeleteSamples { public final class ConfigurationStoresGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresGet.json */ /** @@ -228,7 +320,7 @@ public final class ConfigurationStoresGetByResourceGroupSamples { public final class ConfigurationStoresGetDeletedSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * DeletedConfigurationStoresGet.json */ /** @@ -252,7 +344,7 @@ public final class ConfigurationStoresGetDeletedSamples { public final class ConfigurationStoresListSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresList.json */ /** @@ -276,7 +368,7 @@ public final class ConfigurationStoresListSamples { public final class ConfigurationStoresListByResourceGroupSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresListByResourceGroup.json */ /** @@ -300,7 +392,7 @@ public final class ConfigurationStoresListByResourceGroupSamples { public final class ConfigurationStoresListDeletedSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * DeletedConfigurationStoresList.json */ /** @@ -324,7 +416,7 @@ public final class ConfigurationStoresListDeletedSamples { public final class ConfigurationStoresListKeysSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresListKeys.json */ /** @@ -348,7 +440,7 @@ public final class ConfigurationStoresListKeysSamples { public final class ConfigurationStoresPurgeDeletedSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * DeletedConfigurationStoresPurge.json */ /** @@ -374,7 +466,7 @@ import com.azure.resourcemanager.appconfiguration.models.RegenerateKeyParameters public final class ConfigurationStoresRegenerateKeySamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresRegenerateKey.json */ /** @@ -391,12 +483,43 @@ public final class ConfigurationStoresRegenerateKeySamples { } ``` +### ConfigurationStores_ResetSasKind + +```java +import com.azure.resourcemanager.appconfiguration.models.ResetSasKindParameters; +import com.azure.resourcemanager.appconfiguration.models.SasKind; + +/** + * Samples for ConfigurationStores ResetSasKind. + */ +public final class ConfigurationStoresResetSasKindSamples { + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ + * ConfigurationStoresResetSasKind.json + */ + /** + * Sample code: ConfigurationStores_ResetSasKind. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void + configurationStoresResetSasKind(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .resetSasKindWithResponse("myResourceGroup", "contoso", + new ResetSasKindParameters().withName(SasKind.PRIMARY), com.azure.core.util.Context.NONE); + } +} +``` + ### ConfigurationStores_Update ```java import com.azure.resourcemanager.appconfiguration.models.ConfigurationStore; import com.azure.resourcemanager.appconfiguration.models.IdentityType; import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; +import com.azure.resourcemanager.appconfiguration.models.SasProperties; +import com.azure.resourcemanager.appconfiguration.models.SasStatus; import com.azure.resourcemanager.appconfiguration.models.Sku; import com.azure.resourcemanager.appconfiguration.models.UserIdentity; import java.util.HashMap; @@ -408,7 +531,7 @@ import java.util.Map; public final class ConfigurationStoresUpdateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresUpdateDisableLocalAuth.json */ /** @@ -426,7 +549,7 @@ public final class ConfigurationStoresUpdateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresUpdate.json */ /** @@ -444,7 +567,7 @@ public final class ConfigurationStoresUpdateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresUpdateWithIdentity.json */ /** @@ -467,6 +590,27 @@ public final class ConfigurationStoresUpdateSamples { .apply(); } + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ + * ConfigurationStoresUpdateEnableSas.json + */ + /** + * Sample code: ConfigurationStores_Update_Enable_Sas_Auth. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresUpdateEnableSasAuth( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + ConfigurationStore resource = manager.configurationStores() + .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSku(new Sku().withName("Standard")) + .withSas(new SasProperties().withStatus(SasStatus.ENABLED)) + .apply(); + } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { @@ -493,7 +637,7 @@ import java.util.Map; public final class KeyValuesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateKeyValue.json */ /** @@ -534,7 +678,7 @@ public final class KeyValuesCreateOrUpdateSamples { public final class KeyValuesDeleteSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresDeleteKeyValue.json */ /** @@ -557,7 +701,7 @@ public final class KeyValuesDeleteSamples { public final class KeyValuesGetSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresGetKeyValue.json */ /** @@ -584,7 +728,7 @@ import com.azure.resourcemanager.appconfiguration.models.ConfigurationResourceTy public final class OperationsCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * CheckNameAvailable.json */ /** @@ -603,7 +747,7 @@ public final class OperationsCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * CheckNameNotAvailable.json */ /** @@ -631,7 +775,7 @@ public final class OperationsCheckNameAvailabilitySamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * OperationsList.json */ /** @@ -657,7 +801,7 @@ import com.azure.resourcemanager.appconfiguration.models.ConfigurationResourceTy public final class OperationsRegionalCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * RegionalCheckNameAvailable.json */ /** @@ -676,7 +820,7 @@ public final class OperationsRegionalCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * RegionalCheckNameNotAvailable.json */ /** @@ -708,7 +852,7 @@ import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConne public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresUpdatePrivateEndpointConnection.json */ /** @@ -739,7 +883,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { public final class PrivateEndpointConnectionsDeleteSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresDeletePrivateEndpointConnection.json */ /** @@ -764,7 +908,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresGetPrivateEndpointConnection.json */ /** @@ -789,7 +933,7 @@ public final class PrivateEndpointConnectionsGetSamples { public final class PrivateEndpointConnectionsListByConfigurationStoreSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresListPrivateEndpointConnections.json */ /** @@ -814,7 +958,7 @@ public final class PrivateEndpointConnectionsListByConfigurationStoreSamples { public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * PrivateLinkResourceGet.json */ /** @@ -839,7 +983,7 @@ public final class PrivateLinkResourcesGetSamples { public final class PrivateLinkResourcesListByConfigurationStoreSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * PrivateLinkResourcesListByConfigurationStore.json */ /** @@ -864,7 +1008,7 @@ public final class PrivateLinkResourcesListByConfigurationStoreSamples { public final class ReplicasCreateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateReplica.json */ /** @@ -891,7 +1035,7 @@ public final class ReplicasCreateSamples { public final class ReplicasDeleteSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresDeleteReplica.json */ /** @@ -914,7 +1058,7 @@ public final class ReplicasDeleteSamples { public final class ReplicasGetSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresGetReplica.json */ /** @@ -938,7 +1082,7 @@ public final class ReplicasGetSamples { public final class ReplicasListByConfigurationStoreSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresListReplicas.json */ /** @@ -966,7 +1110,7 @@ import java.util.Arrays; public final class SnapshotsCreateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateSnapshot.json */ /** @@ -994,7 +1138,7 @@ public final class SnapshotsCreateSamples { public final class SnapshotsGetSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresGetSnapshot.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml index 60248016e950..05cf82e4a81d 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for AppConfiguration Management - This package contains Microsoft Azure SDK for AppConfiguration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-05-01. + This package contains Microsoft Azure SDK for AppConfiguration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2024-06. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true false diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/AppConfigurationManager.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/AppConfigurationManager.java index f53f5e8c88e0..3fdff40678dc 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/AppConfigurationManager.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/AppConfigurationManager.java @@ -22,6 +22,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.appconfiguration.fluent.AppConfigurationManagementClient; import com.azure.resourcemanager.appconfiguration.implementation.AppConfigurationManagementClientBuilder; @@ -43,6 +44,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -116,6 +118,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-appconfiguration.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -223,12 +228,14 @@ public AppConfigurationManager authenticate(TokenCredential credential, AzurePro Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.appconfiguration") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/ConfigurationStoresClient.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/ConfigurationStoresClient.java index 3ef77962e3ad..68feb4a7a156 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/ConfigurationStoresClient.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/ConfigurationStoresClient.java @@ -14,8 +14,11 @@ import com.azure.resourcemanager.appconfiguration.fluent.models.ApiKeyInner; import com.azure.resourcemanager.appconfiguration.fluent.models.ConfigurationStoreInner; import com.azure.resourcemanager.appconfiguration.fluent.models.DeletedConfigurationStoreInner; +import com.azure.resourcemanager.appconfiguration.fluent.models.SasTokenGenerationResultInner; import com.azure.resourcemanager.appconfiguration.models.ConfigurationStoreUpdateParameters; import com.azure.resourcemanager.appconfiguration.models.RegenerateKeyParameters; +import com.azure.resourcemanager.appconfiguration.models.ResetSasKindParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationParameters; /** * An instance of this class provides access to all the operations defined in ConfigurationStoresClient. @@ -341,6 +344,68 @@ Response regenerateKeyWithResponse(String resourceGroupName, String ApiKeyInner regenerateKey(String resourceGroupName, String configStoreName, RegenerateKeyParameters regenerateKeyParameters); + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @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 result of a request to generate a SAS token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateSasTokenWithResponse(String resourceGroupName, + String configStoreName, SasTokenGenerationParameters sasTokenGenerationParameters, Context context); + + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to generate a SAS token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SasTokenGenerationResultInner generateSasToken(String resourceGroupName, String configStoreName, + SasTokenGenerationParameters sasTokenGenerationParameters); + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @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 configuration store along with all resource properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response resetSasKindWithResponse(String resourceGroupName, String configStoreName, + ResetSasKindParameters resetSasKindParameters, Context context); + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration store along with all resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationStoreInner resetSasKind(String resourceGroupName, String configStoreName, + ResetSasKindParameters resetSasKindParameters); + /** * Gets information about the deleted configuration stores in a subscription. * diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStoreInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStoreInner.java index 1cdf66403c68..e13b233a1a40 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStoreInner.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStoreInner.java @@ -14,11 +14,14 @@ import com.azure.resourcemanager.appconfiguration.models.CreateMode; import com.azure.resourcemanager.appconfiguration.models.DataPlaneProxyProperties; import com.azure.resourcemanager.appconfiguration.models.EncryptionProperties; +import com.azure.resourcemanager.appconfiguration.models.ExperimentationProperties; import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnectionReference; import com.azure.resourcemanager.appconfiguration.models.ProvisioningState; import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; +import com.azure.resourcemanager.appconfiguration.models.SasProperties; import com.azure.resourcemanager.appconfiguration.models.Sku; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -263,7 +266,7 @@ public ConfigurationStoreInner withPublicNetworkAccess(PublicNetworkAccess publi } /** - * Get the disableLocalAuth property: Disables all authentication methods other than AAD authentication. + * Get the disableLocalAuth property: Disables access key authentication. * * @return the disableLocalAuth value. */ @@ -272,7 +275,7 @@ public Boolean disableLocalAuth() { } /** - * Set the disableLocalAuth property: Disables all authentication methods other than AAD authentication. + * Set the disableLocalAuth property: Disables access key authentication. * * @param disableLocalAuth the disableLocalAuth value to set. * @return the ConfigurationStoreInner object itself. @@ -285,6 +288,29 @@ public ConfigurationStoreInner withDisableLocalAuth(Boolean disableLocalAuth) { return this; } + /** + * Get the sas property: The SAS authentication settings of the configuration store. + * + * @return the sas value. + */ + public SasProperties sas() { + return this.innerProperties() == null ? null : this.innerProperties().sas(); + } + + /** + * Set the sas property: The SAS authentication settings of the configuration store. + * + * @param sas the sas value to set. + * @return the ConfigurationStoreInner object itself. + */ + public ConfigurationStoreInner withSas(SasProperties sas) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationStoreProperties(); + } + this.innerProperties().withSas(sas); + return this; + } + /** * Get the softDeleteRetentionInDays property: The amount of time in days that the configuration store will be * retained when it is soft deleted. @@ -383,6 +409,54 @@ public ConfigurationStoreInner withCreateMode(CreateMode createMode) { return this; } + /** + * Get the telemetry property: Property specifying the configuration of telemetry for this configuration store. + * + * @return the telemetry value. + */ + public TelemetryProperties telemetry() { + return this.innerProperties() == null ? null : this.innerProperties().telemetry(); + } + + /** + * Set the telemetry property: Property specifying the configuration of telemetry for this configuration store. + * + * @param telemetry the telemetry value to set. + * @return the ConfigurationStoreInner object itself. + */ + public ConfigurationStoreInner withTelemetry(TelemetryProperties telemetry) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationStoreProperties(); + } + this.innerProperties().withTelemetry(telemetry); + return this; + } + + /** + * Get the experimentation property: Property specifying the configuration of experimentation for this configuration + * store. + * + * @return the experimentation value. + */ + public ExperimentationProperties experimentation() { + return this.innerProperties() == null ? null : this.innerProperties().experimentation(); + } + + /** + * Set the experimentation property: Property specifying the configuration of experimentation for this configuration + * store. + * + * @param experimentation the experimentation value to set. + * @return the ConfigurationStoreInner object itself. + */ + public ConfigurationStoreInner withExperimentation(ExperimentationProperties experimentation) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationStoreProperties(); + } + this.innerProperties().withExperimentation(experimentation); + return this; + } + /** * Validates the instance. * diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStoreProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStoreProperties.java index eec6c2d78117..694f3e3fda7d 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStoreProperties.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStoreProperties.java @@ -13,9 +13,12 @@ import com.azure.resourcemanager.appconfiguration.models.CreateMode; import com.azure.resourcemanager.appconfiguration.models.DataPlaneProxyProperties; import com.azure.resourcemanager.appconfiguration.models.EncryptionProperties; +import com.azure.resourcemanager.appconfiguration.models.ExperimentationProperties; import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnectionReference; import com.azure.resourcemanager.appconfiguration.models.ProvisioningState; import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; +import com.azure.resourcemanager.appconfiguration.models.SasProperties; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -56,10 +59,15 @@ public final class ConfigurationStoreProperties implements JsonSerializable e.validate()); } + if (sas() != null) { + sas().validate(); + } if (dataPlaneProxy() != null) { dataPlaneProxy().validate(); } + if (telemetry() != null) { + telemetry().validate(); + } + if (experimentation() != null) { + experimentation().validate(); + } } /** @@ -298,10 +387,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); + jsonWriter.writeJsonField("sas", this.sas); jsonWriter.writeNumberField("softDeleteRetentionInDays", this.softDeleteRetentionInDays); jsonWriter.writeBooleanField("enablePurgeProtection", this.enablePurgeProtection); jsonWriter.writeJsonField("dataPlaneProxy", this.dataPlaneProxy); jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeJsonField("telemetry", this.telemetry); + jsonWriter.writeJsonField("experimentation", this.experimentation); return jsonWriter.writeEndObject(); } @@ -340,6 +432,8 @@ public static ConfigurationStoreProperties fromJson(JsonReader jsonReader) throw } else if ("disableLocalAuth".equals(fieldName)) { deserializedConfigurationStoreProperties.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); + } else if ("sas".equals(fieldName)) { + deserializedConfigurationStoreProperties.sas = SasProperties.fromJson(reader); } else if ("softDeleteRetentionInDays".equals(fieldName)) { deserializedConfigurationStoreProperties.softDeleteRetentionInDays = reader.getNullable(JsonReader::getInt); @@ -350,6 +444,11 @@ public static ConfigurationStoreProperties fromJson(JsonReader jsonReader) throw deserializedConfigurationStoreProperties.dataPlaneProxy = DataPlaneProxyProperties.fromJson(reader); } else if ("createMode".equals(fieldName)) { deserializedConfigurationStoreProperties.createMode = CreateMode.fromString(reader.getString()); + } else if ("telemetry".equals(fieldName)) { + deserializedConfigurationStoreProperties.telemetry = TelemetryProperties.fromJson(reader); + } else if ("experimentation".equals(fieldName)) { + deserializedConfigurationStoreProperties.experimentation + = ExperimentationProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStorePropertiesUpdateParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStorePropertiesUpdateParameters.java index 4b58ad88a53f..a9ea8f353630 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStorePropertiesUpdateParameters.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ConfigurationStorePropertiesUpdateParameters.java @@ -11,7 +11,10 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.appconfiguration.models.DataPlaneProxyProperties; import com.azure.resourcemanager.appconfiguration.models.EncryptionProperties; +import com.azure.resourcemanager.appconfiguration.models.ExperimentationProperties; import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; +import com.azure.resourcemanager.appconfiguration.models.SasProperties; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; import java.io.IOException; /** @@ -26,10 +29,15 @@ public final class ConfigurationStorePropertiesUpdateParameters private EncryptionProperties encryption; /* - * Disables all authentication methods other than AAD authentication. + * Disables access key authentication. */ private Boolean disableLocalAuth; + /* + * The SAS authentication settings of the configuration store. + */ + private SasProperties sas; + /* * Control permission for data plane traffic coming from public networks while private endpoint is enabled. */ @@ -45,6 +53,16 @@ public final class ConfigurationStorePropertiesUpdateParameters */ private DataPlaneProxyProperties dataPlaneProxy; + /* + * Property specifying the configuration of telemetry to update for this configuration store + */ + private TelemetryProperties telemetry; + + /* + * Property specifying the configuration of experimentation to update for this configuration store + */ + private ExperimentationProperties experimentation; + /** * Creates an instance of ConfigurationStorePropertiesUpdateParameters class. */ @@ -72,7 +90,7 @@ public ConfigurationStorePropertiesUpdateParameters withEncryption(EncryptionPro } /** - * Get the disableLocalAuth property: Disables all authentication methods other than AAD authentication. + * Get the disableLocalAuth property: Disables access key authentication. * * @return the disableLocalAuth value. */ @@ -81,7 +99,7 @@ public Boolean disableLocalAuth() { } /** - * Set the disableLocalAuth property: Disables all authentication methods other than AAD authentication. + * Set the disableLocalAuth property: Disables access key authentication. * * @param disableLocalAuth the disableLocalAuth value to set. * @return the ConfigurationStorePropertiesUpdateParameters object itself. @@ -91,6 +109,26 @@ public ConfigurationStorePropertiesUpdateParameters withDisableLocalAuth(Boolean return this; } + /** + * Get the sas property: The SAS authentication settings of the configuration store. + * + * @return the sas value. + */ + public SasProperties sas() { + return this.sas; + } + + /** + * Set the sas property: The SAS authentication settings of the configuration store. + * + * @param sas the sas value to set. + * @return the ConfigurationStorePropertiesUpdateParameters object itself. + */ + public ConfigurationStorePropertiesUpdateParameters withSas(SasProperties sas) { + this.sas = sas; + return this; + } + /** * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. @@ -158,6 +196,50 @@ public ConfigurationStorePropertiesUpdateParameters withDataPlaneProxy(DataPlane return this; } + /** + * Get the telemetry property: Property specifying the configuration of telemetry to update for this configuration + * store. + * + * @return the telemetry value. + */ + public TelemetryProperties telemetry() { + return this.telemetry; + } + + /** + * Set the telemetry property: Property specifying the configuration of telemetry to update for this configuration + * store. + * + * @param telemetry the telemetry value to set. + * @return the ConfigurationStorePropertiesUpdateParameters object itself. + */ + public ConfigurationStorePropertiesUpdateParameters withTelemetry(TelemetryProperties telemetry) { + this.telemetry = telemetry; + return this; + } + + /** + * Get the experimentation property: Property specifying the configuration of experimentation to update for this + * configuration store. + * + * @return the experimentation value. + */ + public ExperimentationProperties experimentation() { + return this.experimentation; + } + + /** + * Set the experimentation property: Property specifying the configuration of experimentation to update for this + * configuration store. + * + * @param experimentation the experimentation value to set. + * @return the ConfigurationStorePropertiesUpdateParameters object itself. + */ + public ConfigurationStorePropertiesUpdateParameters withExperimentation(ExperimentationProperties experimentation) { + this.experimentation = experimentation; + return this; + } + /** * Validates the instance. * @@ -167,9 +249,18 @@ public void validate() { if (encryption() != null) { encryption().validate(); } + if (sas() != null) { + sas().validate(); + } if (dataPlaneProxy() != null) { dataPlaneProxy().validate(); } + if (telemetry() != null) { + telemetry().validate(); + } + if (experimentation() != null) { + experimentation().validate(); + } } /** @@ -180,10 +271,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("encryption", this.encryption); jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); + jsonWriter.writeJsonField("sas", this.sas); jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); jsonWriter.writeBooleanField("enablePurgeProtection", this.enablePurgeProtection); jsonWriter.writeJsonField("dataPlaneProxy", this.dataPlaneProxy); + jsonWriter.writeJsonField("telemetry", this.telemetry); + jsonWriter.writeJsonField("experimentation", this.experimentation); return jsonWriter.writeEndObject(); } @@ -209,6 +303,8 @@ public static ConfigurationStorePropertiesUpdateParameters fromJson(JsonReader j } else if ("disableLocalAuth".equals(fieldName)) { deserializedConfigurationStorePropertiesUpdateParameters.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); + } else if ("sas".equals(fieldName)) { + deserializedConfigurationStorePropertiesUpdateParameters.sas = SasProperties.fromJson(reader); } else if ("publicNetworkAccess".equals(fieldName)) { deserializedConfigurationStorePropertiesUpdateParameters.publicNetworkAccess = PublicNetworkAccess.fromString(reader.getString()); @@ -218,6 +314,12 @@ public static ConfigurationStorePropertiesUpdateParameters fromJson(JsonReader j } else if ("dataPlaneProxy".equals(fieldName)) { deserializedConfigurationStorePropertiesUpdateParameters.dataPlaneProxy = DataPlaneProxyProperties.fromJson(reader); + } else if ("telemetry".equals(fieldName)) { + deserializedConfigurationStorePropertiesUpdateParameters.telemetry + = TelemetryProperties.fromJson(reader); + } else if ("experimentation".equals(fieldName)) { + deserializedConfigurationStorePropertiesUpdateParameters.experimentation + = ExperimentationProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/SasTokenGenerationResultInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/SasTokenGenerationResultInner.java new file mode 100644 index 000000000000..2abeab99cbf9 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/SasTokenGenerationResultInner.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.appconfiguration.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appconfiguration.models.SasKind; +import com.azure.resourcemanager.appconfiguration.models.SasTokenScope; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The result of a request to generate a SAS token. + */ +@Immutable +public final class SasTokenGenerationResultInner implements JsonSerializable { + /* + * The data plane resource scope that the SAS token is authorized to access. + */ + private SasTokenScope sasTokenScope; + + /* + * The time that the SAS token expires in the Universal ISO 8601 DateTime format. Max allowed expiration is 1 year + * from the time of token creation. + */ + private OffsetDateTime expires; + + /* + * Time (in seconds) for which the data plane response may be cached by clients. App Configuration sets the + * Cache-Control response header `max-age` to the value that's specified on the SAS token. See + * [rfc9111](https://www.rfc-editor.org/rfc/rfc9111#name-max-age-2) for more details. + */ + private Float cacheControlMaxAge; + + /* + * The kind of the SAS token. + */ + private SasKind kind; + + /* + * The value of the SAS token. + */ + private String value; + + /** + * Creates an instance of SasTokenGenerationResultInner class. + */ + public SasTokenGenerationResultInner() { + } + + /** + * Get the sasTokenScope property: The data plane resource scope that the SAS token is authorized to access. + * + * @return the sasTokenScope value. + */ + public SasTokenScope sasTokenScope() { + return this.sasTokenScope; + } + + /** + * Get the expires property: The time that the SAS token expires in the Universal ISO 8601 DateTime format. Max + * allowed expiration is 1 year from the time of token creation. + * + * @return the expires value. + */ + public OffsetDateTime expires() { + return this.expires; + } + + /** + * Get the cacheControlMaxAge property: Time (in seconds) for which the data plane response may be cached by + * clients. App Configuration sets the Cache-Control response header `max-age` to the value that's specified on the + * SAS token. See [rfc9111](https://www.rfc-editor.org/rfc/rfc9111#name-max-age-2) for more details. + * + * @return the cacheControlMaxAge value. + */ + public Float cacheControlMaxAge() { + return this.cacheControlMaxAge; + } + + /** + * Get the kind property: The kind of the SAS token. + * + * @return the kind value. + */ + public SasKind kind() { + return this.kind; + } + + /** + * Get the value property: The value of the SAS token. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sasTokenScope() != null) { + sasTokenScope().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasTokenGenerationResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasTokenGenerationResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SasTokenGenerationResultInner. + */ + public static SasTokenGenerationResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasTokenGenerationResultInner deserializedSasTokenGenerationResultInner + = new SasTokenGenerationResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasTokenScope".equals(fieldName)) { + deserializedSasTokenGenerationResultInner.sasTokenScope = SasTokenScope.fromJson(reader); + } else if ("expires".equals(fieldName)) { + deserializedSasTokenGenerationResultInner.expires = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("cacheControlMaxAge".equals(fieldName)) { + deserializedSasTokenGenerationResultInner.cacheControlMaxAge + = reader.getNullable(JsonReader::getFloat); + } else if ("kind".equals(fieldName)) { + deserializedSasTokenGenerationResultInner.kind = SasKind.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedSasTokenGenerationResultInner.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSasTokenGenerationResultInner; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/AppConfigurationManagementClientImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/AppConfigurationManagementClientImpl.java index 1a62618ee5df..fe654d19446c 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/AppConfigurationManagementClientImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/AppConfigurationManagementClientImpl.java @@ -244,7 +244,7 @@ public SnapshotsClient getSnapshots() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-05-01"; + this.apiVersion = "2024-06-01-preview"; this.configurationStores = new ConfigurationStoresClientImpl(this); this.operations = new OperationsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoreImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoreImpl.java index 467233e102fd..64bbab5e6f29 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoreImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoreImpl.java @@ -16,12 +16,18 @@ import com.azure.resourcemanager.appconfiguration.models.CreateMode; import com.azure.resourcemanager.appconfiguration.models.DataPlaneProxyProperties; import com.azure.resourcemanager.appconfiguration.models.EncryptionProperties; +import com.azure.resourcemanager.appconfiguration.models.ExperimentationProperties; import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnectionReference; import com.azure.resourcemanager.appconfiguration.models.ProvisioningState; import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; import com.azure.resourcemanager.appconfiguration.models.RegenerateKeyParameters; +import com.azure.resourcemanager.appconfiguration.models.ResetSasKindParameters; import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; +import com.azure.resourcemanager.appconfiguration.models.SasProperties; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationResult; import com.azure.resourcemanager.appconfiguration.models.Sku; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -103,6 +109,10 @@ public Boolean disableLocalAuth() { return this.innerModel().disableLocalAuth(); } + public SasProperties sas() { + return this.innerModel().sas(); + } + public Integer softDeleteRetentionInDays() { return this.innerModel().softDeleteRetentionInDays(); } @@ -119,6 +129,14 @@ public CreateMode createMode() { return this.innerModel().createMode(); } + public TelemetryProperties telemetry() { + return this.innerModel().telemetry(); + } + + public ExperimentationProperties experimentation() { + return this.innerModel().experimentation(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -233,6 +251,28 @@ public ApiKey regenerateKey(RegenerateKeyParameters regenerateKeyParameters) { .regenerateKey(resourceGroupName, configStoreName, regenerateKeyParameters); } + public Response + generateSasTokenWithResponse(SasTokenGenerationParameters sasTokenGenerationParameters, Context context) { + return serviceManager.configurationStores() + .generateSasTokenWithResponse(resourceGroupName, configStoreName, sasTokenGenerationParameters, context); + } + + public SasTokenGenerationResult generateSasToken(SasTokenGenerationParameters sasTokenGenerationParameters) { + return serviceManager.configurationStores() + .generateSasToken(resourceGroupName, configStoreName, sasTokenGenerationParameters); + } + + public Response resetSasKindWithResponse(ResetSasKindParameters resetSasKindParameters, + Context context) { + return serviceManager.configurationStores() + .resetSasKindWithResponse(resourceGroupName, configStoreName, resetSasKindParameters, context); + } + + public ConfigurationStore resetSasKind(ResetSasKindParameters resetSasKindParameters) { + return serviceManager.configurationStores() + .resetSasKind(resourceGroupName, configStoreName, resetSasKindParameters); + } + public ConfigurationStoreImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -303,6 +343,16 @@ public ConfigurationStoreImpl withDisableLocalAuth(Boolean disableLocalAuth) { } } + public ConfigurationStoreImpl withSas(SasProperties sas) { + if (isInCreateMode()) { + this.innerModel().withSas(sas); + return this; + } else { + this.updateConfigStoreUpdateParameters.withSas(sas); + return this; + } + } + public ConfigurationStoreImpl withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays) { this.innerModel().withSoftDeleteRetentionInDays(softDeleteRetentionInDays); return this; @@ -333,6 +383,26 @@ public ConfigurationStoreImpl withCreateMode(CreateMode createMode) { return this; } + public ConfigurationStoreImpl withTelemetry(TelemetryProperties telemetry) { + if (isInCreateMode()) { + this.innerModel().withTelemetry(telemetry); + return this; + } else { + this.updateConfigStoreUpdateParameters.withTelemetry(telemetry); + return this; + } + } + + public ConfigurationStoreImpl withExperimentation(ExperimentationProperties experimentation) { + if (isInCreateMode()) { + this.innerModel().withExperimentation(experimentation); + return this; + } else { + this.updateConfigStoreUpdateParameters.withExperimentation(experimentation); + return this; + } + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoresClientImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoresClientImpl.java index 5e739dabcc60..feb35db214fc 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoresClientImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoresClientImpl.java @@ -37,11 +37,14 @@ import com.azure.resourcemanager.appconfiguration.fluent.models.ApiKeyInner; import com.azure.resourcemanager.appconfiguration.fluent.models.ConfigurationStoreInner; import com.azure.resourcemanager.appconfiguration.fluent.models.DeletedConfigurationStoreInner; +import com.azure.resourcemanager.appconfiguration.fluent.models.SasTokenGenerationResultInner; import com.azure.resourcemanager.appconfiguration.models.ApiKeyListResult; import com.azure.resourcemanager.appconfiguration.models.ConfigurationStoreListResult; import com.azure.resourcemanager.appconfiguration.models.ConfigurationStoreUpdateParameters; import com.azure.resourcemanager.appconfiguration.models.DeletedConfigurationStoreListResult; import com.azure.resourcemanager.appconfiguration.models.RegenerateKeyParameters; +import com.azure.resourcemanager.appconfiguration.models.ResetSasKindParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -158,6 +161,28 @@ Mono> regenerateKey(@HostParam("$host") String endpoint, @BodyParam("application/json") RegenerateKeyParameters regenerateKeyParameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/generateSasToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> generateSasToken(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SasTokenGenerationParameters sasTokenGenerationParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/resetSasKind") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> resetSasKind(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResetSasKindParameters resetSasKindParameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores") @ExpectedResponses({ 200 }) @@ -1654,6 +1679,294 @@ public ApiKeyInner regenerateKey(String resourceGroupName, String configStoreNam .getValue(); } + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to generate a SAS token along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateSasTokenWithResponseAsync(String resourceGroupName, + String configStoreName, SasTokenGenerationParameters sasTokenGenerationParameters) { + 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 (configStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); + } + if (sasTokenGenerationParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter sasTokenGenerationParameters is required and cannot be null.")); + } else { + sasTokenGenerationParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.generateSasToken(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), sasTokenGenerationParameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @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 result of a request to generate a SAS token along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> generateSasTokenWithResponseAsync(String resourceGroupName, + String configStoreName, SasTokenGenerationParameters sasTokenGenerationParameters, 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 (configStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); + } + if (sasTokenGenerationParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter sasTokenGenerationParameters is required and cannot be null.")); + } else { + sasTokenGenerationParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.generateSasToken(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), sasTokenGenerationParameters, accept, context); + } + + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to generate a SAS token on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateSasTokenAsync(String resourceGroupName, String configStoreName, + SasTokenGenerationParameters sasTokenGenerationParameters) { + return generateSasTokenWithResponseAsync(resourceGroupName, configStoreName, sasTokenGenerationParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @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 result of a request to generate a SAS token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateSasTokenWithResponse(String resourceGroupName, + String configStoreName, SasTokenGenerationParameters sasTokenGenerationParameters, Context context) { + return generateSasTokenWithResponseAsync(resourceGroupName, configStoreName, sasTokenGenerationParameters, + context).block(); + } + + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to generate a SAS token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SasTokenGenerationResultInner generateSasToken(String resourceGroupName, String configStoreName, + SasTokenGenerationParameters sasTokenGenerationParameters) { + return generateSasTokenWithResponse(resourceGroupName, configStoreName, sasTokenGenerationParameters, + Context.NONE).getValue(); + } + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration store along with all resource properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resetSasKindWithResponseAsync(String resourceGroupName, + String configStoreName, ResetSasKindParameters resetSasKindParameters) { + 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 (configStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); + } + if (resetSasKindParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter resetSasKindParameters is required and cannot be null.")); + } else { + resetSasKindParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.resetSasKind(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), resetSasKindParameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @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 configuration store along with all resource properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resetSasKindWithResponseAsync(String resourceGroupName, + String configStoreName, ResetSasKindParameters resetSasKindParameters, 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 (configStoreName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); + } + if (resetSasKindParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter resetSasKindParameters is required and cannot be null.")); + } else { + resetSasKindParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.resetSasKind(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), resetSasKindParameters, accept, context); + } + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration store along with all resource properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetSasKindAsync(String resourceGroupName, String configStoreName, + ResetSasKindParameters resetSasKindParameters) { + return resetSasKindWithResponseAsync(resourceGroupName, configStoreName, resetSasKindParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @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 configuration store along with all resource properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resetSasKindWithResponse(String resourceGroupName, String configStoreName, + ResetSasKindParameters resetSasKindParameters, Context context) { + return resetSasKindWithResponseAsync(resourceGroupName, configStoreName, resetSasKindParameters, context) + .block(); + } + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration store along with all resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationStoreInner resetSasKind(String resourceGroupName, String configStoreName, + ResetSasKindParameters resetSasKindParameters) { + return resetSasKindWithResponse(resourceGroupName, configStoreName, resetSasKindParameters, Context.NONE) + .getValue(); + } + /** * Gets information about the deleted configuration stores in a subscription. * diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoresImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoresImpl.java index b4900aaed4ec..695ea9f3a62f 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoresImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoresImpl.java @@ -13,11 +13,15 @@ import com.azure.resourcemanager.appconfiguration.fluent.models.ApiKeyInner; import com.azure.resourcemanager.appconfiguration.fluent.models.ConfigurationStoreInner; import com.azure.resourcemanager.appconfiguration.fluent.models.DeletedConfigurationStoreInner; +import com.azure.resourcemanager.appconfiguration.fluent.models.SasTokenGenerationResultInner; import com.azure.resourcemanager.appconfiguration.models.ApiKey; import com.azure.resourcemanager.appconfiguration.models.ConfigurationStore; import com.azure.resourcemanager.appconfiguration.models.ConfigurationStores; import com.azure.resourcemanager.appconfiguration.models.DeletedConfigurationStore; import com.azure.resourcemanager.appconfiguration.models.RegenerateKeyParameters; +import com.azure.resourcemanager.appconfiguration.models.ResetSasKindParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationResult; public final class ConfigurationStoresImpl implements ConfigurationStores { private static final ClientLogger LOGGER = new ClientLogger(ConfigurationStoresImpl.class); @@ -118,6 +122,52 @@ public ApiKey regenerateKey(String resourceGroupName, String configStoreName, } } + public Response generateSasTokenWithResponse(String resourceGroupName, + String configStoreName, SasTokenGenerationParameters sasTokenGenerationParameters, Context context) { + Response inner = this.serviceClient() + .generateSasTokenWithResponse(resourceGroupName, configStoreName, sasTokenGenerationParameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SasTokenGenerationResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SasTokenGenerationResult generateSasToken(String resourceGroupName, String configStoreName, + SasTokenGenerationParameters sasTokenGenerationParameters) { + SasTokenGenerationResultInner inner + = this.serviceClient().generateSasToken(resourceGroupName, configStoreName, sasTokenGenerationParameters); + if (inner != null) { + return new SasTokenGenerationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response resetSasKindWithResponse(String resourceGroupName, String configStoreName, + ResetSasKindParameters resetSasKindParameters, Context context) { + Response inner = this.serviceClient() + .resetSasKindWithResponse(resourceGroupName, configStoreName, resetSasKindParameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConfigurationStoreImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigurationStore resetSasKind(String resourceGroupName, String configStoreName, + ResetSasKindParameters resetSasKindParameters) { + ConfigurationStoreInner inner + = this.serviceClient().resetSasKind(resourceGroupName, configStoreName, resetSasKindParameters); + if (inner != null) { + return new ConfigurationStoreImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable listDeleted() { PagedIterable inner = this.serviceClient().listDeleted(); return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedConfigurationStoreImpl(inner1, this.manager())); diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SasTokenGenerationResultImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SasTokenGenerationResultImpl.java new file mode 100644 index 000000000000..664bbe170d54 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SasTokenGenerationResultImpl.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.appconfiguration.implementation; + +import com.azure.resourcemanager.appconfiguration.fluent.models.SasTokenGenerationResultInner; +import com.azure.resourcemanager.appconfiguration.models.SasKind; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationResult; +import com.azure.resourcemanager.appconfiguration.models.SasTokenScope; +import java.time.OffsetDateTime; + +public final class SasTokenGenerationResultImpl implements SasTokenGenerationResult { + private SasTokenGenerationResultInner innerObject; + + private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; + + SasTokenGenerationResultImpl(SasTokenGenerationResultInner innerObject, + com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SasTokenScope sasTokenScope() { + return this.innerModel().sasTokenScope(); + } + + public OffsetDateTime expires() { + return this.innerModel().expires(); + } + + public Float cacheControlMaxAge() { + return this.innerModel().cacheControlMaxAge(); + } + + public SasKind kind() { + return this.innerModel().kind(); + } + + public String value() { + return this.innerModel().value(); + } + + public SasTokenGenerationResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStore.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStore.java index f98d64da3bfb..05f2ce3f7ecd 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStore.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStore.java @@ -119,12 +119,19 @@ public interface ConfigurationStore { PublicNetworkAccess publicNetworkAccess(); /** - * Gets the disableLocalAuth property: Disables all authentication methods other than AAD authentication. + * Gets the disableLocalAuth property: Disables access key authentication. * * @return the disableLocalAuth value. */ Boolean disableLocalAuth(); + /** + * Gets the sas property: The SAS authentication settings of the configuration store. + * + * @return the sas value. + */ + SasProperties sas(); + /** * Gets the softDeleteRetentionInDays property: The amount of time in days that the configuration store will be * retained when it is soft deleted. @@ -156,6 +163,21 @@ public interface ConfigurationStore { */ CreateMode createMode(); + /** + * Gets the telemetry property: Property specifying the configuration of telemetry for this configuration store. + * + * @return the telemetry value. + */ + TelemetryProperties telemetry(); + + /** + * Gets the experimentation property: Property specifying the configuration of experimentation for this + * configuration store. + * + * @return the experimentation value. + */ + ExperimentationProperties experimentation(); + /** * Gets the region of the resource. * @@ -254,9 +276,10 @@ interface WithSku { */ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithEncryption, - DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithDisableLocalAuth, + DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithDisableLocalAuth, DefinitionStages.WithSas, DefinitionStages.WithSoftDeleteRetentionInDays, DefinitionStages.WithEnablePurgeProtection, - DefinitionStages.WithDataPlaneProxy, DefinitionStages.WithCreateMode { + DefinitionStages.WithDataPlaneProxy, DefinitionStages.WithCreateMode, DefinitionStages.WithTelemetry, + DefinitionStages.WithExperimentation { /** * Executes the create request. * @@ -332,15 +355,27 @@ interface WithPublicNetworkAccess { */ interface WithDisableLocalAuth { /** - * Specifies the disableLocalAuth property: Disables all authentication methods other than AAD - * authentication.. + * Specifies the disableLocalAuth property: Disables access key authentication.. * - * @param disableLocalAuth Disables all authentication methods other than AAD authentication. + * @param disableLocalAuth Disables access key authentication. * @return the next definition stage. */ WithCreate withDisableLocalAuth(Boolean disableLocalAuth); } + /** + * The stage of the ConfigurationStore definition allowing to specify sas. + */ + interface WithSas { + /** + * Specifies the sas property: The SAS authentication settings of the configuration store.. + * + * @param sas The SAS authentication settings of the configuration store. + * @return the next definition stage. + */ + WithCreate withSas(SasProperties sas); + } + /** * The stage of the ConfigurationStore definition allowing to specify softDeleteRetentionInDays. */ @@ -398,6 +433,35 @@ interface WithCreateMode { */ WithCreate withCreateMode(CreateMode createMode); } + + /** + * The stage of the ConfigurationStore definition allowing to specify telemetry. + */ + interface WithTelemetry { + /** + * Specifies the telemetry property: Property specifying the configuration of telemetry for this + * configuration store. + * + * @param telemetry Property specifying the configuration of telemetry for this configuration store. + * @return the next definition stage. + */ + WithCreate withTelemetry(TelemetryProperties telemetry); + } + + /** + * The stage of the ConfigurationStore definition allowing to specify experimentation. + */ + interface WithExperimentation { + /** + * Specifies the experimentation property: Property specifying the configuration of experimentation for this + * configuration store. + * + * @param experimentation Property specifying the configuration of experimentation for this configuration + * store. + * @return the next definition stage. + */ + WithCreate withExperimentation(ExperimentationProperties experimentation); + } } /** @@ -411,8 +475,9 @@ interface WithCreateMode { * The template for ConfigurationStore update. */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku, - UpdateStages.WithEncryption, UpdateStages.WithDisableLocalAuth, UpdateStages.WithPublicNetworkAccess, - UpdateStages.WithEnablePurgeProtection, UpdateStages.WithDataPlaneProxy { + UpdateStages.WithEncryption, UpdateStages.WithDisableLocalAuth, UpdateStages.WithSas, + UpdateStages.WithPublicNetworkAccess, UpdateStages.WithEnablePurgeProtection, UpdateStages.WithDataPlaneProxy, + UpdateStages.WithTelemetry, UpdateStages.WithExperimentation { /** * Executes the update request. * @@ -490,15 +555,27 @@ interface WithEncryption { */ interface WithDisableLocalAuth { /** - * Specifies the disableLocalAuth property: Disables all authentication methods other than AAD - * authentication.. + * Specifies the disableLocalAuth property: Disables access key authentication.. * - * @param disableLocalAuth Disables all authentication methods other than AAD authentication. + * @param disableLocalAuth Disables access key authentication. * @return the next definition stage. */ Update withDisableLocalAuth(Boolean disableLocalAuth); } + /** + * The stage of the ConfigurationStore update allowing to specify sas. + */ + interface WithSas { + /** + * Specifies the sas property: The SAS authentication settings of the configuration store.. + * + * @param sas The SAS authentication settings of the configuration store. + * @return the next definition stage. + */ + Update withSas(SasProperties sas); + } + /** * The stage of the ConfigurationStore update allowing to specify publicNetworkAccess. */ @@ -543,6 +620,36 @@ interface WithDataPlaneProxy { */ Update withDataPlaneProxy(DataPlaneProxyProperties dataPlaneProxy); } + + /** + * The stage of the ConfigurationStore update allowing to specify telemetry. + */ + interface WithTelemetry { + /** + * Specifies the telemetry property: Property specifying the configuration of telemetry to update for this + * configuration store. + * + * @param telemetry Property specifying the configuration of telemetry to update for this configuration + * store. + * @return the next definition stage. + */ + Update withTelemetry(TelemetryProperties telemetry); + } + + /** + * The stage of the ConfigurationStore update allowing to specify experimentation. + */ + interface WithExperimentation { + /** + * Specifies the experimentation property: Property specifying the configuration of experimentation to + * update for this configuration store. + * + * @param experimentation Property specifying the configuration of experimentation to update for this + * configuration store. + * @return the next definition stage. + */ + Update withExperimentation(ExperimentationProperties experimentation); + } } /** @@ -605,4 +712,52 @@ interface WithDataPlaneProxy { * @return an API key used for authenticating with a configuration store endpoint. */ ApiKey regenerateKey(RegenerateKeyParameters regenerateKeyParameters); + + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @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 result of a request to generate a SAS token along with {@link Response}. + */ + Response + generateSasTokenWithResponse(SasTokenGenerationParameters sasTokenGenerationParameters, Context context); + + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to generate a SAS token. + */ + SasTokenGenerationResult generateSasToken(SasTokenGenerationParameters sasTokenGenerationParameters); + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @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 configuration store along with all resource properties along with {@link Response}. + */ + Response resetSasKindWithResponse(ResetSasKindParameters resetSasKindParameters, + Context context); + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration store along with all resource properties. + */ + ConfigurationStore resetSasKind(ResetSasKindParameters resetSasKindParameters); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStoreUpdateParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStoreUpdateParameters.java index 9c4cd1368ee2..b7fbd365e964 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStoreUpdateParameters.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStoreUpdateParameters.java @@ -137,7 +137,7 @@ public ConfigurationStoreUpdateParameters withEncryption(EncryptionProperties en } /** - * Get the disableLocalAuth property: Disables all authentication methods other than AAD authentication. + * Get the disableLocalAuth property: Disables access key authentication. * * @return the disableLocalAuth value. */ @@ -146,7 +146,7 @@ public Boolean disableLocalAuth() { } /** - * Set the disableLocalAuth property: Disables all authentication methods other than AAD authentication. + * Set the disableLocalAuth property: Disables access key authentication. * * @param disableLocalAuth the disableLocalAuth value to set. * @return the ConfigurationStoreUpdateParameters object itself. @@ -159,6 +159,29 @@ public ConfigurationStoreUpdateParameters withDisableLocalAuth(Boolean disableLo return this; } + /** + * Get the sas property: The SAS authentication settings of the configuration store. + * + * @return the sas value. + */ + public SasProperties sas() { + return this.innerProperties() == null ? null : this.innerProperties().sas(); + } + + /** + * Set the sas property: The SAS authentication settings of the configuration store. + * + * @param sas the sas value to set. + * @return the ConfigurationStoreUpdateParameters object itself. + */ + public ConfigurationStoreUpdateParameters withSas(SasProperties sas) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationStorePropertiesUpdateParameters(); + } + this.innerProperties().withSas(sas); + return this; + } + /** * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. @@ -234,6 +257,56 @@ public ConfigurationStoreUpdateParameters withDataPlaneProxy(DataPlaneProxyPrope return this; } + /** + * Get the telemetry property: Property specifying the configuration of telemetry to update for this configuration + * store. + * + * @return the telemetry value. + */ + public TelemetryProperties telemetry() { + return this.innerProperties() == null ? null : this.innerProperties().telemetry(); + } + + /** + * Set the telemetry property: Property specifying the configuration of telemetry to update for this configuration + * store. + * + * @param telemetry the telemetry value to set. + * @return the ConfigurationStoreUpdateParameters object itself. + */ + public ConfigurationStoreUpdateParameters withTelemetry(TelemetryProperties telemetry) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationStorePropertiesUpdateParameters(); + } + this.innerProperties().withTelemetry(telemetry); + return this; + } + + /** + * Get the experimentation property: Property specifying the configuration of experimentation to update for this + * configuration store. + * + * @return the experimentation value. + */ + public ExperimentationProperties experimentation() { + return this.innerProperties() == null ? null : this.innerProperties().experimentation(); + } + + /** + * Set the experimentation property: Property specifying the configuration of experimentation to update for this + * configuration store. + * + * @param experimentation the experimentation value to set. + * @return the ConfigurationStoreUpdateParameters object itself. + */ + public ConfigurationStoreUpdateParameters withExperimentation(ExperimentationProperties experimentation) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationStorePropertiesUpdateParameters(); + } + this.innerProperties().withExperimentation(experimentation); + return this; + } + /** * Validates the instance. * diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStores.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStores.java index 29b6954cb2e5..f69cf23d0e2c 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStores.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStores.java @@ -167,6 +167,64 @@ Response regenerateKeyWithResponse(String resourceGroupName, String conf ApiKey regenerateKey(String resourceGroupName, String configStoreName, RegenerateKeyParameters regenerateKeyParameters); + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @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 result of a request to generate a SAS token along with {@link Response}. + */ + Response generateSasTokenWithResponse(String resourceGroupName, String configStoreName, + SasTokenGenerationParameters sasTokenGenerationParameters, Context context); + + /** + * Generates a SAS token for scoped, read-only access of the specified configuration store. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param sasTokenGenerationParameters The object containing information for the SAS token generation request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to generate a SAS token. + */ + SasTokenGenerationResult generateSasToken(String resourceGroupName, String configStoreName, + SasTokenGenerationParameters sasTokenGenerationParameters); + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @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 configuration store along with all resource properties along with {@link Response}. + */ + Response resetSasKindWithResponse(String resourceGroupName, String configStoreName, + ResetSasKindParameters resetSasKindParameters, Context context); + + /** + * Reset SAS kind to invalidate all previously generated SAS tokens of the specified kind. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasKindParameters The object containing information for the SAS kind reset request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration store along with all resource properties. + */ + ConfigurationStore resetSasKind(String resourceGroupName, String configStoreName, + ResetSasKindParameters resetSasKindParameters); + /** * Gets information about the deleted configuration stores in a subscription. * diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ExperimentationProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ExperimentationProperties.java new file mode 100644 index 000000000000..5ed41ba62719 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ExperimentationProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Experimentation settings. + */ +@Fluent +public final class ExperimentationProperties implements JsonSerializable { + /* + * Resource ID of a resource enabling experimentation + */ + private String resourceId; + + /* + * The data plane endpoint of the Split experimentation workspace resource where experimentation data can be + * retrieved + */ + private String dataPlaneEndpoint; + + /** + * Creates an instance of ExperimentationProperties class. + */ + public ExperimentationProperties() { + } + + /** + * Get the resourceId property: Resource ID of a resource enabling experimentation. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID of a resource enabling experimentation. + * + * @param resourceId the resourceId value to set. + * @return the ExperimentationProperties object itself. + */ + public ExperimentationProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the dataPlaneEndpoint property: The data plane endpoint of the Split experimentation workspace resource where + * experimentation data can be retrieved. + * + * @return the dataPlaneEndpoint value. + */ + public String dataPlaneEndpoint() { + return this.dataPlaneEndpoint; + } + + /** + * Set the dataPlaneEndpoint property: The data plane endpoint of the Split experimentation workspace resource where + * experimentation data can be retrieved. + * + * @param dataPlaneEndpoint the dataPlaneEndpoint value to set. + * @return the ExperimentationProperties object itself. + */ + public ExperimentationProperties withDataPlaneEndpoint(String dataPlaneEndpoint) { + this.dataPlaneEndpoint = dataPlaneEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("dataPlaneEndpoint", this.dataPlaneEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExperimentationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExperimentationProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExperimentationProperties. + */ + public static ExperimentationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExperimentationProperties deserializedExperimentationProperties = new ExperimentationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedExperimentationProperties.resourceId = reader.getString(); + } else if ("dataPlaneEndpoint".equals(fieldName)) { + deserializedExperimentationProperties.dataPlaneEndpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExperimentationProperties; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KvSasTokenScope.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KvSasTokenScope.java new file mode 100644 index 000000000000..34e5f005ed69 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KvSasTokenScope.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The key value resource scope that the SAS token is authorized to access. + */ +@Fluent +public final class KvSasTokenScope extends SasTokenScope { + /* + * The resourceType property. + */ + private ResourceType resourceType = ResourceType.KV; + + /* + * A filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. + */ + private String key; + + /* + * A filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. + */ + private String label; + + /* + * An array of tag filters used to match tags. + */ + private List tags; + + /** + * Creates an instance of KvSasTokenScope class. + */ + public KvSasTokenScope() { + } + + /** + * Get the resourceType property: The resourceType property. + * + * @return the resourceType value. + */ + @Override + public ResourceType resourceType() { + return this.resourceType; + } + + /** + * Get the key property: A filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: A filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. + * + * @param key the key value to set. + * @return the KvSasTokenScope object itself. + */ + public KvSasTokenScope withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the label property: A filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: A filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. + * + * @param label the label value to set. + * @return the KvSasTokenScope object itself. + */ + public KvSasTokenScope withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the tags property: An array of tag filters used to match tags. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: An array of tag filters used to match tags. + * + * @param tags the tags value to set. + * @return the KvSasTokenScope object itself. + */ + public KvSasTokenScope withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("label", this.label); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KvSasTokenScope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KvSasTokenScope if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the KvSasTokenScope. + */ + public static KvSasTokenScope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KvSasTokenScope deserializedKvSasTokenScope = new KvSasTokenScope(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedKvSasTokenScope.resourceType = ResourceType.fromString(reader.getString()); + } else if ("key".equals(fieldName)) { + deserializedKvSasTokenScope.key = reader.getString(); + } else if ("label".equals(fieldName)) { + deserializedKvSasTokenScope.label = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> reader1.getString()); + deserializedKvSasTokenScope.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedKvSasTokenScope; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResetSasKindParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResetSasKindParameters.java new file mode 100644 index 000000000000..34012ff448ce --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResetSasKindParameters.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.appconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters used for resetting SAS kind. + */ +@Fluent +public final class ResetSasKindParameters implements JsonSerializable { + /* + * The kind of the SAS token. + */ + private SasKind name; + + /** + * Creates an instance of ResetSasKindParameters class. + */ + public ResetSasKindParameters() { + } + + /** + * Get the name property: The kind of the SAS token. + * + * @return the name value. + */ + public SasKind name() { + return this.name; + } + + /** + * Set the name property: The kind of the SAS token. + * + * @param name the name value to set. + * @return the ResetSasKindParameters object itself. + */ + public ResetSasKindParameters withName(SasKind 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.atError() + .log(new IllegalArgumentException("Missing required property name in model ResetSasKindParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResetSasKindParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResetSasKindParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResetSasKindParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResetSasKindParameters. + */ + public static ResetSasKindParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResetSasKindParameters deserializedResetSasKindParameters = new ResetSasKindParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedResetSasKindParameters.name = SasKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResetSasKindParameters; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResourceType.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResourceType.java new file mode 100644 index 000000000000..4f524d0529d3 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResourceType.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.appconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ResourceType. + */ +public final class ResourceType extends ExpandableStringEnum { + /** + * Static value Kv for ResourceType. + */ + public static final ResourceType KV = fromString("Kv"); + + /** + * Static value Snapshot for ResourceType. + */ + public static final ResourceType SNAPSHOT = fromString("Snapshot"); + + /** + * Creates a new instance of ResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceType() { + } + + /** + * Creates or finds a ResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceType. + */ + public static ResourceType fromString(String name) { + return fromString(name, ResourceType.class); + } + + /** + * Gets known ResourceType values. + * + * @return known ResourceType values. + */ + public static Collection values() { + return values(ResourceType.class); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasKind.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasKind.java new file mode 100644 index 000000000000..87ae6bcd23cc --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasKind.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.appconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of the SAS token. + */ +public final class SasKind extends ExpandableStringEnum { + /** + * Static value Primary for SasKind. + */ + public static final SasKind PRIMARY = fromString("Primary"); + + /** + * Static value Secondary for SasKind. + */ + public static final SasKind SECONDARY = fromString("Secondary"); + + /** + * Creates a new instance of SasKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SasKind() { + } + + /** + * Creates or finds a SasKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SasKind. + */ + public static SasKind fromString(String name) { + return fromString(name, SasKind.class); + } + + /** + * Gets known SasKind values. + * + * @return known SasKind values. + */ + public static Collection values() { + return values(SasKind.class); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasKindInfo.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasKindInfo.java new file mode 100644 index 000000000000..37c653d6f0a9 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasKindInfo.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Information about a specific kind of SAS token. + */ +@Immutable +public final class SasKindInfo implements JsonSerializable { + /* + * The kind of the SAS token. + */ + private SasKind name; + + /* + * The last reset time of all tokens of the specified SAS kind. + */ + private OffsetDateTime lastModifiedAt; + + /** + * Creates an instance of SasKindInfo class. + */ + public SasKindInfo() { + } + + /** + * Get the name property: The kind of the SAS token. + * + * @return the name value. + */ + public SasKind name() { + return this.name; + } + + /** + * Get the lastModifiedAt property: The last reset time of all tokens of the specified SAS kind. + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasKindInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasKindInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SasKindInfo. + */ + public static SasKindInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasKindInfo deserializedSasKindInfo = new SasKindInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSasKindInfo.name = SasKind.fromString(reader.getString()); + } else if ("lastModifiedAt".equals(fieldName)) { + deserializedSasKindInfo.lastModifiedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedSasKindInfo; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasProperties.java new file mode 100644 index 000000000000..4c3f80ad7bdd --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasProperties.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.appconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The SAS authentication settings of the configuration store. + */ +@Fluent +public final class SasProperties implements JsonSerializable { + /* + * The status of the SAS token authentication. This property manages if SAS token authentication is enabled or + * disabled. + */ + private SasStatus status; + + /* + * Information about different kinds of SAS token. + */ + private List kinds; + + /** + * Creates an instance of SasProperties class. + */ + public SasProperties() { + } + + /** + * Get the status property: The status of the SAS token authentication. This property manages if SAS token + * authentication is enabled or disabled. + * + * @return the status value. + */ + public SasStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the SAS token authentication. This property manages if SAS token + * authentication is enabled or disabled. + * + * @param status the status value to set. + * @return the SasProperties object itself. + */ + public SasProperties withStatus(SasStatus status) { + this.status = status; + return this; + } + + /** + * Get the kinds property: Information about different kinds of SAS token. + * + * @return the kinds value. + */ + public List kinds() { + return this.kinds; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kinds() != null) { + kinds().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SasProperties. + */ + public static SasProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasProperties deserializedSasProperties = new SasProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedSasProperties.status = SasStatus.fromString(reader.getString()); + } else if ("kinds".equals(fieldName)) { + List kinds = reader.readArray(reader1 -> SasKindInfo.fromJson(reader1)); + deserializedSasProperties.kinds = kinds; + } else { + reader.skipChildren(); + } + } + + return deserializedSasProperties; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasStatus.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasStatus.java new file mode 100644 index 000000000000..b4258eb491e3 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasStatus.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.appconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the SAS token authentication. This property manages if SAS token authentication is enabled or disabled. + */ +public final class SasStatus extends ExpandableStringEnum { + /** + * Static value Enabled for SasStatus. + */ + public static final SasStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for SasStatus. + */ + public static final SasStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of SasStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SasStatus() { + } + + /** + * Creates or finds a SasStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SasStatus. + */ + public static SasStatus fromString(String name) { + return fromString(name, SasStatus.class); + } + + /** + * Gets known SasStatus values. + * + * @return known SasStatus values. + */ + public static Collection values() { + return values(SasStatus.class); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenGenerationParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenGenerationParameters.java new file mode 100644 index 000000000000..73f6af591abf --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenGenerationParameters.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Parameters used for generating SAS token. + */ +@Fluent +public final class SasTokenGenerationParameters implements JsonSerializable { + /* + * The data plane resource scope that the SAS token is authorized to access. + */ + private SasTokenScope sasTokenScope; + + /* + * The time that the SAS token expires in the Universal ISO 8601 DateTime format. Max allowed expiration is 1 year + * from the time of token creation. + */ + private OffsetDateTime expires; + + /* + * Time (in seconds) for which the data plane response may be cached by clients. App Configuration sets the + * Cache-Control response header `max-age` to the value that's specified on the SAS token. See + * [rfc9111](https://www.rfc-editor.org/rfc/rfc9111#name-max-age-2) for more details. + */ + private Float cacheControlMaxAge; + + /* + * The kind of the SAS token. + */ + private SasKind kind; + + /** + * Creates an instance of SasTokenGenerationParameters class. + */ + public SasTokenGenerationParameters() { + } + + /** + * Get the sasTokenScope property: The data plane resource scope that the SAS token is authorized to access. + * + * @return the sasTokenScope value. + */ + public SasTokenScope sasTokenScope() { + return this.sasTokenScope; + } + + /** + * Set the sasTokenScope property: The data plane resource scope that the SAS token is authorized to access. + * + * @param sasTokenScope the sasTokenScope value to set. + * @return the SasTokenGenerationParameters object itself. + */ + public SasTokenGenerationParameters withSasTokenScope(SasTokenScope sasTokenScope) { + this.sasTokenScope = sasTokenScope; + return this; + } + + /** + * Get the expires property: The time that the SAS token expires in the Universal ISO 8601 DateTime format. Max + * allowed expiration is 1 year from the time of token creation. + * + * @return the expires value. + */ + public OffsetDateTime expires() { + return this.expires; + } + + /** + * Set the expires property: The time that the SAS token expires in the Universal ISO 8601 DateTime format. Max + * allowed expiration is 1 year from the time of token creation. + * + * @param expires the expires value to set. + * @return the SasTokenGenerationParameters object itself. + */ + public SasTokenGenerationParameters withExpires(OffsetDateTime expires) { + this.expires = expires; + return this; + } + + /** + * Get the cacheControlMaxAge property: Time (in seconds) for which the data plane response may be cached by + * clients. App Configuration sets the Cache-Control response header `max-age` to the value that's specified on the + * SAS token. See [rfc9111](https://www.rfc-editor.org/rfc/rfc9111#name-max-age-2) for more details. + * + * @return the cacheControlMaxAge value. + */ + public Float cacheControlMaxAge() { + return this.cacheControlMaxAge; + } + + /** + * Set the cacheControlMaxAge property: Time (in seconds) for which the data plane response may be cached by + * clients. App Configuration sets the Cache-Control response header `max-age` to the value that's specified on the + * SAS token. See [rfc9111](https://www.rfc-editor.org/rfc/rfc9111#name-max-age-2) for more details. + * + * @param cacheControlMaxAge the cacheControlMaxAge value to set. + * @return the SasTokenGenerationParameters object itself. + */ + public SasTokenGenerationParameters withCacheControlMaxAge(Float cacheControlMaxAge) { + this.cacheControlMaxAge = cacheControlMaxAge; + return this; + } + + /** + * Get the kind property: The kind of the SAS token. + * + * @return the kind value. + */ + public SasKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the SAS token. + * + * @param kind the kind value to set. + * @return the SasTokenGenerationParameters object itself. + */ + public SasTokenGenerationParameters withKind(SasKind kind) { + this.kind = kind; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sasTokenScope() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sasTokenScope in model SasTokenGenerationParameters")); + } else { + sasTokenScope().validate(); + } + if (expires() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property expires in model SasTokenGenerationParameters")); + } + if (kind() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property kind in model SasTokenGenerationParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SasTokenGenerationParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sasTokenScope", this.sasTokenScope); + jsonWriter.writeStringField("expires", + this.expires == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expires)); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeNumberField("cacheControlMaxAge", this.cacheControlMaxAge); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasTokenGenerationParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasTokenGenerationParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SasTokenGenerationParameters. + */ + public static SasTokenGenerationParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasTokenGenerationParameters deserializedSasTokenGenerationParameters = new SasTokenGenerationParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasTokenScope".equals(fieldName)) { + deserializedSasTokenGenerationParameters.sasTokenScope = SasTokenScope.fromJson(reader); + } else if ("expires".equals(fieldName)) { + deserializedSasTokenGenerationParameters.expires = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("kind".equals(fieldName)) { + deserializedSasTokenGenerationParameters.kind = SasKind.fromString(reader.getString()); + } else if ("cacheControlMaxAge".equals(fieldName)) { + deserializedSasTokenGenerationParameters.cacheControlMaxAge + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedSasTokenGenerationParameters; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenGenerationResult.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenGenerationResult.java new file mode 100644 index 000000000000..be29c08af02c --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenGenerationResult.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.appconfiguration.models; + +import com.azure.resourcemanager.appconfiguration.fluent.models.SasTokenGenerationResultInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of SasTokenGenerationResult. + */ +public interface SasTokenGenerationResult { + /** + * Gets the sasTokenScope property: The data plane resource scope that the SAS token is authorized to access. + * + * @return the sasTokenScope value. + */ + SasTokenScope sasTokenScope(); + + /** + * Gets the expires property: The time that the SAS token expires in the Universal ISO 8601 DateTime format. Max + * allowed expiration is 1 year from the time of token creation. + * + * @return the expires value. + */ + OffsetDateTime expires(); + + /** + * Gets the cacheControlMaxAge property: Time (in seconds) for which the data plane response may be cached by + * clients. App Configuration sets the Cache-Control response header `max-age` to the value that's specified on the + * SAS token. See [rfc9111](https://www.rfc-editor.org/rfc/rfc9111#name-max-age-2) for more details. + * + * @return the cacheControlMaxAge value. + */ + Float cacheControlMaxAge(); + + /** + * Gets the kind property: The kind of the SAS token. + * + * @return the kind value. + */ + SasKind kind(); + + /** + * Gets the value property: The value of the SAS token. + * + * @return the value value. + */ + String value(); + + /** + * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.SasTokenGenerationResultInner object. + * + * @return the inner object. + */ + SasTokenGenerationResultInner innerModel(); +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenScope.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenScope.java new file mode 100644 index 000000000000..3044243df077 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenScope.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.appconfiguration.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The data plane resource scope that the SAS token is authorized to access. + */ +@Immutable +public class SasTokenScope implements JsonSerializable { + /* + * The resourceType property. + */ + private ResourceType resourceType = ResourceType.fromString("SasTokenScope"); + + /** + * Creates an instance of SasTokenScope class. + */ + public SasTokenScope() { + } + + /** + * Get the resourceType property: The resourceType property. + * + * @return the resourceType value. + */ + public ResourceType resourceType() { + return this.resourceType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasTokenScope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasTokenScope if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SasTokenScope. + */ + public static SasTokenScope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("resourceType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Kv".equals(discriminatorValue)) { + return KvSasTokenScope.fromJson(readerToUse.reset()); + } else if ("Snapshot".equals(discriminatorValue)) { + return SnapshotSasTokenScope.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static SasTokenScope fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasTokenScope deserializedSasTokenScope = new SasTokenScope(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedSasTokenScope.resourceType = ResourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSasTokenScope; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SnapshotSasTokenScope.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SnapshotSasTokenScope.java new file mode 100644 index 000000000000..8da472f3311d --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SnapshotSasTokenScope.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The snapshot resource scope that the SAS token is authorized to access. + */ +@Fluent +public final class SnapshotSasTokenScope extends SasTokenScope { + /* + * The resourceType property. + */ + private ResourceType resourceType = ResourceType.SNAPSHOT; + + /* + * The name of the snapshot. + */ + private String name; + + /** + * Creates an instance of SnapshotSasTokenScope class. + */ + public SnapshotSasTokenScope() { + } + + /** + * Get the resourceType property: The resourceType property. + * + * @return the resourceType value. + */ + @Override + public ResourceType resourceType() { + return this.resourceType; + } + + /** + * Get the name property: The name of the snapshot. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the snapshot. + * + * @param name the name value to set. + * @return the SnapshotSasTokenScope object itself. + */ + public SnapshotSasTokenScope withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model SnapshotSasTokenScope")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SnapshotSasTokenScope.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnapshotSasTokenScope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapshotSasTokenScope if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SnapshotSasTokenScope. + */ + public static SnapshotSasTokenScope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapshotSasTokenScope deserializedSnapshotSasTokenScope = new SnapshotSasTokenScope(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSnapshotSasTokenScope.name = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + deserializedSnapshotSasTokenScope.resourceType = ResourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapshotSasTokenScope; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/TelemetryProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/TelemetryProperties.java new file mode 100644 index 000000000000..8d20b51967f7 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/TelemetryProperties.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.appconfiguration.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Telemetry settings. + */ +@Fluent +public final class TelemetryProperties implements JsonSerializable { + /* + * Resource ID of a resource enabling telemetry collection + */ + private String resourceId; + + /** + * Creates an instance of TelemetryProperties class. + */ + public TelemetryProperties() { + } + + /** + * Get the resourceId property: Resource ID of a resource enabling telemetry collection. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID of a resource enabling telemetry collection. + * + * @param resourceId the resourceId value to set. + * @return the TelemetryProperties object itself. + */ + public TelemetryProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TelemetryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TelemetryProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TelemetryProperties. + */ + public static TelemetryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TelemetryProperties deserializedTelemetryProperties = new TelemetryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedTelemetryProperties.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTelemetryProperties; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/resources/azure-resourcemanager-appconfiguration.properties b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/resources/azure-resourcemanager-appconfiguration.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/resources/azure-resourcemanager-appconfiguration.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresCreateSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresCreateSamples.java index a2e028d54570..00b4490c8183 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresCreateSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresCreateSamples.java @@ -6,10 +6,14 @@ import com.azure.resourcemanager.appconfiguration.models.AuthenticationMode; import com.azure.resourcemanager.appconfiguration.models.DataPlaneProxyProperties; +import com.azure.resourcemanager.appconfiguration.models.ExperimentationProperties; import com.azure.resourcemanager.appconfiguration.models.IdentityType; import com.azure.resourcemanager.appconfiguration.models.PrivateLinkDelegation; import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; +import com.azure.resourcemanager.appconfiguration.models.SasProperties; +import com.azure.resourcemanager.appconfiguration.models.SasStatus; import com.azure.resourcemanager.appconfiguration.models.Sku; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; import com.azure.resourcemanager.appconfiguration.models.UserIdentity; import java.util.HashMap; import java.util.Map; @@ -20,7 +24,7 @@ public final class ConfigurationStoresCreateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreate.json */ /** @@ -41,7 +45,7 @@ public final class ConfigurationStoresCreateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateWithIdentity.json */ /** @@ -66,7 +70,7 @@ public static void configurationStoresCreateWithIdentity( /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateWithDataPlaneProxy.json */ /** @@ -88,7 +92,7 @@ public static void configurationStoresCreateWithDataPlaneProxy( /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateWithLocalAuthDisabled.json */ /** @@ -107,6 +111,53 @@ public static void configurationStoresCreateWithLocalAuthDisabled( .create(); } + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ + * ConfigurationStoresCreateWithTelemetryAndExperimentation.json + */ + /** + * Sample code: ConfigurationStores_Create_With_Telemetry_And_Experimentation. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresCreateWithTelemetryAndExperimentation( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .define("contoso") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard")) + .withTags(mapOf("myTag", "myTagValue")) + .withTelemetry(new TelemetryProperties().withResourceId( + "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/microsoft.insights/components/appInsightsName")) + .withExperimentation(new ExperimentationProperties().withResourceId( + "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/SplitIO.Experimentation/experimentationWorkspaces/myWorkspaceName") + .withDataPlaneEndpoint("https://asi.eu.az.split.io")) + .create(); + } + + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ + * ConfigurationStoresCreateWithSasEnabled.json + */ + /** + * Sample code: ConfigurationStores_Create_With_Sas_Auth_Enabled. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresCreateWithSasAuthEnabled( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .define("contoso") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard")) + .withSas(new SasProperties().withStatus(SasStatus.ENABLED)) + .create(); + } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresDeleteSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresDeleteSamples.java index b986c7fd81ca..971959261728 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresDeleteSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresDeleteSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationStoresDeleteSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresDelete.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGenerateSasTokenSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGenerateSasTokenSamples.java new file mode 100644 index 000000000000..bf226332e7e7 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGenerateSasTokenSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.generated; + +import com.azure.resourcemanager.appconfiguration.models.KvSasTokenScope; +import com.azure.resourcemanager.appconfiguration.models.SasKind; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for ConfigurationStores GenerateSasToken. + */ +public final class ConfigurationStoresGenerateSasTokenSamples { + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ + * ConfigurationStoresGenerateSasToken.json + */ + /** + * Sample code: ConfigurationStores_GenerateSasToken. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresGenerateSasToken( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .generateSasTokenWithResponse("myResourceGroup", "contoso", + new SasTokenGenerationParameters() + .withSasTokenScope(new KvSasTokenScope().withKey("fakeTokenPlaceholder") + .withLabel("prod") + .withTags(Arrays.asList("group=test-group", "region=eastus"))) + .withExpires(OffsetDateTime.parse("2024-09-01T00:00:00.0000000Z")) + .withCacheControlMaxAge(3600.0F) + .withKind(SasKind.PRIMARY), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetByResourceGroupSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetByResourceGroupSamples.java index c829dc298f48..91fcd56e7943 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetByResourceGroupSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationStoresGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresGet.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetDeletedSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetDeletedSamples.java index f81467033ebe..dd737f9ceee6 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetDeletedSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetDeletedSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationStoresGetDeletedSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * DeletedConfigurationStoresGet.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListByResourceGroupSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListByResourceGroupSamples.java index d7c5cbe1518a..10931c63340e 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListByResourceGroupSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationStoresListByResourceGroupSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresListByResourceGroup.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListDeletedSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListDeletedSamples.java index b69bd92678f8..056641c334f8 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListDeletedSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListDeletedSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationStoresListDeletedSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * DeletedConfigurationStoresList.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListKeysSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListKeysSamples.java index 78a6446af084..89fd5fc4bdb0 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListKeysSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListKeysSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationStoresListKeysSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresListKeys.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListSamples.java index 35d1e973497b..9da042abd8dd 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationStoresListSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresList.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresPurgeDeletedSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresPurgeDeletedSamples.java index a01fa19c4e3d..fb2f8cb76f85 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresPurgeDeletedSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresPurgeDeletedSamples.java @@ -10,7 +10,7 @@ public final class ConfigurationStoresPurgeDeletedSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * DeletedConfigurationStoresPurge.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresRegenerateKeySamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresRegenerateKeySamples.java index 9103f7620001..61fb6cc071df 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresRegenerateKeySamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresRegenerateKeySamples.java @@ -12,7 +12,7 @@ public final class ConfigurationStoresRegenerateKeySamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresRegenerateKey.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresResetSasKindSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresResetSasKindSamples.java new file mode 100644 index 000000000000..c4362e042f77 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresResetSasKindSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.generated; + +import com.azure.resourcemanager.appconfiguration.models.ResetSasKindParameters; +import com.azure.resourcemanager.appconfiguration.models.SasKind; + +/** + * Samples for ConfigurationStores ResetSasKind. + */ +public final class ConfigurationStoresResetSasKindSamples { + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ + * ConfigurationStoresResetSasKind.json + */ + /** + * Sample code: ConfigurationStores_ResetSasKind. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void + configurationStoresResetSasKind(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .resetSasKindWithResponse("myResourceGroup", "contoso", + new ResetSasKindParameters().withName(SasKind.PRIMARY), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresUpdateSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresUpdateSamples.java index 4bb105300778..2ee0d4d594b5 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresUpdateSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresUpdateSamples.java @@ -7,6 +7,8 @@ import com.azure.resourcemanager.appconfiguration.models.ConfigurationStore; import com.azure.resourcemanager.appconfiguration.models.IdentityType; import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; +import com.azure.resourcemanager.appconfiguration.models.SasProperties; +import com.azure.resourcemanager.appconfiguration.models.SasStatus; import com.azure.resourcemanager.appconfiguration.models.Sku; import com.azure.resourcemanager.appconfiguration.models.UserIdentity; import java.util.HashMap; @@ -18,7 +20,7 @@ public final class ConfigurationStoresUpdateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresUpdateDisableLocalAuth.json */ /** @@ -36,7 +38,7 @@ public static void configurationStoresUpdateDisableLocalAuth( /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresUpdate.json */ /** @@ -54,7 +56,7 @@ public static void configurationStoresUpdateDisableLocalAuth( /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresUpdateWithIdentity.json */ /** @@ -77,6 +79,27 @@ public static void configurationStoresUpdateWithIdentity( .apply(); } + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ + * ConfigurationStoresUpdateEnableSas.json + */ + /** + * Sample code: ConfigurationStores_Update_Enable_Sas_Auth. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresUpdateEnableSasAuth( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + ConfigurationStore resource = manager.configurationStores() + .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withSku(new Sku().withName("Standard")) + .withSas(new SasProperties().withStatus(SasStatus.ENABLED)) + .apply(); + } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesCreateOrUpdateSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesCreateOrUpdateSamples.java index d980c9b0d195..a04a62f95ab7 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesCreateOrUpdateSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ public final class KeyValuesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateKeyValue.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesDeleteSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesDeleteSamples.java index 3d716a8a4b8e..8b827a1e5393 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesDeleteSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesDeleteSamples.java @@ -10,7 +10,7 @@ public final class KeyValuesDeleteSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresDeleteKeyValue.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesGetSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesGetSamples.java index ccdac75fdeae..e7b36c1bbf4f 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesGetSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesGetSamples.java @@ -10,7 +10,7 @@ public final class KeyValuesGetSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresGetKeyValue.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsCheckNameAvailabilitySamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsCheckNameAvailabilitySamples.java index 040edc785886..61e344b65111 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsCheckNameAvailabilitySamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsCheckNameAvailabilitySamples.java @@ -13,7 +13,7 @@ public final class OperationsCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * CheckNameAvailable.json */ /** @@ -32,7 +32,7 @@ public static void configurationStoresCheckNameAvailable( /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * CheckNameNotAvailable.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListSamples.java index df85019abdeb..53b61e50efe0 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListSamples.java @@ -10,7 +10,7 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * OperationsList.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsRegionalCheckNameAvailabilitySamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsRegionalCheckNameAvailabilitySamples.java index 15b28ec52947..83836f9cb4fb 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsRegionalCheckNameAvailabilitySamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/OperationsRegionalCheckNameAvailabilitySamples.java @@ -13,7 +13,7 @@ public final class OperationsRegionalCheckNameAvailabilitySamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * RegionalCheckNameAvailable.json */ /** @@ -32,7 +32,7 @@ public static void configurationStoresCheckNameAvailable( /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * RegionalCheckNameNotAvailable.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index 878526dc1900..2694d5d5d150 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -14,7 +14,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresUpdatePrivateEndpointConnection.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsDeleteSamples.java index d4752e1243ae..b0c5ee0aecb5 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresDeletePrivateEndpointConnection.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsGetSamples.java index 4a64d058ee02..1d9a6d1c5111 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresGetPrivateEndpointConnection.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsListByConfigurationStoreSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsListByConfigurationStoreSamples.java index ab3de9653bdb..e9185c3b57c3 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsListByConfigurationStoreSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsListByConfigurationStoreSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionsListByConfigurationStoreSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresListPrivateEndpointConnections.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesGetSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesGetSamples.java index 68f17ba48f67..6a6592bf9a23 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesGetSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * PrivateLinkResourceGet.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesListByConfigurationStoreSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesListByConfigurationStoreSamples.java index 14c1f5bd5a9c..eada2b43bb36 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesListByConfigurationStoreSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesListByConfigurationStoreSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourcesListByConfigurationStoreSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * PrivateLinkResourcesListByConfigurationStore.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasCreateSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasCreateSamples.java index 70a8f3914411..b4accf082479 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasCreateSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasCreateSamples.java @@ -10,7 +10,7 @@ public final class ReplicasCreateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateReplica.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasDeleteSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasDeleteSamples.java index 1d9c278efb06..32ddff40d3cf 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasDeleteSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasDeleteSamples.java @@ -10,7 +10,7 @@ public final class ReplicasDeleteSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresDeleteReplica.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasGetSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasGetSamples.java index 59093131f6e3..8af7338b13fd 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasGetSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasGetSamples.java @@ -10,7 +10,7 @@ public final class ReplicasGetSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresGetReplica.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasListByConfigurationStoreSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasListByConfigurationStoreSamples.java index 84958d71a7db..c676b31c05e6 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasListByConfigurationStoreSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasListByConfigurationStoreSamples.java @@ -10,7 +10,7 @@ public final class ReplicasListByConfigurationStoreSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresListReplicas.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/SnapshotsCreateSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/SnapshotsCreateSamples.java index c6a06799b083..4e9382cc3a83 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/SnapshotsCreateSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/SnapshotsCreateSamples.java @@ -13,7 +13,7 @@ public final class SnapshotsCreateSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresCreateSnapshot.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/SnapshotsGetSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/SnapshotsGetSamples.java index 76e643fb276f..de2b1ce3eea1 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/SnapshotsGetSamples.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/SnapshotsGetSamples.java @@ -10,7 +10,7 @@ public final class SnapshotsGetSamples { /* * x-ms-original-file: - * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2024-05-01/examples/ + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-06-01-preview/examples/ * ConfigurationStoresGetSnapshot.json */ /** diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ApiKeyInnerTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ApiKeyInnerTests.java deleted file mode 100644 index 43f1a88c60a2..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ApiKeyInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.ApiKeyInner; - -public final class ApiKeyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiKeyInner model = BinaryData.fromString( - "{\"id\":\"jqul\",\"name\":\"sntnbybkzgcw\",\"value\":\"clxxwrljdo\",\"connectionString\":\"kcqvkocrc\",\"lastModified\":\"2021-02-11T18:18:15Z\",\"readOnly\":false}") - .toObject(ApiKeyInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiKeyInner model = new ApiKeyInner(); - model = BinaryData.fromObject(model).toObject(ApiKeyInner.class); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ApiKeyListResultTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ApiKeyListResultTests.java deleted file mode 100644 index cdfb4bda9818..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ApiKeyListResultTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.ApiKeyInner; -import com.azure.resourcemanager.appconfiguration.models.ApiKeyListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ApiKeyListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiKeyListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"ojakhmsbzjhcrze\",\"name\":\"phlxa\",\"value\":\"thqt\",\"connectionString\":\"qjbpfzfsin\",\"lastModified\":\"2021-11-15T02:44:36Z\",\"readOnly\":true},{\"id\":\"rwzoxxjtfelluwf\",\"name\":\"tonpe\",\"value\":\"pjkjlxofpdv\",\"connectionString\":\"fxxypininmayhuy\",\"lastModified\":\"2021-05-05T04:33:07Z\",\"readOnly\":true},{\"id\":\"epoo\",\"name\":\"nuvamiheogna\",\"value\":\"zxtheotusivyevcc\",\"connectionString\":\"ihnhun\",\"lastModified\":\"2021-08-15T16:10:49Z\",\"readOnly\":false},{\"id\":\"nfygxgispemvtz\",\"name\":\"ufubl\",\"value\":\"fxqeof\",\"connectionString\":\"e\",\"lastModified\":\"2021-01-23T13:20:17Z\",\"readOnly\":true}],\"nextLink\":\"asvm\"}") - .toObject(ApiKeyListResult.class); - Assertions.assertEquals("asvm", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiKeyListResult model = new ApiKeyListResult() - .withValue(Arrays.asList(new ApiKeyInner(), new ApiKeyInner(), new ApiKeyInner(), new ApiKeyInner())) - .withNextLink("asvm"); - model = BinaryData.fromObject(model).toObject(ApiKeyListResult.class); - Assertions.assertEquals("asvm", model.nextLink()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/CheckNameAvailabilityParametersTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/CheckNameAvailabilityParametersTests.java deleted file mode 100644 index 8e9f6cf42e3a..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/CheckNameAvailabilityParametersTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters; -import com.azure.resourcemanager.appconfiguration.models.ConfigurationResourceType; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityParameters model = BinaryData - .fromString("{\"name\":\"yoqpsoaccta\",\"type\":\"Microsoft.AppConfiguration/configurationStores\"}") - .toObject(CheckNameAvailabilityParameters.class); - Assertions.assertEquals("yoqpsoaccta", model.name()); - Assertions.assertEquals(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES, - model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityParameters model = new CheckNameAvailabilityParameters().withName("yoqpsoaccta") - .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityParameters.class); - Assertions.assertEquals("yoqpsoaccta", model.name()); - Assertions.assertEquals(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES, - model.type()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresDeleteMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresDeleteMockTests.java deleted file mode 100644 index f8952559fa02..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.configurationStores().delete("iiswacffgdkzze", "kfvhqcrailvpn", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetDeletedWithResponseMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetDeletedWithResponseMockTests.java deleted file mode 100644 index ef73ad08dd49..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetDeletedWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.DeletedConfigurationStore; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresGetDeletedWithResponseMockTests { - @Test - public void testGetDeletedWithResponse() throws Exception { - String responseStr - = "{\"id\":\"qyib\",\"name\":\"wfluszdt\",\"type\":\"rkwofyyvoqa\",\"properties\":{\"configurationStoreId\":\"expbtg\",\"location\":\"bwoenwashrt\",\"deletionDate\":\"2021-03-25T05:20:51Z\",\"scheduledPurgeDate\":\"2021-10-02T00:32Z\",\"tags\":{\"qiiobyuqer\":\"wbpokulpiujwaasi\",\"bdbutauvf\":\"qlpqwcciuq\",\"afnn\":\"tkuwhhmhykojo\"},\"purgeProtectionEnabled\":true}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeletedConfigurationStore response = manager.configurationStores() - .getDeletedWithResponse("jrjxgciqibrhosx", "dqrhzoymib", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListDeletedMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListDeletedMockTests.java deleted file mode 100644 index 1af3b8e2fab5..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListDeletedMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.DeletedConfigurationStore; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresListDeletedMockTests { - @Test - public void testListDeleted() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"cpwi\",\"name\":\"vqtmnub\",\"type\":\"kpzksmondjmq\",\"properties\":{\"configurationStoreId\":\"ypomgkopkwho\",\"location\":\"pajqgxysm\",\"deletionDate\":\"2020-12-21T19:48:14Z\",\"scheduledPurgeDate\":\"2021-03-21T23:12:31Z\",\"tags\":{\"zapvhelx\":\"vmkcx\",\"tddckcb\":\"rgly\"},\"purgeProtectionEnabled\":true}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.configurationStores().listDeleted(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListKeysMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListKeysMockTests.java deleted file mode 100644 index c5ad18951658..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListKeysMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ApiKey; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresListKeysMockTests { - @Test - public void testListKeys() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"agafcnihgwqap\",\"name\":\"dgfbcvkcvqvpke\",\"value\":\"cvdrhvoodsot\",\"connectionString\":\"bzdopcj\",\"lastModified\":\"2021-09-30T23:37:37Z\",\"readOnly\":false}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.configurationStores().listKeys("pfuflrw", "mh", "lxyjr", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresPurgeDeletedMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresPurgeDeletedMockTests.java deleted file mode 100644 index dc48c83c9cc7..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresPurgeDeletedMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresPurgeDeletedMockTests { - @Test - public void testPurgeDeleted() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.configurationStores().purgeDeleted("ichkoymkcdyhb", "kkpwdreqnovvq", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresRegenerateKeyWithResponseMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresRegenerateKeyWithResponseMockTests.java deleted file mode 100644 index e0fd1c1a8f3e..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresRegenerateKeyWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ApiKey; -import com.azure.resourcemanager.appconfiguration.models.RegenerateKeyParameters; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresRegenerateKeyWithResponseMockTests { - @Test - public void testRegenerateKeyWithResponse() throws Exception { - String responseStr - = "{\"id\":\"wniyqsluicpd\",\"name\":\"kzzlvmbmpaxmodf\",\"value\":\"efyw\",\"connectionString\":\"pfvmwyhrfou\",\"lastModified\":\"2021-03-05T05:10:55Z\",\"readOnly\":false}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ApiKey response = manager.configurationStores() - .regenerateKeyWithResponse("ld", "mgxcxrslpm", new RegenerateKeyParameters().withId("wuoegrpk"), - com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DataPlaneProxyPropertiesTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DataPlaneProxyPropertiesTests.java deleted file mode 100644 index ad69602e0954..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DataPlaneProxyPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.AuthenticationMode; -import com.azure.resourcemanager.appconfiguration.models.DataPlaneProxyProperties; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkDelegation; -import org.junit.jupiter.api.Assertions; - -public final class DataPlaneProxyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataPlaneProxyProperties model - = BinaryData.fromString("{\"authenticationMode\":\"Pass-through\",\"privateLinkDelegation\":\"Enabled\"}") - .toObject(DataPlaneProxyProperties.class); - Assertions.assertEquals(AuthenticationMode.PASS_THROUGH, model.authenticationMode()); - Assertions.assertEquals(PrivateLinkDelegation.ENABLED, model.privateLinkDelegation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataPlaneProxyProperties model - = new DataPlaneProxyProperties().withAuthenticationMode(AuthenticationMode.PASS_THROUGH) - .withPrivateLinkDelegation(PrivateLinkDelegation.ENABLED); - model = BinaryData.fromObject(model).toObject(DataPlaneProxyProperties.class); - Assertions.assertEquals(AuthenticationMode.PASS_THROUGH, model.authenticationMode()); - Assertions.assertEquals(PrivateLinkDelegation.ENABLED, model.privateLinkDelegation()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStoreInnerTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStoreInnerTests.java deleted file mode 100644 index f36f875dbc14..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStoreInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.DeletedConfigurationStoreInner; - -public final class DeletedConfigurationStoreInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeletedConfigurationStoreInner model = BinaryData.fromString( - "{\"id\":\"uzgwyzmhtx\",\"name\":\"gmtsavjcbpwxqpsr\",\"type\":\"ftguv\",\"properties\":{\"configurationStoreId\":\"hprwmdyv\",\"location\":\"tayriwwroyqbex\",\"deletionDate\":\"2021-05-05T17:55:38Z\",\"scheduledPurgeDate\":\"2021-02-15T11:45:28Z\",\"tags\":{\"vah\":\"cnojvknmefqsg\",\"qzcjrvxdj\":\"pjyzhpv\",\"awjvzunluthnnp\":\"lmwlxkvugfhzo\",\"jzuaejxdultskzbb\":\"nxipeil\"},\"purgeProtectionEnabled\":true}}") - .toObject(DeletedConfigurationStoreInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeletedConfigurationStoreInner model = new DeletedConfigurationStoreInner(); - model = BinaryData.fromObject(model).toObject(DeletedConfigurationStoreInner.class); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStoreListResultTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStoreListResultTests.java deleted file mode 100644 index e75f136e5da6..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStoreListResultTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.DeletedConfigurationStoreInner; -import com.azure.resourcemanager.appconfiguration.models.DeletedConfigurationStoreListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeletedConfigurationStoreListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeletedConfigurationStoreListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"ndnhj\",\"name\":\"uwhvylwzbtdhxujz\",\"type\":\"mpowuwpr\",\"properties\":{\"configurationStoreId\":\"veual\",\"location\":\"j\",\"deletionDate\":\"2021-04-21T08:53:38Z\",\"scheduledPurgeDate\":\"2021-04-26T22:12:21Z\",\"tags\":{\"riplrbpbewtg\":\"bcswsrt\",\"c\":\"fgb\",\"gibtnm\":\"wxzvlvqhjkb\"},\"purgeProtectionEnabled\":true}}],\"nextLink\":\"wwaloayqcgwrt\"}") - .toObject(DeletedConfigurationStoreListResult.class); - Assertions.assertEquals("wwaloayqcgwrt", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeletedConfigurationStoreListResult model - = new DeletedConfigurationStoreListResult().withValue(Arrays.asList(new DeletedConfigurationStoreInner())) - .withNextLink("wwaloayqcgwrt"); - model = BinaryData.fromObject(model).toObject(DeletedConfigurationStoreListResult.class); - Assertions.assertEquals("wwaloayqcgwrt", model.nextLink()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStorePropertiesTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStorePropertiesTests.java deleted file mode 100644 index 8a82e51c40f0..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStorePropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.DeletedConfigurationStoreProperties; - -public final class DeletedConfigurationStorePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeletedConfigurationStoreProperties model = BinaryData.fromString( - "{\"configurationStoreId\":\"mv\",\"location\":\"kgpwoz\",\"deletionDate\":\"2021-12-04T01:13:33Z\",\"scheduledPurgeDate\":\"2021-08-14T18:03:09Z\",\"tags\":{\"waboe\":\"jyofdxluusdtto\",\"bxwyjsflhhcaa\":\"qvkelnsm\"},\"purgeProtectionEnabled\":true}") - .toObject(DeletedConfigurationStoreProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeletedConfigurationStoreProperties model = new DeletedConfigurationStoreProperties(); - model = BinaryData.fromObject(model).toObject(DeletedConfigurationStoreProperties.class); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesDeleteMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesDeleteMockTests.java deleted file mode 100644 index d352e9177ac7..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class KeyValuesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.keyValues().delete("jcntuj", "tcje", "ftwwaezkojvdc", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/LogSpecificationTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/LogSpecificationTests.java deleted file mode 100644 index b5b80d276aa2..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/LogSpecificationTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.LogSpecification; -import org.junit.jupiter.api.Assertions; - -public final class LogSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogSpecification model - = BinaryData.fromString("{\"name\":\"yxzk\",\"displayName\":\"ocukoklyax\",\"blobDuration\":\"onuq\"}") - .toObject(LogSpecification.class); - Assertions.assertEquals("yxzk", model.name()); - Assertions.assertEquals("ocukoklyax", model.displayName()); - Assertions.assertEquals("onuq", model.blobDuration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogSpecification model - = new LogSpecification().withName("yxzk").withDisplayName("ocukoklyax").withBlobDuration("onuq"); - model = BinaryData.fromObject(model).toObject(LogSpecification.class); - Assertions.assertEquals("yxzk", model.name()); - Assertions.assertEquals("ocukoklyax", model.displayName()); - Assertions.assertEquals("onuq", model.blobDuration()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/MetricDimensionTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/MetricDimensionTests.java deleted file mode 100644 index c62388417006..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/MetricDimensionTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.MetricDimension; -import org.junit.jupiter.api.Assertions; - -public final class MetricDimensionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricDimension model = BinaryData - .fromString("{\"name\":\"hmpvecx\",\"displayName\":\"debfqkkrbmpukgri\",\"internalName\":\"lzlfbxzpuz\"}") - .toObject(MetricDimension.class); - Assertions.assertEquals("hmpvecx", model.name()); - Assertions.assertEquals("debfqkkrbmpukgri", model.displayName()); - Assertions.assertEquals("lzlfbxzpuz", model.internalName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricDimension model = new MetricDimension().withName("hmpvecx") - .withDisplayName("debfqkkrbmpukgri") - .withInternalName("lzlfbxzpuz"); - model = BinaryData.fromObject(model).toObject(MetricDimension.class); - Assertions.assertEquals("hmpvecx", model.name()); - Assertions.assertEquals("debfqkkrbmpukgri", model.displayName()); - Assertions.assertEquals("lzlfbxzpuz", model.internalName()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/MetricSpecificationTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/MetricSpecificationTests.java deleted file mode 100644 index 57bdcfe68c62..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/MetricSpecificationTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.MetricDimension; -import com.azure.resourcemanager.appconfiguration.models.MetricSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MetricSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MetricSpecification model = BinaryData.fromString( - "{\"name\":\"fkbey\",\"displayName\":\"wrmjmwvvjektc\",\"displayDescription\":\"enhwlrs\",\"unit\":\"rzpwvlqdqgbiq\",\"aggregationType\":\"ihkaetcktvfc\",\"internalMetricName\":\"fsnkymuctq\",\"dimensions\":[{\"name\":\"ebrjcxe\",\"displayName\":\"uwutttxfvjrbi\",\"internalName\":\"hxepcyvahfnlj\"},{\"name\":\"qxj\",\"displayName\":\"ujqgidok\",\"internalName\":\"ljyoxgvcltb\"},{\"name\":\"ncghkje\",\"displayName\":\"zhbijhtxfv\",\"internalName\":\"bfs\"}],\"fillGapWithZero\":true}") - .toObject(MetricSpecification.class); - Assertions.assertEquals("fkbey", model.name()); - Assertions.assertEquals("wrmjmwvvjektc", model.displayName()); - Assertions.assertEquals("enhwlrs", model.displayDescription()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.unit()); - Assertions.assertEquals("ihkaetcktvfc", model.aggregationType()); - Assertions.assertEquals("fsnkymuctq", model.internalMetricName()); - Assertions.assertEquals("ebrjcxe", model.dimensions().get(0).name()); - Assertions.assertEquals("uwutttxfvjrbi", model.dimensions().get(0).displayName()); - Assertions.assertEquals("hxepcyvahfnlj", model.dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.fillGapWithZero()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricSpecification model = new MetricSpecification().withName("fkbey") - .withDisplayName("wrmjmwvvjektc") - .withDisplayDescription("enhwlrs") - .withUnit("rzpwvlqdqgbiq") - .withAggregationType("ihkaetcktvfc") - .withInternalMetricName("fsnkymuctq") - .withDimensions(Arrays.asList( - new MetricDimension().withName("ebrjcxe") - .withDisplayName("uwutttxfvjrbi") - .withInternalName("hxepcyvahfnlj"), - new MetricDimension().withName("qxj").withDisplayName("ujqgidok").withInternalName("ljyoxgvcltb"), - new MetricDimension().withName("ncghkje").withDisplayName("zhbijhtxfv").withInternalName("bfs"))) - .withFillGapWithZero(true); - model = BinaryData.fromObject(model).toObject(MetricSpecification.class); - Assertions.assertEquals("fkbey", model.name()); - Assertions.assertEquals("wrmjmwvvjektc", model.displayName()); - Assertions.assertEquals("enhwlrs", model.displayDescription()); - Assertions.assertEquals("rzpwvlqdqgbiq", model.unit()); - Assertions.assertEquals("ihkaetcktvfc", model.aggregationType()); - Assertions.assertEquals("fsnkymuctq", model.internalMetricName()); - Assertions.assertEquals("ebrjcxe", model.dimensions().get(0).name()); - Assertions.assertEquals("uwutttxfvjrbi", model.dimensions().get(0).displayName()); - Assertions.assertEquals("hxepcyvahfnlj", model.dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.fillGapWithZero()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/NameAvailabilityStatusInnerTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/NameAvailabilityStatusInnerTests.java deleted file mode 100644 index 2a3f5381121f..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/NameAvailabilityStatusInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.NameAvailabilityStatusInner; - -public final class NameAvailabilityStatusInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityStatusInner model - = BinaryData.fromString("{\"nameAvailable\":true,\"message\":\"lahbcryff\",\"reason\":\"dosyg\"}") - .toObject(NameAvailabilityStatusInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityStatusInner model = new NameAvailabilityStatusInner(); - model = BinaryData.fromObject(model).toObject(NameAvailabilityStatusInner.class); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionDisplayTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionDisplayTests.java deleted file mode 100644 index 3afaa3c9d174..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionDisplayTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.OperationDefinitionDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDefinitionDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDefinitionDisplay model = BinaryData.fromString( - "{\"provider\":\"h\",\"resource\":\"osfln\",\"operation\":\"sfqpteehz\",\"description\":\"ypyqrimzinp\"}") - .toObject(OperationDefinitionDisplay.class); - Assertions.assertEquals("osfln", model.resource()); - Assertions.assertEquals("sfqpteehz", model.operation()); - Assertions.assertEquals("ypyqrimzinp", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDefinitionDisplay model = new OperationDefinitionDisplay().withResource("osfln") - .withOperation("sfqpteehz") - .withDescription("ypyqrimzinp"); - model = BinaryData.fromObject(model).toObject(OperationDefinitionDisplay.class); - Assertions.assertEquals("osfln", model.resource()); - Assertions.assertEquals("sfqpteehz", model.operation()); - Assertions.assertEquals("ypyqrimzinp", model.description()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionInnerTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionInnerTests.java deleted file mode 100644 index 4ca613865ca3..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionInnerTests.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.OperationDefinitionInner; -import com.azure.resourcemanager.appconfiguration.models.LogSpecification; -import com.azure.resourcemanager.appconfiguration.models.MetricDimension; -import com.azure.resourcemanager.appconfiguration.models.MetricSpecification; -import com.azure.resourcemanager.appconfiguration.models.OperationDefinitionDisplay; -import com.azure.resourcemanager.appconfiguration.models.OperationProperties; -import com.azure.resourcemanager.appconfiguration.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationDefinitionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDefinitionInner model = BinaryData.fromString( - "{\"name\":\"mmnkzsmodmgl\",\"isDataAction\":true,\"display\":{\"provider\":\"kwtmutduqktapspw\",\"resource\":\"uertumk\",\"operation\":\"svqwhbmdgbbjfd\",\"description\":\"mbmbexppbh\"},\"origin\":\"qrolfpf\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"qux\",\"displayName\":\"jyj\",\"blobDuration\":\"jaoyfhrtx\"},{\"name\":\"n\",\"displayName\":\"kujysvlejuvfq\",\"blobDuration\":\"rlyxwjkcprbnw\"}],\"metricSpecifications\":[{\"name\":\"vtb\",\"displayName\":\"ysszdnrujqguh\",\"displayDescription\":\"ouqfprwz\",\"unit\":\"nguitnwuizgazxu\",\"aggregationType\":\"zuckyfi\",\"internalMetricName\":\"fidfvzw\",\"dimensions\":[{}],\"fillGapWithZero\":false},{\"name\":\"mwisdkfthwxmnt\",\"displayName\":\"waopvkmijcmmxd\",\"displayDescription\":\"fufsrpymzi\",\"unit\":\"sezcxtb\",\"aggregationType\":\"gfycc\",\"internalMetricName\":\"ewmdw\",\"dimensions\":[{},{},{},{}],\"fillGapWithZero\":false}]}}}") - .toObject(OperationDefinitionInner.class); - Assertions.assertEquals("mmnkzsmodmgl", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("uertumk", model.display().resource()); - Assertions.assertEquals("svqwhbmdgbbjfd", model.display().operation()); - Assertions.assertEquals("mbmbexppbh", model.display().description()); - Assertions.assertEquals("qrolfpf", model.origin()); - Assertions.assertEquals("qux", model.properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("jyj", - model.properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("jaoyfhrtx", - model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("vtb", model.properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("ysszdnrujqguh", - model.properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("ouqfprwz", - model.properties().serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("nguitnwuizgazxu", - model.properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("zuckyfi", - model.properties().serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("fidfvzw", - model.properties().serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals(false, - model.properties().serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDefinitionInner model = new OperationDefinitionInner().withName("mmnkzsmodmgl") - .withIsDataAction(true) - .withDisplay(new OperationDefinitionDisplay().withResource("uertumk") - .withOperation("svqwhbmdgbbjfd") - .withDescription("mbmbexppbh")) - .withOrigin("qrolfpf") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList( - new LogSpecification().withName("qux").withDisplayName("jyj").withBlobDuration("jaoyfhrtx"), - new LogSpecification().withName("n") - .withDisplayName("kujysvlejuvfq") - .withBlobDuration("rlyxwjkcprbnw"))) - .withMetricSpecifications(Arrays.asList( - new MetricSpecification().withName("vtb") - .withDisplayName("ysszdnrujqguh") - .withDisplayDescription("ouqfprwz") - .withUnit("nguitnwuizgazxu") - .withAggregationType("zuckyfi") - .withInternalMetricName("fidfvzw") - .withDimensions(Arrays.asList(new MetricDimension())) - .withFillGapWithZero(false), - new MetricSpecification().withName("mwisdkfthwxmnt") - .withDisplayName("waopvkmijcmmxd") - .withDisplayDescription("fufsrpymzi") - .withUnit("sezcxtb") - .withAggregationType("gfycc") - .withInternalMetricName("ewmdw") - .withDimensions(Arrays.asList(new MetricDimension(), new MetricDimension(), - new MetricDimension(), new MetricDimension())) - .withFillGapWithZero(false))))); - model = BinaryData.fromObject(model).toObject(OperationDefinitionInner.class); - Assertions.assertEquals("mmnkzsmodmgl", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("uertumk", model.display().resource()); - Assertions.assertEquals("svqwhbmdgbbjfd", model.display().operation()); - Assertions.assertEquals("mbmbexppbh", model.display().description()); - Assertions.assertEquals("qrolfpf", model.origin()); - Assertions.assertEquals("qux", model.properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("jyj", - model.properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("jaoyfhrtx", - model.properties().serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("vtb", model.properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("ysszdnrujqguh", - model.properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("ouqfprwz", - model.properties().serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("nguitnwuizgazxu", - model.properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("zuckyfi", - model.properties().serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("fidfvzw", - model.properties().serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals(false, - model.properties().serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionListResultTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionListResultTests.java deleted file mode 100644 index 3abc5e06c09a..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionListResultTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.OperationDefinitionInner; -import com.azure.resourcemanager.appconfiguration.models.LogSpecification; -import com.azure.resourcemanager.appconfiguration.models.MetricSpecification; -import com.azure.resourcemanager.appconfiguration.models.OperationDefinitionDisplay; -import com.azure.resourcemanager.appconfiguration.models.OperationDefinitionListResult; -import com.azure.resourcemanager.appconfiguration.models.OperationProperties; -import com.azure.resourcemanager.appconfiguration.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationDefinitionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDefinitionListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"inqpjwnzll\",\"isDataAction\":true,\"display\":{\"provider\":\"eebvmgxsab\",\"resource\":\"qduujitcjczdz\",\"operation\":\"ndhkrw\",\"description\":\"appd\"},\"origin\":\"dkvwrwjfe\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{},{},{}],\"metricSpecifications\":[{}]}}},{\"name\":\"ltmrldh\",\"isDataAction\":false,\"display\":{\"provider\":\"datqxhocdgeabl\",\"resource\":\"huticndvkao\",\"operation\":\"yiftyhxhuro\",\"description\":\"tyxolniwpwc\"},\"origin\":\"jfkgiawxk\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{},{},{}],\"metricSpecifications\":[{},{},{}]}}},{\"name\":\"basyy\",\"isDataAction\":true,\"display\":{\"provider\":\"sgcbac\",\"resource\":\"ejk\",\"operation\":\"ynqgoulzndlikwyq\",\"description\":\"fgibmadgakeq\"},\"origin\":\"xybz\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}],\"metricSpecifications\":[{},{},{}]}}}],\"nextLink\":\"ciqfou\"}") - .toObject(OperationDefinitionListResult.class); - Assertions.assertEquals("inqpjwnzll", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("qduujitcjczdz", model.value().get(0).display().resource()); - Assertions.assertEquals("ndhkrw", model.value().get(0).display().operation()); - Assertions.assertEquals("appd", model.value().get(0).display().description()); - Assertions.assertEquals("dkvwrwjfe", model.value().get(0).origin()); - Assertions.assertEquals("ciqfou", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDefinitionListResult model = new OperationDefinitionListResult().withValue(Arrays.asList( - new OperationDefinitionInner().withName("inqpjwnzll") - .withIsDataAction(true) - .withDisplay(new OperationDefinitionDisplay().withResource("qduujitcjczdz") - .withOperation("ndhkrw") - .withDescription("appd")) - .withOrigin("dkvwrwjfe") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification(), - new LogSpecification(), new LogSpecification())) - .withMetricSpecifications(Arrays.asList(new MetricSpecification())))), - new OperationDefinitionInner().withName("ltmrldh") - .withIsDataAction(false) - .withDisplay(new OperationDefinitionDisplay().withResource("huticndvkao") - .withOperation("yiftyhxhuro") - .withDescription("tyxolniwpwc")) - .withOrigin("jfkgiawxk") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification(), - new LogSpecification(), new LogSpecification())) - .withMetricSpecifications(Arrays.asList(new MetricSpecification(), new MetricSpecification(), - new MetricSpecification())))), - new OperationDefinitionInner().withName("basyy") - .withIsDataAction(true) - .withDisplay(new OperationDefinitionDisplay().withResource("ejk") - .withOperation("ynqgoulzndlikwyq") - .withDescription("fgibmadgakeq")) - .withOrigin("xybz") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification())) - .withMetricSpecifications(Arrays.asList(new MetricSpecification(), new MetricSpecification(), - new MetricSpecification())))))) - .withNextLink("ciqfou"); - model = BinaryData.fromObject(model).toObject(OperationDefinitionListResult.class); - Assertions.assertEquals("inqpjwnzll", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("qduujitcjczdz", model.value().get(0).display().resource()); - Assertions.assertEquals("ndhkrw", model.value().get(0).display().operation()); - Assertions.assertEquals("appd", model.value().get(0).display().description()); - Assertions.assertEquals("dkvwrwjfe", model.value().get(0).origin()); - Assertions.assertEquals("ciqfou", model.nextLink()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationPropertiesTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationPropertiesTests.java deleted file mode 100644 index 32ae0a34ff49..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationPropertiesTests.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.LogSpecification; -import com.azure.resourcemanager.appconfiguration.models.MetricDimension; -import com.azure.resourcemanager.appconfiguration.models.MetricSpecification; -import com.azure.resourcemanager.appconfiguration.models.OperationProperties; -import com.azure.resourcemanager.appconfiguration.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationProperties model = BinaryData.fromString( - "{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"kirsoodqxhc\",\"displayName\":\"nohjt\",\"blobDuration\":\"whdsoifiyip\"},{\"name\":\"sqwpgrjb\",\"displayName\":\"orcjxvsnby\",\"blobDuration\":\"abnmocpcyshu\"},{\"name\":\"afbljjgpbtoqcjmk\",\"displayName\":\"a\",\"blobDuration\":\"qidtqajzyu\"}],\"metricSpecifications\":[{\"name\":\"dj\",\"displayName\":\"lkhbz\",\"displayDescription\":\"epgzgqexz\",\"unit\":\"c\",\"aggregationType\":\"c\",\"internalMetricName\":\"ierhhbcsglummaj\",\"dimensions\":[{\"name\":\"dxob\",\"displayName\":\"dxkqpx\",\"internalName\":\"ajionpimexgstxg\"},{\"name\":\"odgmaajrmvdjwz\",\"displayName\":\"ovmclwhijcoejct\",\"internalName\":\"aqsqsycbkbfk\"}],\"fillGapWithZero\":false},{\"name\":\"kexxppof\",\"displayName\":\"axcfjpgddtocjjx\",\"displayDescription\":\"pmouexhdz\",\"unit\":\"bqe\",\"aggregationType\":\"nxqbzvddn\",\"internalMetricName\":\"ndei\",\"dimensions\":[{\"name\":\"npzaoq\",\"displayName\":\"hrhcffcyddglmjth\",\"internalName\":\"kw\"},{\"name\":\"eicxmqciwqvhkhi\",\"displayName\":\"igdtopbob\",\"internalName\":\"ghmewuam\"},{\"name\":\"hrzayvvtpgvdf\",\"displayName\":\"otkftutqxlngx\",\"internalName\":\"fgugnxkrxdqmid\"},{\"name\":\"hzrvqd\",\"displayName\":\"bhj\",\"internalName\":\"igeho\"}],\"fillGapWithZero\":false},{\"name\":\"wska\",\"displayName\":\"ktzlcuiywg\",\"displayDescription\":\"wgndrvynhzgpp\",\"unit\":\"cgyncocpecf\",\"aggregationType\":\"mcoo\",\"internalMetricName\":\"xlzevgbmqjqabcy\",\"dimensions\":[{\"name\":\"kwlzuvccfwnfn\",\"displayName\":\"cfionl\",\"internalName\":\"x\"},{\"name\":\"qgtz\",\"displayName\":\"pnqbqqwxrjfe\",\"internalName\":\"lnwsubisn\"},{\"name\":\"mpmngnzscxaqwoo\",\"displayName\":\"cbonqvpk\",\"internalName\":\"rxnjeaseipheofl\"},{\"name\":\"eyy\",\"displayName\":\"nj\",\"internalName\":\"lwtgrhpdj\"}],\"fillGapWithZero\":true}]}}") - .toObject(OperationProperties.class); - Assertions.assertEquals("kirsoodqxhc", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("nohjt", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("whdsoifiyip", model.serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("dj", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("lkhbz", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("epgzgqexz", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("c", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("c", model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("ierhhbcsglummaj", - model.serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("dxob", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("dxkqpx", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("ajionpimexgstxg", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(false, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationProperties model = new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withLogSpecifications(Arrays.asList( - new LogSpecification().withName("kirsoodqxhc").withDisplayName("nohjt").withBlobDuration("whdsoifiyip"), - new LogSpecification().withName("sqwpgrjb") - .withDisplayName("orcjxvsnby") - .withBlobDuration("abnmocpcyshu"), - new LogSpecification().withName("afbljjgpbtoqcjmk") - .withDisplayName("a") - .withBlobDuration("qidtqajzyu"))) - .withMetricSpecifications(Arrays.asList( - new MetricSpecification().withName("dj") - .withDisplayName("lkhbz") - .withDisplayDescription("epgzgqexz") - .withUnit("c") - .withAggregationType("c") - .withInternalMetricName("ierhhbcsglummaj") - .withDimensions(Arrays.asList( - new MetricDimension().withName("dxob") - .withDisplayName("dxkqpx") - .withInternalName("ajionpimexgstxg"), - new MetricDimension().withName("odgmaajrmvdjwz") - .withDisplayName("ovmclwhijcoejct") - .withInternalName("aqsqsycbkbfk"))) - .withFillGapWithZero(false), - new MetricSpecification().withName("kexxppof") - .withDisplayName("axcfjpgddtocjjx") - .withDisplayDescription("pmouexhdz") - .withUnit("bqe") - .withAggregationType("nxqbzvddn") - .withInternalMetricName("ndei") - .withDimensions(Arrays.asList( - new MetricDimension().withName("npzaoq") - .withDisplayName("hrhcffcyddglmjth") - .withInternalName("kw"), - new MetricDimension().withName("eicxmqciwqvhkhi") - .withDisplayName("igdtopbob") - .withInternalName("ghmewuam"), - new MetricDimension().withName("hrzayvvtpgvdf") - .withDisplayName("otkftutqxlngx") - .withInternalName("fgugnxkrxdqmid"), - new MetricDimension().withName("hzrvqd").withDisplayName("bhj").withInternalName("igeho"))) - .withFillGapWithZero(false), - new MetricSpecification().withName("wska") - .withDisplayName("ktzlcuiywg") - .withDisplayDescription("wgndrvynhzgpp") - .withUnit("cgyncocpecf") - .withAggregationType("mcoo") - .withInternalMetricName("xlzevgbmqjqabcy") - .withDimensions(Arrays.asList( - new MetricDimension().withName("kwlzuvccfwnfn").withDisplayName("cfionl").withInternalName("x"), - new MetricDimension().withName("qgtz") - .withDisplayName("pnqbqqwxrjfe") - .withInternalName("lnwsubisn"), - new MetricDimension().withName("mpmngnzscxaqwoo") - .withDisplayName("cbonqvpk") - .withInternalName("rxnjeaseipheofl"), - new MetricDimension().withName("eyy").withDisplayName("nj").withInternalName("lwtgrhpdj"))) - .withFillGapWithZero(true)))); - model = BinaryData.fromObject(model).toObject(OperationProperties.class); - Assertions.assertEquals("kirsoodqxhc", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("nohjt", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("whdsoifiyip", model.serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("dj", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("lkhbz", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("epgzgqexz", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("c", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("c", model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("ierhhbcsglummaj", - model.serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("dxob", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("dxkqpx", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("ajionpimexgstxg", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(false, model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsCheckNameAvailabilityWithResponseMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index 529468941f76..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters; -import com.azure.resourcemanager.appconfiguration.models.ConfigurationResourceType; -import com.azure.resourcemanager.appconfiguration.models.NameAvailabilityStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":false,\"message\":\"mnzgmwznmabi\",\"reason\":\"sorgj\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailabilityStatus response = manager.operations() - .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityParameters().withName("itsmypyyn") - .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES), - com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListMockTests.java deleted file mode 100644 index c142822ecf3e..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListMockTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.OperationDefinition; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"ok\",\"isDataAction\":false,\"display\":{\"provider\":\"d\",\"resource\":\"gsyocogj\",\"operation\":\"dtbnnha\",\"description\":\"ocrkvcikh\"},\"origin\":\"p\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"queziky\",\"displayName\":\"gxk\",\"blobDuration\":\"la\"}],\"metricSpecifications\":[{\"name\":\"wuipiccjzkzivg\",\"displayName\":\"c\",\"displayDescription\":\"y\",\"unit\":\"yrnxxmueedn\",\"aggregationType\":\"dvstkw\",\"internalMetricName\":\"tchealmf\",\"dimensions\":[{}],\"fillGapWithZero\":true},{\"name\":\"gdv\",\"displayName\":\"gpiohgwxrtfudxe\",\"displayDescription\":\"gyqagvrvmnpkuk\",\"unit\":\"i\",\"aggregationType\":\"blxgwimf\",\"internalMetricName\":\"hfjx\",\"dimensions\":[{},{},{}],\"fillGapWithZero\":false}]}}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.operations().list("xbldtlwwrlkdmtn", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ok", response.iterator().next().name()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - Assertions.assertEquals("gsyocogj", response.iterator().next().display().resource()); - Assertions.assertEquals("dtbnnha", response.iterator().next().display().operation()); - Assertions.assertEquals("ocrkvcikh", response.iterator().next().display().description()); - Assertions.assertEquals("p", response.iterator().next().origin()); - Assertions.assertEquals("queziky", - response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("gxk", - response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("la", - response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("wuipiccjzkzivg", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("c", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("y", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .displayDescription()); - Assertions.assertEquals("yrnxxmueedn", - response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("dvstkw", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .aggregationType()); - Assertions.assertEquals("tchealmf", - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .internalMetricName()); - Assertions.assertEquals(true, - response.iterator() - .next() - .properties() - .serviceSpecification() - .metricSpecifications() - .get(0) - .fillGapWithZero()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsRegionalCheckNameAvailabilityWithResponseMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsRegionalCheckNameAvailabilityWithResponseMockTests.java deleted file mode 100644 index 6001317f12da..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsRegionalCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters; -import com.azure.resourcemanager.appconfiguration.models.ConfigurationResourceType; -import com.azure.resourcemanager.appconfiguration.models.NameAvailabilityStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsRegionalCheckNameAvailabilityWithResponseMockTests { - @Test - public void testRegionalCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":false,\"message\":\"lpcirelsf\",\"reason\":\"enwabfatk\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NameAvailabilityStatus response = manager.operations() - .regionalCheckNameAvailabilityWithResponse("kfoqreyfkzikfj", - new CheckNameAvailabilityParameters().withName("wneaiv") - .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES), - com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionInnerTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 064373800439..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpoint; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"qik\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"vplwzbhv\",\"actionsRequired\":\"None\"}},\"id\":\"gu\",\"name\":\"svmkfssxquk\",\"type\":\"fpl\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("qik", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("vplwzbhv", model.privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model - = new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("qik")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED) - .withDescription("vplwzbhv")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("qik", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("vplwzbhv", model.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionListResultTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index 6fc5d19e80e8..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpoint; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"ahmgkbrp\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ibnuqqkpik\",\"actionsRequired\":\"None\"}},\"id\":\"gvtqagnbuynh\",\"name\":\"jggmebfsiarbu\",\"type\":\"rcvpnazzmhjrunmp\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"rbnlankxmyskp\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"btkcxywnytnrsyn\",\"actionsRequired\":\"Recreate\"}},\"id\":\"dybyxczfclhaa\",\"name\":\"dbabp\",\"type\":\"lwrq\"},{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{\"id\":\"hsucoc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"azt\",\"actionsRequired\":\"None\"}},\"id\":\"wwrq\",\"name\":\"uedck\",\"type\":\"ywbiexzfeyueax\"},{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"bhqwalmuzyoxa\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"zjancuxr\",\"actionsRequired\":\"Recreate\"}},\"id\":\"bavxbniwdjswzt\",\"name\":\"dbpgnxytxhp\",\"type\":\"xbzpfzab\"}],\"nextLink\":\"cuh\"}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals("ahmgkbrp", model.value().get(0).privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ibnuqqkpik", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cuh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = new PrivateEndpointConnectionListResult().withValue(Arrays.asList( - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("ahmgkbrp")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED) - .withDescription("ibnuqqkpik")), - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("rbnlankxmyskp")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.REJECTED) - .withDescription("btkcxywnytnrsyn")), - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("hsucoc")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED) - .withDescription("azt")), - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("bhqwalmuzyoxa")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.REJECTED) - .withDescription("zjancuxr")))) - .withNextLink("cuh"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals("ahmgkbrp", model.value().get(0).privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ibnuqqkpik", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cuh", model.nextLink()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index e75120680524..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpoint; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"chgejspodm\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"ydehoj\",\"actionsRequired\":\"None\"}}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("chgejspodm", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ydehoj", model.privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint().withId("chgejspodm")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.DISCONNECTED) - .withDescription("ydehoj")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("chgejspodm", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ydehoj", model.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionReferenceTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionReferenceTests.java deleted file mode 100644 index 8e7d1a92e0c5..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionReferenceTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpoint; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnectionReference; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionReference model = BinaryData.fromString( - "{\"id\":\"fwvuk\",\"name\":\"audccsnhs\",\"type\":\"nyejhkryhtnap\",\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{\"id\":\"jye\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"ni\",\"actionsRequired\":\"Recreate\"}}}") - .toObject(PrivateEndpointConnectionReference.class); - Assertions.assertEquals("jye", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ni", model.privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionReference model = new PrivateEndpointConnectionReference() - .withPrivateEndpoint(new PrivateEndpoint().withId("jye")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.REJECTED).withDescription("ni")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionReference.class); - Assertions.assertEquals("jye", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ni", model.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java deleted file mode 100644 index 4c6c7dbcadc5..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpoint; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnection; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"xleptramx\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"lwnwxuqlcvydyp\",\"actionsRequired\":\"Recreate\"}},\"id\":\"ooaojkniodkooebw\",\"name\":\"ujhemmsbvdkcrodt\",\"type\":\"infwjlfltkacjve\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .define("judpfrxt") - .withExistingConfigurationStore("mewzsyyc", "uzsoi") - .withPrivateEndpoint(new PrivateEndpoint().withId("ytdw")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED).withDescription("qu")) - .create(); - - Assertions.assertEquals("xleptramx", response.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.PENDING, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("lwnwxuqlcvydyp", response.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsDeleteMockTests.java deleted file mode 100644 index d9f3735816a1..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.privateEndpointConnections() - .delete("nbyxbaaabjyv", "yffimrzrtuzqogs", "xnevfdnwn", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 4c77ee5c72a5..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{\"id\":\"hp\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"ymareqnajxqugj\",\"actionsRequired\":\"Recreate\"}},\"id\":\"cubeddgssofw\",\"name\":\"mzqa\",\"type\":\"krmnjijpxacqqud\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .getWithResponse("moadsuvarmy", "dmjsjqb", "hhyxxrw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("hp", response.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.DISCONNECTED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ymareqnajxqugj", response.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsListByConfigurationStoreMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsListByConfigurationStoreMockTests.java deleted file mode 100644 index 00069b98e94e..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsListByConfigurationStoreMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnection; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByConfigurationStoreMockTests { - @Test - public void testListByConfigurationStore() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"glrvimjwosytxi\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"fcktqumiekke\",\"actionsRequired\":\"None\"}},\"id\":\"khly\",\"name\":\"jhdgqggebdunyga\",\"type\":\"qidbqfatpxllrxcy\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.privateEndpointConnections() - .listByConfigurationStore("ddxbjhwuaanoz", "osphyoul", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("glrvimjwosytxi", response.iterator().next().privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.PENDING, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("fcktqumiekke", - response.iterator().next().privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointTests.java deleted file mode 100644 index 928f1b196ad9..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpoint; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"uxinpmqnjaq\"}").toObject(PrivateEndpoint.class); - Assertions.assertEquals("uxinpmqnjaq", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint().withId("uxinpmqnjaq"); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - Assertions.assertEquals("uxinpmqnjaq", model.id()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourceInnerTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index d06c1a05d219..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourceInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.PrivateLinkResourceInner; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = BinaryData.fromString( - "{\"id\":\"nbbelda\",\"name\":\"zbaliourqha\",\"type\":\"uhashsfwx\",\"properties\":{\"groupId\":\"w\",\"requiredMembers\":[\"ugicjooxdjebw\",\"ucww\",\"vo\"],\"requiredZoneNames\":[\"meue\",\"ivyhzceuojgjrwju\"]}}") - .toObject(PrivateLinkResourceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model = new PrivateLinkResourceInner(); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourceListResultTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourceListResultTests.java deleted file mode 100644 index 0b9f2e190266..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourceListResultTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkResourceListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"xnkjzkdesl\",\"name\":\"lopwiyig\",\"type\":\"pkdwzbai\",\"properties\":{\"groupId\":\"baumnyqupedeoj\",\"requiredMembers\":[\"ckhsmtxpsieb\",\"fhvpesaps\",\"rdqmhjjdhtldwkyz\"],\"requiredZoneNames\":[\"tkncwsc\",\"svlxotogtwrup\"]}},{\"id\":\"xvnmicykvceov\",\"name\":\"lo\",\"type\":\"oty\",\"properties\":{\"groupId\":\"cnjbkcnxdhbt\",\"requiredMembers\":[\"h\",\"wpn\"],\"requiredZoneNames\":[\"oqnermclfpl\"]}},{\"id\":\"oxuscrpabgyepsbj\",\"name\":\"zq\",\"type\":\"xywpmueefjzwfqkq\",\"properties\":{\"groupId\":\"dsuyonobgla\",\"requiredMembers\":[\"xtccmg\",\"udxytlmoyrx\",\"wfudwpzntxhdzhl\"],\"requiredZoneNames\":[\"bh\",\"kfrlhrxsbky\",\"pycanuzbpz\"]}},{\"id\":\"fkuwbcrnwbmehhse\",\"name\":\"jusrtslhspk\",\"type\":\"emaofmxagkvt\",\"properties\":{\"groupId\":\"mqkrhahvljuahaqu\",\"requiredMembers\":[\"hmdua\",\"aex\"],\"requiredZoneNames\":[\"fadmws\",\"crgvxpvgom\"]}}],\"nextLink\":\"fmisg\"}") - .toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("fmisg", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = new PrivateLinkResourceListResult() - .withValue(Arrays.asList(new PrivateLinkResourceInner(), new PrivateLinkResourceInner(), - new PrivateLinkResourceInner(), new PrivateLinkResourceInner())) - .withNextLink("fmisg"); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("fmisg", model.nextLink()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcePropertiesTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 2bfc07a02f5f..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.PrivateLinkResourceProperties; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = BinaryData - .fromString("{\"groupId\":\"otwmcdyt\",\"requiredMembers\":[\"it\"],\"requiredZoneNames\":[\"jawgqwg\"]}") - .toObject(PrivateLinkResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties(); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesGetWithResponseMockTests.java deleted file mode 100644 index 83ab5b8611de..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesGetWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"id\":\"cwsobqwcs\",\"name\":\"nwdcfhu\",\"type\":\"dpfuvg\",\"properties\":{\"groupId\":\"jjcanvxbvtv\",\"requiredMembers\":[\"tncormrlxqtvco\",\"udflvkgjubgdknn\"],\"requiredZoneNames\":[\"aznqntoru\",\"sgsahmkycgr\",\"uwjuetaeburuvdmo\"]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResource response = manager.privateLinkResources() - .getWithResponse("feqztppriol", "or", "altol", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesListByConfigurationStoreMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesListByConfigurationStoreMockTests.java deleted file mode 100644 index 104c0a55eba1..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesListByConfigurationStoreMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByConfigurationStoreMockTests { - @Test - public void testListByConfigurationStore() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"blylsyxkqjnsj\",\"name\":\"vti\",\"type\":\"xsdszuempsb\",\"properties\":{\"groupId\":\"z\",\"requiredMembers\":[\"v\",\"nqicvinvkjjxdxrb\",\"ukzclewyhmlwpaz\",\"zpof\"],\"requiredZoneNames\":[\"kwyfzqwhxxbuyqax\"]}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.privateLinkResources() - .listByConfigurationStore("kdlfoa", "ggkfpagaowpul", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index 9bd17a187de3..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = BinaryData - .fromString("{\"status\":\"Pending\",\"description\":\"sprozvcput\",\"actionsRequired\":\"None\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(ConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("sprozvcput", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.PENDING) - .withDescription("sprozvcput"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(ConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("sprozvcput", model.description()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/RegenerateKeyParametersTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/RegenerateKeyParametersTests.java deleted file mode 100644 index 4f9d56acb378..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/RegenerateKeyParametersTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.RegenerateKeyParameters; -import org.junit.jupiter.api.Assertions; - -public final class RegenerateKeyParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegenerateKeyParameters model - = BinaryData.fromString("{\"id\":\"hxbnjbiksqrg\"}").toObject(RegenerateKeyParameters.class); - Assertions.assertEquals("hxbnjbiksqrg", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegenerateKeyParameters model = new RegenerateKeyParameters().withId("hxbnjbiksqrg"); - model = BinaryData.fromObject(model).toObject(RegenerateKeyParameters.class); - Assertions.assertEquals("hxbnjbiksqrg", model.id()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaInnerTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaInnerTests.java deleted file mode 100644 index 549656b594a4..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.ReplicaInner; -import org.junit.jupiter.api.Assertions; - -public final class ReplicaInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReplicaInner model = BinaryData.fromString( - "{\"location\":\"aqtdoqmcbx\",\"properties\":{\"endpoint\":\"yslqbhsfx\",\"provisioningState\":\"Deleting\"},\"id\":\"ytkblmpew\",\"name\":\"wfbkrvrns\",\"type\":\"shqjohxcrsbf\"}") - .toObject(ReplicaInner.class); - Assertions.assertEquals("aqtdoqmcbx", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaInner model = new ReplicaInner().withLocation("aqtdoqmcbx"); - model = BinaryData.fromObject(model).toObject(ReplicaInner.class); - Assertions.assertEquals("aqtdoqmcbx", model.location()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaListResultTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaListResultTests.java deleted file mode 100644 index c69ddd4b0def..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaListResultTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.ReplicaInner; -import com.azure.resourcemanager.appconfiguration.models.ReplicaListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReplicaListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReplicaListResult model = BinaryData.fromString( - "{\"value\":[{\"location\":\"sxyawjoyaqcs\",\"properties\":{\"endpoint\":\"kiidzyex\",\"provisioningState\":\"Creating\"},\"id\":\"lixhnrztfol\",\"name\":\"bnxknalaulppg\",\"type\":\"dtpnapnyiropuhp\"},{\"location\":\"vpgylgqgitxmed\",\"properties\":{\"endpoint\":\"lynqwwncwzzh\",\"provisioningState\":\"Succeeded\"},\"id\":\"trmgucnapkte\",\"name\":\"ellwptfdy\",\"type\":\"pfqbuaceopzf\"},{\"location\":\"hhuao\",\"properties\":{\"endpoint\":\"qeqxo\",\"provisioningState\":\"Deleting\"},\"id\":\"ahzxctobgbk\",\"name\":\"moizpos\",\"type\":\"mgrcfbu\"},{\"location\":\"mfqjhhkxbp\",\"properties\":{\"endpoint\":\"jhxxjyn\",\"provisioningState\":\"Succeeded\"},\"id\":\"ivkrtsw\",\"name\":\"xqzvszjfa\",\"type\":\"vjfdx\"}],\"nextLink\":\"vetvt\"}") - .toObject(ReplicaListResult.class); - Assertions.assertEquals("sxyawjoyaqcs", model.value().get(0).location()); - Assertions.assertEquals("vetvt", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaListResult model - = new ReplicaListResult().withValue(Arrays.asList(new ReplicaInner().withLocation("sxyawjoyaqcs"), - new ReplicaInner().withLocation("vpgylgqgitxmed"), new ReplicaInner().withLocation("hhuao"), - new ReplicaInner().withLocation("mfqjhhkxbp"))).withNextLink("vetvt"); - model = BinaryData.fromObject(model).toObject(ReplicaListResult.class); - Assertions.assertEquals("sxyawjoyaqcs", model.value().get(0).location()); - Assertions.assertEquals("vetvt", model.nextLink()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaPropertiesTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaPropertiesTests.java deleted file mode 100644 index e073bd1e2433..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaPropertiesTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.fluent.models.ReplicaProperties; - -public final class ReplicaPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReplicaProperties model = BinaryData.fromString("{\"endpoint\":\"asrru\",\"provisioningState\":\"Canceled\"}") - .toObject(ReplicaProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaProperties model = new ReplicaProperties(); - model = BinaryData.fromObject(model).toObject(ReplicaProperties.class); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasCreateMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasCreateMockTests.java deleted file mode 100644 index cd90b4ca8c32..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasCreateMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.Replica; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ReplicasCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"location\":\"brgz\",\"properties\":{\"endpoint\":\"weyp\",\"provisioningState\":\"Succeeded\"},\"id\":\"xggicccnxqhuexmk\",\"name\":\"tlstvlzywem\",\"type\":\"zrncsdt\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Replica response = manager.replicas() - .define("zqhof") - .withExistingConfigurationStore("hziuiefozbhdms", "l") - .withRegion("maequiahxicslfa") - .create(); - - Assertions.assertEquals("brgz", response.location()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasDeleteMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasDeleteMockTests.java deleted file mode 100644 index c1082c0e1399..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ReplicasDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.replicas().delete("u", "zkopb", "inrfdwoyu", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasGetWithResponseMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasGetWithResponseMockTests.java deleted file mode 100644 index 8e2aeaa5d9e8..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.Replica; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ReplicasGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"location\":\"kzevdlhewpusds\",\"properties\":{\"endpoint\":\"ogvbbejdcngq\",\"provisioningState\":\"Failed\"},\"id\":\"akufgmjz\",\"name\":\"wr\",\"type\":\"grtwae\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Replica response = manager.replicas() - .getWithResponse("znkbykutwpfhpagm", "r", "kdsnfdsdoakgtdl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kzevdlhewpusds", response.location()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasListByConfigurationStoreMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasListByConfigurationStoreMockTests.java deleted file mode 100644 index 805a059175a9..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasListByConfigurationStoreMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.Replica; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ReplicasListByConfigurationStoreMockTests { - @Test - public void testListByConfigurationStore() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"bt\",\"properties\":{\"endpoint\":\"ra\",\"provisioningState\":\"Succeeded\"},\"id\":\"koowtl\",\"name\":\"nguxawqaldsy\",\"type\":\"uximerqfobw\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - AppConfigurationManager manager = AppConfigurationManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.replicas() - .listByConfigurationStore("khnzbonlw", "toego", "dwbwhkszzcmrvexz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bt", response.iterator().next().location()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ResourceIdentityTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ResourceIdentityTests.java deleted file mode 100644 index 66e4888890a8..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ResourceIdentityTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.IdentityType; -import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; -import com.azure.resourcemanager.appconfiguration.models.UserIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ResourceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceIdentity model = BinaryData.fromString( - "{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"rtihfxtijbpz\":{\"principalId\":\"xzdxtayrlhmwh\",\"clientId\":\"mrqobmtukknr\"}},\"principalId\":\"nwzsymg\",\"tenantId\":\"uf\"}") - .toObject(ResourceIdentity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceIdentity model = new ResourceIdentity().withType(IdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("rtihfxtijbpz", new UserIdentity())); - model = BinaryData.fromObject(model).toObject(ResourceIdentity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @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/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ServiceSpecificationTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ServiceSpecificationTests.java deleted file mode 100644 index defa4cd3557d..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ServiceSpecificationTests.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.LogSpecification; -import com.azure.resourcemanager.appconfiguration.models.MetricDimension; -import com.azure.resourcemanager.appconfiguration.models.MetricSpecification; -import com.azure.resourcemanager.appconfiguration.models.ServiceSpecification; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceSpecificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceSpecification model = BinaryData.fromString( - "{\"logSpecifications\":[{\"name\":\"xazjpqyegual\",\"displayName\":\"xxhejjzzvd\",\"blobDuration\":\"gwdslfhotwm\"},{\"name\":\"npwlbjnpg\",\"displayName\":\"ftadehxnltyfs\",\"blobDuration\":\"pusuesn\"},{\"name\":\"dejbavo\",\"displayName\":\"zdmohctbqvu\",\"blobDuration\":\"xdn\"},{\"name\":\"vo\",\"displayName\":\"ujjugwdkcglh\",\"blobDuration\":\"azjdyggd\"}],\"metricSpecifications\":[{\"name\":\"hbkuofqwey\",\"displayName\":\"menevfyexfwh\",\"displayDescription\":\"cibvyvdcsitynn\",\"unit\":\"mdectehfiqscjey\",\"aggregationType\":\"hezrkgq\",\"internalMetricName\":\"jrefovgmkqsle\",\"dimensions\":[{\"name\":\"yqjpkcatt\",\"displayName\":\"gjcrcczsqpjhvm\",\"internalName\":\"jvnysounqe\"},{\"name\":\"noae\",\"displayName\":\"fhyhltrpmopjmcma\",\"internalName\":\"okth\"},{\"name\":\"iuaod\",\"displayName\":\"cpkvxodp\",\"internalName\":\"zmyzydagf\"},{\"name\":\"xbezyiuokktwh\",\"displayName\":\"xw\",\"internalName\":\"wqsmbsur\"}],\"fillGapWithZero\":true},{\"name\":\"o\",\"displayName\":\"ocfs\",\"displayDescription\":\"s\",\"unit\":\"ddystkiiuxhqy\",\"aggregationType\":\"xorrqnb\",\"internalMetricName\":\"czvyifq\",\"dimensions\":[{\"name\":\"vjsllrmvvdfw\",\"displayName\":\"kpnpulexxbczwtr\",\"internalName\":\"iqzbq\"},{\"name\":\"sovmyokacspkwl\",\"displayName\":\"dobpxjmflbvvn\",\"internalName\":\"rkcciwwzjuqk\"}],\"fillGapWithZero\":false},{\"name\":\"jiwkuofoskghsau\",\"displayName\":\"mjmvxieduugidyjr\",\"displayDescription\":\"byao\",\"unit\":\"e\",\"aggregationType\":\"sonpclhocohs\",\"internalMetricName\":\"ev\",\"dimensions\":[{\"name\":\"zfbuhf\",\"displayName\":\"faxkffeii\",\"internalName\":\"lvmezyvshxmzsbbz\"},{\"name\":\"gigr\",\"displayName\":\"burvjxxjnspy\",\"internalName\":\"tko\"}],\"fillGapWithZero\":true},{\"name\":\"uknvudwti\",\"displayName\":\"bldngkpoc\",\"displayDescription\":\"azyxoegukg\",\"unit\":\"piu\",\"aggregationType\":\"ygevqzntypmrbpiz\",\"internalMetricName\":\"r\",\"dimensions\":[{\"name\":\"pyd\",\"displayName\":\"yhxdeoejzicwi\",\"internalName\":\"jttgzf\"},{\"name\":\"shcbkhajdeyeamdp\",\"displayName\":\"g\",\"internalName\":\"pbuxwgipwhon\"},{\"name\":\"kgshwa\",\"displayName\":\"ixzbinjeputtmryw\",\"internalName\":\"zoqftiyqzrnkcqvy\"},{\"name\":\"whzlsicohoq\",\"displayName\":\"wvl\",\"internalName\":\"avwhheunm\"}],\"fillGapWithZero\":true}]}") - .toObject(ServiceSpecification.class); - Assertions.assertEquals("xazjpqyegual", model.logSpecifications().get(0).name()); - Assertions.assertEquals("xxhejjzzvd", model.logSpecifications().get(0).displayName()); - Assertions.assertEquals("gwdslfhotwm", model.logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("hbkuofqwey", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("menevfyexfwh", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("cibvyvdcsitynn", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("mdectehfiqscjey", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("hezrkgq", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("jrefovgmkqsle", model.metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("yqjpkcatt", model.metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("gjcrcczsqpjhvm", - model.metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("jvnysounqe", model.metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.metricSpecifications().get(0).fillGapWithZero()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceSpecification model = new ServiceSpecification().withLogSpecifications(Arrays.asList( - new LogSpecification().withName("xazjpqyegual") - .withDisplayName("xxhejjzzvd") - .withBlobDuration("gwdslfhotwm"), - new LogSpecification().withName("npwlbjnpg").withDisplayName("ftadehxnltyfs").withBlobDuration("pusuesn"), - new LogSpecification().withName("dejbavo").withDisplayName("zdmohctbqvu").withBlobDuration("xdn"), - new LogSpecification().withName("vo").withDisplayName("ujjugwdkcglh").withBlobDuration("azjdyggd"))) - .withMetricSpecifications(Arrays.asList( - new MetricSpecification().withName("hbkuofqwey") - .withDisplayName("menevfyexfwh") - .withDisplayDescription("cibvyvdcsitynn") - .withUnit("mdectehfiqscjey") - .withAggregationType("hezrkgq") - .withInternalMetricName("jrefovgmkqsle") - .withDimensions(Arrays.asList(new MetricDimension() - .withName("yqjpkcatt") - .withDisplayName("gjcrcczsqpjhvm") - .withInternalName("jvnysounqe"), - new MetricDimension().withName("noae") - .withDisplayName("fhyhltrpmopjmcma") - .withInternalName("okth"), - new MetricDimension() - .withName("iuaod") - .withDisplayName("cpkvxodp") - .withInternalName("zmyzydagf"), - new MetricDimension().withName("xbezyiuokktwh") - .withDisplayName("xw") - .withInternalName("wqsmbsur"))) - .withFillGapWithZero(true), - new MetricSpecification().withName("o") - .withDisplayName("ocfs") - .withDisplayDescription("s") - .withUnit("ddystkiiuxhqy") - .withAggregationType("xorrqnb") - .withInternalMetricName("czvyifq") - .withDimensions(Arrays.asList( - new MetricDimension().withName("vjsllrmvvdfw") - .withDisplayName("kpnpulexxbczwtr") - .withInternalName("iqzbq"), - new MetricDimension().withName("sovmyokacspkwl") - .withDisplayName("dobpxjmflbvvn") - .withInternalName("rkcciwwzjuqk"))) - .withFillGapWithZero(false), - new MetricSpecification().withName("jiwkuofoskghsau") - .withDisplayName("mjmvxieduugidyjr") - .withDisplayDescription("byao") - .withUnit("e") - .withAggregationType("sonpclhocohs") - .withInternalMetricName("ev") - .withDimensions(Arrays.asList( - new MetricDimension().withName("zfbuhf") - .withDisplayName("faxkffeii") - .withInternalName("lvmezyvshxmzsbbz"), - new MetricDimension().withName("gigr").withDisplayName("burvjxxjnspy").withInternalName("tko"))) - .withFillGapWithZero(true), - new MetricSpecification().withName("uknvudwti") - .withDisplayName("bldngkpoc") - .withDisplayDescription("azyxoegukg") - .withUnit("piu") - .withAggregationType("ygevqzntypmrbpiz") - .withInternalMetricName("r") - .withDimensions(Arrays.asList( - new MetricDimension().withName("pyd") - .withDisplayName("yhxdeoejzicwi") - .withInternalName("jttgzf"), - new MetricDimension().withName("shcbkhajdeyeamdp") - .withDisplayName("g") - .withInternalName("pbuxwgipwhon"), - new MetricDimension().withName("kgshwa") - .withDisplayName("ixzbinjeputtmryw") - .withInternalName("zoqftiyqzrnkcqvy"), - new MetricDimension().withName("whzlsicohoq") - .withDisplayName("wvl") - .withInternalName("avwhheunm"))) - .withFillGapWithZero(true))); - model = BinaryData.fromObject(model).toObject(ServiceSpecification.class); - Assertions.assertEquals("xazjpqyegual", model.logSpecifications().get(0).name()); - Assertions.assertEquals("xxhejjzzvd", model.logSpecifications().get(0).displayName()); - Assertions.assertEquals("gwdslfhotwm", model.logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("hbkuofqwey", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("menevfyexfwh", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("cibvyvdcsitynn", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("mdectehfiqscjey", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("hezrkgq", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("jrefovgmkqsle", model.metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals("yqjpkcatt", model.metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("gjcrcczsqpjhvm", - model.metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("jvnysounqe", model.metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.metricSpecifications().get(0).fillGapWithZero()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/SkuTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/SkuTests.java deleted file mode 100644 index ba509821738f..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/SkuTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.Sku; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString("{\"name\":\"datscmd\"}").toObject(Sku.class); - Assertions.assertEquals("datscmd", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("datscmd"); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("datscmd", model.name()); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/UserIdentityTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/UserIdentityTests.java deleted file mode 100644 index 6abceb652217..000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/UserIdentityTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appconfiguration.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appconfiguration.models.UserIdentity; - -public final class UserIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserIdentity model = BinaryData.fromString("{\"principalId\":\"zk\",\"clientId\":\"dbihanufhfcbj\"}") - .toObject(UserIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentity model = new UserIdentity(); - model = BinaryData.fromObject(model).toObject(UserIdentity.class); - } -}