diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md index 1df8b85f1613c..1e6b994ce77fb 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.8 (Unreleased) +## 1.0.0-beta.1 (2024-07-23) + +- Azure Resource Manager AppConfiguration client library for Java. This package contains Microsoft Azure SDK for AppConfiguration Management SDK. Package tag package-preview-2024-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/README.md index 1b36cf7e56b23..ccb2cf3e98554 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-2023-03-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-09. 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-beta.7 + 1.0.0-beta.8 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -94,12 +90,15 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md [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/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fappconfiguration%2Fazure-resourcemanager-appconfiguration%2FREADME.png) diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/SAMPLE.md b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/SAMPLE.md index 02a9a5cc5eb82..dd81cc8bc0fba 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) +- [ResetSasTokens](#configurationstores_resetsastokens) - [Update](#configurationstores_update) ## KeyValues @@ -45,30 +47,43 @@ - [Delete](#replicas_delete) - [Get](#replicas_get) - [ListByConfigurationStore](#replicas_listbyconfigurationstore) + +## Snapshots + +- [Create](#snapshots_create) +- [Get](#snapshots_get) ### ConfigurationStores_Create ```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.Sku; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; import com.azure.resourcemanager.appconfiguration.models.UserIdentity; import java.util.HashMap; import java.util.Map; -/** Samples for ConfigurationStores Create. */ +/** + * Samples for ConfigurationStores Create. + */ public final class ConfigurationStoresCreateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreate.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreate.json */ /** * Sample code: ConfigurationStores_Create. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresCreate( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .configurationStores() + public static void + configurationStoresCreate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() .define("contoso") .withRegion("westus") .withExistingResourceGroup("myResourceGroup") @@ -78,44 +93,65 @@ public final class ConfigurationStoresCreateSamples { } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateWithIdentity.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateWithIdentity.json */ /** * Sample code: ConfigurationStores_Create_With_Identity. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCreateWithIdentity( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .configurationStores() + manager.configurationStores() .define("contoso") .withRegion("westus") .withExistingResourceGroup("myResourceGroup") .withSku(new Sku().withName("Standard")) .withTags(mapOf("myTag", "myTagValue")) - .withIdentity( - new ResourceIdentity() - .withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", - new UserIdentity()))) + .withIdentity(new ResourceIdentity().withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentity()))) .create(); } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateWithLocalAuthDisabled.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateWithDataPlaneProxy.json + */ + /** + * Sample code: ConfigurationStores_Create_With_Data_Plane_Proxy. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresCreateWithDataPlaneProxy( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .define("contoso") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard")) + .withDataPlaneProxy(new DataPlaneProxyProperties().withAuthenticationMode(AuthenticationMode.PASS_THROUGH) + .withPrivateLinkDelegation(PrivateLinkDelegation.ENABLED)) + .create(); + } + + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateWithLocalAuthDisabled.json */ /** * Sample code: ConfigurationStores_Create_With_Local_Auth_Disabled. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCreateWithLocalAuthDisabled( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .configurationStores() + manager.configurationStores() .define("contoso") .withRegion("westus") .withExistingResourceGroup("myResourceGroup") @@ -124,6 +160,33 @@ public final class ConfigurationStoresCreateSamples { .create(); } + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-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(); + } + + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -140,40 +203,86 @@ public final class ConfigurationStoresCreateSamples { ### ConfigurationStores_Delete ```java -/** Samples for ConfigurationStores Delete. */ +/** + * Samples for ConfigurationStores Delete. + */ public final class ConfigurationStoresDeleteSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDelete.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresDelete.json */ /** * Sample code: ConfigurationStores_Delete. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresDelete( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + configurationStoresDelete(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().delete("myResourceGroup", "contoso", com.azure.core.util.Context.NONE); } } ``` +### ConfigurationStores_GenerateSasToken + +```java +import com.azure.resourcemanager.appconfiguration.models.KvResourceParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenKind; +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-09-01-preview/examples/ + * ConfigurationStoresSasTokenGeneration.json + */ + /** + * Sample code: ConfigurationStores_SasTokenGeneration. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresSasTokenGeneration( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .generateSasTokenWithResponse("myResourceGroup", "contoso", + new SasTokenGenerationParameters() + .withResourceParameters(new KvResourceParameters().withKey("fakeTokenPlaceholder") + .withLabel("prod") + .withTags(Arrays.asList("group=test-group", "region=eastus"))) + .withExpires(OffsetDateTime.parse("2024-09-01T00:00:00")) + .withCacheControlMaxAge(3600.0F) + .withKind(SasTokenKind.PRIMARY), + com.azure.core.util.Context.NONE); + } +} +``` + ### ConfigurationStores_GetByResourceGroup ```java -/** Samples for ConfigurationStores GetByResourceGroup. */ +/** + * Samples for ConfigurationStores GetByResourceGroup. + */ public final class ConfigurationStoresGetByResourceGroupSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGet.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresGet.json */ /** * Sample code: ConfigurationStores_Get. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresGet( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .configurationStores() + public static void + configurationStoresGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE); } } @@ -182,18 +291,22 @@ public final class ConfigurationStoresGetByResourceGroupSamples { ### ConfigurationStores_GetDeleted ```java -/** Samples for ConfigurationStores GetDeleted. */ +/** + * Samples for ConfigurationStores GetDeleted. + */ public final class ConfigurationStoresGetDeletedSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresGet.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * DeletedConfigurationStoresGet.json */ /** * Sample code: DeletedConfigurationStores_Get. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void deletedConfigurationStoresGet( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + deletedConfigurationStoresGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().getDeletedWithResponse("westus", "contoso", com.azure.core.util.Context.NONE); } } @@ -202,18 +315,22 @@ public final class ConfigurationStoresGetDeletedSamples { ### ConfigurationStores_List ```java -/** Samples for ConfigurationStores List. */ +/** + * Samples for ConfigurationStores List. + */ public final class ConfigurationStoresListSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresList.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresList.json */ /** * Sample code: ConfigurationStores_List. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresList( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + configurationStoresList(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().list(null, com.azure.core.util.Context.NONE); } } @@ -222,14 +339,18 @@ public final class ConfigurationStoresListSamples { ### ConfigurationStores_ListByResourceGroup ```java -/** Samples for ConfigurationStores ListByResourceGroup. */ +/** + * Samples for ConfigurationStores ListByResourceGroup. + */ public final class ConfigurationStoresListByResourceGroupSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListByResourceGroup.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresListByResourceGroup.json */ /** * Sample code: ConfigurationStores_ListByResourceGroup. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresListByResourceGroup( @@ -242,18 +363,22 @@ public final class ConfigurationStoresListByResourceGroupSamples { ### ConfigurationStores_ListDeleted ```java -/** Samples for ConfigurationStores ListDeleted. */ +/** + * Samples for ConfigurationStores ListDeleted. + */ public final class ConfigurationStoresListDeletedSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresList.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * DeletedConfigurationStoresList.json */ /** * Sample code: DeletedConfigurationStores_List. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void deletedConfigurationStoresList( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + deletedConfigurationStoresList(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().listDeleted(com.azure.core.util.Context.NONE); } } @@ -262,18 +387,22 @@ public final class ConfigurationStoresListDeletedSamples { ### ConfigurationStores_ListKeys ```java -/** Samples for ConfigurationStores ListKeys. */ +/** + * Samples for ConfigurationStores ListKeys. + */ public final class ConfigurationStoresListKeysSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListKeys.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresListKeys.json */ /** * Sample code: ConfigurationStores_ListKeys. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresListKeys( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + configurationStoresListKeys(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().listKeys("myResourceGroup", "contoso", null, com.azure.core.util.Context.NONE); } } @@ -282,18 +411,22 @@ public final class ConfigurationStoresListKeysSamples { ### ConfigurationStores_PurgeDeleted ```java -/** Samples for ConfigurationStores PurgeDeleted. */ +/** + * Samples for ConfigurationStores PurgeDeleted. + */ public final class ConfigurationStoresPurgeDeletedSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresPurge.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * DeletedConfigurationStoresPurge.json */ /** * Sample code: Purge a deleted configuration store. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void purgeADeletedConfigurationStore( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + purgeADeletedConfigurationStore(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().purgeDeleted("westus", "contoso", com.azure.core.util.Context.NONE); } } @@ -304,25 +437,54 @@ public final class ConfigurationStoresPurgeDeletedSamples { ```java import com.azure.resourcemanager.appconfiguration.models.RegenerateKeyParameters; -/** Samples for ConfigurationStores RegenerateKey. */ +/** + * Samples for ConfigurationStores RegenerateKey. + */ public final class ConfigurationStoresRegenerateKeySamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresRegenerateKey.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresRegenerateKey.json */ /** * Sample code: ConfigurationStores_RegenerateKey. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresRegenerateKey( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .configurationStores() - .regenerateKeyWithResponse( - "myResourceGroup", - "contoso", - new RegenerateKeyParameters().withId("439AD01B4BE67DB1"), - com.azure.core.util.Context.NONE); + public static void + configurationStoresRegenerateKey(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .regenerateKeyWithResponse("myResourceGroup", "contoso", + new RegenerateKeyParameters().withId("439AD01B4BE67DB1"), com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationStores_ResetSasTokens + +```java +import com.azure.resourcemanager.appconfiguration.models.ResetSasTokensParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenKind; + +/** + * Samples for ConfigurationStores ResetSasTokens. + */ +public final class ConfigurationStoresResetSasTokensSamples { + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresResetSasTokens.json + */ + /** + * Sample code: ConfigurationStores_ResetSasTokens. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void + configurationStoresResetSasTokens(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .resetSasTokensWithResponse("myResourceGroup", "contoso", + new ResetSasTokensParameters().withKind(SasTokenKind.PRIMARY), com.azure.core.util.Context.NONE); } } ``` @@ -338,73 +500,72 @@ import com.azure.resourcemanager.appconfiguration.models.UserIdentity; import java.util.HashMap; import java.util.Map; -/** Samples for ConfigurationStores Update. */ +/** + * Samples for ConfigurationStores Update. + */ public final class ConfigurationStoresUpdateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdateDisableLocalAuth.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresUpdateDisableLocalAuth.json */ /** * Sample code: ConfigurationStores_Update_Disable_Local_Auth. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresUpdateDisableLocalAuth( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - ConfigurationStore resource = - manager - .configurationStores() - .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) - .getValue(); + ConfigurationStore resource = manager.configurationStores() + .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withSku(new Sku().withName("Standard")).withDisableLocalAuth(true).apply(); } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdate.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresUpdate.json */ /** * Sample code: ConfigurationStores_Update. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresUpdate( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - ConfigurationStore resource = - manager - .configurationStores() - .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) - .getValue(); + public static void + configurationStoresUpdate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + ConfigurationStore resource = manager.configurationStores() + .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("Category", "Marketing")).withSku(new Sku().withName("Standard")).apply(); } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdateWithIdentity.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresUpdateWithIdentity.json */ /** * Sample code: ConfigurationStores_Update_With_Identity. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresUpdateWithIdentity( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - ConfigurationStore resource = - manager - .configurationStores() - .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + ConfigurationStore resource = manager.configurationStores() + .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("Category", "Marketing")) - .withIdentity( - new ResourceIdentity() - .withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", - new UserIdentity()))) + .withIdentity(new ResourceIdentity().withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentity()))) .withSku(new Sku().withName("Standard")) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -424,20 +585,23 @@ public final class ConfigurationStoresUpdateSamples { import java.util.HashMap; import java.util.Map; -/** Samples for KeyValues CreateOrUpdate. */ +/** + * Samples for KeyValues CreateOrUpdate. + */ public final class KeyValuesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateKeyValue.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateKeyValue.json */ /** * Sample code: KeyValues_CreateOrUpdate. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void keyValuesCreateOrUpdate( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .keyValues() + public static void + keyValuesCreateOrUpdate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.keyValues() .define("myKey$myLabel") .withExistingConfigurationStore("myResourceGroup", "contoso") .withTags(mapOf("tag1", "tagValue1", "tag2", "tagValue2")) @@ -445,6 +609,7 @@ public final class KeyValuesCreateOrUpdateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -461,14 +626,18 @@ public final class KeyValuesCreateOrUpdateSamples { ### KeyValues_Delete ```java -/** Samples for KeyValues Delete. */ +/** + * Samples for KeyValues Delete. + */ public final class KeyValuesDeleteSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeleteKeyValue.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresDeleteKeyValue.json */ /** * Sample code: KeyValues_Delete. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void keyValuesDelete(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { @@ -480,19 +649,22 @@ public final class KeyValuesDeleteSamples { ### KeyValues_Get ```java -/** Samples for KeyValues Get. */ +/** + * Samples for KeyValues Get. + */ public final class KeyValuesGetSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetKeyValue.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresGetKeyValue.json */ /** * Sample code: KeyValues_Get. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void keyValuesGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .keyValues() + manager.keyValues() .getWithResponse("myResourceGroup", "contoso", "myKey$myLabel", com.azure.core.util.Context.NONE); } } @@ -504,42 +676,44 @@ public final class KeyValuesGetSamples { import com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters; import com.azure.resourcemanager.appconfiguration.models.ConfigurationResourceType; -/** Samples for Operations CheckNameAvailability. */ +/** + * Samples for Operations CheckNameAvailability. + */ public final class OperationsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/CheckNameAvailable.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * CheckNameAvailable.json */ /** * Sample code: ConfigurationStores_CheckNameAvailable. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCheckNameAvailable( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .operations() + manager.operations() .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityParameters() - .withName("contoso") + new CheckNameAvailabilityParameters().withName("contoso") .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/CheckNameNotAvailable.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * CheckNameNotAvailable.json */ /** * Sample code: ConfigurationStores_CheckNameNotAvailable. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCheckNameNotAvailable( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .operations() + manager.operations() .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityParameters() - .withName("contoso") + new CheckNameAvailabilityParameters().withName("contoso") .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES), com.azure.core.util.Context.NONE); } @@ -549,14 +723,18 @@ public final class OperationsCheckNameAvailabilitySamples { ### Operations_List ```java -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/OperationsList.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * OperationsList.json */ /** * Sample code: Operations_List. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void operationsList(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { @@ -571,44 +749,44 @@ public final class OperationsListSamples { import com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters; import com.azure.resourcemanager.appconfiguration.models.ConfigurationResourceType; -/** Samples for Operations RegionalCheckNameAvailability. */ +/** + * Samples for Operations RegionalCheckNameAvailability. + */ public final class OperationsRegionalCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/RegionalCheckNameAvailable.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * RegionalCheckNameAvailable.json */ /** * Sample code: ConfigurationStores_CheckNameAvailable. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCheckNameAvailable( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .operations() - .regionalCheckNameAvailabilityWithResponse( - "westus", - new CheckNameAvailabilityParameters() - .withName("contoso") + manager.operations() + .regionalCheckNameAvailabilityWithResponse("westus", + new CheckNameAvailabilityParameters().withName("contoso") .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/RegionalCheckNameNotAvailable.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * RegionalCheckNameNotAvailable.json */ /** * Sample code: ConfigurationStores_CheckNameNotAvailable. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCheckNameNotAvailable( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .operations() - .regionalCheckNameAvailabilityWithResponse( - "westus", - new CheckNameAvailabilityParameters() - .withName("contoso") + manager.operations() + .regionalCheckNameAvailabilityWithResponse("westus", + new CheckNameAvailabilityParameters().withName("contoso") .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES), com.azure.core.util.Context.NONE); } @@ -622,28 +800,28 @@ import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnection; import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; -/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdatePrivateEndpointConnection.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresUpdatePrivateEndpointConnection.json */ /** * Sample code: PrivateEndpointConnection_Update. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void privateEndpointConnectionUpdate( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - PrivateEndpointConnection resource = - manager - .privateEndpointConnections() - .getWithResponse("myResourceGroup", "contoso", "myConnection", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + privateEndpointConnectionUpdate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + PrivateEndpointConnection resource = manager.privateEndpointConnections() + .getWithResponse("myResourceGroup", "contoso", "myConnection", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(ConnectionStatus.APPROVED) + new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED) .withDescription("Auto-Approved")) .apply(); } @@ -653,20 +831,23 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { ### PrivateEndpointConnections_Delete ```java -/** Samples for PrivateEndpointConnections Delete. */ +/** + * Samples for PrivateEndpointConnections Delete. + */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeletePrivateEndpointConnection.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresDeletePrivateEndpointConnection.json */ /** * Sample code: PrivateEndpointConnections_Delete. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void privateEndpointConnectionsDelete( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateEndpointConnections() + public static void + privateEndpointConnectionsDelete(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.privateEndpointConnections() .delete("myResourceGroup", "contoso", "myConnection", com.azure.core.util.Context.NONE); } } @@ -675,20 +856,23 @@ public final class PrivateEndpointConnectionsDeleteSamples { ### PrivateEndpointConnections_Get ```java -/** Samples for PrivateEndpointConnections Get. */ +/** + * Samples for PrivateEndpointConnections Get. + */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresGetPrivateEndpointConnection.json */ /** * Sample code: PrivateEndpointConnection_GetConnection. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void privateEndpointConnectionGetConnection( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateEndpointConnections() + manager.privateEndpointConnections() .getWithResponse("myResourceGroup", "contoso", "myConnection", com.azure.core.util.Context.NONE); } } @@ -697,20 +881,23 @@ public final class PrivateEndpointConnectionsGetSamples { ### PrivateEndpointConnections_ListByConfigurationStore ```java -/** Samples for PrivateEndpointConnections ListByConfigurationStore. */ +/** + * Samples for PrivateEndpointConnections ListByConfigurationStore. + */ public final class PrivateEndpointConnectionsListByConfigurationStoreSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListPrivateEndpointConnections.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresListPrivateEndpointConnections.json */ /** * Sample code: PrivateEndpointConnection_List. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void privateEndpointConnectionList( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateEndpointConnections() + public static void + privateEndpointConnectionList(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.privateEndpointConnections() .listByConfigurationStore("myResourceGroup", "contoso", com.azure.core.util.Context.NONE); } } @@ -719,20 +906,23 @@ public final class PrivateEndpointConnectionsListByConfigurationStoreSamples { ### PrivateLinkResources_Get ```java -/** Samples for PrivateLinkResources Get. */ +/** + * Samples for PrivateLinkResources Get. + */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourceGet.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * PrivateLinkResourceGet.json */ /** * Sample code: PrivateLinkResources_Get. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void privateLinkResourcesGet( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateLinkResources() + public static void + privateLinkResourcesGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.privateLinkResources() .getWithResponse("myResourceGroup", "contoso", "configurationStores", com.azure.core.util.Context.NONE); } } @@ -741,20 +931,23 @@ public final class PrivateLinkResourcesGetSamples { ### PrivateLinkResources_ListByConfigurationStore ```java -/** Samples for PrivateLinkResources ListByConfigurationStore. */ +/** + * Samples for PrivateLinkResources ListByConfigurationStore. + */ public final class PrivateLinkResourcesListByConfigurationStoreSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourcesListByConfigurationStore.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * PrivateLinkResourcesListByConfigurationStore.json */ /** * Sample code: PrivateLinkResources_ListGroupIds. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void privateLinkResourcesListGroupIds( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateLinkResources() + public static void + privateLinkResourcesListGroupIds(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.privateLinkResources() .listByConfigurationStore("myResourceGroup", "contoso", com.azure.core.util.Context.NONE); } } @@ -763,19 +956,22 @@ public final class PrivateLinkResourcesListByConfigurationStoreSamples { ### Replicas_Create ```java -/** Samples for Replicas Create. */ +/** + * Samples for Replicas Create. + */ public final class ReplicasCreateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateReplica.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateReplica.json */ /** * Sample code: Replicas_Create. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void replicasCreate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .replicas() + manager.replicas() .define("myReplicaEus") .withExistingConfigurationStore("myResourceGroup", "contoso") .withRegion("eastus") @@ -787,14 +983,18 @@ public final class ReplicasCreateSamples { ### Replicas_Delete ```java -/** Samples for Replicas Delete. */ +/** + * Samples for Replicas Delete. + */ public final class ReplicasDeleteSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeleteReplica.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresDeleteReplica.json */ /** * Sample code: Replicas_Delete. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void replicasDelete(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { @@ -806,19 +1006,22 @@ public final class ReplicasDeleteSamples { ### Replicas_Get ```java -/** Samples for Replicas Get. */ +/** + * Samples for Replicas Get. + */ public final class ReplicasGetSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetReplica.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresGetReplica.json */ /** * Sample code: Replicas_Get. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void replicasGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .replicas() + manager.replicas() .getWithResponse("myResourceGroup", "contoso", "myReplicaEus", com.azure.core.util.Context.NONE); } } @@ -827,22 +1030,80 @@ public final class ReplicasGetSamples { ### Replicas_ListByConfigurationStore ```java -/** Samples for Replicas ListByConfigurationStore. */ +/** + * Samples for Replicas ListByConfigurationStore. + */ public final class ReplicasListByConfigurationStoreSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListReplicas.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresListReplicas.json */ /** * Sample code: Replicas_ListByConfigurationStore. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void replicasListByConfigurationStore( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .replicas() + public static void + replicasListByConfigurationStore(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.replicas() .listByConfigurationStore("myResourceGroup", "contoso", null, com.azure.core.util.Context.NONE); } } ``` +### Snapshots_Create + +```java +import com.azure.resourcemanager.appconfiguration.models.KeyValueFilter; +import java.util.Arrays; + +/** + * Samples for Snapshots Create. + */ +public final class SnapshotsCreateSamples { + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateSnapshot.json + */ + /** + * Sample code: Snapshots_Create. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void snapshotsCreate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.snapshots() + .define("mySnapshot") + .withExistingConfigurationStore("myResourceGroup", "contoso") + .withFilters(Arrays.asList(new KeyValueFilter().withKey("fakeTokenPlaceholder").withLabel("Production"))) + .withRetentionPeriod(3600L) + .create(); + } +} +``` + +### Snapshots_Get + +```java +/** + * Samples for Snapshots Get. + */ +public final class SnapshotsGetSamples { + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresGetSnapshot.json + */ + /** + * Sample code: Snapshots_Get. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void snapshotsGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.snapshots() + .getWithResponse("myResourceGroup", "contoso", "mySnapshot", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/pom.xml index e5ac900025267..2593ce9169427 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-2023-03-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-09. https://github.com/Azure/azure-sdk-for-java @@ -45,8 +45,14 @@ UTF-8 0 0 + true + + com.azure + azure-json + 1.1.0 + com.azure azure-core @@ -87,8 +93,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy 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 016de98ae511c..cd86b490aae90 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 @@ -11,8 +11,8 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -31,12 +31,14 @@ import com.azure.resourcemanager.appconfiguration.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.appconfiguration.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.appconfiguration.implementation.ReplicasImpl; +import com.azure.resourcemanager.appconfiguration.implementation.SnapshotsImpl; import com.azure.resourcemanager.appconfiguration.models.ConfigurationStores; import com.azure.resourcemanager.appconfiguration.models.KeyValues; import com.azure.resourcemanager.appconfiguration.models.Operations; import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnections; import com.azure.resourcemanager.appconfiguration.models.PrivateLinkResources; import com.azure.resourcemanager.appconfiguration.models.Replicas; +import com.azure.resourcemanager.appconfiguration.models.Snapshots; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -44,7 +46,9 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to AppConfigurationManager. */ +/** + * Entry point to AppConfigurationManager. + */ public final class AppConfigurationManager { private ConfigurationStores configurationStores; @@ -58,23 +62,23 @@ public final class AppConfigurationManager { private Replicas replicas; + private Snapshots snapshots; + private final AppConfigurationManagementClient clientObject; private AppConfigurationManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new AppConfigurationManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new AppConfigurationManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** * Creates an instance of AppConfiguration service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the AppConfiguration service API instance. @@ -87,7 +91,7 @@ public static AppConfigurationManager authenticate(TokenCredential credential, A /** * Creates an instance of AppConfiguration service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the AppConfiguration service API instance. @@ -100,14 +104,16 @@ public static AppConfigurationManager authenticate(HttpPipeline httpPipeline, Az /** * Gets a Configurable instance that can be used to create AppConfigurationManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new AppConfigurationManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -179,8 +185,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -197,8 +203,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -218,15 +224,13 @@ public AppConfigurationManager authenticate(TokenCredential credential, AzurePro Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") + userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.appconfiguration") .append("/") - .append("1.0.0-beta.7"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") + userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) .append("; ") .append(Configuration.getGlobalConfiguration().get("os.name")) @@ -251,38 +255,28 @@ public AppConfigurationManager authenticate(TokenCredential credential, AzurePro policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new AppConfigurationManager(httpPipeline, profile, defaultPollInterval); } } /** * Gets the resource collection API of ConfigurationStores. It manages ConfigurationStore. - * + * * @return Resource collection API of ConfigurationStores. */ public ConfigurationStores configurationStores() { @@ -294,7 +288,7 @@ public ConfigurationStores configurationStores() { /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -306,20 +300,20 @@ public Operations operations() { /** * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. - * + * * @return Resource collection API of PrivateEndpointConnections. */ public PrivateEndpointConnections privateEndpointConnections() { if (this.privateEndpointConnections == null) { - this.privateEndpointConnections = - new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); } return privateEndpointConnections; } /** * Gets the resource collection API of PrivateLinkResources. - * + * * @return Resource collection API of PrivateLinkResources. */ public PrivateLinkResources privateLinkResources() { @@ -331,7 +325,7 @@ public PrivateLinkResources privateLinkResources() { /** * Gets the resource collection API of KeyValues. It manages KeyValue. - * + * * @return Resource collection API of KeyValues. */ public KeyValues keyValues() { @@ -343,7 +337,7 @@ public KeyValues keyValues() { /** * Gets the resource collection API of Replicas. It manages Replica. - * + * * @return Resource collection API of Replicas. */ public Replicas replicas() { @@ -354,8 +348,22 @@ public Replicas replicas() { } /** - * @return Wrapped service client AppConfigurationManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets the resource collection API of Snapshots. It manages Snapshot. + * + * @return Resource collection API of Snapshots. + */ + public Snapshots snapshots() { + if (this.snapshots == null) { + this.snapshots = new SnapshotsImpl(clientObject.getSnapshots(), this); + } + return snapshots; + } + + /** + * Gets wrapped service client AppConfigurationManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client AppConfigurationManagementClient. */ public AppConfigurationManagementClient serviceClient() { return this.clientObject; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/AppConfigurationManagementClient.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/AppConfigurationManagementClient.java index 186b77e2b62cf..f982a26056145 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/AppConfigurationManagementClient.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/AppConfigurationManagementClient.java @@ -7,82 +7,91 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for AppConfigurationManagementClient class. */ +/** + * The interface for AppConfigurationManagementClient class. + */ public interface AppConfigurationManagementClient { /** * Gets The Microsoft Azure subscription ID. - * + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** * Gets the ConfigurationStoresClient object to access its operations. - * + * * @return the ConfigurationStoresClient object. */ ConfigurationStoresClient getConfigurationStores(); /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); /** * Gets the PrivateEndpointConnectionsClient object to access its operations. - * + * * @return the PrivateEndpointConnectionsClient object. */ PrivateEndpointConnectionsClient getPrivateEndpointConnections(); /** * Gets the PrivateLinkResourcesClient object to access its operations. - * + * * @return the PrivateLinkResourcesClient object. */ PrivateLinkResourcesClient getPrivateLinkResources(); /** * Gets the KeyValuesClient object to access its operations. - * + * * @return the KeyValuesClient object. */ KeyValuesClient getKeyValues(); /** * Gets the ReplicasClient object to access its operations. - * + * * @return the ReplicasClient object. */ ReplicasClient getReplicas(); + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + SnapshotsClient getSnapshots(); } 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 cb4972b4e297a..aeddf3974c0e4 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,14 +14,19 @@ 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.ResetSasTokensParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationParameters; -/** An instance of this class provides access to all the operations defined in ConfigurationStoresClient. */ +/** + * An instance of this class provides access to all the operations defined in ConfigurationStoresClient. + */ public interface ConfigurationStoresClient { /** * Lists the configuration stores for a given subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list configuration stores as paginated response with {@link PagedIterable}. @@ -31,10 +36,10 @@ public interface ConfigurationStoresClient { /** * Lists the configuration stores for a given subscription. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -46,7 +51,7 @@ public interface ConfigurationStoresClient { /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -58,11 +63,11 @@ public interface ConfigurationStoresClient { /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -70,12 +75,12 @@ public interface ConfigurationStoresClient { * @return the result of a request to list configuration stores as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String skipToken, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, + Context context); /** * Gets the properties 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 context The context to associate with this operation. @@ -85,12 +90,12 @@ PagedIterable listByResourceGroup( * @return the properties of the specified configuration store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String configStoreName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String configStoreName, + Context context); /** * Gets the properties 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -103,7 +108,7 @@ Response getByResourceGroupWithResponse( /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -113,12 +118,12 @@ Response getByResourceGroupWithResponse( * @return the {@link SyncPoller} for polling of the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationStoreInner> beginCreate( - String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters); + SyncPoller, ConfigurationStoreInner> beginCreate(String resourceGroupName, + String configStoreName, ConfigurationStoreInner configStoreCreationParameters); /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -129,15 +134,12 @@ SyncPoller, ConfigurationStoreInner> beginCr * @return the {@link SyncPoller} for polling of the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationStoreInner> beginCreate( - String resourceGroupName, - String configStoreName, - ConfigurationStoreInner configStoreCreationParameters, - Context context); + SyncPoller, ConfigurationStoreInner> beginCreate(String resourceGroupName, + String configStoreName, ConfigurationStoreInner configStoreCreationParameters, Context context); /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -147,12 +149,12 @@ SyncPoller, ConfigurationStoreInner> beginCr * @return the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationStoreInner create( - String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters); + ConfigurationStoreInner create(String resourceGroupName, String configStoreName, + ConfigurationStoreInner configStoreCreationParameters); /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -163,15 +165,12 @@ ConfigurationStoreInner create( * @return the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationStoreInner create( - String resourceGroupName, - String configStoreName, - ConfigurationStoreInner configStoreCreationParameters, - Context context); + ConfigurationStoreInner create(String resourceGroupName, String configStoreName, + ConfigurationStoreInner configStoreCreationParameters, Context context); /** * Deletes a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -184,7 +183,7 @@ ConfigurationStoreInner create( /** * Deletes a 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 context The context to associate with this operation. @@ -198,7 +197,7 @@ ConfigurationStoreInner create( /** * Deletes a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -210,7 +209,7 @@ ConfigurationStoreInner create( /** * Deletes a 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 context The context to associate with this operation. @@ -223,7 +222,7 @@ ConfigurationStoreInner create( /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -233,14 +232,12 @@ ConfigurationStoreInner create( * @return the {@link SyncPoller} for polling of the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationStoreInner> beginUpdate( - String resourceGroupName, - String configStoreName, - ConfigurationStoreUpdateParameters configStoreUpdateParameters); + SyncPoller, ConfigurationStoreInner> beginUpdate(String resourceGroupName, + String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters); /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -251,15 +248,12 @@ SyncPoller, ConfigurationStoreInner> beginUp * @return the {@link SyncPoller} for polling of the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ConfigurationStoreInner> beginUpdate( - String resourceGroupName, - String configStoreName, - ConfigurationStoreUpdateParameters configStoreUpdateParameters, - Context context); + SyncPoller, ConfigurationStoreInner> beginUpdate(String resourceGroupName, + String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters, Context context); /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -269,14 +263,12 @@ SyncPoller, ConfigurationStoreInner> beginUp * @return the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationStoreInner update( - String resourceGroupName, - String configStoreName, + ConfigurationStoreInner update(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters); /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -287,15 +279,12 @@ ConfigurationStoreInner update( * @return the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConfigurationStoreInner update( - String resourceGroupName, - String configStoreName, - ConfigurationStoreUpdateParameters configStoreUpdateParameters, - Context context); + ConfigurationStoreInner update(String resourceGroupName, String configStoreName, + ConfigurationStoreUpdateParameters configStoreUpdateParameters, Context context); /** * Lists the access key for 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -308,12 +297,12 @@ ConfigurationStoreInner update( /** * Lists the access key for 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -321,12 +310,12 @@ ConfigurationStoreInner update( * @return the result of a request to list API keys as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listKeys( - String resourceGroupName, String configStoreName, String skipToken, Context context); + PagedIterable listKeys(String resourceGroupName, String configStoreName, String skipToken, + Context context); /** * Regenerates an access key for 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 regenerateKeyParameters The parameters for regenerating an access key. @@ -337,15 +326,12 @@ PagedIterable listKeys( * @return an API key used for authenticating with a configuration store endpoint along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeyWithResponse( - String resourceGroupName, - String configStoreName, - RegenerateKeyParameters regenerateKeyParameters, - Context context); + Response regenerateKeyWithResponse(String resourceGroupName, String configStoreName, + RegenerateKeyParameters regenerateKeyParameters, Context context); /** * Regenerates an access key for 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 regenerateKeyParameters The parameters for regenerating an access key. @@ -355,36 +341,97 @@ Response regenerateKeyWithResponse( * @return an API key used for authenticating with a configuration store endpoint. */ @ServiceMethod(returns = ReturnType.SINGLE) - ApiKeyInner regenerateKey( - String resourceGroupName, String configStoreName, RegenerateKeyParameters regenerateKeyParameters); + 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 all SAS tokens of a given kind (primary/secondary). + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasTokensParameters The object containing information for the SAS token 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response resetSasTokensWithResponse(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters, Context context); + + /** + * Reset all SAS tokens of a given kind (primary/secondary). + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasTokensParameters The object containing information for the SAS token 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetSasTokens(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters); /** * Gets information about the deleted configuration stores in a subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted configuration stores in a subscription as paginated response with {@link - * PagedIterable}. + * @return information about the deleted configuration stores in a subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDeleted(); /** * Gets information about the deleted configuration stores in a subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted configuration stores in a subscription as paginated response with {@link - * PagedIterable}. + * @return information about the deleted configuration stores in a subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listDeleted(Context context); /** * Gets a deleted Azure app configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. @@ -394,12 +441,12 @@ ApiKeyInner regenerateKey( * @return a deleted Azure app configuration store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getDeletedWithResponse( - String location, String configStoreName, Context context); + Response getDeletedWithResponse(String location, String configStoreName, + Context context); /** * Gets a deleted Azure app configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -412,7 +459,7 @@ Response getDeletedWithResponse( /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -425,7 +472,7 @@ Response getDeletedWithResponse( /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. @@ -439,7 +486,7 @@ Response getDeletedWithResponse( /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -451,7 +498,7 @@ Response getDeletedWithResponse( /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/KeyValuesClient.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/KeyValuesClient.java index ac185501d864c..dac813fc27b7f 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/KeyValuesClient.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/KeyValuesClient.java @@ -12,15 +12,19 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appconfiguration.fluent.models.KeyValueInner; -/** An instance of this class provides access to all the operations defined in KeyValuesClient. */ +/** + * An instance of this class provides access to all the operations defined in KeyValuesClient. + */ public interface KeyValuesClient { /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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. @@ -28,16 +32,18 @@ public interface KeyValuesClient { * @return the properties of the specified key-value along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String configStoreName, String keyValueName, Context context); + Response getWithResponse(String resourceGroupName, String configStoreName, String keyValueName, + Context context); /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -47,12 +53,13 @@ Response getWithResponse( KeyValueInner get(String resourceGroupName, String configStoreName, String keyValueName); /** - * Creates a key-value. - * + * Creates a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @param keyValueParameters The parameters for creating a key-value. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -61,20 +68,17 @@ Response getWithResponse( * @return the key-value resource along with all resource properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String configStoreName, - String keyValueName, - KeyValueInner keyValueParameters, - Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String configStoreName, + String keyValueName, KeyValueInner keyValueParameters, Context context); /** - * Creates a key-value. - * + * Creates a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -84,28 +88,30 @@ Response createOrUpdateWithResponse( KeyValueInner createOrUpdate(String resourceGroupName, String configStoreName, String keyValueName); /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String keyValueName); + SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String keyValueName); /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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. @@ -113,16 +119,17 @@ SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String keyValueName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String keyValueName, Context context); /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -131,12 +138,13 @@ SyncPoller, Void> beginDelete( void delete(String resourceGroupName, String configStoreName, String keyValueName); /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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. diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/OperationsClient.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/OperationsClient.java index 102a8a4ca2169..a735e42bf8596 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/OperationsClient.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/OperationsClient.java @@ -13,11 +13,13 @@ import com.azure.resourcemanager.appconfiguration.fluent.models.OperationDefinitionInner; import com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * Checks whether the configuration store name is available for use. - * + * * @param checkNameAvailabilityParameters The object containing information for the availability request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,7 +33,7 @@ Response checkNameAvailabilityWithResponse( /** * Checks whether the configuration store name is available for use. - * + * * @param checkNameAvailabilityParameters The object containing information for the availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -43,34 +45,34 @@ Response checkNameAvailabilityWithResponse( /** * Lists the operations available from this provider. - * + * * @throws com.azure.core.management.exception.ManagementException 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 list configuration store operations as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list configuration store operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Lists the operations available from this provider. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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 list configuration store operations as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list configuration store operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String skipToken, Context context); /** * Checks whether the configuration store name is available for use. - * + * * @param location The location in which uniqueness will be verified. * @param checkNameAvailabilityParameters The object containing information for the availability request. * @param context The context to associate with this operation. @@ -80,12 +82,12 @@ Response checkNameAvailabilityWithResponse( * @return the result of a request to check the availability of a resource name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regionalCheckNameAvailabilityWithResponse( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context); + Response regionalCheckNameAvailabilityWithResponse(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context); /** * Checks whether the configuration store name is available for use. - * + * * @param location The location in which uniqueness will be verified. * @param checkNameAvailabilityParameters The object containing information for the availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -94,6 +96,6 @@ Response regionalCheckNameAvailabilityWithResponse( * @return the result of a request to check the availability of a resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) - NameAvailabilityStatusInner regionalCheckNameAvailability( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters); + NameAvailabilityStatusInner regionalCheckNameAvailability(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateEndpointConnectionsClient.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateEndpointConnectionsClient.java index 0a92340eb6035..ccd211e04d097 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateEndpointConnectionsClient.java @@ -13,11 +13,13 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appconfiguration.fluent.models.PrivateEndpointConnectionInner; -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ public interface PrivateEndpointConnectionsClient { /** * Lists all private endpoint connections for a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -26,12 +28,12 @@ public interface PrivateEndpointConnectionsClient { * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName); + PagedIterable listByConfigurationStore(String resourceGroupName, + String configStoreName); /** * Lists all private endpoint connections for a 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 context The context to associate with this operation. @@ -41,12 +43,12 @@ PagedIterable listByConfigurationStore( * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, Context context); + PagedIterable listByConfigurationStore(String resourceGroupName, + String configStoreName, Context context); /** * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName Private endpoint connection name. @@ -54,16 +56,16 @@ PagedIterable listByConfigurationStore( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the configuration store along with {@link - * Response}. + * @return the specified private endpoint connection associated with the configuration store along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context); + Response getWithResponse(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, Context context); /** * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName Private endpoint connection name. @@ -73,14 +75,14 @@ Response getWithResponse( * @return the specified private endpoint connection associated with the configuration store. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName); + PrivateEndpointConnectionInner get(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName); /** * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -92,16 +94,14 @@ PrivateEndpointConnectionInner get( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, + String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection); /** * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -114,17 +114,14 @@ SyncPoller, PrivateEndpointConnection */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, - Context context); + String resourceGroupName, String configStoreName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, Context context); /** * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -135,17 +132,14 @@ SyncPoller, PrivateEndpointConnection * @return a private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection); + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection); /** * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -157,16 +151,13 @@ PrivateEndpointConnectionInner createOrUpdate( * @return a private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, Context context); /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -176,12 +167,12 @@ PrivateEndpointConnectionInner createOrUpdate( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName); + SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName); /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -192,12 +183,12 @@ SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, Context context); /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -210,7 +201,7 @@ SyncPoller, Void> beginDelete( /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -220,6 +211,6 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context); + void delete(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, + Context context); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateLinkResourcesClient.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateLinkResourcesClient.java index c11541741e8a1..3e4119b85608c 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateLinkResourcesClient.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/PrivateLinkResourcesClient.java @@ -11,25 +11,27 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.appconfiguration.fluent.models.PrivateLinkResourceInner; -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ public interface PrivateLinkResourcesClient { /** * Gets the private link resources that need to be created for a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a configuration store as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName); /** * Gets the private link resources that need to be created for a 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 context The context to associate with this operation. @@ -37,15 +39,15 @@ public interface PrivateLinkResourcesClient { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a configuration store as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, Context context); + PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName, + Context context); /** * Gets a private link resource that need to be created for a 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 groupName The name of the private link resource group. @@ -56,12 +58,12 @@ PagedIterable listByConfigurationStore( * @return a private link resource that need to be created for a configuration store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String configStoreName, String groupName, Context context); + Response getWithResponse(String resourceGroupName, String configStoreName, + String groupName, Context context); /** * Gets a private link resource that need to be created for a 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 groupName The name of the private link resource group. diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/ReplicasClient.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/ReplicasClient.java index 36f7683c7ac31..27a876a9c2d18 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/ReplicasClient.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/ReplicasClient.java @@ -13,11 +13,13 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.appconfiguration.fluent.models.ReplicaInner; -/** An instance of this class provides access to all the operations defined in ReplicasClient. */ +/** + * An instance of this class provides access to all the operations defined in ReplicasClient. + */ public interface ReplicasClient { /** * Lists the replicas for a given configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -30,12 +32,12 @@ public interface ReplicasClient { /** * Lists the replicas for a given 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -43,12 +45,12 @@ public interface ReplicasClient { * @return the result of a request to list replicas as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, String skipToken, Context context); + PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName, + String skipToken, Context context); /** * Gets the properties of the specified replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -59,12 +61,12 @@ PagedIterable listByConfigurationStore( * @return the properties of the specified replica along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String configStoreName, String replicaName, Context context); + Response getWithResponse(String resourceGroupName, String configStoreName, String replicaName, + Context context); /** * Gets the properties of the specified replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -78,7 +80,7 @@ Response getWithResponse( /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -89,12 +91,12 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of the replica resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ReplicaInner> beginCreate( - String resourceGroupName, String configStoreName, String replicaName, ReplicaInner replicaCreationParameters); + SyncPoller, ReplicaInner> beginCreate(String resourceGroupName, String configStoreName, + String replicaName, ReplicaInner replicaCreationParameters); /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -106,16 +108,12 @@ SyncPoller, ReplicaInner> beginCreate( * @return the {@link SyncPoller} for polling of the replica resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ReplicaInner> beginCreate( - String resourceGroupName, - String configStoreName, - String replicaName, - ReplicaInner replicaCreationParameters, - Context context); + SyncPoller, ReplicaInner> beginCreate(String resourceGroupName, String configStoreName, + String replicaName, ReplicaInner replicaCreationParameters, Context context); /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -126,12 +124,12 @@ SyncPoller, ReplicaInner> beginCreate( * @return the replica resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ReplicaInner create( - String resourceGroupName, String configStoreName, String replicaName, ReplicaInner replicaCreationParameters); + ReplicaInner create(String resourceGroupName, String configStoreName, String replicaName, + ReplicaInner replicaCreationParameters); /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -143,16 +141,12 @@ ReplicaInner create( * @return the replica resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ReplicaInner create( - String resourceGroupName, - String configStoreName, - String replicaName, - ReplicaInner replicaCreationParameters, - Context context); + ReplicaInner create(String resourceGroupName, String configStoreName, String replicaName, + ReplicaInner replicaCreationParameters, Context context); /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -162,12 +156,12 @@ ReplicaInner create( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String replicaName); + SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String replicaName); /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -178,12 +172,12 @@ SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String replicaName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, String replicaName, + Context context); /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -196,7 +190,7 @@ SyncPoller, Void> beginDelete( /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/SnapshotsClient.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/SnapshotsClient.java new file mode 100644 index 0000000000000..4151df67468bb --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/SnapshotsClient.java @@ -0,0 +1,121 @@ +// 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; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appconfiguration.fluent.models.SnapshotInner; + +/** + * An instance of this class provides access to all the operations defined in SnapshotsClient. + */ +public interface SnapshotsClient { + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @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 properties of the specified snapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String configStoreName, String snapshotName, + Context context); + + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner get(String resourceGroupName, String configStoreName, String snapshotName); + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnapshotInner> beginCreate(String resourceGroupName, String configStoreName, + String snapshotName, SnapshotInner body); + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnapshotInner> beginCreate(String resourceGroupName, String configStoreName, + String snapshotName, SnapshotInner body, Context context); + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner create(String resourceGroupName, String configStoreName, String snapshotName, SnapshotInner body); + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @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 snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner create(String resourceGroupName, String configStoreName, String snapshotName, SnapshotInner body, + Context context); +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ApiKeyInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ApiKeyInner.java index d5e7279b7b5fc..3e66b6eb0d55f 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ApiKeyInner.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ApiKeyInner.java @@ -5,55 +5,58 @@ package com.azure.resourcemanager.appconfiguration.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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; -/** An API key used for authenticating with a configuration store endpoint. */ +/** + * An API key used for authenticating with a configuration store endpoint. + */ @Immutable -public final class ApiKeyInner { +public final class ApiKeyInner implements JsonSerializable { /* * The key ID. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * A name for the key describing its usage. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The value of the key that is used for authentication purposes. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; /* * A connection string that can be used by supporting clients for authentication. */ - @JsonProperty(value = "connectionString", access = JsonProperty.Access.WRITE_ONLY) private String connectionString; /* * The last time any of the key's properties were modified. */ - @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastModified; /* * Whether this key can only be used for read operations. */ - @JsonProperty(value = "readOnly", access = JsonProperty.Access.WRITE_ONLY) private Boolean readOnly; - /** Creates an instance of ApiKeyInner class. */ + /** + * Creates an instance of ApiKeyInner class. + */ public ApiKeyInner() { } /** * Get the id property: The key ID. - * + * * @return the id value. */ public String id() { @@ -62,7 +65,7 @@ public String id() { /** * Get the name property: A name for the key describing its usage. - * + * * @return the name value. */ public String name() { @@ -71,7 +74,7 @@ public String name() { /** * Get the value property: The value of the key that is used for authentication purposes. - * + * * @return the value value. */ public String value() { @@ -80,7 +83,7 @@ public String value() { /** * Get the connectionString property: A connection string that can be used by supporting clients for authentication. - * + * * @return the connectionString value. */ public String connectionString() { @@ -89,7 +92,7 @@ public String connectionString() { /** * Get the lastModified property: The last time any of the key's properties were modified. - * + * * @return the lastModified value. */ public OffsetDateTime lastModified() { @@ -98,7 +101,7 @@ public OffsetDateTime lastModified() { /** * Get the readOnly property: Whether this key can only be used for read operations. - * + * * @return the readOnly value. */ public Boolean readOnly() { @@ -107,9 +110,55 @@ public Boolean readOnly() { /** * 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 ApiKeyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeyInner 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 ApiKeyInner. + */ + public static ApiKeyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeyInner deserializedApiKeyInner = new ApiKeyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApiKeyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedApiKeyInner.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedApiKeyInner.value = reader.getString(); + } else if ("connectionString".equals(fieldName)) { + deserializedApiKeyInner.connectionString = reader.getString(); + } else if ("lastModified".equals(fieldName)) { + deserializedApiKeyInner.lastModified = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("readOnly".equals(fieldName)) { + deserializedApiKeyInner.readOnly = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeyInner; + }); + } } 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 2888ffc9cbb11..40db67b3d4798 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 @@ -8,14 +8,20 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; 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.Sku; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -29,34 +35,47 @@ public final class ConfigurationStoreInner extends Resource { /* * The managed identity information, if configured. */ - @JsonProperty(value = "identity") private ResourceIdentity identity; /* * The properties of a configuration store. */ - @JsonProperty(value = "properties") private ConfigurationStoreProperties innerProperties; /* * The sku of the configuration store. */ - @JsonProperty(value = "sku", required = true) private Sku sku; /* * Resource system metadata. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of ConfigurationStoreInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ConfigurationStoreInner class. + */ public ConfigurationStoreInner() { } /** * Get the identity property: The managed identity information, if configured. - * + * * @return the identity value. */ public ResourceIdentity identity() { @@ -65,7 +84,7 @@ public ResourceIdentity identity() { /** * Set the identity property: The managed identity information, if configured. - * + * * @param identity the identity value to set. * @return the ConfigurationStoreInner object itself. */ @@ -76,7 +95,7 @@ public ConfigurationStoreInner withIdentity(ResourceIdentity identity) { /** * Get the innerProperties property: The properties of a configuration store. - * + * * @return the innerProperties value. */ private ConfigurationStoreProperties innerProperties() { @@ -85,7 +104,7 @@ private ConfigurationStoreProperties innerProperties() { /** * Get the sku property: The sku of the configuration store. - * + * * @return the sku value. */ public Sku sku() { @@ -94,7 +113,7 @@ public Sku sku() { /** * Set the sku property: The sku of the configuration store. - * + * * @param sku the sku value to set. * @return the ConfigurationStoreInner object itself. */ @@ -105,21 +124,55 @@ public ConfigurationStoreInner withSku(Sku sku) { /** * Get the systemData property: Resource system metadata. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ @Override public ConfigurationStoreInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ConfigurationStoreInner withTags(Map tags) { super.withTags(tags); @@ -128,7 +181,7 @@ public ConfigurationStoreInner withTags(Map tags) { /** * Get the provisioningState property: The provisioning state of the configuration store. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -137,7 +190,7 @@ public ProvisioningState provisioningState() { /** * Get the creationDate property: The creation date of configuration store. - * + * * @return the creationDate value. */ public OffsetDateTime creationDate() { @@ -146,7 +199,7 @@ public OffsetDateTime creationDate() { /** * Get the endpoint property: The DNS endpoint where the configuration store API will be available. - * + * * @return the endpoint value. */ public String endpoint() { @@ -155,7 +208,7 @@ public String endpoint() { /** * Get the encryption property: The encryption settings of the configuration store. - * + * * @return the encryption value. */ public EncryptionProperties encryption() { @@ -164,7 +217,7 @@ public EncryptionProperties encryption() { /** * Set the encryption property: The encryption settings of the configuration store. - * + * * @param encryption the encryption value to set. * @return the ConfigurationStoreInner object itself. */ @@ -179,7 +232,7 @@ public ConfigurationStoreInner withEncryption(EncryptionProperties encryption) { /** * Get the privateEndpointConnections property: The list of private endpoint connections that are set up for this * resource. - * + * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { @@ -189,7 +242,7 @@ public List privateEndpointConnections() { /** * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -199,7 +252,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the ConfigurationStoreInner object itself. */ @@ -213,7 +266,7 @@ public ConfigurationStoreInner withPublicNetworkAccess(PublicNetworkAccess publi /** * Get the disableLocalAuth property: Disables all authentication methods other than AAD authentication. - * + * * @return the disableLocalAuth value. */ public Boolean disableLocalAuth() { @@ -222,7 +275,7 @@ public Boolean disableLocalAuth() { /** * Set the disableLocalAuth property: Disables all authentication methods other than AAD authentication. - * + * * @param disableLocalAuth the disableLocalAuth value to set. * @return the ConfigurationStoreInner object itself. */ @@ -237,7 +290,7 @@ public ConfigurationStoreInner withDisableLocalAuth(Boolean disableLocalAuth) { /** * Get the softDeleteRetentionInDays property: The amount of time in days that the configuration store will be * retained when it is soft deleted. - * + * * @return the softDeleteRetentionInDays value. */ public Integer softDeleteRetentionInDays() { @@ -247,7 +300,7 @@ public Integer softDeleteRetentionInDays() { /** * Set the softDeleteRetentionInDays property: The amount of time in days that the configuration store will be * retained when it is soft deleted. - * + * * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. * @return the ConfigurationStoreInner object itself. */ @@ -262,7 +315,7 @@ public ConfigurationStoreInner withSoftDeleteRetentionInDays(Integer softDeleteR /** * Get the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this * configuration store. - * + * * @return the enablePurgeProtection value. */ public Boolean enablePurgeProtection() { @@ -272,7 +325,7 @@ public Boolean enablePurgeProtection() { /** * Set the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this * configuration store. - * + * * @param enablePurgeProtection the enablePurgeProtection value to set. * @return the ConfigurationStoreInner object itself. */ @@ -284,9 +337,34 @@ public ConfigurationStoreInner withEnablePurgeProtection(Boolean enablePurgeProt return this; } + /** + * Get the dataPlaneProxy property: Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * + * @return the dataPlaneProxy value. + */ + public DataPlaneProxyProperties dataPlaneProxy() { + return this.innerProperties() == null ? null : this.innerProperties().dataPlaneProxy(); + } + + /** + * Set the dataPlaneProxy property: Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * + * @param dataPlaneProxy the dataPlaneProxy value to set. + * @return the ConfigurationStoreInner object itself. + */ + public ConfigurationStoreInner withDataPlaneProxy(DataPlaneProxyProperties dataPlaneProxy) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationStoreProperties(); + } + this.innerProperties().withDataPlaneProxy(dataPlaneProxy); + return this; + } + /** * Get the createMode property: Indicates whether the configuration store need to be recovered. - * + * * @return the createMode value. */ public CreateMode createMode() { @@ -295,7 +373,7 @@ public CreateMode createMode() { /** * Set the createMode property: Indicates whether the configuration store need to be recovered. - * + * * @param createMode the createMode value to set. * @return the ConfigurationStoreInner object itself. */ @@ -307,9 +385,57 @@ 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. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -320,13 +446,70 @@ public void validate() { innerProperties().validate(); } if (sku() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property sku in model ConfigurationStoreInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sku in model ConfigurationStoreInner")); } else { sku().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(ConfigurationStoreInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationStoreInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationStoreInner 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 ConfigurationStoreInner. + */ + public static ConfigurationStoreInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationStoreInner deserializedConfigurationStoreInner = new ConfigurationStoreInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConfigurationStoreInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConfigurationStoreInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConfigurationStoreInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedConfigurationStoreInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigurationStoreInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedConfigurationStoreInner.sku = Sku.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedConfigurationStoreInner.identity = ResourceIdentity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedConfigurationStoreInner.innerProperties = ConfigurationStoreProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedConfigurationStoreInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationStoreInner; + }); + } } 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 1a73d53100d53..5b2cf56a5e93e 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 @@ -5,85 +5,102 @@ package com.azure.resourcemanager.appconfiguration.fluent.models; import com.azure.core.annotation.Fluent; +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.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.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; -/** The properties of a configuration store. */ +/** + * The properties of a configuration store. + */ @Fluent -public final class ConfigurationStoreProperties { +public final class ConfigurationStoreProperties implements JsonSerializable { /* * The provisioning state of the configuration store. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * The creation date of configuration store. */ - @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime creationDate; /* * The DNS endpoint where the configuration store API will be available. */ - @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) private String endpoint; /* * The encryption settings of the configuration store. */ - @JsonProperty(value = "encryption") private EncryptionProperties encryption; /* * The list of private endpoint connections that are set up for this resource. */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; /* * Control permission for data plane traffic coming from public networks while private endpoint is enabled. */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; /* * Disables all authentication methods other than AAD authentication. */ - @JsonProperty(value = "disableLocalAuth") private Boolean disableLocalAuth; /* * The amount of time in days that the configuration store will be retained when it is soft deleted. */ - @JsonProperty(value = "softDeleteRetentionInDays") private Integer softDeleteRetentionInDays; /* * Property specifying whether protection against purge is enabled for this configuration store. */ - @JsonProperty(value = "enablePurgeProtection") private Boolean enablePurgeProtection; + /* + * Property specifying the configuration of data plane proxy for Azure Resource Manager (ARM). + */ + private DataPlaneProxyProperties dataPlaneProxy; + /* * Indicates whether the configuration store need to be recovered. */ - @JsonProperty(value = "createMode") private CreateMode createMode; - /** Creates an instance of ConfigurationStoreProperties class. */ + /* + * Property specifying the configuration of telemetry for this configuration store + */ + private TelemetryProperties telemetry; + + /* + * Property specifying the configuration of experimentation for this configuration store + */ + private ExperimentationProperties experimentation; + + /** + * Creates an instance of ConfigurationStoreProperties class. + */ public ConfigurationStoreProperties() { } /** * Get the provisioningState property: The provisioning state of the configuration store. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -92,7 +109,7 @@ public ProvisioningState provisioningState() { /** * Get the creationDate property: The creation date of configuration store. - * + * * @return the creationDate value. */ public OffsetDateTime creationDate() { @@ -101,7 +118,7 @@ public OffsetDateTime creationDate() { /** * Get the endpoint property: The DNS endpoint where the configuration store API will be available. - * + * * @return the endpoint value. */ public String endpoint() { @@ -110,7 +127,7 @@ public String endpoint() { /** * Get the encryption property: The encryption settings of the configuration store. - * + * * @return the encryption value. */ public EncryptionProperties encryption() { @@ -119,7 +136,7 @@ public EncryptionProperties encryption() { /** * Set the encryption property: The encryption settings of the configuration store. - * + * * @param encryption the encryption value to set. * @return the ConfigurationStoreProperties object itself. */ @@ -131,7 +148,7 @@ public ConfigurationStoreProperties withEncryption(EncryptionProperties encrypti /** * Get the privateEndpointConnections property: The list of private endpoint connections that are set up for this * resource. - * + * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { @@ -141,7 +158,7 @@ public List privateEndpointConnections() { /** * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -151,7 +168,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the ConfigurationStoreProperties object itself. */ @@ -162,7 +179,7 @@ public ConfigurationStoreProperties withPublicNetworkAccess(PublicNetworkAccess /** * Get the disableLocalAuth property: Disables all authentication methods other than AAD authentication. - * + * * @return the disableLocalAuth value. */ public Boolean disableLocalAuth() { @@ -171,7 +188,7 @@ public Boolean disableLocalAuth() { /** * Set the disableLocalAuth property: Disables all authentication methods other than AAD authentication. - * + * * @param disableLocalAuth the disableLocalAuth value to set. * @return the ConfigurationStoreProperties object itself. */ @@ -183,7 +200,7 @@ public ConfigurationStoreProperties withDisableLocalAuth(Boolean disableLocalAut /** * Get the softDeleteRetentionInDays property: The amount of time in days that the configuration store will be * retained when it is soft deleted. - * + * * @return the softDeleteRetentionInDays value. */ public Integer softDeleteRetentionInDays() { @@ -193,7 +210,7 @@ public Integer softDeleteRetentionInDays() { /** * Set the softDeleteRetentionInDays property: The amount of time in days that the configuration store will be * retained when it is soft deleted. - * + * * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. * @return the ConfigurationStoreProperties object itself. */ @@ -205,7 +222,7 @@ public ConfigurationStoreProperties withSoftDeleteRetentionInDays(Integer softDe /** * Get the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this * configuration store. - * + * * @return the enablePurgeProtection value. */ public Boolean enablePurgeProtection() { @@ -215,7 +232,7 @@ public Boolean enablePurgeProtection() { /** * Set the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this * configuration store. - * + * * @param enablePurgeProtection the enablePurgeProtection value to set. * @return the ConfigurationStoreProperties object itself. */ @@ -224,9 +241,31 @@ public ConfigurationStoreProperties withEnablePurgeProtection(Boolean enablePurg return this; } + /** + * Get the dataPlaneProxy property: Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * + * @return the dataPlaneProxy value. + */ + public DataPlaneProxyProperties dataPlaneProxy() { + return this.dataPlaneProxy; + } + + /** + * Set the dataPlaneProxy property: Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * + * @param dataPlaneProxy the dataPlaneProxy value to set. + * @return the ConfigurationStoreProperties object itself. + */ + public ConfigurationStoreProperties withDataPlaneProxy(DataPlaneProxyProperties dataPlaneProxy) { + this.dataPlaneProxy = dataPlaneProxy; + return this; + } + /** * Get the createMode property: Indicates whether the configuration store need to be recovered. - * + * * @return the createMode value. */ public CreateMode createMode() { @@ -235,7 +274,7 @@ public CreateMode createMode() { /** * Set the createMode property: Indicates whether the configuration store need to be recovered. - * + * * @param createMode the createMode value to set. * @return the ConfigurationStoreProperties object itself. */ @@ -244,9 +283,51 @@ public ConfigurationStoreProperties 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.telemetry; + } + + /** + * Set the telemetry property: Property specifying the configuration of telemetry for this configuration store. + * + * @param telemetry the telemetry value to set. + * @return the ConfigurationStoreProperties object itself. + */ + public ConfigurationStoreProperties withTelemetry(TelemetryProperties telemetry) { + this.telemetry = 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.experimentation; + } + + /** + * Set the experimentation property: Property specifying the configuration of experimentation for this configuration + * store. + * + * @param experimentation the experimentation value to set. + * @return the ConfigurationStoreProperties object itself. + */ + public ConfigurationStoreProperties withExperimentation(ExperimentationProperties experimentation) { + this.experimentation = experimentation; + return this; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -256,5 +337,92 @@ public void validate() { if (privateEndpointConnections() != null) { privateEndpointConnections().forEach(e -> e.validate()); } + if (dataPlaneProxy() != null) { + dataPlaneProxy().validate(); + } + if (telemetry() != null) { + telemetry().validate(); + } + if (experimentation() != null) { + experimentation().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); + 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(); + } + + /** + * Reads an instance of ConfigurationStoreProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationStoreProperties 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 ConfigurationStoreProperties. + */ + public static ConfigurationStoreProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationStoreProperties deserializedConfigurationStoreProperties = new ConfigurationStoreProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedConfigurationStoreProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("creationDate".equals(fieldName)) { + deserializedConfigurationStoreProperties.creationDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endpoint".equals(fieldName)) { + deserializedConfigurationStoreProperties.endpoint = reader.getString(); + } else if ("encryption".equals(fieldName)) { + deserializedConfigurationStoreProperties.encryption = EncryptionProperties.fromJson(reader); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionReference.fromJson(reader1)); + deserializedConfigurationStoreProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedConfigurationStoreProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedConfigurationStoreProperties.disableLocalAuth + = reader.getNullable(JsonReader::getBoolean); + } else if ("softDeleteRetentionInDays".equals(fieldName)) { + deserializedConfigurationStoreProperties.softDeleteRetentionInDays + = reader.getNullable(JsonReader::getInt); + } else if ("enablePurgeProtection".equals(fieldName)) { + deserializedConfigurationStoreProperties.enablePurgeProtection + = reader.getNullable(JsonReader::getBoolean); + } else if ("dataPlaneProxy".equals(fieldName)) { + 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(); + } + } + + return deserializedConfigurationStoreProperties; + }); } } 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 2c9a7fe23dbf3..0b47b3115e673 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 @@ -5,44 +5,67 @@ package com.azure.resourcemanager.appconfiguration.fluent.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 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.fasterxml.jackson.annotation.JsonProperty; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; +import java.io.IOException; -/** The properties for updating a configuration store. */ +/** + * The properties for updating a configuration store. + */ @Fluent -public final class ConfigurationStorePropertiesUpdateParameters { +public final class ConfigurationStorePropertiesUpdateParameters + implements JsonSerializable { /* * The encryption settings of the configuration store. */ - @JsonProperty(value = "encryption") private EncryptionProperties encryption; /* * Disables all authentication methods other than AAD authentication. */ - @JsonProperty(value = "disableLocalAuth") private Boolean disableLocalAuth; /* * Control permission for data plane traffic coming from public networks while private endpoint is enabled. */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; /* * Property specifying whether protection against purge is enabled for this configuration store. */ - @JsonProperty(value = "enablePurgeProtection") private Boolean enablePurgeProtection; - /** Creates an instance of ConfigurationStorePropertiesUpdateParameters class. */ + /* + * Property specifying the configuration of data plane proxy for Azure Resource Manager (ARM). + */ + 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. + */ public ConfigurationStorePropertiesUpdateParameters() { } /** * Get the encryption property: The encryption settings of the configuration store. - * + * * @return the encryption value. */ public EncryptionProperties encryption() { @@ -51,7 +74,7 @@ public EncryptionProperties encryption() { /** * Set the encryption property: The encryption settings of the configuration store. - * + * * @param encryption the encryption value to set. * @return the ConfigurationStorePropertiesUpdateParameters object itself. */ @@ -62,7 +85,7 @@ public ConfigurationStorePropertiesUpdateParameters withEncryption(EncryptionPro /** * Get the disableLocalAuth property: Disables all authentication methods other than AAD authentication. - * + * * @return the disableLocalAuth value. */ public Boolean disableLocalAuth() { @@ -71,7 +94,7 @@ public Boolean disableLocalAuth() { /** * Set the disableLocalAuth property: Disables all authentication methods other than AAD authentication. - * + * * @param disableLocalAuth the disableLocalAuth value to set. * @return the ConfigurationStorePropertiesUpdateParameters object itself. */ @@ -83,7 +106,7 @@ public ConfigurationStorePropertiesUpdateParameters withDisableLocalAuth(Boolean /** * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -93,12 +116,12 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the ConfigurationStorePropertiesUpdateParameters object itself. */ - public ConfigurationStorePropertiesUpdateParameters withPublicNetworkAccess( - PublicNetworkAccess publicNetworkAccess) { + public ConfigurationStorePropertiesUpdateParameters + withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { this.publicNetworkAccess = publicNetworkAccess; return this; } @@ -106,7 +129,7 @@ public ConfigurationStorePropertiesUpdateParameters withPublicNetworkAccess( /** * Get the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this * configuration store. - * + * * @return the enablePurgeProtection value. */ public Boolean enablePurgeProtection() { @@ -116,7 +139,7 @@ public Boolean enablePurgeProtection() { /** * Set the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this * configuration store. - * + * * @param enablePurgeProtection the enablePurgeProtection value to set. * @return the ConfigurationStorePropertiesUpdateParameters object itself. */ @@ -125,14 +148,152 @@ public ConfigurationStorePropertiesUpdateParameters withEnablePurgeProtection(Bo return this; } + /** + * Get the dataPlaneProxy property: Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * + * @return the dataPlaneProxy value. + */ + public DataPlaneProxyProperties dataPlaneProxy() { + return this.dataPlaneProxy; + } + + /** + * Set the dataPlaneProxy property: Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * + * @param dataPlaneProxy the dataPlaneProxy value to set. + * @return the ConfigurationStorePropertiesUpdateParameters object itself. + */ + public ConfigurationStorePropertiesUpdateParameters withDataPlaneProxy(DataPlaneProxyProperties dataPlaneProxy) { + this.dataPlaneProxy = dataPlaneProxy; + 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. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (encryption() != null) { encryption().validate(); } + if (dataPlaneProxy() != null) { + dataPlaneProxy().validate(); + } + if (telemetry() != null) { + telemetry().validate(); + } + if (experimentation() != null) { + experimentation().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); + 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(); + } + + /** + * Reads an instance of ConfigurationStorePropertiesUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationStorePropertiesUpdateParameters 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 ConfigurationStorePropertiesUpdateParameters. + */ + public static ConfigurationStorePropertiesUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationStorePropertiesUpdateParameters deserializedConfigurationStorePropertiesUpdateParameters + = new ConfigurationStorePropertiesUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("encryption".equals(fieldName)) { + deserializedConfigurationStorePropertiesUpdateParameters.encryption + = EncryptionProperties.fromJson(reader); + } else if ("disableLocalAuth".equals(fieldName)) { + deserializedConfigurationStorePropertiesUpdateParameters.disableLocalAuth + = reader.getNullable(JsonReader::getBoolean); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedConfigurationStorePropertiesUpdateParameters.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("enablePurgeProtection".equals(fieldName)) { + deserializedConfigurationStorePropertiesUpdateParameters.enablePurgeProtection + = reader.getNullable(JsonReader::getBoolean); + } 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(); + } + } + + return deserializedConfigurationStorePropertiesUpdateParameters; + }); } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/DeletedConfigurationStoreInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/DeletedConfigurationStoreInner.java index a5b6218c397cf..b65fd96cb23b6 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/DeletedConfigurationStoreInner.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/DeletedConfigurationStoreInner.java @@ -5,44 +5,48 @@ package com.azure.resourcemanager.appconfiguration.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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.util.Map; -/** Deleted configuration store information with extended details. */ +/** + * Deleted configuration store information with extended details. + */ @Immutable -public final class DeletedConfigurationStoreInner { +public final class DeletedConfigurationStoreInner implements JsonSerializable { /* * The resource ID for the deleted configuration store. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The name of the configuration store. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The resource type of the configuration store. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * Properties of the deleted configuration store */ - @JsonProperty(value = "properties") private DeletedConfigurationStoreProperties innerProperties; - /** Creates an instance of DeletedConfigurationStoreInner class. */ + /** + * Creates an instance of DeletedConfigurationStoreInner class. + */ public DeletedConfigurationStoreInner() { } /** * Get the id property: The resource ID for the deleted configuration store. - * + * * @return the id value. */ public String id() { @@ -51,7 +55,7 @@ public String id() { /** * Get the name property: The name of the configuration store. - * + * * @return the name value. */ public String name() { @@ -60,7 +64,7 @@ public String name() { /** * Get the type property: The resource type of the configuration store. - * + * * @return the type value. */ public String type() { @@ -69,7 +73,7 @@ public String type() { /** * Get the innerProperties property: Properties of the deleted configuration store. - * + * * @return the innerProperties value. */ private DeletedConfigurationStoreProperties innerProperties() { @@ -78,7 +82,7 @@ private DeletedConfigurationStoreProperties innerProperties() { /** * Get the configurationStoreId property: The resource id of the original configuration store. - * + * * @return the configurationStoreId value. */ public String configurationStoreId() { @@ -87,7 +91,7 @@ public String configurationStoreId() { /** * Get the location property: The location of the original configuration store. - * + * * @return the location value. */ public String location() { @@ -96,7 +100,7 @@ public String location() { /** * Get the deletionDate property: The deleted date. - * + * * @return the deletionDate value. */ public OffsetDateTime deletionDate() { @@ -105,7 +109,7 @@ public OffsetDateTime deletionDate() { /** * Get the scheduledPurgeDate property: The scheduled purged date. - * + * * @return the scheduledPurgeDate value. */ public OffsetDateTime scheduledPurgeDate() { @@ -114,7 +118,7 @@ public OffsetDateTime scheduledPurgeDate() { /** * Get the tags property: Tags of the original configuration store. - * + * * @return the tags value. */ public Map tags() { @@ -123,7 +127,7 @@ public Map tags() { /** * Get the purgeProtectionEnabled property: Purge protection status of the original configuration store. - * + * * @return the purgeProtectionEnabled value. */ public Boolean purgeProtectionEnabled() { @@ -132,7 +136,7 @@ public Boolean purgeProtectionEnabled() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -140,4 +144,48 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedConfigurationStoreInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedConfigurationStoreInner 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 DeletedConfigurationStoreInner. + */ + public static DeletedConfigurationStoreInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedConfigurationStoreInner deserializedDeletedConfigurationStoreInner + = new DeletedConfigurationStoreInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDeletedConfigurationStoreInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDeletedConfigurationStoreInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDeletedConfigurationStoreInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeletedConfigurationStoreInner.innerProperties + = DeletedConfigurationStoreProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedConfigurationStoreInner; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/DeletedConfigurationStoreProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/DeletedConfigurationStoreProperties.java index 7bad42461fbdb..43ea594eacd5e 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/DeletedConfigurationStoreProperties.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/DeletedConfigurationStoreProperties.java @@ -5,58 +5,60 @@ package com.azure.resourcemanager.appconfiguration.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +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; import java.util.Map; -/** Properties of the deleted configuration store. */ +/** + * Properties of the deleted configuration store. + */ @Immutable -public final class DeletedConfigurationStoreProperties { +public final class DeletedConfigurationStoreProperties + implements JsonSerializable { /* * The resource id of the original configuration store. */ - @JsonProperty(value = "configurationStoreId", access = JsonProperty.Access.WRITE_ONLY) private String configurationStoreId; /* * The location of the original configuration store. */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; /* * The deleted date. */ - @JsonProperty(value = "deletionDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime deletionDate; /* * The scheduled purged date. */ - @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime scheduledPurgeDate; /* * Tags of the original configuration store. */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * Purge protection status of the original configuration store. */ - @JsonProperty(value = "purgeProtectionEnabled", access = JsonProperty.Access.WRITE_ONLY) private Boolean purgeProtectionEnabled; - /** Creates an instance of DeletedConfigurationStoreProperties class. */ + /** + * Creates an instance of DeletedConfigurationStoreProperties class. + */ public DeletedConfigurationStoreProperties() { } /** * Get the configurationStoreId property: The resource id of the original configuration store. - * + * * @return the configurationStoreId value. */ public String configurationStoreId() { @@ -65,7 +67,7 @@ public String configurationStoreId() { /** * Get the location property: The location of the original configuration store. - * + * * @return the location value. */ public String location() { @@ -74,7 +76,7 @@ public String location() { /** * Get the deletionDate property: The deleted date. - * + * * @return the deletionDate value. */ public OffsetDateTime deletionDate() { @@ -83,7 +85,7 @@ public OffsetDateTime deletionDate() { /** * Get the scheduledPurgeDate property: The scheduled purged date. - * + * * @return the scheduledPurgeDate value. */ public OffsetDateTime scheduledPurgeDate() { @@ -92,7 +94,7 @@ public OffsetDateTime scheduledPurgeDate() { /** * Get the tags property: Tags of the original configuration store. - * + * * @return the tags value. */ public Map tags() { @@ -101,7 +103,7 @@ public Map tags() { /** * Get the purgeProtectionEnabled property: Purge protection status of the original configuration store. - * + * * @return the purgeProtectionEnabled value. */ public Boolean purgeProtectionEnabled() { @@ -110,9 +112,59 @@ public Boolean purgeProtectionEnabled() { /** * 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 DeletedConfigurationStoreProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedConfigurationStoreProperties 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 DeletedConfigurationStoreProperties. + */ + public static DeletedConfigurationStoreProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedConfigurationStoreProperties deserializedDeletedConfigurationStoreProperties + = new DeletedConfigurationStoreProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("configurationStoreId".equals(fieldName)) { + deserializedDeletedConfigurationStoreProperties.configurationStoreId = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDeletedConfigurationStoreProperties.location = reader.getString(); + } else if ("deletionDate".equals(fieldName)) { + deserializedDeletedConfigurationStoreProperties.deletionDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("scheduledPurgeDate".equals(fieldName)) { + deserializedDeletedConfigurationStoreProperties.scheduledPurgeDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDeletedConfigurationStoreProperties.tags = tags; + } else if ("purgeProtectionEnabled".equals(fieldName)) { + deserializedDeletedConfigurationStoreProperties.purgeProtectionEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedConfigurationStoreProperties; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/KeyValueInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/KeyValueInner.java index ed9138c2b7e19..71eb555201eeb 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/KeyValueInner.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/KeyValueInner.java @@ -6,26 +6,47 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; -/** The key-value resource along with all resource properties. */ +/** + * The key-value resource along with all resource properties. + */ @Fluent public final class KeyValueInner extends ProxyResource { /* * All key-value properties. */ - @JsonProperty(value = "properties") private KeyValueProperties innerProperties; - /** Creates an instance of KeyValueInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of KeyValueInner class. + */ public KeyValueInner() { } /** * Get the innerProperties property: All key-value properties. - * + * * @return the innerProperties value. */ private KeyValueProperties innerProperties() { @@ -33,9 +54,39 @@ private KeyValueProperties innerProperties() { } /** - * Get the key property: The primary identifier of a key-value. The key is used in unison with the label to uniquely - * identify a key-value. - * + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the key property: The primary identifier of a key-value. + * The key is used in unison with the label to uniquely identify a key-value. + * * @return the key value. */ public String key() { @@ -43,9 +94,9 @@ public String key() { } /** - * Get the label property: A value used to group key-values. The label is used in unison with the key to uniquely - * identify a key-value. - * + * Get the label property: A value used to group key-values. + * The label is used in unison with the key to uniquely identify a key-value. + * * @return the label value. */ public String label() { @@ -54,7 +105,7 @@ public String label() { /** * Get the value property: The value of the key-value. - * + * * @return the value value. */ public String value() { @@ -63,7 +114,7 @@ public String value() { /** * Set the value property: The value of the key-value. - * + * * @param value the value value to set. * @return the KeyValueInner object itself. */ @@ -76,9 +127,9 @@ public KeyValueInner withValue(String value) { } /** - * Get the contentType property: The content type of the key-value's value. Providing a proper content-type can - * enable transformations of values when they are retrieved by applications. - * + * Get the contentType property: The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values when they are retrieved by applications. + * * @return the contentType value. */ public String contentType() { @@ -86,9 +137,9 @@ public String contentType() { } /** - * Set the contentType property: The content type of the key-value's value. Providing a proper content-type can - * enable transformations of values when they are retrieved by applications. - * + * Set the contentType property: The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values when they are retrieved by applications. + * * @param contentType the contentType value to set. * @return the KeyValueInner object itself. */ @@ -102,7 +153,7 @@ public KeyValueInner withContentType(String contentType) { /** * Get the etag property: An ETag indicating the state of a key-value within a configuration store. - * + * * @return the etag value. */ public String etag() { @@ -111,7 +162,7 @@ public String etag() { /** * Get the lastModified property: The last time a modifying operation was performed on the given key-value. - * + * * @return the lastModified value. */ public OffsetDateTime lastModified() { @@ -119,9 +170,9 @@ public OffsetDateTime lastModified() { } /** - * Get the locked property: A value indicating whether the key-value is locked. A locked key-value may not be - * modified until it is unlocked. - * + * Get the locked property: A value indicating whether the key-value is locked. + * A locked key-value may not be modified until it is unlocked. + * * @return the locked value. */ public Boolean locked() { @@ -130,7 +181,7 @@ public Boolean locked() { /** * Get the tags property: A dictionary of tags that can help identify what a key-value may be applicable for. - * + * * @return the tags value. */ public Map tags() { @@ -139,7 +190,7 @@ public Map tags() { /** * Set the tags property: A dictionary of tags that can help identify what a key-value may be applicable for. - * + * * @param tags the tags value to set. * @return the KeyValueInner object itself. */ @@ -153,7 +204,7 @@ public KeyValueInner withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -161,4 +212,47 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyValueInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyValueInner 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 KeyValueInner. + */ + public static KeyValueInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyValueInner deserializedKeyValueInner = new KeyValueInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedKeyValueInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedKeyValueInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedKeyValueInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedKeyValueInner.innerProperties = KeyValueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyValueInner; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/KeyValueProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/KeyValueProperties.java index 3bce903610fdb..ea65e864f75f4 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/KeyValueProperties.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/KeyValueProperties.java @@ -5,75 +5,74 @@ package com.azure.resourcemanager.appconfiguration.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +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; import java.util.Map; -/** All key-value properties. */ +/** + * All key-value properties. + */ @Fluent -public final class KeyValueProperties { +public final class KeyValueProperties implements JsonSerializable { /* * The primary identifier of a key-value. * The key is used in unison with the label to uniquely identify a key-value. */ - @JsonProperty(value = "key", access = JsonProperty.Access.WRITE_ONLY) private String key; /* * A value used to group key-values. * The label is used in unison with the key to uniquely identify a key-value. */ - @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY) private String label; /* * The value of the key-value. */ - @JsonProperty(value = "value") private String value; /* * The content type of the key-value's value. * Providing a proper content-type can enable transformations of values when they are retrieved by applications. */ - @JsonProperty(value = "contentType") private String contentType; /* * An ETag indicating the state of a key-value within a configuration store. */ - @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /* * The last time a modifying operation was performed on the given key-value. */ - @JsonProperty(value = "lastModified", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastModified; /* * A value indicating whether the key-value is locked. * A locked key-value may not be modified until it is unlocked. */ - @JsonProperty(value = "locked", access = JsonProperty.Access.WRITE_ONLY) private Boolean locked; /* * A dictionary of tags that can help identify what a key-value may be applicable for. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of KeyValueProperties class. */ + /** + * Creates an instance of KeyValueProperties class. + */ public KeyValueProperties() { } /** - * Get the key property: The primary identifier of a key-value. The key is used in unison with the label to uniquely - * identify a key-value. - * + * Get the key property: The primary identifier of a key-value. + * The key is used in unison with the label to uniquely identify a key-value. + * * @return the key value. */ public String key() { @@ -81,9 +80,9 @@ public String key() { } /** - * Get the label property: A value used to group key-values. The label is used in unison with the key to uniquely - * identify a key-value. - * + * Get the label property: A value used to group key-values. + * The label is used in unison with the key to uniquely identify a key-value. + * * @return the label value. */ public String label() { @@ -92,7 +91,7 @@ public String label() { /** * Get the value property: The value of the key-value. - * + * * @return the value value. */ public String value() { @@ -101,7 +100,7 @@ public String value() { /** * Set the value property: The value of the key-value. - * + * * @param value the value value to set. * @return the KeyValueProperties object itself. */ @@ -111,9 +110,9 @@ public KeyValueProperties withValue(String value) { } /** - * Get the contentType property: The content type of the key-value's value. Providing a proper content-type can - * enable transformations of values when they are retrieved by applications. - * + * Get the contentType property: The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values when they are retrieved by applications. + * * @return the contentType value. */ public String contentType() { @@ -121,9 +120,9 @@ public String contentType() { } /** - * Set the contentType property: The content type of the key-value's value. Providing a proper content-type can - * enable transformations of values when they are retrieved by applications. - * + * Set the contentType property: The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values when they are retrieved by applications. + * * @param contentType the contentType value to set. * @return the KeyValueProperties object itself. */ @@ -134,7 +133,7 @@ public KeyValueProperties withContentType(String contentType) { /** * Get the etag property: An ETag indicating the state of a key-value within a configuration store. - * + * * @return the etag value. */ public String etag() { @@ -143,7 +142,7 @@ public String etag() { /** * Get the lastModified property: The last time a modifying operation was performed on the given key-value. - * + * * @return the lastModified value. */ public OffsetDateTime lastModified() { @@ -151,9 +150,9 @@ public OffsetDateTime lastModified() { } /** - * Get the locked property: A value indicating whether the key-value is locked. A locked key-value may not be - * modified until it is unlocked. - * + * Get the locked property: A value indicating whether the key-value is locked. + * A locked key-value may not be modified until it is unlocked. + * * @return the locked value. */ public Boolean locked() { @@ -162,7 +161,7 @@ public Boolean locked() { /** * Get the tags property: A dictionary of tags that can help identify what a key-value may be applicable for. - * + * * @return the tags value. */ public Map tags() { @@ -171,7 +170,7 @@ public Map tags() { /** * Set the tags property: A dictionary of tags that can help identify what a key-value may be applicable for. - * + * * @param tags the tags value to set. * @return the KeyValueProperties object itself. */ @@ -182,9 +181,63 @@ public KeyValueProperties withTags(Map tags) { /** * 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("value", this.value); + jsonWriter.writeStringField("contentType", this.contentType); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyValueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyValueProperties 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 KeyValueProperties. + */ + public static KeyValueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyValueProperties deserializedKeyValueProperties = new KeyValueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedKeyValueProperties.key = reader.getString(); + } else if ("label".equals(fieldName)) { + deserializedKeyValueProperties.label = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedKeyValueProperties.value = reader.getString(); + } else if ("contentType".equals(fieldName)) { + deserializedKeyValueProperties.contentType = reader.getString(); + } else if ("eTag".equals(fieldName)) { + deserializedKeyValueProperties.etag = reader.getString(); + } else if ("lastModified".equals(fieldName)) { + deserializedKeyValueProperties.lastModified = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("locked".equals(fieldName)) { + deserializedKeyValueProperties.locked = reader.getNullable(JsonReader::getBoolean); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKeyValueProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedKeyValueProperties; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/NameAvailabilityStatusInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/NameAvailabilityStatusInner.java index f2e029e3cc067..3495025c5ebe4 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/NameAvailabilityStatusInner.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/NameAvailabilityStatusInner.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.appconfiguration.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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 result of a request to check the availability of a resource name. */ +/** + * The result of a request to check the availability of a resource name. + */ @Immutable -public final class NameAvailabilityStatusInner { +public final class NameAvailabilityStatusInner implements JsonSerializable { /* * The value indicating whether the resource name is available. */ - @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) private Boolean nameAvailable; /* * If any, the error message that provides more detail for the reason that the name is not available. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /* * If any, the reason that the name is not available. */ - @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) private String reason; - /** Creates an instance of NameAvailabilityStatusInner class. */ + /** + * Creates an instance of NameAvailabilityStatusInner class. + */ public NameAvailabilityStatusInner() { } /** * Get the nameAvailable property: The value indicating whether the resource name is available. - * + * * @return the nameAvailable value. */ public Boolean nameAvailable() { @@ -44,7 +49,7 @@ public Boolean nameAvailable() { /** * Get the message property: If any, the error message that provides more detail for the reason that the name is not * available. - * + * * @return the message value. */ public String message() { @@ -53,7 +58,7 @@ public String message() { /** * Get the reason property: If any, the reason that the name is not available. - * + * * @return the reason value. */ public String reason() { @@ -62,9 +67,48 @@ public String reason() { /** * 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 NameAvailabilityStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NameAvailabilityStatusInner 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 NameAvailabilityStatusInner. + */ + public static NameAvailabilityStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NameAvailabilityStatusInner deserializedNameAvailabilityStatusInner = new NameAvailabilityStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedNameAvailabilityStatusInner.nameAvailable = reader.getNullable(JsonReader::getBoolean); + } else if ("message".equals(fieldName)) { + deserializedNameAvailabilityStatusInner.message = reader.getString(); + } else if ("reason".equals(fieldName)) { + deserializedNameAvailabilityStatusInner.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNameAvailabilityStatusInner; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/OperationDefinitionInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/OperationDefinitionInner.java index 13a1b553b42e0..1fe9878ed6ab1 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/OperationDefinitionInner.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/OperationDefinitionInner.java @@ -5,50 +5,53 @@ package com.azure.resourcemanager.appconfiguration.fluent.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 com.azure.resourcemanager.appconfiguration.models.OperationDefinitionDisplay; import com.azure.resourcemanager.appconfiguration.models.OperationProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The definition of a configuration store operation. */ +/** + * The definition of a configuration store operation. + */ @Fluent -public final class OperationDefinitionInner { +public final class OperationDefinitionInner implements JsonSerializable { /* * Operation name: {provider}/{resource}/{operation}. */ - @JsonProperty(value = "name") private String name; /* * Indicates whether the operation is a data action */ - @JsonProperty(value = "isDataAction") private Boolean isDataAction; /* * The display information for the configuration store operation. */ - @JsonProperty(value = "display") private OperationDefinitionDisplay display; /* * Origin of the operation */ - @JsonProperty(value = "origin") private String origin; /* * Properties of the operation */ - @JsonProperty(value = "properties") private OperationProperties properties; - /** Creates an instance of OperationDefinitionInner class. */ + /** + * Creates an instance of OperationDefinitionInner class. + */ public OperationDefinitionInner() { } /** * Get the name property: Operation name: {provider}/{resource}/{operation}. - * + * * @return the name value. */ public String name() { @@ -57,7 +60,7 @@ public String name() { /** * Set the name property: Operation name: {provider}/{resource}/{operation}. - * + * * @param name the name value to set. * @return the OperationDefinitionInner object itself. */ @@ -68,7 +71,7 @@ public OperationDefinitionInner withName(String name) { /** * Get the isDataAction property: Indicates whether the operation is a data action. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -77,7 +80,7 @@ public Boolean isDataAction() { /** * Set the isDataAction property: Indicates whether the operation is a data action. - * + * * @param isDataAction the isDataAction value to set. * @return the OperationDefinitionInner object itself. */ @@ -88,7 +91,7 @@ public OperationDefinitionInner withIsDataAction(Boolean isDataAction) { /** * Get the display property: The display information for the configuration store operation. - * + * * @return the display value. */ public OperationDefinitionDisplay display() { @@ -97,7 +100,7 @@ public OperationDefinitionDisplay display() { /** * Set the display property: The display information for the configuration store operation. - * + * * @param display the display value to set. * @return the OperationDefinitionInner object itself. */ @@ -108,7 +111,7 @@ public OperationDefinitionInner withDisplay(OperationDefinitionDisplay display) /** * Get the origin property: Origin of the operation. - * + * * @return the origin value. */ public String origin() { @@ -117,7 +120,7 @@ public String origin() { /** * Set the origin property: Origin of the operation. - * + * * @param origin the origin value to set. * @return the OperationDefinitionInner object itself. */ @@ -128,7 +131,7 @@ public OperationDefinitionInner withOrigin(String origin) { /** * Get the properties property: Properties of the operation. - * + * * @return the properties value. */ public OperationProperties properties() { @@ -137,7 +140,7 @@ public OperationProperties properties() { /** * Set the properties property: Properties of the operation. - * + * * @param properties the properties value to set. * @return the OperationDefinitionInner object itself. */ @@ -148,7 +151,7 @@ public OperationDefinitionInner withProperties(OperationProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -159,4 +162,52 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("isDataAction", this.isDataAction); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeStringField("origin", this.origin); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDefinitionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDefinitionInner 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 OperationDefinitionInner. + */ + public static OperationDefinitionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDefinitionInner deserializedOperationDefinitionInner = new OperationDefinitionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationDefinitionInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationDefinitionInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationDefinitionInner.display = OperationDefinitionDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationDefinitionInner.origin = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOperationDefinitionInner.properties = OperationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDefinitionInner; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateEndpointConnectionInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateEndpointConnectionInner.java index 479d27655917f..8c06886eabcc7 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateEndpointConnectionInner.java @@ -6,36 +6,87 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.appconfiguration.models.PrivateEndpoint; import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; import com.azure.resourcemanager.appconfiguration.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** A private endpoint connection. */ +/** + * A private endpoint connection. + */ @Fluent public final class PrivateEndpointConnectionInner extends ProxyResource { /* * The properties of a private endpoint. */ - @JsonProperty(value = "properties") private PrivateEndpointConnectionProperties innerProperties; - /** Creates an instance of PrivateEndpointConnectionInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of PrivateEndpointConnectionInner class. + */ public PrivateEndpointConnectionInner() { } /** * Get the innerProperties property: The properties of a private endpoint. - * + * * @return the innerProperties value. */ private PrivateEndpointConnectionProperties innerProperties() { return this.innerProperties; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the provisioningState property: The provisioning status of the private endpoint connection. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -44,7 +95,7 @@ public ProvisioningState provisioningState() { /** * Get the privateEndpoint property: The resource of private endpoint. - * + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -53,7 +104,7 @@ public PrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: The resource of private endpoint. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionInner object itself. */ @@ -68,7 +119,7 @@ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privat /** * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -78,12 +129,12 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionInner object itself. */ - public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { if (this.innerProperties() == null) { this.innerProperties = new PrivateEndpointConnectionProperties(); } @@ -93,7 +144,7 @@ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -101,4 +152,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateEndpointConnectionProperties.java index b2bd87f6b18ac..bc045818a5a8e 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateEndpointConnectionProperties.java @@ -6,39 +6,45 @@ 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 com.azure.resourcemanager.appconfiguration.models.PrivateEndpoint; import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; import com.azure.resourcemanager.appconfiguration.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties of a private endpoint connection. */ +/** + * Properties of a private endpoint connection. + */ @Fluent -public final class PrivateEndpointConnectionProperties { +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { /* * The provisioning status of the private endpoint connection. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * The resource of private endpoint. */ - @JsonProperty(value = "privateEndpoint") private PrivateEndpoint privateEndpoint; /* * A collection of information about the state of the connection between service consumer and provider. */ - @JsonProperty(value = "privateLinkServiceConnectionState", required = true) private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - /** Creates an instance of PrivateEndpointConnectionProperties class. */ + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ public PrivateEndpointConnectionProperties() { } /** * Get the provisioningState property: The provisioning status of the private endpoint connection. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -47,7 +53,7 @@ public ProvisioningState provisioningState() { /** * Get the privateEndpoint property: The resource of private endpoint. - * + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -56,7 +62,7 @@ public PrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: The resource of private endpoint. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionProperties object itself. */ @@ -68,7 +74,7 @@ public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint p /** * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -78,19 +84,19 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionProperties object itself. */ - public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -98,15 +104,58 @@ public void validate() { privateEndpoint().validate(); } if (privateLinkServiceConnectionState() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model" - + " PrivateEndpointConnectionProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); } else { privateLinkServiceConnectionState().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateLinkResourceInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateLinkResourceInner.java index 7df32c9421853..ae4b2bca4c017 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateLinkResourceInner.java @@ -5,43 +5,47 @@ package com.azure.resourcemanager.appconfiguration.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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; -/** A resource that supports private link capabilities. */ +/** + * A resource that supports private link capabilities. + */ @Immutable -public final class PrivateLinkResourceInner { +public final class PrivateLinkResourceInner implements JsonSerializable { /* * The resource ID. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The name of the resource. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The type of the resource. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * Private link resource properties. */ - @JsonProperty(value = "properties") private PrivateLinkResourceProperties innerProperties; - /** Creates an instance of PrivateLinkResourceInner class. */ + /** + * Creates an instance of PrivateLinkResourceInner class. + */ public PrivateLinkResourceInner() { } /** * Get the id property: The resource ID. - * + * * @return the id value. */ public String id() { @@ -50,7 +54,7 @@ public String id() { /** * Get the name property: The name of the resource. - * + * * @return the name value. */ public String name() { @@ -59,7 +63,7 @@ public String name() { /** * Get the type property: The type of the resource. - * + * * @return the type value. */ public String type() { @@ -68,7 +72,7 @@ public String type() { /** * Get the innerProperties property: Private link resource properties. - * + * * @return the innerProperties value. */ private PrivateLinkResourceProperties innerProperties() { @@ -77,7 +81,7 @@ private PrivateLinkResourceProperties innerProperties() { /** * Get the groupId property: The private link resource group id. - * + * * @return the groupId value. */ public String groupId() { @@ -86,7 +90,7 @@ public String groupId() { /** * Get the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -95,7 +99,7 @@ public List requiredMembers() { /** * Get the requiredZoneNames property: The list of required DNS zone names of the private link resource. - * + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -104,7 +108,7 @@ public List requiredZoneNames() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -112,4 +116,47 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner 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 PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.innerProperties + = PrivateLinkResourceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateLinkResourceProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateLinkResourceProperties.java index b51547cb4ab33..57b1a77b06427 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/PrivateLinkResourceProperties.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.appconfiguration.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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; -/** Properties of a private link resource. */ +/** + * Properties of a private link resource. + */ @Immutable -public final class PrivateLinkResourceProperties { +public final class PrivateLinkResourceProperties implements JsonSerializable { /* * The private link resource group id. */ - @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) private String groupId; /* * The private link resource required member names. */ - @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) private List requiredMembers; /* * The list of required DNS zone names of the private link resource. */ - @JsonProperty(value = "requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) private List requiredZoneNames; - /** Creates an instance of PrivateLinkResourceProperties class. */ + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ public PrivateLinkResourceProperties() { } /** * Get the groupId property: The private link resource group id. - * + * * @return the groupId value. */ public String groupId() { @@ -44,7 +49,7 @@ public String groupId() { /** * Get the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -53,7 +58,7 @@ public List requiredMembers() { /** * Get the requiredZoneNames property: The list of required DNS zone names of the private link resource. - * + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -62,9 +67,51 @@ public List requiredZoneNames() { /** * 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 PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties 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 PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ReplicaInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ReplicaInner.java index 6efee8955650e..f7d2753a7264d 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ReplicaInner.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ReplicaInner.java @@ -7,37 +7,56 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.appconfiguration.models.ReplicaProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The replica resource. */ +/** + * The replica resource. + */ @Fluent public final class ReplicaInner extends ProxyResource { /* * The location of the replica. */ - @JsonProperty(value = "location") private String location; /* * Resource system metadata. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* * All replica properties. */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private ReplicaProperties innerProperties; - /** Creates an instance of ReplicaInner class. */ + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ReplicaInner class. + */ public ReplicaInner() { } /** * Get the location property: The location of the replica. - * + * * @return the location value. */ public String location() { @@ -46,7 +65,7 @@ public String location() { /** * Set the location property: The location of the replica. - * + * * @param location the location value to set. * @return the ReplicaInner object itself. */ @@ -57,7 +76,7 @@ public ReplicaInner withLocation(String location) { /** * Get the systemData property: Resource system metadata. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -66,16 +85,46 @@ public SystemData systemData() { /** * Get the innerProperties property: All replica properties. - * + * * @return the innerProperties value. */ private ReplicaProperties innerProperties() { return this.innerProperties; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Get the endpoint property: The URI of the replica where the replica API will be available. - * + * * @return the endpoint value. */ public String endpoint() { @@ -84,7 +133,7 @@ public String endpoint() { /** * Get the provisioningState property: The provisioning state of the replica. - * + * * @return the provisioningState value. */ public ReplicaProvisioningState provisioningState() { @@ -93,7 +142,7 @@ public ReplicaProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -101,4 +150,51 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicaInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaInner 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 ReplicaInner. + */ + public static ReplicaInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaInner deserializedReplicaInner = new ReplicaInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedReplicaInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedReplicaInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedReplicaInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedReplicaInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedReplicaInner.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedReplicaInner.innerProperties = ReplicaProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaInner; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ReplicaProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ReplicaProperties.java index bff2cfb3674ec..03540dc8f814d 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ReplicaProperties.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/ReplicaProperties.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.appconfiguration.fluent.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 com.azure.resourcemanager.appconfiguration.models.ReplicaProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** All replica properties. */ +/** + * All replica properties. + */ @Immutable -public final class ReplicaProperties { +public final class ReplicaProperties implements JsonSerializable { /* * The URI of the replica where the replica API will be available. */ - @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) private String endpoint; /* * The provisioning state of the replica. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ReplicaProvisioningState provisioningState; - /** Creates an instance of ReplicaProperties class. */ + /** + * Creates an instance of ReplicaProperties class. + */ public ReplicaProperties() { } /** * Get the endpoint property: The URI of the replica where the replica API will be available. - * + * * @return the endpoint value. */ public String endpoint() { @@ -38,7 +44,7 @@ public String endpoint() { /** * Get the provisioningState property: The provisioning state of the replica. - * + * * @return the provisioningState value. */ public ReplicaProvisioningState provisioningState() { @@ -47,9 +53,47 @@ public ReplicaProvisioningState provisioningState() { /** * 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 ReplicaProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaProperties 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 ReplicaProperties. + */ + public static ReplicaProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaProperties deserializedReplicaProperties = new ReplicaProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoint".equals(fieldName)) { + deserializedReplicaProperties.endpoint = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedReplicaProperties.provisioningState + = ReplicaProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaProperties; + }); + } } 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 0000000000000..4c32ada0f7f89 --- /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.ResourceParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenKind; +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 parameters to define the data plane resource scope. + */ + private ResourceParameters resourceParameters; + + /* + * 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 SasTokenKind kind; + + /* + * The value of the SAS token. + */ + private String value; + + /** + * Creates an instance of SasTokenGenerationResultInner class. + */ + public SasTokenGenerationResultInner() { + } + + /** + * Get the resourceParameters property: The parameters to define the data plane resource scope. + * + * @return the resourceParameters value. + */ + public ResourceParameters resourceParameters() { + return this.resourceParameters; + } + + /** + * 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 SasTokenKind 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 (resourceParameters() != null) { + resourceParameters().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 ("resourceParameters".equals(fieldName)) { + deserializedSasTokenGenerationResultInner.resourceParameters = ResourceParameters.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 = SasTokenKind.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/fluent/models/SnapshotInner.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/SnapshotInner.java new file mode 100644 index 0000000000000..a901e99b983e5 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/SnapshotInner.java @@ -0,0 +1,307 @@ +// 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.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.appconfiguration.models.CompositionType; +import com.azure.resourcemanager.appconfiguration.models.KeyValueFilter; +import com.azure.resourcemanager.appconfiguration.models.ProvisioningState; +import com.azure.resourcemanager.appconfiguration.models.SnapshotStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * The snapshot resource. + */ +@Fluent +public final class SnapshotInner extends ProxyResource { + /* + * All snapshot properties. + */ + private SnapshotProperties innerProperties; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of SnapshotInner class. + */ + public SnapshotInner() { + } + + /** + * Get the innerProperties property: All snapshot properties. + * + * @return the innerProperties value. + */ + private SnapshotProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the provisioningState property: The provisioning state of the snapshot. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: The current status of the snapshot. + * + * @return the status value. + */ + public SnapshotStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the filters property: A list of filters used to filter the key-values included in the snapshot. + * + * @return the filters value. + */ + public List filters() { + return this.innerProperties() == null ? null : this.innerProperties().filters(); + } + + /** + * Set the filters property: A list of filters used to filter the key-values included in the snapshot. + * + * @param filters the filters value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withFilters(List filters) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withFilters(filters); + return this; + } + + /** + * Get the compositionType property: The composition type describes how the key-values within the snapshot are + * composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' + * composition type ensures there are no two key-values containing the same key and label. + * + * @return the compositionType value. + */ + public CompositionType compositionType() { + return this.innerProperties() == null ? null : this.innerProperties().compositionType(); + } + + /** + * Set the compositionType property: The composition type describes how the key-values within the snapshot are + * composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' + * composition type ensures there are no two key-values containing the same key and label. + * + * @param compositionType the compositionType value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withCompositionType(CompositionType compositionType) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withCompositionType(compositionType); + return this; + } + + /** + * Get the created property: The time that the snapshot was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.innerProperties() == null ? null : this.innerProperties().created(); + } + + /** + * Get the expires property: The time that the snapshot will expire. + * + * @return the expires value. + */ + public OffsetDateTime expires() { + return this.innerProperties() == null ? null : this.innerProperties().expires(); + } + + /** + * Get the retentionPeriod property: The amount of time, in seconds, that a snapshot will remain in the archived + * state before expiring. This property is only writable during the creation of a snapshot. If not specified, the + * default lifetime of key-value revisions will be used. + * + * @return the retentionPeriod value. + */ + public Long retentionPeriod() { + return this.innerProperties() == null ? null : this.innerProperties().retentionPeriod(); + } + + /** + * Set the retentionPeriod property: The amount of time, in seconds, that a snapshot will remain in the archived + * state before expiring. This property is only writable during the creation of a snapshot. If not specified, the + * default lifetime of key-value revisions will be used. + * + * @param retentionPeriod the retentionPeriod value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withRetentionPeriod(Long retentionPeriod) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withRetentionPeriod(retentionPeriod); + return this; + } + + /** + * Get the size property: The size in bytes of the snapshot. + * + * @return the size value. + */ + public Long size() { + return this.innerProperties() == null ? null : this.innerProperties().size(); + } + + /** + * Get the itemsCount property: The amount of key-values in the snapshot. + * + * @return the itemsCount value. + */ + public Long itemsCount() { + return this.innerProperties() == null ? null : this.innerProperties().itemsCount(); + } + + /** + * Get the tags property: The tags of the snapshot. NOTE: These are data plane tags, not ARM tags. + * + * @return the tags value. + */ + public Map tags() { + return this.innerProperties() == null ? null : this.innerProperties().tags(); + } + + /** + * Set the tags property: The tags of the snapshot. NOTE: These are data plane tags, not ARM tags. + * + * @param tags the tags value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withTags(Map tags) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withTags(tags); + return this; + } + + /** + * Get the etag property: A value representing the current state of the snapshot. + * + * @return the etag value. + */ + public String etag() { + return this.innerProperties() == null ? null : this.innerProperties().etag(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnapshotInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapshotInner 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 SnapshotInner. + */ + public static SnapshotInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapshotInner deserializedSnapshotInner = new SnapshotInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSnapshotInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSnapshotInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSnapshotInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSnapshotInner.innerProperties = SnapshotProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapshotInner; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/SnapshotProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/SnapshotProperties.java new file mode 100644 index 0000000000000..97182488f02d3 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/SnapshotProperties.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.fluent.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 com.azure.resourcemanager.appconfiguration.models.CompositionType; +import com.azure.resourcemanager.appconfiguration.models.KeyValueFilter; +import com.azure.resourcemanager.appconfiguration.models.ProvisioningState; +import com.azure.resourcemanager.appconfiguration.models.SnapshotStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * All snapshot properties. + */ +@Fluent +public final class SnapshotProperties implements JsonSerializable { + /* + * The provisioning state of the snapshot. + */ + private ProvisioningState provisioningState; + + /* + * The current status of the snapshot. + */ + private SnapshotStatus status; + + /* + * A list of filters used to filter the key-values included in the snapshot. + */ + private List filters; + + /* + * The composition type describes how the key-values within the snapshot are composed. The 'key' composition type + * ensures there are no two key-values containing the same key. The 'key_label' composition type ensures there are + * no two key-values containing the same key and label. + */ + private CompositionType compositionType; + + /* + * The time that the snapshot was created. + */ + private OffsetDateTime created; + + /* + * The time that the snapshot will expire. + */ + private OffsetDateTime expires; + + /* + * The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. This property + * is only writable during the creation of a snapshot. If not specified, the default lifetime of key-value revisions + * will be used. + */ + private Long retentionPeriod; + + /* + * The size in bytes of the snapshot. + */ + private Long size; + + /* + * The amount of key-values in the snapshot. + */ + private Long itemsCount; + + /* + * The tags of the snapshot. NOTE: These are data plane tags, not ARM tags. + */ + private Map tags; + + /* + * A value representing the current state of the snapshot. + */ + private String etag; + + /** + * Creates an instance of SnapshotProperties class. + */ + public SnapshotProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the snapshot. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: The current status of the snapshot. + * + * @return the status value. + */ + public SnapshotStatus status() { + return this.status; + } + + /** + * Get the filters property: A list of filters used to filter the key-values included in the snapshot. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: A list of filters used to filter the key-values included in the snapshot. + * + * @param filters the filters value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Get the compositionType property: The composition type describes how the key-values within the snapshot are + * composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' + * composition type ensures there are no two key-values containing the same key and label. + * + * @return the compositionType value. + */ + public CompositionType compositionType() { + return this.compositionType; + } + + /** + * Set the compositionType property: The composition type describes how the key-values within the snapshot are + * composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' + * composition type ensures there are no two key-values containing the same key and label. + * + * @param compositionType the compositionType value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withCompositionType(CompositionType compositionType) { + this.compositionType = compositionType; + return this; + } + + /** + * Get the created property: The time that the snapshot was created. + * + * @return the created value. + */ + public OffsetDateTime created() { + return this.created; + } + + /** + * Get the expires property: The time that the snapshot will expire. + * + * @return the expires value. + */ + public OffsetDateTime expires() { + return this.expires; + } + + /** + * Get the retentionPeriod property: The amount of time, in seconds, that a snapshot will remain in the archived + * state before expiring. This property is only writable during the creation of a snapshot. If not specified, the + * default lifetime of key-value revisions will be used. + * + * @return the retentionPeriod value. + */ + public Long retentionPeriod() { + return this.retentionPeriod; + } + + /** + * Set the retentionPeriod property: The amount of time, in seconds, that a snapshot will remain in the archived + * state before expiring. This property is only writable during the creation of a snapshot. If not specified, the + * default lifetime of key-value revisions will be used. + * + * @param retentionPeriod the retentionPeriod value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withRetentionPeriod(Long retentionPeriod) { + this.retentionPeriod = retentionPeriod; + return this; + } + + /** + * Get the size property: The size in bytes of the snapshot. + * + * @return the size value. + */ + public Long size() { + return this.size; + } + + /** + * Get the itemsCount property: The amount of key-values in the snapshot. + * + * @return the itemsCount value. + */ + public Long itemsCount() { + return this.itemsCount; + } + + /** + * Get the tags property: The tags of the snapshot. NOTE: These are data plane tags, not ARM tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags of the snapshot. NOTE: These are data plane tags, not ARM tags. + * + * @param tags the tags value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the etag property: A value representing the current state of the snapshot. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property filters in model SnapshotProperties")); + } else { + filters().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SnapshotProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("compositionType", + this.compositionType == null ? null : this.compositionType.toString()); + jsonWriter.writeNumberField("retentionPeriod", this.retentionPeriod); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SnapshotProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapshotProperties 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 SnapshotProperties. + */ + public static SnapshotProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapshotProperties deserializedSnapshotProperties = new SnapshotProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filters".equals(fieldName)) { + List filters = reader.readArray(reader1 -> KeyValueFilter.fromJson(reader1)); + deserializedSnapshotProperties.filters = filters; + } else if ("provisioningState".equals(fieldName)) { + deserializedSnapshotProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedSnapshotProperties.status = SnapshotStatus.fromString(reader.getString()); + } else if ("compositionType".equals(fieldName)) { + deserializedSnapshotProperties.compositionType = CompositionType.fromString(reader.getString()); + } else if ("created".equals(fieldName)) { + deserializedSnapshotProperties.created = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expires".equals(fieldName)) { + deserializedSnapshotProperties.expires = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("retentionPeriod".equals(fieldName)) { + deserializedSnapshotProperties.retentionPeriod = reader.getNullable(JsonReader::getLong); + } else if ("size".equals(fieldName)) { + deserializedSnapshotProperties.size = reader.getNullable(JsonReader::getLong); + } else if ("itemsCount".equals(fieldName)) { + deserializedSnapshotProperties.itemsCount = reader.getNullable(JsonReader::getLong); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSnapshotProperties.tags = tags; + } else if ("etag".equals(fieldName)) { + deserializedSnapshotProperties.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapshotProperties; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/package-info.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/package-info.java index 0a03fa178fa24..e24a7869d77eb 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/package-info.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the inner data models for AppConfigurationManagementClient. null. */ +/** + * Package containing the inner data models for AppConfigurationManagementClient. + * null. + */ package com.azure.resourcemanager.appconfiguration.fluent.models; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/package-info.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/package-info.java index 6f2e40677ff07..27f4d1f4ae436 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/package-info.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/fluent/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the service clients for AppConfigurationManagementClient. null. */ +/** + * Package containing the service clients for AppConfigurationManagementClient. + * null. + */ package com.azure.resourcemanager.appconfiguration.fluent; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ApiKeyImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ApiKeyImpl.java index b4a4e7e071dd1..e1bf978c5a1e8 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ApiKeyImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ApiKeyImpl.java @@ -13,8 +13,8 @@ public final class ApiKeyImpl implements ApiKey { private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - ApiKeyImpl( - ApiKeyInner innerObject, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { + ApiKeyImpl(ApiKeyInner innerObject, + com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/AppConfigurationManagementClientBuilder.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/AppConfigurationManagementClientBuilder.java index 2feef4e71cc6d..b58f725625edc 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/AppConfigurationManagementClientBuilder.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/AppConfigurationManagementClientBuilder.java @@ -14,8 +14,10 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the AppConfigurationManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {AppConfigurationManagementClientImpl.class}) +/** + * A builder for creating a new instance of the AppConfigurationManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { AppConfigurationManagementClientImpl.class }) public final class AppConfigurationManagementClientBuilder { /* * The Microsoft Azure subscription ID. @@ -24,7 +26,7 @@ public final class AppConfigurationManagementClientBuilder { /** * Sets The Microsoft Azure subscription ID. - * + * * @param subscriptionId the subscriptionId value. * @return the AppConfigurationManagementClientBuilder. */ @@ -40,7 +42,7 @@ public AppConfigurationManagementClientBuilder subscriptionId(String subscriptio /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the AppConfigurationManagementClientBuilder. */ @@ -56,7 +58,7 @@ public AppConfigurationManagementClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the AppConfigurationManagementClientBuilder. */ @@ -72,7 +74,7 @@ public AppConfigurationManagementClientBuilder environment(AzureEnvironment envi /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the AppConfigurationManagementClientBuilder. */ @@ -88,7 +90,7 @@ public AppConfigurationManagementClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the AppConfigurationManagementClientBuilder. */ @@ -104,7 +106,7 @@ public AppConfigurationManagementClientBuilder defaultPollInterval(Duration defa /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the AppConfigurationManagementClientBuilder. */ @@ -115,30 +117,22 @@ public AppConfigurationManagementClientBuilder serializerAdapter(SerializerAdapt /** * Builds an instance of AppConfigurationManagementClientImpl with the provided parameters. - * + * * @return an instance of AppConfigurationManagementClientImpl. */ public AppConfigurationManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - AppConfigurationManagementClientImpl client = - new AppConfigurationManagementClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + AppConfigurationManagementClientImpl client = new AppConfigurationManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } 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 d63aac08d63d4..62e93c08b0981 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.appconfiguration.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,8 +13,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -29,6 +30,7 @@ import com.azure.resourcemanager.appconfiguration.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.appconfiguration.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.appconfiguration.fluent.ReplicasClient; +import com.azure.resourcemanager.appconfiguration.fluent.SnapshotsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -38,156 +40,196 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the AppConfigurationManagementClientImpl type. */ +/** + * Initializes a new instance of the AppConfigurationManagementClientImpl type. + */ @ServiceClient(builder = AppConfigurationManagementClientBuilder.class) public final class AppConfigurationManagementClientImpl implements AppConfigurationManagementClient { - /** The Microsoft Azure subscription ID. */ + /** + * The Microsoft Azure subscription ID. + */ private final String subscriptionId; /** * Gets The Microsoft Azure subscription ID. - * + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The ConfigurationStoresClient object to access its operations. */ + /** + * The ConfigurationStoresClient object to access its operations. + */ private final ConfigurationStoresClient configurationStores; /** * Gets the ConfigurationStoresClient object to access its operations. - * + * * @return the ConfigurationStoresClient object. */ public ConfigurationStoresClient getConfigurationStores() { return this.configurationStores; } - /** The OperationsClient object to access its operations. */ + /** + * The OperationsClient object to access its operations. + */ private final OperationsClient operations; /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ public OperationsClient getOperations() { return this.operations; } - /** The PrivateEndpointConnectionsClient object to access its operations. */ + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ private final PrivateEndpointConnectionsClient privateEndpointConnections; /** * Gets the PrivateEndpointConnectionsClient object to access its operations. - * + * * @return the PrivateEndpointConnectionsClient object. */ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { return this.privateEndpointConnections; } - /** The PrivateLinkResourcesClient object to access its operations. */ + /** + * The PrivateLinkResourcesClient object to access its operations. + */ private final PrivateLinkResourcesClient privateLinkResources; /** * Gets the PrivateLinkResourcesClient object to access its operations. - * + * * @return the PrivateLinkResourcesClient object. */ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } - /** The KeyValuesClient object to access its operations. */ + /** + * The KeyValuesClient object to access its operations. + */ private final KeyValuesClient keyValues; /** * Gets the KeyValuesClient object to access its operations. - * + * * @return the KeyValuesClient object. */ public KeyValuesClient getKeyValues() { return this.keyValues; } - /** The ReplicasClient object to access its operations. */ + /** + * The ReplicasClient object to access its operations. + */ private final ReplicasClient replicas; /** * Gets the ReplicasClient object to access its operations. - * + * * @return the ReplicasClient object. */ public ReplicasClient getReplicas() { return this.replicas; } + /** + * The SnapshotsClient object to access its operations. + */ + private final SnapshotsClient snapshots; + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + public SnapshotsClient getSnapshots() { + return this.snapshots; + } + /** * Initializes an instance of AppConfigurationManagementClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. @@ -195,30 +237,26 @@ public ReplicasClient getReplicas() { * @param subscriptionId The Microsoft Azure subscription ID. * @param endpoint server parameter. */ - AppConfigurationManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + AppConfigurationManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-03-01"; + this.apiVersion = "2024-09-01-preview"; this.configurationStores = new ConfigurationStoresClientImpl(this); this.operations = new OperationsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.keyValues = new KeyValuesClientImpl(this); this.replicas = new ReplicasClientImpl(this); + this.snapshots = new SnapshotsClientImpl(this); } /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -227,7 +265,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -237,7 +275,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -247,26 +285,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); } /** * Gets the final result, or an error, based on last async poll response. - * + * * @param response the last async poll response. * @param type of poll result. * @param type of final result. @@ -279,19 +306,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); errorMessage = response.getValue().getError().getMessage(); String errorBody = response.getValue().getError().getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -332,7 +356,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { 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 b13ff769dabd8..331dbfd9bb3d8 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 @@ -14,13 +14,19 @@ import com.azure.resourcemanager.appconfiguration.models.ConfigurationStore; import com.azure.resourcemanager.appconfiguration.models.ConfigurationStoreUpdateParameters; 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.ResetSasTokensParameters; import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; +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; @@ -110,10 +116,22 @@ public Boolean enablePurgeProtection() { return this.innerModel().enablePurgeProtection(); } + public DataPlaneProxyProperties dataPlaneProxy() { + return this.innerModel().dataPlaneProxy(); + } + 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()); } @@ -146,25 +164,21 @@ public ConfigurationStoreImpl withExistingResourceGroup(String resourceGroupName } public ConfigurationStore create() { - this.innerObject = - serviceManager - .serviceClient() - .getConfigurationStores() - .create(resourceGroupName, configStoreName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getConfigurationStores() + .create(resourceGroupName, configStoreName, this.innerModel(), Context.NONE); return this; } public ConfigurationStore create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getConfigurationStores() - .create(resourceGroupName, configStoreName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getConfigurationStores() + .create(resourceGroupName, configStoreName, this.innerModel(), context); return this; } - ConfigurationStoreImpl( - String name, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { + ConfigurationStoreImpl(String name, + com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = new ConfigurationStoreInner(); this.serviceManager = serviceManager; this.configStoreName = name; @@ -176,49 +190,40 @@ public ConfigurationStoreImpl update() { } public ConfigurationStore apply() { - this.innerObject = - serviceManager - .serviceClient() - .getConfigurationStores() - .update(resourceGroupName, configStoreName, updateConfigStoreUpdateParameters, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getConfigurationStores() + .update(resourceGroupName, configStoreName, updateConfigStoreUpdateParameters, Context.NONE); return this; } public ConfigurationStore apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getConfigurationStores() - .update(resourceGroupName, configStoreName, updateConfigStoreUpdateParameters, context); + this.innerObject = serviceManager.serviceClient() + .getConfigurationStores() + .update(resourceGroupName, configStoreName, updateConfigStoreUpdateParameters, context); return this; } - ConfigurationStoreImpl( - ConfigurationStoreInner innerObject, + ConfigurationStoreImpl(ConfigurationStoreInner innerObject, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.configStoreName = Utils.getValueFromIdByName(innerObject.id(), "configurationStores"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.configStoreName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "configurationStores"); } public ConfigurationStore refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getConfigurationStores() - .getByResourceGroupWithResponse(resourceGroupName, configStoreName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getConfigurationStores() + .getByResourceGroupWithResponse(resourceGroupName, configStoreName, Context.NONE) + .getValue(); return this; } public ConfigurationStore refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getConfigurationStores() - .getByResourceGroupWithResponse(resourceGroupName, configStoreName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getConfigurationStores() + .getByResourceGroupWithResponse(resourceGroupName, configStoreName, context) + .getValue(); return this; } @@ -230,19 +235,39 @@ public PagedIterable listKeys(String skipToken, Context context) { return serviceManager.configurationStores().listKeys(resourceGroupName, configStoreName, skipToken, context); } - public Response regenerateKeyWithResponse( - RegenerateKeyParameters regenerateKeyParameters, Context context) { - return serviceManager - .configurationStores() + public Response regenerateKeyWithResponse(RegenerateKeyParameters regenerateKeyParameters, + Context context) { + return serviceManager.configurationStores() .regenerateKeyWithResponse(resourceGroupName, configStoreName, regenerateKeyParameters, context); } public ApiKey regenerateKey(RegenerateKeyParameters regenerateKeyParameters) { - return serviceManager - .configurationStores() + return serviceManager.configurationStores() .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 resetSasTokensWithResponse(ResetSasTokensParameters resetSasTokensParameters, + Context context) { + return serviceManager.configurationStores() + .resetSasTokensWithResponse(resourceGroupName, configStoreName, resetSasTokensParameters, context); + } + + public void resetSasTokens(ResetSasTokensParameters resetSasTokensParameters) { + serviceManager.configurationStores() + .resetSasTokens(resourceGroupName, configStoreName, resetSasTokensParameters); + } + public ConfigurationStoreImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -328,11 +353,41 @@ public ConfigurationStoreImpl withEnablePurgeProtection(Boolean enablePurgeProte } } + public ConfigurationStoreImpl withDataPlaneProxy(DataPlaneProxyProperties dataPlaneProxy) { + if (isInCreateMode()) { + this.innerModel().withDataPlaneProxy(dataPlaneProxy); + return this; + } else { + this.updateConfigStoreUpdateParameters.withDataPlaneProxy(dataPlaneProxy); + return this; + } + } + public ConfigurationStoreImpl withCreateMode(CreateMode createMode) { this.innerModel().withCreateMode(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 6cfa8b83596d4..b43fc6d4d4f46 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,31 +37,40 @@ 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.ResetSasTokensParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ConfigurationStoresClient. */ +/** + * An instance of this class provides access to all the operations defined in ConfigurationStoresClient. + */ public final class ConfigurationStoresClientImpl implements ConfigurationStoresClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ConfigurationStoresService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AppConfigurationManagementClientImpl client; /** * Initializes an instance of ConfigurationStoresClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ConfigurationStoresClientImpl(AppConfigurationManagementClientImpl client) { - this.service = - RestProxy.create(ConfigurationStoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(ConfigurationStoresService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -72,304 +81,235 @@ public final class ConfigurationStoresClientImpl implements ConfigurationStoresC @Host("{$host}") @ServiceInterface(name = "AppConfigurationMana") public interface ConfigurationStoresService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/configurationStores") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores") - @ExpectedResponses({200}) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") - @ExpectedResponses({200}) + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, + Mono> getByResourceGroup(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") - @ExpectedResponses({200, 201}) + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, + Mono>> create(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ConfigurationStoreInner configStoreCreationParameters, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") - @ExpectedResponses({200, 201}) + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ConfigurationStoreUpdateParameters configStoreUpdateParameters, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys( - @HostParam("$host") String endpoint, + Mono> listKeys(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey") - @ExpectedResponses({200}) + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/regenerateKey") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKey( - @HostParam("$host") String endpoint, + Mono> regenerateKey(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") RegenerateKeyParameters regenerateKeyParameters, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/generateSasToken") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeleted( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> generateSasToken(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + @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"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/resetSasTokens") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getDeleted( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> resetSasTokens(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @PathParam("configStoreName") String configStoreName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge") - @ExpectedResponses({200, 202, 204}) + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ResetSasTokensParameters resetSasTokensParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/deletedConfigurationStores") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> purgeDeleted( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @PathParam("configStoreName") String configStoreName, - @HeaderParam("Accept") String accept, - Context context); + Mono> listDeleted(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDeleted(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("configStoreName") String configStoreName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/deletedConfigurationStores/{configStoreName}/purge") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> purgeDeleted(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("configStoreName") String configStoreName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeysNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listKeysNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listDeletedNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Lists the configuration stores for a given subscription. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list configuration stores along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String skipToken) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - skipToken, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), skipToken, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the configuration stores for a given subscription. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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 list configuration stores along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String skipToken, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), skipToken, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the configuration stores for a given subscription. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -382,7 +322,7 @@ private PagedFlux listAsync(String skipToken) { /** * Lists the configuration stores for a given subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list configuration stores as paginated response with {@link PagedFlux}. @@ -395,10 +335,10 @@ private PagedFlux listAsync() { /** * Lists the configuration stores for a given subscription. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -407,13 +347,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String skipToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists the configuration stores for a given subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list configuration stores as paginated response with {@link PagedIterable}. @@ -426,10 +366,10 @@ public PagedIterable list() { /** * Lists the configuration stores for a given subscription. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -443,31 +383,27 @@ public PagedIterable list(String skipToken, Context con /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list configuration stores along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String skipToken) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String skipToken) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -476,56 +412,37 @@ private Mono> listByResourceGroupSinglePa final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - skipToken, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), skipToken, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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 list configuration stores along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String skipToken, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String skipToken, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -534,32 +451,19 @@ private Mono> listByResourceGroupSinglePa final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - this.client.getApiVersion(), - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -567,14 +471,13 @@ private Mono> listByResourceGroupSinglePa */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skipToken) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -584,18 +487,17 @@ private PagedFlux listByResourceGroupAsync(String resou @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { final String skipToken = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -603,16 +505,15 @@ private PagedFlux listByResourceGroupAsync(String resou * @return the result of a request to list configuration stores as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String skipToken, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken, context), + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skipToken, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -627,11 +528,11 @@ public PagedIterable listByResourceGroup(String resourc /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -639,36 +540,32 @@ public PagedIterable listByResourceGroup(String resourc * @return the result of a request to list configuration stores as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String skipToken, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, + Context context) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, skipToken, context)); } /** * Gets the properties 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of the specified configuration store along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String configStoreName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String configStoreName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -681,22 +578,14 @@ private Mono> getByResourceGroupWithResponseAs final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - accept, - context)) + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the properties 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 context The context to associate with this operation. @@ -704,22 +593,18 @@ private Mono> getByResourceGroupWithResponseAs * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of the specified configuration store along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String configStoreName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String configStoreName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -731,20 +616,13 @@ private Mono> getByResourceGroupWithResponseAs } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), accept, context); } /** * Gets the properties 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -760,7 +638,7 @@ private Mono getByResourceGroupAsync(String resourceGro /** * Gets the properties 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 context The context to associate with this operation. @@ -770,14 +648,14 @@ private Mono getByResourceGroupAsync(String resourceGro * @return the properties of the specified configuration store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String configStoreName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, + String configStoreName, Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, configStoreName, context).block(); } /** * Gets the properties 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -792,7 +670,7 @@ public ConfigurationStoreInner getByResourceGroup(String resourceGroupName, Stri /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -800,22 +678,18 @@ public ConfigurationStoreInner getByResourceGroup(String resourceGroupName, Stri * @throws ManagementException 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters) { + private Mono>> createWithResponseAsync(String resourceGroupName, String configStoreName, + ConfigurationStoreInner configStoreCreationParameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -826,33 +700,22 @@ private Mono>> createWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (configStoreCreationParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter configStoreCreationParameters is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter configStoreCreationParameters is required and cannot be null.")); } else { configStoreCreationParameters.validate(); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - configStoreCreationParameters, - accept, - context)) + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), configStoreCreationParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -861,25 +724,18 @@ private Mono>> createWithResponseAsync( * @throws ManagementException 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String configStoreName, - ConfigurationStoreInner configStoreCreationParameters, - Context context) { + private Mono>> createWithResponseAsync(String resourceGroupName, String configStoreName, + ConfigurationStoreInner configStoreCreationParameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -890,30 +746,20 @@ private Mono>> createWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (configStoreCreationParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter configStoreCreationParameters is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter configStoreCreationParameters is required and cannot be null.")); } else { configStoreCreationParameters.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - configStoreCreationParameters, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), configStoreCreationParameters, accept, context); } /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -925,21 +771,16 @@ private Mono>> createWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ConfigurationStoreInner> beginCreateAsync( String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, configStoreName, configStoreCreationParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfigurationStoreInner.class, - ConfigurationStoreInner.class, - this.client.getContext()); + Mono>> mono + = createWithResponseAsync(resourceGroupName, configStoreName, configStoreCreationParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfigurationStoreInner.class, ConfigurationStoreInner.class, + this.client.getContext()); } /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -951,26 +792,18 @@ private PollerFlux, ConfigurationStoreInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ConfigurationStoreInner> beginCreateAsync( - String resourceGroupName, - String configStoreName, - ConfigurationStoreInner configStoreCreationParameters, + String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync(resourceGroupName, configStoreName, configStoreCreationParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfigurationStoreInner.class, - ConfigurationStoreInner.class, - context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, configStoreName, configStoreCreationParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfigurationStoreInner.class, ConfigurationStoreInner.class, context); } /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -987,7 +820,7 @@ public SyncPoller, ConfigurationStoreInner> /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -999,18 +832,15 @@ public SyncPoller, ConfigurationStoreInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ConfigurationStoreInner> beginCreate( - String resourceGroupName, - String configStoreName, - ConfigurationStoreInner configStoreCreationParameters, + String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters, Context context) { - return this - .beginCreateAsync(resourceGroupName, configStoreName, configStoreCreationParameters, context) + return this.beginCreateAsync(resourceGroupName, configStoreName, configStoreCreationParameters, context) .getSyncPoller(); } /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -1020,16 +850,15 @@ public SyncPoller, ConfigurationStoreInner> * @return the configuration store along with all resource properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters) { - return beginCreateAsync(resourceGroupName, configStoreName, configStoreCreationParameters) - .last() + private Mono createAsync(String resourceGroupName, String configStoreName, + ConfigurationStoreInner configStoreCreationParameters) { + return beginCreateAsync(resourceGroupName, configStoreName, configStoreCreationParameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -1040,19 +869,15 @@ private Mono createAsync( * @return the configuration store along with all resource properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String configStoreName, - ConfigurationStoreInner configStoreCreationParameters, - Context context) { - return beginCreateAsync(resourceGroupName, configStoreName, configStoreCreationParameters, context) - .last() + private Mono createAsync(String resourceGroupName, String configStoreName, + ConfigurationStoreInner configStoreCreationParameters, Context context) { + return beginCreateAsync(resourceGroupName, configStoreName, configStoreCreationParameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -1062,14 +887,14 @@ private Mono createAsync( * @return the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationStoreInner create( - String resourceGroupName, String configStoreName, ConfigurationStoreInner configStoreCreationParameters) { + public ConfigurationStoreInner create(String resourceGroupName, String configStoreName, + ConfigurationStoreInner configStoreCreationParameters) { return createAsync(resourceGroupName, configStoreName, configStoreCreationParameters).block(); } /** * Creates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreCreationParameters The parameters for creating a configuration store. @@ -1080,17 +905,14 @@ public ConfigurationStoreInner create( * @return the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationStoreInner create( - String resourceGroupName, - String configStoreName, - ConfigurationStoreInner configStoreCreationParameters, - Context context) { + public ConfigurationStoreInner create(String resourceGroupName, String configStoreName, + ConfigurationStoreInner configStoreCreationParameters, Context context) { return createAsync(resourceGroupName, configStoreName, configStoreCreationParameters, context).block(); } /** * Deletes a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1101,16 +923,12 @@ public ConfigurationStoreInner create( @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String configStoreName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1122,23 +940,14 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a 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 context The context to associate with this operation. @@ -1148,19 +957,15 @@ private Mono>> deleteWithResponseAsync(String resource * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String configStoreName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String configStoreName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1172,20 +977,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), accept, context); } /** * Deletes a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1196,15 +994,13 @@ private Mono>> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String configStoreName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, configStoreName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deletes a 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 context The context to associate with this operation. @@ -1214,18 +1010,17 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String configStoreName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String configStoreName, + Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, configStoreName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Deletes a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1240,7 +1035,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes a 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 context The context to associate with this operation. @@ -1250,14 +1045,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + Context context) { return this.beginDeleteAsync(resourceGroupName, configStoreName, context).getSyncPoller(); } /** * Deletes a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1267,14 +1062,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String configStoreName) { - return beginDeleteAsync(resourceGroupName, configStoreName) - .last() + return beginDeleteAsync(resourceGroupName, configStoreName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a 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 context The context to associate with this operation. @@ -1285,14 +1079,13 @@ private Mono deleteAsync(String resourceGroupName, String configStoreName) */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String configStoreName, Context context) { - return beginDeleteAsync(resourceGroupName, configStoreName, context) - .last() + return beginDeleteAsync(resourceGroupName, configStoreName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1306,7 +1099,7 @@ public void delete(String resourceGroupName, String configStoreName) { /** * Deletes a 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 context The context to associate with this operation. @@ -1321,7 +1114,7 @@ public void delete(String resourceGroupName, String configStoreName, Context con /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -1329,24 +1122,18 @@ public void delete(String resourceGroupName, String configStoreName, Context con * @throws ManagementException 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String configStoreName, + private Mono>> updateWithResponseAsync(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1357,33 +1144,22 @@ private Mono>> updateWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (configStoreUpdateParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter configStoreUpdateParameters is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter configStoreUpdateParameters is required and cannot be null.")); } else { configStoreUpdateParameters.validate(); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - configStoreUpdateParameters, - accept, - context)) + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), configStoreUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -1392,25 +1168,18 @@ private Mono>> updateWithResponseAsync( * @throws ManagementException 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}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String configStoreName, - ConfigurationStoreUpdateParameters configStoreUpdateParameters, - Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String configStoreName, + ConfigurationStoreUpdateParameters configStoreUpdateParameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1421,30 +1190,20 @@ private Mono>> updateWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (configStoreUpdateParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter configStoreUpdateParameters is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter configStoreUpdateParameters is required and cannot be null.")); } else { configStoreUpdateParameters.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - configStoreUpdateParameters, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), configStoreUpdateParameters, accept, context); } /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -1455,24 +1214,18 @@ private Mono>> updateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ConfigurationStoreInner> beginUpdateAsync( - String resourceGroupName, - String configStoreName, + String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, configStoreName, configStoreUpdateParameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfigurationStoreInner.class, - ConfigurationStoreInner.class, - this.client.getContext()); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, configStoreName, configStoreUpdateParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfigurationStoreInner.class, ConfigurationStoreInner.class, + this.client.getContext()); } /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -1484,26 +1237,18 @@ private PollerFlux, ConfigurationStoreInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ConfigurationStoreInner> beginUpdateAsync( - String resourceGroupName, - String configStoreName, - ConfigurationStoreUpdateParameters configStoreUpdateParameters, - Context context) { + String resourceGroupName, String configStoreName, + ConfigurationStoreUpdateParameters configStoreUpdateParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, configStoreName, configStoreUpdateParameters, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ConfigurationStoreInner.class, - ConfigurationStoreInner.class, - context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, configStoreName, configStoreUpdateParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConfigurationStoreInner.class, ConfigurationStoreInner.class, context); } /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -1514,15 +1259,14 @@ private PollerFlux, ConfigurationStoreInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ConfigurationStoreInner> beginUpdate( - String resourceGroupName, - String configStoreName, + String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { return this.beginUpdateAsync(resourceGroupName, configStoreName, configStoreUpdateParameters).getSyncPoller(); } /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -1534,18 +1278,15 @@ public SyncPoller, ConfigurationStoreInner> */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ConfigurationStoreInner> beginUpdate( - String resourceGroupName, - String configStoreName, - ConfigurationStoreUpdateParameters configStoreUpdateParameters, - Context context) { - return this - .beginUpdateAsync(resourceGroupName, configStoreName, configStoreUpdateParameters, context) + String resourceGroupName, String configStoreName, + ConfigurationStoreUpdateParameters configStoreUpdateParameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, configStoreName, configStoreUpdateParameters, context) .getSyncPoller(); } /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -1555,18 +1296,15 @@ public SyncPoller, ConfigurationStoreInner> * @return the configuration store along with all resource properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String configStoreName, + private Mono updateAsync(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { - return beginUpdateAsync(resourceGroupName, configStoreName, configStoreUpdateParameters) - .last() + return beginUpdateAsync(resourceGroupName, configStoreName, configStoreUpdateParameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -1577,19 +1315,15 @@ private Mono updateAsync( * @return the configuration store along with all resource properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String configStoreName, - ConfigurationStoreUpdateParameters configStoreUpdateParameters, - Context context) { - return beginUpdateAsync(resourceGroupName, configStoreName, configStoreUpdateParameters, context) - .last() + private Mono updateAsync(String resourceGroupName, String configStoreName, + ConfigurationStoreUpdateParameters configStoreUpdateParameters, Context context) { + return beginUpdateAsync(resourceGroupName, configStoreName, configStoreUpdateParameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -1599,16 +1333,14 @@ private Mono updateAsync( * @return the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationStoreInner update( - String resourceGroupName, - String configStoreName, + public ConfigurationStoreInner update(String resourceGroupName, String configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters) { return updateAsync(resourceGroupName, configStoreName, configStoreUpdateParameters).block(); } /** * Updates a configuration store with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param configStoreUpdateParameters The parameters for updating a configuration store. @@ -1619,42 +1351,35 @@ public ConfigurationStoreInner update( * @return the configuration store along with all resource properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationStoreInner update( - String resourceGroupName, - String configStoreName, - ConfigurationStoreUpdateParameters configStoreUpdateParameters, - Context context) { + public ConfigurationStoreInner update(String resourceGroupName, String configStoreName, + ConfigurationStoreUpdateParameters configStoreUpdateParameters, Context context) { return updateAsync(resourceGroupName, configStoreName, configStoreUpdateParameters, context).block(); } /** * Lists the access key for 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list API keys along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysSinglePageAsync( - String resourceGroupName, String configStoreName, String skipToken) { + private Mono> listKeysSinglePageAsync(String resourceGroupName, String configStoreName, + String skipToken) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1666,59 +1391,38 @@ private Mono> listKeysSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listKeys( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - skipToken, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), skipToken, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the access key for 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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 list API keys along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysSinglePageAsync( - String resourceGroupName, String configStoreName, String skipToken, Context context) { + private Mono> listKeysSinglePageAsync(String resourceGroupName, String configStoreName, + String skipToken, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1731,34 +1435,20 @@ private Mono> listKeysSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listKeys( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, configStoreName, + this.client.getApiVersion(), skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the access key for 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1766,14 +1456,13 @@ private Mono> listKeysSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listKeysAsync(String resourceGroupName, String configStoreName, String skipToken) { - return new PagedFlux<>( - () -> listKeysSinglePageAsync(resourceGroupName, configStoreName, skipToken), + return new PagedFlux<>(() -> listKeysSinglePageAsync(resourceGroupName, configStoreName, skipToken), nextLink -> listKeysNextSinglePageAsync(nextLink)); } /** * Lists the access key for 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1784,19 +1473,18 @@ private PagedFlux listKeysAsync(String resourceGroupName, String co @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listKeysAsync(String resourceGroupName, String configStoreName) { final String skipToken = null; - return new PagedFlux<>( - () -> listKeysSinglePageAsync(resourceGroupName, configStoreName, skipToken), + return new PagedFlux<>(() -> listKeysSinglePageAsync(resourceGroupName, configStoreName, skipToken), nextLink -> listKeysNextSinglePageAsync(nextLink)); } /** * Lists the access key for 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -1804,16 +1492,15 @@ private PagedFlux listKeysAsync(String resourceGroupName, String co * @return the result of a request to list API keys as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listKeysAsync( - String resourceGroupName, String configStoreName, String skipToken, Context context) { - return new PagedFlux<>( - () -> listKeysSinglePageAsync(resourceGroupName, configStoreName, skipToken, context), + private PagedFlux listKeysAsync(String resourceGroupName, String configStoreName, String skipToken, + Context context) { + return new PagedFlux<>(() -> listKeysSinglePageAsync(resourceGroupName, configStoreName, skipToken, context), nextLink -> listKeysNextSinglePageAsync(nextLink, context)); } /** * Lists the access key for 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1829,12 +1516,12 @@ public PagedIterable listKeys(String resourceGroupName, String conf /** * Lists the access key for 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -1842,14 +1529,14 @@ public PagedIterable listKeys(String resourceGroupName, String conf * @return the result of a request to list API keys as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listKeys( - String resourceGroupName, String configStoreName, String skipToken, Context context) { + public PagedIterable listKeys(String resourceGroupName, String configStoreName, String skipToken, + Context context) { return new PagedIterable<>(listKeysAsync(resourceGroupName, configStoreName, skipToken, context)); } /** * Regenerates an access key for 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 regenerateKeyParameters The parameters for regenerating an access key. @@ -1857,22 +1544,18 @@ public PagedIterable listKeys( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an API key used for authenticating with a configuration store endpoint along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeyWithResponseAsync( - String resourceGroupName, String configStoreName, RegenerateKeyParameters regenerateKeyParameters) { + private Mono> regenerateKeyWithResponseAsync(String resourceGroupName, String configStoreName, + RegenerateKeyParameters regenerateKeyParameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1883,32 +1566,22 @@ private Mono> regenerateKeyWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (regenerateKeyParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter regenerateKeyParameters is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter regenerateKeyParameters is required and cannot be null.")); } else { regenerateKeyParameters.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .regenerateKey( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - regenerateKeyParameters, - accept, - context)) + .withContext(context -> service.regenerateKey(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), regenerateKeyParameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Regenerates an access key for 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 regenerateKeyParameters The parameters for regenerating an access key. @@ -1917,25 +1590,18 @@ private Mono> regenerateKeyWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an API key used for authenticating with a configuration store endpoint along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeyWithResponseAsync( - String resourceGroupName, - String configStoreName, - RegenerateKeyParameters regenerateKeyParameters, - Context context) { + private Mono> regenerateKeyWithResponseAsync(String resourceGroupName, String configStoreName, + RegenerateKeyParameters regenerateKeyParameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1946,48 +1612,39 @@ private Mono> regenerateKeyWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (regenerateKeyParameters == null) { - return Mono - .error( - new IllegalArgumentException("Parameter regenerateKeyParameters is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter regenerateKeyParameters is required and cannot be null.")); } else { regenerateKeyParameters.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .regenerateKey( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - regenerateKeyParameters, - accept, - context); + return service.regenerateKey(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), regenerateKeyParameters, accept, context); } /** * Regenerates an access key for 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 regenerateKeyParameters The parameters for regenerating an access key. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an API key used for authenticating with a configuration store endpoint on successful completion of {@link - * Mono}. + * @return an API key used for authenticating with a configuration store endpoint on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeyAsync( - String resourceGroupName, String configStoreName, RegenerateKeyParameters regenerateKeyParameters) { + private Mono regenerateKeyAsync(String resourceGroupName, String configStoreName, + RegenerateKeyParameters regenerateKeyParameters) { return regenerateKeyWithResponseAsync(resourceGroupName, configStoreName, regenerateKeyParameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Regenerates an access key for 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 regenerateKeyParameters The parameters for regenerating an access key. @@ -1998,18 +1655,15 @@ private Mono regenerateKeyAsync( * @return an API key used for authenticating with a configuration store endpoint along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeyWithResponse( - String resourceGroupName, - String configStoreName, - RegenerateKeyParameters regenerateKeyParameters, - Context context) { + public Response regenerateKeyWithResponse(String resourceGroupName, String configStoreName, + RegenerateKeyParameters regenerateKeyParameters, Context context) { return regenerateKeyWithResponseAsync(resourceGroupName, configStoreName, regenerateKeyParameters, context) .block(); } /** * Regenerates an access key for 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 regenerateKeyParameters The parameters for regenerating an access key. @@ -2019,138 +1673,389 @@ public Response regenerateKeyWithResponse( * @return an API key used for authenticating with a configuration store endpoint. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ApiKeyInner regenerateKey( - String resourceGroupName, String configStoreName, RegenerateKeyParameters regenerateKeyParameters) { + public ApiKeyInner regenerateKey(String resourceGroupName, String configStoreName, + RegenerateKeyParameters regenerateKeyParameters) { return regenerateKeyWithResponse(resourceGroupName, configStoreName, regenerateKeyParameters, Context.NONE) .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 all SAS tokens of a given kind (primary/secondary). + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasTokensParameters The object containing information for the SAS token 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resetSasTokensWithResponseAsync(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters) { + 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 (resetSasTokensParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter resetSasTokensParameters is required and cannot be null.")); + } else { + resetSasTokensParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.resetSasTokens(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), resetSasTokensParameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reset all SAS tokens of a given kind (primary/secondary). + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasTokensParameters The object containing information for the SAS token 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resetSasTokensWithResponseAsync(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters, 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 (resetSasTokensParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter resetSasTokensParameters is required and cannot be null.")); + } else { + resetSasTokensParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.resetSasTokens(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), resetSasTokensParameters, accept, context); + } + + /** + * Reset all SAS tokens of a given kind (primary/secondary). + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasTokensParameters The object containing information for the SAS token 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetSasTokensAsync(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters) { + return resetSasTokensWithResponseAsync(resourceGroupName, configStoreName, resetSasTokensParameters) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Reset all SAS tokens of a given kind (primary/secondary). + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasTokensParameters The object containing information for the SAS token 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resetSasTokensWithResponse(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters, Context context) { + return resetSasTokensWithResponseAsync(resourceGroupName, configStoreName, resetSasTokensParameters, context) + .block(); + } + + /** + * Reset all SAS tokens of a given kind (primary/secondary). + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasTokensParameters The object containing information for the SAS token 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetSasTokens(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters) { + resetSasTokensWithResponse(resourceGroupName, configStoreName, resetSasTokensParameters, Context.NONE); + } + /** * Gets information about the deleted configuration stores in a subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the deleted configuration stores in a subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeletedSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listDeleted(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets information about the deleted configuration stores in a subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the deleted configuration stores in a subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeletedSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listDeleted(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets information about the deleted configuration stores in a subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted configuration stores in a subscription as paginated response with {@link - * PagedFlux}. + * @return information about the deleted configuration stores in a subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeletedAsync() { - return new PagedFlux<>( - () -> listDeletedSinglePageAsync(), nextLink -> listDeletedNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listDeletedSinglePageAsync(), + nextLink -> listDeletedNextSinglePageAsync(nextLink)); } /** * Gets information about the deleted configuration stores in a subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted configuration stores in a subscription as paginated response with {@link - * PagedFlux}. + * @return information about the deleted configuration stores in a subscription as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeletedAsync(Context context) { - return new PagedFlux<>( - () -> listDeletedSinglePageAsync(context), nextLink -> listDeletedNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listDeletedSinglePageAsync(context), + nextLink -> listDeletedNextSinglePageAsync(nextLink, context)); } /** * Gets information about the deleted configuration stores in a subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted configuration stores in a subscription as paginated response with {@link - * PagedIterable}. + * @return information about the deleted configuration stores in a subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeleted() { @@ -2159,13 +2064,13 @@ public PagedIterable listDeleted() { /** * Gets information about the deleted configuration stores in a subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted configuration stores in a subscription as paginated response with {@link - * PagedIterable}. + * @return information about the deleted configuration stores in a subscription as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeleted(Context context) { @@ -2174,29 +2079,25 @@ public PagedIterable listDeleted(Context context /** * Gets a deleted Azure app configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deleted Azure app configuration store along with {@link Response} on successful completion of {@link - * Mono}. + * @return a deleted Azure app configuration store along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDeletedWithResponseAsync( - String location, String configStoreName) { + private Mono> getDeletedWithResponseAsync(String location, + String configStoreName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -2207,46 +2108,33 @@ private Mono> getDeletedWithResponseAsy } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - configStoreName, - accept, - context)) + .withContext(context -> service.getDeleted(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, configStoreName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a deleted Azure app configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deleted Azure app configuration store along with {@link Response} on successful completion of {@link - * Mono}. + * @return a deleted Azure app configuration store along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDeletedWithResponseAsync( - String location, String configStoreName, Context context) { + private Mono> getDeletedWithResponseAsync(String location, + String configStoreName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -2257,20 +2145,13 @@ private Mono> getDeletedWithResponseAsy } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - configStoreName, - accept, - context); + return service.getDeleted(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, configStoreName, accept, context); } /** * Gets a deleted Azure app configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2285,7 +2166,7 @@ private Mono getDeletedAsync(String location, St /** * Gets a deleted Azure app configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. @@ -2295,14 +2176,14 @@ private Mono getDeletedAsync(String location, St * @return a deleted Azure app configuration store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeletedWithResponse( - String location, String configStoreName, Context context) { + public Response getDeletedWithResponse(String location, String configStoreName, + Context context) { return getDeletedWithResponseAsync(location, configStoreName, context).block(); } /** * Gets a deleted Azure app configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2317,7 +2198,7 @@ public DeletedConfigurationStoreInner getDeleted(String location, String configS /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2328,16 +2209,12 @@ public DeletedConfigurationStoreInner getDeleted(String location, String configS @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> purgeDeletedWithResponseAsync(String location, String configStoreName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -2348,23 +2225,14 @@ private Mono>> purgeDeletedWithResponseAsync(String lo } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .purgeDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - configStoreName, - accept, - context)) + .withContext(context -> service.purgeDeleted(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, configStoreName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. @@ -2374,19 +2242,15 @@ private Mono>> purgeDeletedWithResponseAsync(String lo * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> purgeDeletedWithResponseAsync( - String location, String configStoreName, Context context) { + private Mono>> purgeDeletedWithResponseAsync(String location, String configStoreName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -2397,20 +2261,13 @@ private Mono>> purgeDeletedWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .purgeDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - configStoreName, - accept, - context); + return service.purgeDeleted(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, configStoreName, accept, context); } /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2421,15 +2278,13 @@ private Mono>> purgeDeletedWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginPurgeDeletedAsync(String location, String configStoreName) { Mono>> mono = purgeDeletedWithResponseAsync(location, configStoreName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. @@ -2439,18 +2294,17 @@ private PollerFlux, Void> beginPurgeDeletedAsync(String locatio * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginPurgeDeletedAsync( - String location, String configStoreName, Context context) { + private PollerFlux, Void> beginPurgeDeletedAsync(String location, String configStoreName, + Context context) { context = this.client.mergeContext(context); Mono>> mono = purgeDeletedWithResponseAsync(location, configStoreName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2465,7 +2319,7 @@ public SyncPoller, Void> beginPurgeDeleted(String location, Str /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. @@ -2475,14 +2329,14 @@ public SyncPoller, Void> beginPurgeDeleted(String location, Str * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginPurgeDeleted( - String location, String configStoreName, Context context) { + public SyncPoller, Void> beginPurgeDeleted(String location, String configStoreName, + Context context) { return this.beginPurgeDeletedAsync(location, configStoreName, context).getSyncPoller(); } /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2497,7 +2351,7 @@ private Mono purgeDeletedAsync(String location, String configStoreName) { /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. @@ -2508,14 +2362,13 @@ private Mono purgeDeletedAsync(String location, String configStoreName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono purgeDeletedAsync(String location, String configStoreName, Context context) { - return beginPurgeDeletedAsync(location, configStoreName, context) - .last() + return beginPurgeDeletedAsync(location, configStoreName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2529,7 +2382,7 @@ public void purgeDeleted(String location, String configStoreName) { /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. @@ -2544,14 +2397,13 @@ public void purgeDeleted(String location, String configStoreName, Context contex /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list configuration stores along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2559,37 +2411,26 @@ private Mono> listNextSinglePageAsync(Str return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @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 list configuration stores along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -2597,36 +2438,25 @@ private Mono> listNextSinglePageAsync(Str return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list configuration stores along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -2634,76 +2464,55 @@ private Mono> listByResourceGroupNextSing return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @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 list configuration stores along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list API keys along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysNextSinglePageAsync(String nextLink) { @@ -2711,37 +2520,27 @@ private Mono> listKeysNextSinglePageAsync(String next return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listKeysNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @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 list API keys along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysNextSinglePageAsync(String nextLink, Context context) { @@ -2749,36 +2548,25 @@ private Mono> listKeysNextSinglePageAsync(String next return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listKeysNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listKeysNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deleted configuration stores along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of deleted configuration stores along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeletedNextSinglePageAsync(String nextLink) { @@ -2786,62 +2574,42 @@ private Mono> listDeletedNextSingl return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDeletedNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deleted configuration stores along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of deleted configuration stores along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeletedNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listDeletedNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listDeletedNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listDeletedNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/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 ce41fa377799b..12bdb9462cd69 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.ResetSasTokensParameters; +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); @@ -26,8 +30,7 @@ public final class ConfigurationStoresImpl implements ConfigurationStores { private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - public ConfigurationStoresImpl( - ConfigurationStoresClient innerClient, + public ConfigurationStoresImpl(ConfigurationStoresClient innerClient, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -35,35 +38,32 @@ public ConfigurationStoresImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ConfigurationStoreImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationStoreImpl(inner1, this.manager())); } public PagedIterable list(String skipToken, Context context) { PagedIterable inner = this.serviceClient().list(skipToken, context); - return Utils.mapPage(inner, inner1 -> new ConfigurationStoreImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationStoreImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ConfigurationStoreImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationStoreImpl(inner1, this.manager())); } - public PagedIterable listByResourceGroup( - String resourceGroupName, String skipToken, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, skipToken, context); - return Utils.mapPage(inner, inner1 -> new ConfigurationStoreImpl(inner1, this.manager())); + public PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConfigurationStoreImpl(inner1, this.manager())); } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String configStoreName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, configStoreName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String configStoreName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, configStoreName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ConfigurationStoreImpl(inner.getValue(), this.manager())); } else { return null; @@ -89,40 +89,32 @@ public void delete(String resourceGroupName, String configStoreName, Context con public PagedIterable listKeys(String resourceGroupName, String configStoreName) { PagedIterable inner = this.serviceClient().listKeys(resourceGroupName, configStoreName); - return Utils.mapPage(inner, inner1 -> new ApiKeyImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiKeyImpl(inner1, this.manager())); } - public PagedIterable listKeys( - String resourceGroupName, String configStoreName, String skipToken, Context context) { - PagedIterable inner = - this.serviceClient().listKeys(resourceGroupName, configStoreName, skipToken, context); - return Utils.mapPage(inner, inner1 -> new ApiKeyImpl(inner1, this.manager())); + public PagedIterable listKeys(String resourceGroupName, String configStoreName, String skipToken, + Context context) { + PagedIterable inner + = this.serviceClient().listKeys(resourceGroupName, configStoreName, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiKeyImpl(inner1, this.manager())); } - public Response regenerateKeyWithResponse( - String resourceGroupName, - String configStoreName, - RegenerateKeyParameters regenerateKeyParameters, - Context context) { - Response inner = - this - .serviceClient() - .regenerateKeyWithResponse(resourceGroupName, configStoreName, regenerateKeyParameters, context); + public Response regenerateKeyWithResponse(String resourceGroupName, String configStoreName, + RegenerateKeyParameters regenerateKeyParameters, Context context) { + Response inner = this.serviceClient() + .regenerateKeyWithResponse(resourceGroupName, configStoreName, regenerateKeyParameters, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ApiKeyImpl(inner.getValue(), this.manager())); } else { return null; } } - public ApiKey regenerateKey( - String resourceGroupName, String configStoreName, RegenerateKeyParameters regenerateKeyParameters) { - ApiKeyInner inner = - this.serviceClient().regenerateKey(resourceGroupName, configStoreName, regenerateKeyParameters); + public ApiKey regenerateKey(String resourceGroupName, String configStoreName, + RegenerateKeyParameters regenerateKeyParameters) { + ApiKeyInner inner + = this.serviceClient().regenerateKey(resourceGroupName, configStoreName, regenerateKeyParameters); if (inner != null) { return new ApiKeyImpl(inner, this.manager()); } else { @@ -130,25 +122,56 @@ public ApiKey regenerateKey( } } + 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 resetSasTokensWithResponse(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters, Context context) { + return this.serviceClient() + .resetSasTokensWithResponse(resourceGroupName, configStoreName, resetSasTokensParameters, context); + } + + public void resetSasTokens(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters) { + this.serviceClient().resetSasTokens(resourceGroupName, configStoreName, resetSasTokensParameters); + } + public PagedIterable listDeleted() { PagedIterable inner = this.serviceClient().listDeleted(); - return Utils.mapPage(inner, inner1 -> new DeletedConfigurationStoreImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedConfigurationStoreImpl(inner1, this.manager())); } public PagedIterable listDeleted(Context context) { PagedIterable inner = this.serviceClient().listDeleted(context); - return Utils.mapPage(inner, inner1 -> new DeletedConfigurationStoreImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeletedConfigurationStoreImpl(inner1, this.manager())); } - public Response getDeletedWithResponse( - String location, String configStoreName, Context context) { - Response inner = - this.serviceClient().getDeletedWithResponse(location, configStoreName, context); + public Response getDeletedWithResponse(String location, String configStoreName, + Context context) { + Response inner + = this.serviceClient().getDeletedWithResponse(location, configStoreName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DeletedConfigurationStoreImpl(inner.getValue(), this.manager())); } else { return null; @@ -173,85 +196,57 @@ public void purgeDeleted(String location, String configStoreName, Context contex } public ConfigurationStore getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, configStoreName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, configStoreName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } this.delete(resourceGroupName, configStoreName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } this.delete(resourceGroupName, configStoreName, context); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/DeletedConfigurationStoreImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/DeletedConfigurationStoreImpl.java index 30d65aa6049d0..b5224d7bcbbd6 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/DeletedConfigurationStoreImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/DeletedConfigurationStoreImpl.java @@ -15,8 +15,7 @@ public final class DeletedConfigurationStoreImpl implements DeletedConfiguration private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - DeletedConfigurationStoreImpl( - DeletedConfigurationStoreInner innerObject, + DeletedConfigurationStoreImpl(DeletedConfigurationStoreInner innerObject, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValueImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValueImpl.java index 36fb5ba2391c1..6176ba68daa95 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValueImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValueImpl.java @@ -90,24 +90,19 @@ public KeyValueImpl withExistingConfigurationStore(String resourceGroupName, Str } public KeyValue create() { - this.innerObject = - serviceManager - .serviceClient() - .getKeyValues() - .createOrUpdateWithResponse( - resourceGroupName, configStoreName, keyValueName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getKeyValues() + .createOrUpdateWithResponse(resourceGroupName, configStoreName, keyValueName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public KeyValue create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getKeyValues() - .createOrUpdateWithResponse( - resourceGroupName, configStoreName, keyValueName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getKeyValues() + .createOrUpdateWithResponse(resourceGroupName, configStoreName, keyValueName, this.innerModel(), context) + .getValue(); return this; } @@ -122,53 +117,44 @@ public KeyValueImpl update() { } public KeyValue apply() { - this.innerObject = - serviceManager - .serviceClient() - .getKeyValues() - .createOrUpdateWithResponse( - resourceGroupName, configStoreName, keyValueName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getKeyValues() + .createOrUpdateWithResponse(resourceGroupName, configStoreName, keyValueName, this.innerModel(), + Context.NONE) + .getValue(); return this; } public KeyValue apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getKeyValues() - .createOrUpdateWithResponse( - resourceGroupName, configStoreName, keyValueName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getKeyValues() + .createOrUpdateWithResponse(resourceGroupName, configStoreName, keyValueName, this.innerModel(), context) + .getValue(); return this; } - KeyValueImpl( - KeyValueInner innerObject, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { + KeyValueImpl(KeyValueInner innerObject, + com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.configStoreName = Utils.getValueFromIdByName(innerObject.id(), "configurationStores"); - this.keyValueName = Utils.getValueFromIdByName(innerObject.id(), "keyValues"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.configStoreName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "configurationStores"); + this.keyValueName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "keyValues"); } public KeyValue refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getKeyValues() - .getWithResponse(resourceGroupName, configStoreName, keyValueName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getKeyValues() + .getWithResponse(resourceGroupName, configStoreName, keyValueName, Context.NONE) + .getValue(); return this; } public KeyValue refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getKeyValues() - .getWithResponse(resourceGroupName, configStoreName, keyValueName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getKeyValues() + .getWithResponse(resourceGroupName, configStoreName, keyValueName, context) + .getValue(); return this; } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesClientImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesClientImpl.java index 3e8afe89d6708..2cba097a990d6 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesClientImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesClientImpl.java @@ -33,22 +33,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in KeyValuesClient. */ +/** + * An instance of this class provides access to all the operations defined in KeyValuesClient. + */ public final class KeyValuesClientImpl implements KeyValuesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final KeyValuesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AppConfigurationManagementClientImpl client; /** * Initializes an instance of KeyValuesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ KeyValuesClientImpl(AppConfigurationManagementClientImpl client) { - this.service = - RestProxy.create(KeyValuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(KeyValuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -59,80 +65,64 @@ public final class KeyValuesClientImpl implements KeyValuesClient { @Host("{$host}") @ServiceInterface(name = "AppConfigurationMana") public interface KeyValuesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @PathParam("keyValueName") String keyValueName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @PathParam("keyValueName") String keyValueName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, @PathParam("keyValueName") String keyValueName, - @BodyParam("application/json") KeyValueInner keyValueParameters, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") KeyValueInner keyValueParameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @PathParam("keyValueName") String keyValueName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @PathParam("keyValueName") String keyValueName, @HeaderParam("Accept") String accept, Context context); } /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified key-value along with {@link Response} on successful completion of {@link - * Mono}. + * @return the properties of the specified key-value along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String configStoreName, String keyValueName) { + private Mono> getWithResponseAsync(String resourceGroupName, String configStoreName, + String keyValueName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -147,49 +137,37 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - keyValueName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), keyValueName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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 properties of the specified key-value along with {@link Response} on successful completion of {@link - * Mono}. + * @return the properties of the specified key-value along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String configStoreName, String keyValueName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String configStoreName, + String keyValueName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -204,25 +182,19 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - keyValueName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), keyValueName, accept, context); } /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -235,12 +207,14 @@ private Mono getAsync(String resourceGroupName, String configStor } /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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. @@ -248,18 +222,20 @@ private Mono getAsync(String resourceGroupName, String configStor * @return the properties of the specified key-value along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String configStoreName, String keyValueName, Context context) { + public Response getWithResponse(String resourceGroupName, String configStoreName, + String keyValueName, Context context) { return getWithResponseAsync(resourceGroupName, configStoreName, keyValueName, context).block(); } /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -271,33 +247,30 @@ public KeyValueInner get(String resourceGroupName, String configStoreName, Strin } /** - * Creates a key-value. - * + * Creates a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @param keyValueParameters The parameters for creating a key-value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the key-value resource along with all resource properties along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String configStoreName, String keyValueName, KeyValueInner keyValueParameters) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String configStoreName, String keyValueName, KeyValueInner keyValueParameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -315,55 +288,38 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - keyValueName, - keyValueParameters, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), keyValueName, keyValueParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a key-value. - * + * Creates a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @param keyValueParameters The parameters for creating a key-value. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the key-value resource along with all resource properties along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String configStoreName, - String keyValueName, - KeyValueInner keyValueParameters, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String configStoreName, String keyValueName, KeyValueInner keyValueParameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -381,46 +337,39 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - keyValueName, - keyValueParameters, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), keyValueName, keyValueParameters, accept, context); } /** - * Creates a key-value. - * + * Creates a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the key-value resource along with all resource properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String configStoreName, String keyValueName) { + private Mono createOrUpdateAsync(String resourceGroupName, String configStoreName, + String keyValueName) { final KeyValueInner keyValueParameters = null; return createOrUpdateWithResponseAsync(resourceGroupName, configStoreName, keyValueName, keyValueParameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates a key-value. - * + * Creates a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @param keyValueParameters The parameters for creating a key-value. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -429,24 +378,20 @@ private Mono createOrUpdateAsync( * @return the key-value resource along with all resource properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String configStoreName, - String keyValueName, - KeyValueInner keyValueParameters, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, configStoreName, keyValueName, keyValueParameters, context) - .block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String configStoreName, + String keyValueName, KeyValueInner keyValueParameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, configStoreName, keyValueName, keyValueParameters, + context).block(); } /** - * Creates a key-value. - * + * Creates a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -455,37 +400,33 @@ public Response createOrUpdateWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public KeyValueInner createOrUpdate(String resourceGroupName, String configStoreName, String keyValueName) { final KeyValueInner keyValueParameters = null; - return createOrUpdateWithResponse( - resourceGroupName, configStoreName, keyValueName, keyValueParameters, Context.NONE) - .getValue(); + return createOrUpdateWithResponse(resourceGroupName, configStoreName, keyValueName, keyValueParameters, + Context.NONE).getValue(); } /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String configStoreName, String keyValueName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String configStoreName, + String keyValueName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -500,28 +441,19 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - keyValueName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), keyValueName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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. @@ -529,19 +461,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String configStoreName, String keyValueName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String configStoreName, + String keyValueName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -556,48 +484,40 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - keyValueName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), keyValueName, accept, context); } /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String configStoreName, String keyValueName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, configStoreName, keyValueName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String configStoreName, + String keyValueName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, configStoreName, keyValueName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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. @@ -605,41 +525,42 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String configStoreName, String keyValueName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String configStoreName, + String keyValueName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, configStoreName, keyValueName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, configStoreName, keyValueName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String keyValueName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String keyValueName) { return this.beginDeleteAsync(resourceGroupName, configStoreName, keyValueName).getSyncPoller(); } /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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. @@ -647,18 +568,19 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String keyValueName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String keyValueName, Context context) { return this.beginDeleteAsync(resourceGroupName, configStoreName, keyValueName, context).getSyncPoller(); } /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -666,18 +588,18 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String configStoreName, String keyValueName) { - return beginDeleteAsync(resourceGroupName, configStoreName, keyValueName) - .last() + return beginDeleteAsync(resourceGroupName, configStoreName, keyValueName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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. @@ -685,20 +607,20 @@ private Mono deleteAsync(String resourceGroupName, String configStoreName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String configStoreName, String keyValueName, Context context) { - return beginDeleteAsync(resourceGroupName, configStoreName, keyValueName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String configStoreName, String keyValueName, + Context context) { + return beginDeleteAsync(resourceGroupName, configStoreName, keyValueName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -709,12 +631,13 @@ public void delete(String resourceGroupName, String configStoreName, String keyV } /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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. diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesImpl.java index bd01280881e95..91eba150cff60 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/KeyValuesImpl.java @@ -20,22 +20,18 @@ public final class KeyValuesImpl implements KeyValues { private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - public KeyValuesImpl( - KeyValuesClient innerClient, + public KeyValuesImpl(KeyValuesClient innerClient, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Response getWithResponse( - String resourceGroupName, String configStoreName, String keyValueName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, configStoreName, keyValueName, context); + public Response getWithResponse(String resourceGroupName, String configStoreName, String keyValueName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, configStoreName, keyValueName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new KeyValueImpl(inner.getValue(), this.manager())); } else { return null; @@ -60,113 +56,77 @@ public void delete(String resourceGroupName, String configStoreName, String keyV } public KeyValue getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String keyValueName = Utils.getValueFromIdByName(id, "keyValues"); + String keyValueName = ResourceManagerUtils.getValueFromIdByName(id, "keyValues"); if (keyValueName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'keyValues'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'keyValues'.", id))); } return this.getWithResponse(resourceGroupName, configStoreName, keyValueName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String keyValueName = Utils.getValueFromIdByName(id, "keyValues"); + String keyValueName = ResourceManagerUtils.getValueFromIdByName(id, "keyValues"); if (keyValueName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'keyValues'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'keyValues'.", id))); } return this.getWithResponse(resourceGroupName, configStoreName, keyValueName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String keyValueName = Utils.getValueFromIdByName(id, "keyValues"); + String keyValueName = ResourceManagerUtils.getValueFromIdByName(id, "keyValues"); if (keyValueName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'keyValues'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'keyValues'.", id))); } this.delete(resourceGroupName, configStoreName, keyValueName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String keyValueName = Utils.getValueFromIdByName(id, "keyValues"); + String keyValueName = ResourceManagerUtils.getValueFromIdByName(id, "keyValues"); if (keyValueName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'keyValues'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'keyValues'.", id))); } this.delete(resourceGroupName, configStoreName, keyValueName, context); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/NameAvailabilityStatusImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/NameAvailabilityStatusImpl.java index d4200d9e2b59b..cf6796a47fd36 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/NameAvailabilityStatusImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/NameAvailabilityStatusImpl.java @@ -12,8 +12,7 @@ public final class NameAvailabilityStatusImpl implements NameAvailabilityStatus private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - NameAvailabilityStatusImpl( - NameAvailabilityStatusInner innerObject, + NameAvailabilityStatusImpl(NameAvailabilityStatusInner innerObject, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationDefinitionImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationDefinitionImpl.java index dd15c4b4a84e0..f9fad9355de89 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationDefinitionImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationDefinitionImpl.java @@ -14,8 +14,7 @@ public final class OperationDefinitionImpl implements OperationDefinition { private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - OperationDefinitionImpl( - OperationDefinitionInner innerObject, + OperationDefinitionImpl(OperationDefinitionInner innerObject, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationsClientImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationsClientImpl.java index ca0d80114da2c..018c903303d91 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationsClientImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationsClientImpl.java @@ -34,22 +34,28 @@ import com.azure.resourcemanager.appconfiguration.models.OperationDefinitionListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AppConfigurationManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(AppConfigurationManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -60,168 +66,131 @@ public final class OperationsClientImpl implements OperationsClient { @Host("{$host}") @ServiceInterface(name = "AppConfigurationMana") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, + Mono> checkNameAvailability(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") CheckNameAvailabilityParameters checkNameAvailabilityParameters, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.AppConfiguration/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/checkNameAvailability") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/locations/{location}/checkNameAvailability") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regionalCheckNameAvailability( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, + Mono> regionalCheckNameAvailability(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") CheckNameAvailabilityParameters checkNameAvailabilityParameters, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Checks whether the configuration store name is available for use. - * + * * @param checkNameAvailabilityParameters The object containing information for the availability 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 check the availability of a resource name along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - CheckNameAvailabilityParameters checkNameAvailabilityParameters) { + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityParameters checkNameAvailabilityParameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (checkNameAvailabilityParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter checkNameAvailabilityParameters is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter checkNameAvailabilityParameters is required and cannot be null.")); } else { checkNameAvailabilityParameters.validate(); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - checkNameAvailabilityParameters, - accept, - context)) + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), checkNameAvailabilityParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Checks whether the configuration store name is available for use. - * + * * @param checkNameAvailabilityParameters The object containing information for the availability 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 check the availability of a resource name along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (checkNameAvailabilityParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter checkNameAvailabilityParameters is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter checkNameAvailabilityParameters is required and cannot be null.")); } else { checkNameAvailabilityParameters.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - checkNameAvailabilityParameters, - accept, - context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), checkNameAvailabilityParameters, accept, context); } /** * Checks whether the configuration store name is available for use. - * + * * @param checkNameAvailabilityParameters The object containing information for the availability 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 check the availability of a resource name on successful completion of {@link - * Mono}. + * @return the result of a request to check the availability of a resource name on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync( - CheckNameAvailabilityParameters checkNameAvailabilityParameters) { + private Mono + checkNameAvailabilityAsync(CheckNameAvailabilityParameters checkNameAvailabilityParameters) { return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityParameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Checks whether the configuration store name is available for use. - * + * * @param checkNameAvailabilityParameters The object containing information for the availability request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -237,7 +206,7 @@ public Response checkNameAvailabilityWithResponse( /** * Checks whether the configuration store name is available for use. - * + * * @param checkNameAvailabilityParameters The object containing information for the availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -245,95 +214,74 @@ public Response checkNameAvailabilityWithResponse( * @return the result of a request to check the availability of a resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NameAvailabilityStatusInner checkNameAvailability( - CheckNameAvailabilityParameters checkNameAvailabilityParameters) { + public NameAvailabilityStatusInner + checkNameAvailability(CheckNameAvailabilityParameters checkNameAvailabilityParameters) { return checkNameAvailabilityWithResponse(checkNameAvailabilityParameters, Context.NONE).getValue(); } /** * Lists the operations available from this provider. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list configuration store operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String skipToken) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.list(this.client.getEndpoint(), this.client.getApiVersion(), skipToken, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), skipToken, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the operations available from this provider. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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 list configuration store operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String skipToken, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), skipToken, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the operations available from this provider. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list configuration store operations as paginated response with {@link - * PagedFlux}. + * @return the result of a request to list configuration store operations as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String skipToken) { @@ -342,11 +290,11 @@ private PagedFlux listAsync(String skipToken) { /** * Lists the operations available from this provider. - * + * * @throws ManagementException 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 list configuration store operations as paginated response with {@link - * PagedFlux}. + * @return the result of a request to list configuration store operations as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -356,30 +304,30 @@ private PagedFlux listAsync() { /** * Lists the operations available from this provider. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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 list configuration store operations as paginated response with {@link - * PagedFlux}. + * @return the result of a request to list configuration store operations as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String skipToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists the operations available from this provider. - * + * * @throws ManagementException 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 list configuration store operations as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list configuration store operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -389,16 +337,16 @@ public PagedIterable list() { /** * Lists the operations available from this provider. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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 list configuration store operations as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list configuration store operations as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String skipToken, Context context) { @@ -407,60 +355,46 @@ public PagedIterable list(String skipToken, Context co /** * Checks whether the configuration store name is available for use. - * + * * @param location The location in which uniqueness will be verified. * @param checkNameAvailabilityParameters The object containing information for the availability 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 check the availability of a resource name along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regionalCheckNameAvailabilityWithResponseAsync( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters) { + private Mono> regionalCheckNameAvailabilityWithResponseAsync(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (checkNameAvailabilityParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter checkNameAvailabilityParameters is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter checkNameAvailabilityParameters is required and cannot be null.")); } else { checkNameAvailabilityParameters.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .regionalCheckNameAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - this.client.getApiVersion(), - checkNameAvailabilityParameters, - accept, - context)) + .withContext(context -> service.regionalCheckNameAvailability(this.client.getEndpoint(), + this.client.getSubscriptionId(), location, this.client.getApiVersion(), checkNameAvailabilityParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Checks whether the configuration store name is available for use. - * + * * @param location The location in which uniqueness will be verified. * @param checkNameAvailabilityParameters The object containing information for the availability request. * @param context The context to associate with this operation. @@ -468,68 +402,55 @@ private Mono> regionalCheckNameAvailabilit * @throws ManagementException 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 check the availability of a resource name along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regionalCheckNameAvailabilityWithResponseAsync( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { + private Mono> regionalCheckNameAvailabilityWithResponseAsync(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (checkNameAvailabilityParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter checkNameAvailabilityParameters is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter checkNameAvailabilityParameters is required and cannot be null.")); } else { checkNameAvailabilityParameters.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .regionalCheckNameAvailability( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - location, - this.client.getApiVersion(), - checkNameAvailabilityParameters, - accept, - context); + return service.regionalCheckNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + location, this.client.getApiVersion(), checkNameAvailabilityParameters, accept, context); } /** * Checks whether the configuration store name is available for use. - * + * * @param location The location in which uniqueness will be verified. * @param checkNameAvailabilityParameters The object containing information for the availability 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 check the availability of a resource name on successful completion of {@link - * Mono}. + * @return the result of a request to check the availability of a resource name on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regionalCheckNameAvailabilityAsync( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters) { + private Mono regionalCheckNameAvailabilityAsync(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters) { return regionalCheckNameAvailabilityWithResponseAsync(location, checkNameAvailabilityParameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Checks whether the configuration store name is available for use. - * + * * @param location The location in which uniqueness will be verified. * @param checkNameAvailabilityParameters The object containing information for the availability request. * @param context The context to associate with this operation. @@ -539,15 +460,15 @@ private Mono regionalCheckNameAvailabilityAsync( * @return the result of a request to check the availability of a resource name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response regionalCheckNameAvailabilityWithResponse( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { + public Response regionalCheckNameAvailabilityWithResponse(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { return regionalCheckNameAvailabilityWithResponseAsync(location, checkNameAvailabilityParameters, context) .block(); } /** * Checks whether the configuration store name is available for use. - * + * * @param location The location in which uniqueness will be verified. * @param checkNameAvailabilityParameters The object containing information for the availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -556,22 +477,21 @@ public Response regionalCheckNameAvailabilityWithRe * @return the result of a request to check the availability of a resource name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NameAvailabilityStatusInner regionalCheckNameAvailability( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters) { + public NameAvailabilityStatusInner regionalCheckNameAvailability(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters) { return regionalCheckNameAvailabilityWithResponse(location, checkNameAvailabilityParameters, Context.NONE) .getValue(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list configuration store operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -579,37 +499,26 @@ private Mono> listNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @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 list configuration store operations along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -617,23 +526,13 @@ private Mono> listNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationsImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationsImpl.java index 3515cb0b44d5a..e176f905b9bde 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationsImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/OperationsImpl.java @@ -24,8 +24,7 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -33,21 +32,18 @@ public OperationsImpl( public Response checkNameAvailabilityWithResponse( CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { - Response inner = - this.serviceClient().checkNameAvailabilityWithResponse(checkNameAvailabilityParameters, context); + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(checkNameAvailabilityParameters, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new NameAvailabilityStatusImpl(inner.getValue(), this.manager())); } else { return null; } } - public NameAvailabilityStatus checkNameAvailability( - CheckNameAvailabilityParameters checkNameAvailabilityParameters) { + public NameAvailabilityStatus + checkNameAvailability(CheckNameAvailabilityParameters checkNameAvailabilityParameters) { NameAvailabilityStatusInner inner = this.serviceClient().checkNameAvailability(checkNameAvailabilityParameters); if (inner != null) { return new NameAvailabilityStatusImpl(inner, this.manager()); @@ -58,35 +54,30 @@ public NameAvailabilityStatus checkNameAvailability( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationDefinitionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationDefinitionImpl(inner1, this.manager())); } public PagedIterable list(String skipToken, Context context) { PagedIterable inner = this.serviceClient().list(skipToken, context); - return Utils.mapPage(inner, inner1 -> new OperationDefinitionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationDefinitionImpl(inner1, this.manager())); } - public Response regionalCheckNameAvailabilityWithResponse( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { - Response inner = - this - .serviceClient() - .regionalCheckNameAvailabilityWithResponse(location, checkNameAvailabilityParameters, context); + public Response regionalCheckNameAvailabilityWithResponse(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { + Response inner = this.serviceClient() + .regionalCheckNameAvailabilityWithResponse(location, checkNameAvailabilityParameters, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new NameAvailabilityStatusImpl(inner.getValue(), this.manager())); } else { return null; } } - public NameAvailabilityStatus regionalCheckNameAvailability( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters) { - NameAvailabilityStatusInner inner = - this.serviceClient().regionalCheckNameAvailability(location, checkNameAvailabilityParameters); + public NameAvailabilityStatus regionalCheckNameAvailability(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters) { + NameAvailabilityStatusInner inner + = this.serviceClient().regionalCheckNameAvailability(location, checkNameAvailabilityParameters); if (inner != null) { return new NameAvailabilityStatusImpl(inner, this.manager()); } else { diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionImpl.java index 520de5e74d3e6..81426dfc53125 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionImpl.java @@ -59,35 +59,31 @@ private com.azure.resourcemanager.appconfiguration.AppConfigurationManager manag private String privateEndpointConnectionName; - public PrivateEndpointConnectionImpl withExistingConfigurationStore( - String resourceGroupName, String configStoreName) { + public PrivateEndpointConnectionImpl withExistingConfigurationStore(String resourceGroupName, + String configStoreName) { this.resourceGroupName = resourceGroupName; this.configStoreName = configStoreName; return this; } public PrivateEndpointConnection create() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate( - resourceGroupName, configStoreName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, configStoreName, privateEndpointConnectionName, this.innerModel(), + Context.NONE); return this; } public PrivateEndpointConnection create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate( - resourceGroupName, configStoreName, privateEndpointConnectionName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, configStoreName, privateEndpointConnectionName, this.innerModel(), + context); return this; } - PrivateEndpointConnectionImpl( - String name, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { + PrivateEndpointConnectionImpl(String name, + com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = new PrivateEndpointConnectionInner(); this.serviceManager = serviceManager; this.privateEndpointConnectionName = name; @@ -98,52 +94,44 @@ public PrivateEndpointConnectionImpl update() { } public PrivateEndpointConnection apply() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate( - resourceGroupName, configStoreName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, configStoreName, privateEndpointConnectionName, this.innerModel(), + Context.NONE); return this; } public PrivateEndpointConnection apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate( - resourceGroupName, configStoreName, privateEndpointConnectionName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, configStoreName, privateEndpointConnectionName, this.innerModel(), + context); return this; } - PrivateEndpointConnectionImpl( - PrivateEndpointConnectionInner innerObject, + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.configStoreName = Utils.getValueFromIdByName(innerObject.id(), "configurationStores"); - this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.configStoreName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "configurationStores"); + this.privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); } public PrivateEndpointConnection refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, configStoreName, privateEndpointConnectionName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, configStoreName, privateEndpointConnectionName, Context.NONE) + .getValue(); return this; } public PrivateEndpointConnection refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, configStoreName, privateEndpointConnectionName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, configStoreName, privateEndpointConnectionName, context) + .getValue(); return this; } @@ -152,8 +140,8 @@ public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint private return this; } - public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionImpl + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); return this; } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java index 912e78fa79b1d..194b25087c652 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsClientImpl.java @@ -38,24 +38,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PrivateEndpointConnectionsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AppConfigurationManagementClientImpl client; /** * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ PrivateEndpointConnectionsClientImpl(AppConfigurationManagementClientImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -66,102 +70,80 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi @Host("{$host}") @ServiceInterface(name = "AppConfigurationMana") public interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByConfigurationStore( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnection, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByConfigurationStoreNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Lists all private endpoint connections for a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreSinglePageAsync( - String resourceGroupName, String configStoreName) { + private Mono> + listByConfigurationStoreSinglePageAsync(String resourceGroupName, String configStoreName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -174,31 +156,16 @@ private Mono> listByConfigurationS final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listByConfigurationStore( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByConfigurationStore(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all private endpoint connections for a 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 context The context to associate with this operation. @@ -206,22 +173,18 @@ private Mono> listByConfigurationS * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreSinglePageAsync( - String resourceGroupName, String configStoreName, Context context) { + private Mono> + listByConfigurationStoreSinglePageAsync(String resourceGroupName, String configStoreName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -234,28 +197,15 @@ private Mono> listByConfigurationS final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByConfigurationStore( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByConfigurationStore(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all private endpoint connections for a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -264,16 +214,15 @@ private Mono> listByConfigurationS * @return a list of private endpoint connections as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByConfigurationStoreAsync( - String resourceGroupName, String configStoreName) { - return new PagedFlux<>( - () -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName), + private PagedFlux listByConfigurationStoreAsync(String resourceGroupName, + String configStoreName) { + return new PagedFlux<>(() -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName), nextLink -> listByConfigurationStoreNextSinglePageAsync(nextLink)); } /** * Lists all private endpoint connections for a 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 context The context to associate with this operation. @@ -283,8 +232,8 @@ private PagedFlux listByConfigurationStoreAsync( * @return a list of private endpoint connections as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByConfigurationStoreAsync( - String resourceGroupName, String configStoreName, Context context) { + private PagedFlux listByConfigurationStoreAsync(String resourceGroupName, + String configStoreName, Context context) { return new PagedFlux<>( () -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName, context), nextLink -> listByConfigurationStoreNextSinglePageAsync(nextLink, context)); @@ -292,7 +241,7 @@ private PagedFlux listByConfigurationStoreAsync( /** * Lists all private endpoint connections for a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -301,14 +250,14 @@ private PagedFlux listByConfigurationStoreAsync( * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName) { + public PagedIterable listByConfigurationStore(String resourceGroupName, + String configStoreName) { return new PagedIterable<>(listByConfigurationStoreAsync(resourceGroupName, configStoreName)); } /** * Lists all private endpoint connections for a 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 context The context to associate with this operation. @@ -318,37 +267,33 @@ public PagedIterable listByConfigurationStore( * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, Context context) { + public PagedIterable listByConfigurationStore(String resourceGroupName, + String configStoreName, Context context) { return new PagedIterable<>(listByConfigurationStoreAsync(resourceGroupName, configStoreName, context)); } /** * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName Private endpoint connection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the configuration store along with {@link - * Response} on successful completion of {@link Mono}. + * @return the specified private endpoint connection associated with the configuration store along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + private Mono> getWithResponseAsync(String resourceGroupName, + String configStoreName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -359,31 +304,20 @@ private Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - privateEndpointConnectionName, - accept, - context)) + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), privateEndpointConnectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName Private endpoint connection name. @@ -391,23 +325,19 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the configuration store along with {@link - * Response} on successful completion of {@link Mono}. + * @return the specified private endpoint connection associated with the configuration store along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String configStoreName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -418,28 +348,18 @@ private Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - privateEndpointConnectionName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), privateEndpointConnectionName, accept, context); } /** * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName Private endpoint connection name. @@ -447,18 +367,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the configuration store on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + private Mono getAsync(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName) { return getWithResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName Private endpoint connection name. @@ -466,18 +386,18 @@ private Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the configuration store along with {@link - * Response}. + * @return the specified private endpoint connection associated with the configuration store along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context) { + public Response getWithResponse(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, Context context) { return getWithResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, context).block(); } /** * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName Private endpoint connection name. @@ -487,8 +407,8 @@ public Response getWithResponse( * @return the specified private endpoint connection associated with the configuration store. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + public PrivateEndpointConnectionInner get(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName) { return getWithResponse(resourceGroupName, configStoreName, privateEndpointConnectionName, Context.NONE) .getValue(); } @@ -497,7 +417,7 @@ public PrivateEndpointConnectionInner get( * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -508,22 +428,16 @@ public PrivateEndpointConnectionInner get( * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -534,34 +448,20 @@ private Mono>> createOrUpdateWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (privateEndpointConnection == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnection is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null.")); } else { privateEndpointConnection.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - privateEndpointConnectionName, - privateEndpointConnection, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), privateEndpointConnectionName, + privateEndpointConnection, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -569,7 +469,7 @@ private Mono>> createOrUpdateWithResponseAsync( * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -581,23 +481,16 @@ private Mono>> createOrUpdateWithResponseAsync( * @return a private endpoint connection along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, - Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String configStoreName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -608,39 +501,27 @@ private Mono>> createOrUpdateWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (privateEndpointConnection == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnection is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null.")); } else { privateEndpointConnection.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - privateEndpointConnectionName, - privateEndpointConnection, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), privateEndpointConnectionName, privateEndpointConnection, + accept, context); } /** * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -652,29 +533,20 @@ private Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, + beginCreateOrUpdateAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - this.client.getContext()); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, configStoreName, + privateEndpointConnectionName, privateEndpointConnection); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + this.client.getContext()); } /** * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -687,31 +559,21 @@ private Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> - beginCreateOrUpdateAsync( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, - Context context) { + beginCreateOrUpdateAsync(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, configStoreName, + privateEndpointConnectionName, privateEndpointConnection, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + context); } /** * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -723,13 +585,11 @@ private Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, + String resourceGroupName, String configStoreName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { return this - .beginCreateOrUpdateAsync( - resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection) + .beginCreateOrUpdateAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, + privateEndpointConnection) .getSyncPoller(); } @@ -737,7 +597,7 @@ public SyncPoller, PrivateEndpointCon * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -750,14 +610,11 @@ public SyncPoller, PrivateEndpointCon */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, - Context context) { + String resourceGroupName, String configStoreName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, Context context) { return this - .beginCreateOrUpdateAsync( - resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection, context) + .beginCreateOrUpdateAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, + privateEndpointConnection, context) .getSyncPoller(); } @@ -765,7 +622,7 @@ public SyncPoller, PrivateEndpointCon * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -776,22 +633,17 @@ public SyncPoller, PrivateEndpointCon * @return a private endpoint connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection) { - return beginCreateOrUpdateAsync( - resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createOrUpdateAsync(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateOrUpdateAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, + privateEndpointConnection).last().flatMap(this.client::getLroFinalResultOrError); } /** * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -803,23 +655,18 @@ private Mono createOrUpdateAsync( * @return a private endpoint connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, + private Mono createOrUpdateAsync(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + return beginCreateOrUpdateAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, + privateEndpointConnection, context).last().flatMap(this.client::getLroFinalResultOrError); } /** * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -830,21 +677,17 @@ private Mono createOrUpdateAsync( * @return a private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection) { - return createOrUpdateAsync( - resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection) - .block(); + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return createOrUpdateAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, + privateEndpointConnection).block(); } /** * Update the state of the specified private endpoint connection associated with the configuration store. This * operation cannot be used to create a private endpoint connection. Private endpoint connections must be created * with the Network resource provider. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -856,20 +699,16 @@ public PrivateEndpointConnectionInner createOrUpdate( * @return a private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate( - String resourceGroupName, - String configStoreName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, Context context) { - return createOrUpdateAsync( - resourceGroupName, configStoreName, privateEndpointConnectionName, privateEndpointConnection, context) - .block(); + return createOrUpdateAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, + privateEndpointConnection, context).block(); } /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -879,19 +718,15 @@ public PrivateEndpointConnectionInner createOrUpdate( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -902,31 +737,20 @@ private Mono>> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - privateEndpointConnectionName, - accept, - context)) + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), privateEndpointConnectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -937,19 +761,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -960,28 +780,18 @@ private Mono>> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - privateEndpointConnectionName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), privateEndpointConnectionName, accept, context); } /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -991,19 +801,17 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -1014,19 +822,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -1036,14 +843,14 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName) { return this.beginDeleteAsync(resourceGroupName, configStoreName, privateEndpointConnectionName).getSyncPoller(); } /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -1054,16 +861,15 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context) { - return this - .beginDeleteAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, context) + public SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, Context context) { + return this.beginDeleteAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, context) .getSyncPoller(); } /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -1073,16 +879,15 @@ public SyncPoller, Void> beginDelete( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, configStoreName, privateEndpointConnectionName) - .last() + private Mono deleteAsync(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, configStoreName, privateEndpointConnectionName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -1093,16 +898,15 @@ private Mono deleteAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -1117,7 +921,7 @@ public void delete(String resourceGroupName, String configStoreName, String priv /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -1127,86 +931,65 @@ public void delete(String resourceGroupName, String configStoreName, String priv * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context) { + public void delete(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, + Context context) { deleteAsync(resourceGroupName, configStoreName, privateEndpointConnectionName, context).block(); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreNextSinglePageAsync( - String nextLink) { + private Mono> + listByConfigurationStoreNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreNextSinglePageAsync( - String nextLink, Context context) { + private Mono> + listByConfigurationStoreNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsImpl.java index 7b752de63afcb..46d613eb65e7f 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateEndpointConnectionsImpl.java @@ -21,48 +21,42 @@ public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConn private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - public PrivateEndpointConnectionsImpl( - PrivateEndpointConnectionsClient innerClient, + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName) { - PagedIterable inner = - this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + public PagedIterable listByConfigurationStore(String resourceGroupName, + String configStoreName) { + PagedIterable inner + = this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, Context context) { - PagedIterable inner = - this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName, context); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + public PagedIterable listByConfigurationStore(String resourceGroupName, + String configStoreName, Context context) { + PagedIterable inner + = this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, configStoreName, privateEndpointConnectionName, context); + public Response getWithResponse(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, configStoreName, privateEndpointConnectionName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); } else { return null; } } - public PrivateEndpointConnection get( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner = - this.serviceClient().get(resourceGroupName, configStoreName, privateEndpointConnectionName); + public PrivateEndpointConnection get(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, configStoreName, privateEndpointConnectionName); if (inner != null) { return new PrivateEndpointConnectionImpl(inner, this.manager()); } else { @@ -74,133 +68,88 @@ public void delete(String resourceGroupName, String configStoreName, String priv this.serviceClient().delete(resourceGroupName, configStoreName, privateEndpointConnectionName); } - public void delete( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context) { + public void delete(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, + Context context) { this.serviceClient().delete(resourceGroupName, configStoreName, privateEndpointConnectionName, context); } public PrivateEndpointConnection getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } - return this - .getWithResponse(resourceGroupName, configStoreName, privateEndpointConnectionName, Context.NONE) + return this.getWithResponse(resourceGroupName, configStoreName, privateEndpointConnectionName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } return this.getWithResponse(resourceGroupName, configStoreName, privateEndpointConnectionName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } this.delete(resourceGroupName, configStoreName, privateEndpointConnectionName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + String privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); if (privateEndpointConnectionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", - id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } this.delete(resourceGroupName, configStoreName, privateEndpointConnectionName, context); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourceImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourceImpl.java index f26ebfdf13de6..73013770086fb 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourceImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourceImpl.java @@ -14,8 +14,7 @@ public final class PrivateLinkResourceImpl implements PrivateLinkResource { private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - PrivateLinkResourceImpl( - PrivateLinkResourceInner innerObject, + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourcesClientImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourcesClientImpl.java index da69c79ef119e..beace945f5205 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourcesClientImpl.java @@ -30,23 +30,28 @@ import com.azure.resourcemanager.appconfiguration.models.PrivateLinkResourceListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PrivateLinkResourcesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AppConfigurationManagementClientImpl client; /** * Initializes an instance of PrivateLinkResourcesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ PrivateLinkResourcesClientImpl(AppConfigurationManagementClientImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -57,71 +62,56 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource @Host("{$host}") @ServiceInterface(name = "AppConfigurationMana") public interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByConfigurationStore( - @HostParam("$host") String endpoint, + Mono> listByConfigurationStore(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/privateLinkResources/{groupName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @PathParam("groupName") String groupName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByConfigurationStoreNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets the private link resources that need to be created for a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a configuration store along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return the private link resources that need to be created for a configuration store along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreSinglePageAsync( - String resourceGroupName, String configStoreName) { + private Mono> + listByConfigurationStoreSinglePageAsync(String resourceGroupName, String configStoreName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -134,54 +124,35 @@ private Mono> listByConfigurationStoreSi final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listByConfigurationStore( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByConfigurationStore(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the private link resources that need to be created for a 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a configuration store along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return the private link resources that need to be created for a configuration store along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreSinglePageAsync( - String resourceGroupName, String configStoreName, Context context) { + private Mono> + listByConfigurationStoreSinglePageAsync(String resourceGroupName, String configStoreName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -194,47 +165,33 @@ private Mono> listByConfigurationStoreSi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByConfigurationStore( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByConfigurationStore(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets the private link resources that need to be created for a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a configuration store as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByConfigurationStoreAsync( - String resourceGroupName, String configStoreName) { - return new PagedFlux<>( - () -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName), + private PagedFlux listByConfigurationStoreAsync(String resourceGroupName, + String configStoreName) { + return new PagedFlux<>(() -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName), nextLink -> listByConfigurationStoreNextSinglePageAsync(nextLink)); } /** * Gets the private link resources that need to be created for a 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 context The context to associate with this operation. @@ -242,11 +199,11 @@ private PagedFlux listByConfigurationStoreAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a configuration store as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByConfigurationStoreAsync( - String resourceGroupName, String configStoreName, Context context) { + private PagedFlux listByConfigurationStoreAsync(String resourceGroupName, + String configStoreName, Context context) { return new PagedFlux<>( () -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName, context), nextLink -> listByConfigurationStoreNextSinglePageAsync(nextLink, context)); @@ -254,24 +211,24 @@ private PagedFlux listByConfigurationStoreAsync( /** * Gets the private link resources that need to be created for a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a configuration store as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName) { + public PagedIterable listByConfigurationStore(String resourceGroupName, + String configStoreName) { return new PagedIterable<>(listByConfigurationStoreAsync(resourceGroupName, configStoreName)); } /** * Gets the private link resources that need to be created for a 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 context The context to associate with this operation. @@ -279,17 +236,17 @@ public PagedIterable listByConfigurationStore( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a configuration store as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, Context context) { + public PagedIterable listByConfigurationStore(String resourceGroupName, + String configStoreName, Context context) { return new PagedIterable<>(listByConfigurationStoreAsync(resourceGroupName, configStoreName, context)); } /** * Gets a private link resource that need to be created for a 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 groupName The name of the private link resource group. @@ -297,22 +254,18 @@ public PagedIterable listByConfigurationStore( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private link resource that need to be created for a configuration store along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String configStoreName, String groupName) { + private Mono> getWithResponseAsync(String resourceGroupName, + String configStoreName, String groupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -327,24 +280,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - groupName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), groupName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a private link resource that need to be created for a 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 groupName The name of the private link resource group. @@ -353,22 +296,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private link resource that need to be created for a configuration store along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String configStoreName, String groupName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String configStoreName, String groupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -383,21 +322,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - groupName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), groupName, accept, context); } /** * Gets a private link resource that need to be created for a 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 groupName The name of the private link resource group. @@ -405,18 +336,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private link resource that need to be created for a configuration store on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String configStoreName, String groupName) { + private Mono getAsync(String resourceGroupName, String configStoreName, + String groupName) { return getWithResponseAsync(resourceGroupName, configStoreName, groupName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets a private link resource that need to be created for a 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 groupName The name of the private link resource group. @@ -427,14 +358,14 @@ private Mono getAsync( * @return a private link resource that need to be created for a configuration store along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String configStoreName, String groupName, Context context) { + public Response getWithResponse(String resourceGroupName, String configStoreName, + String groupName, Context context) { return getWithResponseAsync(resourceGroupName, configStoreName, groupName, context).block(); } /** * Gets a private link resource that need to be created for a 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 groupName The name of the private link resource group. @@ -450,14 +381,13 @@ public PrivateLinkResourceInner get(String resourceGroupName, String configStore /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByConfigurationStoreNextSinglePageAsync(String nextLink) { @@ -465,63 +395,43 @@ private Mono> listByConfigurationStoreNe return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private link resources along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByConfigurationStoreNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourcesImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourcesImpl.java index df0cb29750eea..dd73be05fcede 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/PrivateLinkResourcesImpl.java @@ -21,36 +21,32 @@ public final class PrivateLinkResourcesImpl implements PrivateLinkResources { private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - public PrivateLinkResourcesImpl( - PrivateLinkResourcesClient innerClient, + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName) { - PagedIterable inner = - this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName); - return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + public PagedIterable listByConfigurationStore(String resourceGroupName, + String configStoreName) { + PagedIterable inner + = this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, Context context) { - PagedIterable inner = - this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName, context); - return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + public PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName, + Context context) { + PagedIterable inner + = this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String configStoreName, String groupName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, configStoreName, groupName, context); + public Response getWithResponse(String resourceGroupName, String configStoreName, + String groupName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, configStoreName, groupName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PrivateLinkResourceImpl(inner.getValue(), this.manager())); } else { return null; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicaImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicaImpl.java index 1ec48e550c2b9..f5b95c64fa628 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicaImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicaImpl.java @@ -16,8 +16,8 @@ public final class ReplicaImpl implements Replica, Replica.Definition { private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - ReplicaImpl( - ReplicaInner innerObject, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { + ReplicaImpl(ReplicaInner innerObject, + com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -79,20 +79,16 @@ public ReplicaImpl withExistingConfigurationStore(String resourceGroupName, Stri } public Replica create() { - this.innerObject = - serviceManager - .serviceClient() - .getReplicas() - .create(resourceGroupName, configStoreName, replicaName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getReplicas() + .create(resourceGroupName, configStoreName, replicaName, this.innerModel(), Context.NONE); return this; } public Replica create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getReplicas() - .create(resourceGroupName, configStoreName, replicaName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getReplicas() + .create(resourceGroupName, configStoreName, replicaName, this.innerModel(), context); return this; } @@ -103,22 +99,18 @@ public Replica create(Context context) { } public Replica refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getReplicas() - .getWithResponse(resourceGroupName, configStoreName, replicaName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getReplicas() + .getWithResponse(resourceGroupName, configStoreName, replicaName, Context.NONE) + .getValue(); return this; } public Replica refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getReplicas() - .getWithResponse(resourceGroupName, configStoreName, replicaName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getReplicas() + .getWithResponse(resourceGroupName, configStoreName, replicaName, context) + .getValue(); return this; } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicasClientImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicasClientImpl.java index 067d4ab0bd8b9..42bc3ccc00bd6 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicasClientImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicasClientImpl.java @@ -38,17 +38,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ReplicasClient. */ +/** + * An instance of this class provides access to all the operations defined in ReplicasClient. + */ public final class ReplicasClientImpl implements ReplicasClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ReplicasService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final AppConfigurationManagementClientImpl client; /** * Initializes an instance of ReplicasClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ReplicasClientImpl(AppConfigurationManagementClientImpl client) { @@ -63,106 +69,81 @@ public final class ReplicasClientImpl implements ReplicasClient { @Host("{$host}") @ServiceInterface(name = "AppConfigurationMana") public interface ReplicasService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByConfigurationStore( - @HostParam("$host") String endpoint, + Mono> listByConfigurationStore(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas/{replicaName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas/{replicaName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @PathParam("replicaName") String replicaName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @PathParam("replicaName") String replicaName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas/{replicaName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas/{replicaName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create( - @HostParam("$host") String endpoint, + Mono>> create(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, @PathParam("replicaName") String replicaName, - @BodyParam("application/json") ReplicaInner replicaCreationParameters, - @HeaderParam("Accept") String accept, + @BodyParam("application/json") ReplicaInner replicaCreationParameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas/{replicaName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/replicas/{replicaName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("configStoreName") String configStoreName, - @QueryParam("api-version") String apiVersion, - @PathParam("replicaName") String replicaName, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("configStoreName") String configStoreName, @QueryParam("api-version") String apiVersion, + @PathParam("replicaName") String replicaName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByConfigurationStoreNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Lists the replicas for a given 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list replicas along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreSinglePageAsync( - String resourceGroupName, String configStoreName, String skipToken) { + private Mono> listByConfigurationStoreSinglePageAsync(String resourceGroupName, + String configStoreName, String skipToken) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -175,58 +156,38 @@ private Mono> listByConfigurationStoreSinglePageAsyn final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .listByConfigurationStore( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - skipToken, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.listByConfigurationStore(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), skipToken, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the replicas for a given 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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 list replicas along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreSinglePageAsync( - String resourceGroupName, String configStoreName, String skipToken, Context context) { + private Mono> listByConfigurationStoreSinglePageAsync(String resourceGroupName, + String configStoreName, String skipToken, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -239,42 +200,28 @@ private Mono> listByConfigurationStoreSinglePageAsyn final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByConfigurationStore( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - skipToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByConfigurationStore(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the replicas for a given 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list replicas as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByConfigurationStoreAsync( - String resourceGroupName, String configStoreName, String skipToken) { + private PagedFlux listByConfigurationStoreAsync(String resourceGroupName, String configStoreName, + String skipToken) { return new PagedFlux<>( () -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName, skipToken), nextLink -> listByConfigurationStoreNextSinglePageAsync(nextLink)); @@ -282,7 +229,7 @@ private PagedFlux listByConfigurationStoreAsync( /** * Lists the replicas for a given configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -300,12 +247,12 @@ private PagedFlux listByConfigurationStoreAsync(String resourceGro /** * Lists the replicas for a given 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -313,8 +260,8 @@ private PagedFlux listByConfigurationStoreAsync(String resourceGro * @return the result of a request to list replicas as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByConfigurationStoreAsync( - String resourceGroupName, String configStoreName, String skipToken, Context context) { + private PagedFlux listByConfigurationStoreAsync(String resourceGroupName, String configStoreName, + String skipToken, Context context) { return new PagedFlux<>( () -> listByConfigurationStoreSinglePageAsync(resourceGroupName, configStoreName, skipToken, context), nextLink -> listByConfigurationStoreNextSinglePageAsync(nextLink, context)); @@ -322,7 +269,7 @@ private PagedFlux listByConfigurationStoreAsync( /** * Lists the replicas for a given configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -338,12 +285,12 @@ public PagedIterable listByConfigurationStore(String resourceGroup /** * Lists the replicas for a given 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -351,38 +298,34 @@ public PagedIterable listByConfigurationStore(String resourceGroup * @return the result of a request to list replicas as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, String skipToken, Context context) { + public PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName, + String skipToken, Context context) { return new PagedIterable<>( listByConfigurationStoreAsync(resourceGroupName, configStoreName, skipToken, context)); } /** * Gets the properties of the specified replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replica along with {@link Response} on successful completion of {@link - * Mono}. + * @return the properties of the specified replica along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String configStoreName, String replicaName) { + private Mono> getWithResponseAsync(String resourceGroupName, String configStoreName, + String replicaName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -397,24 +340,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - replicaName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), replicaName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the properties of the specified replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -422,23 +355,19 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the specified replica along with {@link Response} on successful completion of {@link - * Mono}. + * @return the properties of the specified replica along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String configStoreName, String replicaName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String configStoreName, + String replicaName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -453,21 +382,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - replicaName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), replicaName, accept, context); } /** * Gets the properties of the specified replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -484,7 +405,7 @@ private Mono getAsync(String resourceGroupName, String configStore /** * Gets the properties of the specified replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -495,14 +416,14 @@ private Mono getAsync(String resourceGroupName, String configStore * @return the properties of the specified replica along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String configStoreName, String replicaName, Context context) { + public Response getWithResponse(String resourceGroupName, String configStoreName, String replicaName, + Context context) { return getWithResponseAsync(resourceGroupName, configStoreName, replicaName, context).block(); } /** * Gets the properties of the specified replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -518,7 +439,7 @@ public ReplicaInner get(String resourceGroupName, String configStoreName, String /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -529,19 +450,15 @@ public ReplicaInner get(String resourceGroupName, String configStoreName, String * @return the replica resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, String configStoreName, String replicaName, ReplicaInner replicaCreationParameters) { + private Mono>> createWithResponseAsync(String resourceGroupName, String configStoreName, + String replicaName, ReplicaInner replicaCreationParameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -555,34 +472,22 @@ private Mono>> createWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); } if (replicaCreationParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter replicaCreationParameters is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter replicaCreationParameters is required and cannot be null.")); } else { replicaCreationParameters.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - replicaName, - replicaCreationParameters, - accept, - context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), replicaName, replicaCreationParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -594,23 +499,15 @@ private Mono>> createWithResponseAsync( * @return the replica resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync( - String resourceGroupName, - String configStoreName, - String replicaName, - ReplicaInner replicaCreationParameters, - Context context) { + private Mono>> createWithResponseAsync(String resourceGroupName, String configStoreName, + String replicaName, ReplicaInner replicaCreationParameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -624,31 +521,20 @@ private Mono>> createWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); } if (replicaCreationParameters == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter replicaCreationParameters is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter replicaCreationParameters is required and cannot be null.")); } else { replicaCreationParameters.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - replicaName, - replicaCreationParameters, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), replicaName, replicaCreationParameters, accept, context); } /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -659,19 +545,17 @@ private Mono>> createWithResponseAsync( * @return the {@link PollerFlux} for polling of the replica resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReplicaInner> beginCreateAsync( - String resourceGroupName, String configStoreName, String replicaName, ReplicaInner replicaCreationParameters) { - Mono>> mono = - createWithResponseAsync(resourceGroupName, configStoreName, replicaName, replicaCreationParameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ReplicaInner.class, ReplicaInner.class, this.client.getContext()); + private PollerFlux, ReplicaInner> beginCreateAsync(String resourceGroupName, + String configStoreName, String replicaName, ReplicaInner replicaCreationParameters) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, configStoreName, replicaName, replicaCreationParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ReplicaInner.class, ReplicaInner.class, this.client.getContext()); } /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -683,25 +567,18 @@ private PollerFlux, ReplicaInner> beginCreateAsync( * @return the {@link PollerFlux} for polling of the replica resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReplicaInner> beginCreateAsync( - String resourceGroupName, - String configStoreName, - String replicaName, - ReplicaInner replicaCreationParameters, - Context context) { + private PollerFlux, ReplicaInner> beginCreateAsync(String resourceGroupName, + String configStoreName, String replicaName, ReplicaInner replicaCreationParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createWithResponseAsync( - resourceGroupName, configStoreName, replicaName, replicaCreationParameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ReplicaInner.class, ReplicaInner.class, context); + Mono>> mono = createWithResponseAsync(resourceGroupName, configStoreName, replicaName, + replicaCreationParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ReplicaInner.class, ReplicaInner.class, context); } /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -712,16 +589,15 @@ private PollerFlux, ReplicaInner> beginCreateAsync( * @return the {@link SyncPoller} for polling of the replica resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ReplicaInner> beginCreate( - String resourceGroupName, String configStoreName, String replicaName, ReplicaInner replicaCreationParameters) { - return this - .beginCreateAsync(resourceGroupName, configStoreName, replicaName, replicaCreationParameters) + public SyncPoller, ReplicaInner> beginCreate(String resourceGroupName, + String configStoreName, String replicaName, ReplicaInner replicaCreationParameters) { + return this.beginCreateAsync(resourceGroupName, configStoreName, replicaName, replicaCreationParameters) .getSyncPoller(); } /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -733,12 +609,8 @@ public SyncPoller, ReplicaInner> beginCreate( * @return the {@link SyncPoller} for polling of the replica resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ReplicaInner> beginCreate( - String resourceGroupName, - String configStoreName, - String replicaName, - ReplicaInner replicaCreationParameters, - Context context) { + public SyncPoller, ReplicaInner> beginCreate(String resourceGroupName, + String configStoreName, String replicaName, ReplicaInner replicaCreationParameters, Context context) { return this .beginCreateAsync(resourceGroupName, configStoreName, replicaName, replicaCreationParameters, context) .getSyncPoller(); @@ -746,7 +618,7 @@ public SyncPoller, ReplicaInner> beginCreate( /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -757,16 +629,15 @@ public SyncPoller, ReplicaInner> beginCreate( * @return the replica resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String configStoreName, String replicaName, ReplicaInner replicaCreationParameters) { - return beginCreateAsync(resourceGroupName, configStoreName, replicaName, replicaCreationParameters) - .last() + private Mono createAsync(String resourceGroupName, String configStoreName, String replicaName, + ReplicaInner replicaCreationParameters) { + return beginCreateAsync(resourceGroupName, configStoreName, replicaName, replicaCreationParameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -778,12 +649,8 @@ private Mono createAsync( * @return the replica resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String configStoreName, - String replicaName, - ReplicaInner replicaCreationParameters, - Context context) { + private Mono createAsync(String resourceGroupName, String configStoreName, String replicaName, + ReplicaInner replicaCreationParameters, Context context) { return beginCreateAsync(resourceGroupName, configStoreName, replicaName, replicaCreationParameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -791,7 +658,7 @@ private Mono createAsync( /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -802,14 +669,14 @@ private Mono createAsync( * @return the replica resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicaInner create( - String resourceGroupName, String configStoreName, String replicaName, ReplicaInner replicaCreationParameters) { + public ReplicaInner create(String resourceGroupName, String configStoreName, String replicaName, + ReplicaInner replicaCreationParameters) { return createAsync(resourceGroupName, configStoreName, replicaName, replicaCreationParameters).block(); } /** * Creates a replica with the specified parameters. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -821,18 +688,14 @@ public ReplicaInner create( * @return the replica resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicaInner create( - String resourceGroupName, - String configStoreName, - String replicaName, - ReplicaInner replicaCreationParameters, - Context context) { + public ReplicaInner create(String resourceGroupName, String configStoreName, String replicaName, + ReplicaInner replicaCreationParameters, Context context) { return createAsync(resourceGroupName, configStoreName, replicaName, replicaCreationParameters, context).block(); } /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -842,19 +705,15 @@ public ReplicaInner create( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String configStoreName, String replicaName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String configStoreName, + String replicaName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -869,24 +728,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - replicaName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, this.client.getApiVersion(), replicaName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -897,19 +746,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String configStoreName, String replicaName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String configStoreName, + String replicaName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -924,21 +769,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - configStoreName, - this.client.getApiVersion(), - replicaName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, this.client.getApiVersion(), replicaName, accept, context); } /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -948,19 +785,17 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String configStoreName, String replicaName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, configStoreName, replicaName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String configStoreName, + String replicaName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, configStoreName, replicaName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -971,19 +806,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String configStoreName, String replicaName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String configStoreName, + String replicaName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, configStoreName, replicaName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, configStoreName, replicaName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -993,14 +827,14 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String replicaName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String replicaName) { return this.beginDeleteAsync(resourceGroupName, configStoreName, replicaName).getSyncPoller(); } /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -1011,14 +845,14 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String configStoreName, String replicaName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String configStoreName, + String replicaName, Context context) { return this.beginDeleteAsync(resourceGroupName, configStoreName, replicaName, context).getSyncPoller(); } /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -1029,14 +863,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String configStoreName, String replicaName) { - return beginDeleteAsync(resourceGroupName, configStoreName, replicaName) - .last() + return beginDeleteAsync(resourceGroupName, configStoreName, replicaName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -1047,16 +880,15 @@ private Mono deleteAsync(String resourceGroupName, String configStoreName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String configStoreName, String replicaName, Context context) { - return beginDeleteAsync(resourceGroupName, configStoreName, replicaName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String configStoreName, String replicaName, + Context context) { + return beginDeleteAsync(resourceGroupName, configStoreName, replicaName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -1071,7 +903,7 @@ public void delete(String resourceGroupName, String configStoreName, String repl /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -1087,14 +919,13 @@ public void delete(String resourceGroupName, String configStoreName, String repl /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 list replicas along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByConfigurationStoreNextSinglePageAsync(String nextLink) { @@ -1102,63 +933,43 @@ private Mono> listByConfigurationStoreNextSinglePage return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @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 list replicas along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByConfigurationStoreNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByConfigurationStoreNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByConfigurationStoreNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicasImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicasImpl.java index 7d71a966339e7..a75faa7e1f2e4 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicasImpl.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ReplicasImpl.java @@ -21,34 +21,31 @@ public final class ReplicasImpl implements Replicas { private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; - public ReplicasImpl( - ReplicasClient innerClient, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { + public ReplicasImpl(ReplicasClient innerClient, + com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName) { - PagedIterable inner = - this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName); - return Utils.mapPage(inner, inner1 -> new ReplicaImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReplicaImpl(inner1, this.manager())); } - public PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, String skipToken, Context context) { - PagedIterable inner = - this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName, skipToken, context); - return Utils.mapPage(inner, inner1 -> new ReplicaImpl(inner1, this.manager())); + public PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName, + String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().listByConfigurationStore(resourceGroupName, configStoreName, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReplicaImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String configStoreName, String replicaName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, configStoreName, replicaName, context); + public Response getWithResponse(String resourceGroupName, String configStoreName, String replicaName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, configStoreName, replicaName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ReplicaImpl(inner.getValue(), this.manager())); } else { return null; @@ -73,113 +70,77 @@ public void delete(String resourceGroupName, String configStoreName, String repl } public Replica getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String replicaName = Utils.getValueFromIdByName(id, "replicas"); + String replicaName = ResourceManagerUtils.getValueFromIdByName(id, "replicas"); if (replicaName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); } return this.getWithResponse(resourceGroupName, configStoreName, replicaName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String replicaName = Utils.getValueFromIdByName(id, "replicas"); + String replicaName = ResourceManagerUtils.getValueFromIdByName(id, "replicas"); if (replicaName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); } return this.getWithResponse(resourceGroupName, configStoreName, replicaName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String replicaName = Utils.getValueFromIdByName(id, "replicas"); + String replicaName = ResourceManagerUtils.getValueFromIdByName(id, "replicas"); if (replicaName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); } this.delete(resourceGroupName, configStoreName, replicaName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String configStoreName = Utils.getValueFromIdByName(id, "configurationStores"); + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); if (configStoreName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); } - String replicaName = Utils.getValueFromIdByName(id, "replicas"); + String replicaName = ResourceManagerUtils.getValueFromIdByName(id, "replicas"); if (replicaName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id))); } this.delete(resourceGroupName, configStoreName, replicaName, context); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/Utils.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ResourceManagerUtils.java similarity index 80% rename from sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/Utils.java rename to sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ResourceManagerUtils.java index b321a53294248..466b110331b1c 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/Utils.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +87,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +127,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +189,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } 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 0000000000000..8c9f15cfcaaa2 --- /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.ResourceParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationResult; +import com.azure.resourcemanager.appconfiguration.models.SasTokenKind; +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 ResourceParameters resourceParameters() { + return this.innerModel().resourceParameters(); + } + + public OffsetDateTime expires() { + return this.innerModel().expires(); + } + + public Float cacheControlMaxAge() { + return this.innerModel().cacheControlMaxAge(); + } + + public SasTokenKind 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/implementation/SnapshotImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SnapshotImpl.java new file mode 100644 index 0000000000000..7359dfd0e5a38 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SnapshotImpl.java @@ -0,0 +1,171 @@ +// 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.core.util.Context; +import com.azure.resourcemanager.appconfiguration.fluent.models.SnapshotInner; +import com.azure.resourcemanager.appconfiguration.models.CompositionType; +import com.azure.resourcemanager.appconfiguration.models.KeyValueFilter; +import com.azure.resourcemanager.appconfiguration.models.ProvisioningState; +import com.azure.resourcemanager.appconfiguration.models.Snapshot; +import com.azure.resourcemanager.appconfiguration.models.SnapshotStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SnapshotImpl implements Snapshot, Snapshot.Definition { + private SnapshotInner innerObject; + + private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; + + SnapshotImpl(SnapshotInner innerObject, + com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SnapshotStatus status() { + return this.innerModel().status(); + } + + public List filters() { + List inner = this.innerModel().filters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CompositionType compositionType() { + return this.innerModel().compositionType(); + } + + public OffsetDateTime created() { + return this.innerModel().created(); + } + + public OffsetDateTime expires() { + return this.innerModel().expires(); + } + + public Long retentionPeriod() { + return this.innerModel().retentionPeriod(); + } + + public Long size() { + return this.innerModel().size(); + } + + public Long itemsCount() { + return this.innerModel().itemsCount(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public SnapshotInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String configStoreName; + + private String snapshotName; + + public SnapshotImpl withExistingConfigurationStore(String resourceGroupName, String configStoreName) { + this.resourceGroupName = resourceGroupName; + this.configStoreName = configStoreName; + return this; + } + + public Snapshot create() { + this.innerObject = serviceManager.serviceClient() + .getSnapshots() + .create(resourceGroupName, configStoreName, snapshotName, this.innerModel(), Context.NONE); + return this; + } + + public Snapshot create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSnapshots() + .create(resourceGroupName, configStoreName, snapshotName, this.innerModel(), context); + return this; + } + + SnapshotImpl(String name, com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { + this.innerObject = new SnapshotInner(); + this.serviceManager = serviceManager; + this.snapshotName = name; + } + + public Snapshot refresh() { + this.innerObject = serviceManager.serviceClient() + .getSnapshots() + .getWithResponse(resourceGroupName, configStoreName, snapshotName, Context.NONE) + .getValue(); + return this; + } + + public Snapshot refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSnapshots() + .getWithResponse(resourceGroupName, configStoreName, snapshotName, context) + .getValue(); + return this; + } + + public SnapshotImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public SnapshotImpl withFilters(List filters) { + this.innerModel().withFilters(filters); + return this; + } + + public SnapshotImpl withCompositionType(CompositionType compositionType) { + this.innerModel().withCompositionType(compositionType); + return this; + } + + public SnapshotImpl withRetentionPeriod(Long retentionPeriod) { + this.innerModel().withRetentionPeriod(retentionPeriod); + return this; + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SnapshotsClientImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SnapshotsClientImpl.java new file mode 100644 index 0000000000000..76c5fae67c149 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SnapshotsClientImpl.java @@ -0,0 +1,490 @@ +// 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.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appconfiguration.fluent.SnapshotsClient; +import com.azure.resourcemanager.appconfiguration.fluent.models.SnapshotInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SnapshotsClient. + */ +public final class SnapshotsClientImpl implements SnapshotsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SnapshotsService service; + + /** + * The service client containing this operation class. + */ + private final AppConfigurationManagementClientImpl client; + + /** + * Initializes an instance of SnapshotsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SnapshotsClientImpl(AppConfigurationManagementClientImpl client) { + this.service + = RestProxy.create(SnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppConfigurationManagementClientSnapshots to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppConfigurationMana") + public interface SnapshotsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("configStoreName") String configStoreName, @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/snapshots/{snapshotName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("configStoreName") String configStoreName, @PathParam("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") SnapshotInner body, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified snapshot along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String configStoreName, + String snapshotName) { + 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, snapshotName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @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 properties of the specified snapshot along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String configStoreName, + String snapshotName, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, snapshotName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified snapshot on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String configStoreName, String snapshotName) { + return getWithResponseAsync(resourceGroupName, configStoreName, snapshotName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @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 properties of the specified snapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String configStoreName, + String snapshotName, Context context) { + return getWithResponseAsync(resourceGroupName, configStoreName, snapshotName, context).block(); + } + + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner get(String resourceGroupName, String configStoreName, String snapshotName) { + return getWithResponse(resourceGroupName, configStoreName, snapshotName, Context.NONE).getValue(); + } + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the snapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String configStoreName, + String snapshotName, SnapshotInner body) { + 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, configStoreName, snapshotName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @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 snapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String configStoreName, + String snapshotName, SnapshotInner body, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + configStoreName, snapshotName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnapshotInner> beginCreateAsync(String resourceGroupName, + String configStoreName, String snapshotName, SnapshotInner body) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, configStoreName, snapshotName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SnapshotInner.class, SnapshotInner.class, this.client.getContext()); + } + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnapshotInner> beginCreateAsync(String resourceGroupName, + String configStoreName, String snapshotName, SnapshotInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, configStoreName, snapshotName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SnapshotInner.class, SnapshotInner.class, context); + } + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnapshotInner> beginCreate(String resourceGroupName, + String configStoreName, String snapshotName, SnapshotInner body) { + return this.beginCreateAsync(resourceGroupName, configStoreName, snapshotName, body).getSyncPoller(); + } + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the snapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnapshotInner> beginCreate(String resourceGroupName, + String configStoreName, String snapshotName, SnapshotInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, configStoreName, snapshotName, body, context).getSyncPoller(); + } + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the snapshot resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String configStoreName, String snapshotName, + SnapshotInner body) { + return beginCreateAsync(resourceGroupName, configStoreName, snapshotName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @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 snapshot resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String configStoreName, String snapshotName, + SnapshotInner body, Context context) { + return beginCreateAsync(resourceGroupName, configStoreName, snapshotName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner create(String resourceGroupName, String configStoreName, String snapshotName, + SnapshotInner body) { + return createAsync(resourceGroupName, configStoreName, snapshotName, body).block(); + } + + /** + * Creates a snapshot. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios + * involving App Configuration snapshots the data plane API should be used instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @param body The parameters for creating a snapshot. + * @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 snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner create(String resourceGroupName, String configStoreName, String snapshotName, + SnapshotInner body, Context context) { + return createAsync(resourceGroupName, configStoreName, snapshotName, body, context).block(); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SnapshotsImpl.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SnapshotsImpl.java new file mode 100644 index 0000000000000..5630017555053 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/SnapshotsImpl.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appconfiguration.fluent.SnapshotsClient; +import com.azure.resourcemanager.appconfiguration.fluent.models.SnapshotInner; +import com.azure.resourcemanager.appconfiguration.models.Snapshot; +import com.azure.resourcemanager.appconfiguration.models.Snapshots; + +public final class SnapshotsImpl implements Snapshots { + private static final ClientLogger LOGGER = new ClientLogger(SnapshotsImpl.class); + + private final SnapshotsClient innerClient; + + private final com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager; + + public SnapshotsImpl(SnapshotsClient innerClient, + com.azure.resourcemanager.appconfiguration.AppConfigurationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String configStoreName, String snapshotName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, configStoreName, snapshotName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SnapshotImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Snapshot get(String resourceGroupName, String configStoreName, String snapshotName) { + SnapshotInner inner = this.serviceClient().get(resourceGroupName, configStoreName, snapshotName); + if (inner != null) { + return new SnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public Snapshot getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); + if (configStoreName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + } + String snapshotName = ResourceManagerUtils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.getWithResponse(resourceGroupName, configStoreName, snapshotName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String configStoreName = ResourceManagerUtils.getValueFromIdByName(id, "configurationStores"); + if (configStoreName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'configurationStores'.", id))); + } + String snapshotName = ResourceManagerUtils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.getWithResponse(resourceGroupName, configStoreName, snapshotName, context); + } + + private SnapshotsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager() { + return this.serviceManager; + } + + public SnapshotImpl define(String name) { + return new SnapshotImpl(name, this.manager()); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/package-info.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/package-info.java index 2d209b3d90973..d4bce959d662d 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/package-info.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for AppConfigurationManagementClient. null. */ +/** + * Package containing the implementations for AppConfigurationManagementClient. + * null. + */ package com.azure.resourcemanager.appconfiguration.implementation; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ActionsRequired.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ActionsRequired.java index d5c22ce64f3c1..862f5ba6cb3ff 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ActionsRequired.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ActionsRequired.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Any action that is required beyond basic workflow (approve/ reject/ disconnect). */ +/** + * Any action that is required beyond basic workflow (approve/ reject/ disconnect). + */ public final class ActionsRequired extends ExpandableStringEnum { - /** Static value None for ActionsRequired. */ + /** + * Static value None for ActionsRequired. + */ public static final ActionsRequired NONE = fromString("None"); - /** Static value Recreate for ActionsRequired. */ + /** + * Static value Recreate for ActionsRequired. + */ public static final ActionsRequired RECREATE = fromString("Recreate"); /** * Creates a new instance of ActionsRequired value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ActionsRequired() { /** * Creates or finds a ActionsRequired from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionsRequired. */ - @JsonCreator public static ActionsRequired fromString(String name) { return fromString(name, ActionsRequired.class); } /** * Gets known ActionsRequired values. - * + * * @return known ActionsRequired values. */ public static Collection values() { diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ApiKey.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ApiKey.java index da78257a0276b..1c4be0790ca7c 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ApiKey.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ApiKey.java @@ -7,25 +7,27 @@ import com.azure.resourcemanager.appconfiguration.fluent.models.ApiKeyInner; import java.time.OffsetDateTime; -/** An immutable client-side representation of ApiKey. */ +/** + * An immutable client-side representation of ApiKey. + */ public interface ApiKey { /** * Gets the id property: The key ID. - * + * * @return the id value. */ String id(); /** * Gets the name property: A name for the key describing its usage. - * + * * @return the name value. */ String name(); /** * Gets the value property: The value of the key that is used for authentication purposes. - * + * * @return the value value. */ String value(); @@ -33,28 +35,28 @@ public interface ApiKey { /** * Gets the connectionString property: A connection string that can be used by supporting clients for * authentication. - * + * * @return the connectionString value. */ String connectionString(); /** * Gets the lastModified property: The last time any of the key's properties were modified. - * + * * @return the lastModified value. */ OffsetDateTime lastModified(); /** * Gets the readOnly property: Whether this key can only be used for read operations. - * + * * @return the readOnly value. */ Boolean readOnly(); /** * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.ApiKeyInner object. - * + * * @return the inner object. */ ApiKeyInner innerModel(); diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ApiKeyListResult.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ApiKeyListResult.java index fd657aa841c91..97c6de969edb0 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ApiKeyListResult.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ApiKeyListResult.java @@ -5,32 +5,38 @@ 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 com.azure.resourcemanager.appconfiguration.fluent.models.ApiKeyInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The result of a request to list API keys. */ +/** + * The result of a request to list API keys. + */ @Fluent -public final class ApiKeyListResult { +public final class ApiKeyListResult implements JsonSerializable { /* * The collection value. */ - @JsonProperty(value = "value") private List value; /* * The URI that can be used to request the next set of paged results. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of ApiKeyListResult class. */ + /** + * Creates an instance of ApiKeyListResult class. + */ public ApiKeyListResult() { } /** * Get the value property: The collection value. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The collection value. - * + * * @param value the value value to set. * @return the ApiKeyListResult object itself. */ @@ -50,7 +56,7 @@ public ApiKeyListResult withValue(List value) { /** * Get the nextLink property: The URI that can be used to request the next set of paged results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URI that can be used to request the next set of paged results. - * + * * @param nextLink the nextLink value to set. * @return the ApiKeyListResult object itself. */ @@ -70,7 +76,7 @@ public ApiKeyListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiKeyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiKeyListResult 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 ApiKeyListResult. + */ + public static ApiKeyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiKeyListResult deserializedApiKeyListResult = new ApiKeyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ApiKeyInner.fromJson(reader1)); + deserializedApiKeyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApiKeyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiKeyListResult; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/AuthenticationMode.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/AuthenticationMode.java new file mode 100644 index 0000000000000..8ce4644342fc4 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/AuthenticationMode.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The data plane proxy authentication mode. This property manages the authentication mode of request to the data plane + * resources. + */ +public final class AuthenticationMode extends ExpandableStringEnum { + /** + * Static value Local for AuthenticationMode. + */ + public static final AuthenticationMode LOCAL = fromString("Local"); + + /** + * Static value Pass-through for AuthenticationMode. + */ + public static final AuthenticationMode PASS_THROUGH = fromString("Pass-through"); + + /** + * Creates a new instance of AuthenticationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthenticationMode() { + } + + /** + * Creates or finds a AuthenticationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationMode. + */ + public static AuthenticationMode fromString(String name) { + return fromString(name, AuthenticationMode.class); + } + + /** + * Gets known AuthenticationMode values. + * + * @return known AuthenticationMode values. + */ + public static Collection values() { + return values(AuthenticationMode.class); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CheckNameAvailabilityParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CheckNameAvailabilityParameters.java index af002421c0698..1da4bd3cdc5ab 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CheckNameAvailabilityParameters.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CheckNameAvailabilityParameters.java @@ -6,30 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +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 checking whether a resource name is available. */ +/** + * Parameters used for checking whether a resource name is available. + */ @Fluent -public final class CheckNameAvailabilityParameters { +public final class CheckNameAvailabilityParameters implements JsonSerializable { /* * The name to check for availability. */ - @JsonProperty(value = "name", required = true) private String name; /* * The resource type to check for name availability. */ - @JsonProperty(value = "type", required = true) private ConfigurationResourceType type; - /** Creates an instance of CheckNameAvailabilityParameters class. */ + /** + * Creates an instance of CheckNameAvailabilityParameters class. + */ public CheckNameAvailabilityParameters() { } /** * Get the name property: The name to check for availability. - * + * * @return the name value. */ public String name() { @@ -38,7 +44,7 @@ public String name() { /** * Set the name property: The name to check for availability. - * + * * @param name the name value to set. * @return the CheckNameAvailabilityParameters object itself. */ @@ -49,7 +55,7 @@ public CheckNameAvailabilityParameters withName(String name) { /** * Get the type property: The resource type to check for name availability. - * + * * @return the type value. */ public ConfigurationResourceType type() { @@ -58,7 +64,7 @@ public ConfigurationResourceType type() { /** * Set the type property: The resource type to check for name availability. - * + * * @param type the type value to set. * @return the CheckNameAvailabilityParameters object itself. */ @@ -69,23 +75,63 @@ public CheckNameAvailabilityParameters withType(ConfigurationResourceType type) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model CheckNameAvailabilityParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model CheckNameAvailabilityParameters")); } if (type() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property type in model CheckNameAvailabilityParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model CheckNameAvailabilityParameters")); } } private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityParameters 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 CheckNameAvailabilityParameters. + */ + public static CheckNameAvailabilityParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityParameters deserializedCheckNameAvailabilityParameters + = new CheckNameAvailabilityParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCheckNameAvailabilityParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCheckNameAvailabilityParameters.type + = ConfigurationResourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityParameters; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CompositionType.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CompositionType.java new file mode 100644 index 0000000000000..5692b82df81fb --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CompositionType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The composition type describes how the key-values within the snapshot are composed. The 'key' composition type + * ensures there are no two key-values containing the same key. The 'key_label' composition type ensures there are no + * two key-values containing the same key and label. + */ +public final class CompositionType extends ExpandableStringEnum { + /** + * Static value Key for CompositionType. + */ + public static final CompositionType KEY = fromString("Key"); + + /** + * Static value Key_Label for CompositionType. + */ + public static final CompositionType KEY_LABEL = fromString("Key_Label"); + + /** + * Creates a new instance of CompositionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CompositionType() { + } + + /** + * Creates or finds a CompositionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CompositionType. + */ + public static CompositionType fromString(String name) { + return fromString(name, CompositionType.class); + } + + /** + * Gets known CompositionType values. + * + * @return known CompositionType values. + */ + public static Collection values() { + return values(CompositionType.class); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationResourceType.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationResourceType.java index 879606df206ac..a1c0a6e1d60fc 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationResourceType.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationResourceType.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The resource type to check for name availability. */ +/** + * The resource type to check for name availability. + */ public final class ConfigurationResourceType extends ExpandableStringEnum { - /** Static value Microsoft.AppConfiguration/configurationStores for ConfigurationResourceType. */ - public static final ConfigurationResourceType MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES = - fromString("Microsoft.AppConfiguration/configurationStores"); + /** + * Static value Microsoft.AppConfiguration/configurationStores for ConfigurationResourceType. + */ + public static final ConfigurationResourceType MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES + = fromString("Microsoft.AppConfiguration/configurationStores"); /** * Creates a new instance of ConfigurationResourceType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -25,18 +28,17 @@ public ConfigurationResourceType() { /** * Creates or finds a ConfigurationResourceType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConfigurationResourceType. */ - @JsonCreator public static ConfigurationResourceType fromString(String name) { return fromString(name, ConfigurationResourceType.class); } /** * Gets known ConfigurationResourceType values. - * + * * @return known ConfigurationResourceType values. */ public static Collection values() { 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 e050ac4dcc306..03ca896a7ee63 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 @@ -14,88 +14,90 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of ConfigurationStore. */ +/** + * An immutable client-side representation of ConfigurationStore. + */ public interface ConfigurationStore { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the identity property: The managed identity information, if configured. - * + * * @return the identity value. */ ResourceIdentity identity(); /** * Gets the sku property: The sku of the configuration store. - * + * * @return the sku value. */ Sku sku(); /** * Gets the systemData property: Resource system metadata. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the provisioningState property: The provisioning state of the configuration store. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the creationDate property: The creation date of configuration store. - * + * * @return the creationDate value. */ OffsetDateTime creationDate(); /** * Gets the endpoint property: The DNS endpoint where the configuration store API will be available. - * + * * @return the endpoint value. */ String endpoint(); /** * Gets the encryption property: The encryption settings of the configuration store. - * + * * @return the encryption value. */ EncryptionProperties encryption(); @@ -103,7 +105,7 @@ public interface ConfigurationStore { /** * Gets the privateEndpointConnections property: The list of private endpoint connections that are set up for this * resource. - * + * * @return the privateEndpointConnections value. */ List privateEndpointConnections(); @@ -111,14 +113,14 @@ public interface ConfigurationStore { /** * Gets the publicNetworkAccess property: Control permission for data plane traffic coming from public networks * while private endpoint is enabled. - * + * * @return the publicNetworkAccess value. */ PublicNetworkAccess publicNetworkAccess(); /** * Gets the disableLocalAuth property: Disables all authentication methods other than AAD authentication. - * + * * @return the disableLocalAuth value. */ Boolean disableLocalAuth(); @@ -126,7 +128,7 @@ public interface ConfigurationStore { /** * Gets the softDeleteRetentionInDays property: The amount of time in days that the configuration store will be * retained when it is soft deleted. - * + * * @return the softDeleteRetentionInDays value. */ Integer softDeleteRetentionInDays(); @@ -134,64 +136,93 @@ public interface ConfigurationStore { /** * Gets the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this * configuration store. - * + * * @return the enablePurgeProtection value. */ Boolean enablePurgeProtection(); + /** + * Gets the dataPlaneProxy property: Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * + * @return the dataPlaneProxy value. + */ + DataPlaneProxyProperties dataPlaneProxy(); + /** * Gets the createMode property: Indicates whether the configuration store need to be recovered. - * + * * @return the createMode value. */ 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. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.ConfigurationStoreInner object. - * + * * @return the inner object. */ ConfigurationStoreInner innerModel(); - /** The entirety of the ConfigurationStore definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithSku, - DefinitionStages.WithCreate { + /** + * The entirety of the ConfigurationStore definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { } - /** The ConfigurationStore definition stages. */ + + /** + * The ConfigurationStore definition stages. + */ interface DefinitionStages { - /** The first stage of the ConfigurationStore definition. */ + /** + * The first stage of the ConfigurationStore definition. + */ interface Blank extends WithLocation { } - /** The stage of the ConfigurationStore definition allowing to specify location. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -199,267 +230,406 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the ConfigurationStore definition allowing to specify parent resource. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @return the next definition stage. */ WithSku withExistingResourceGroup(String resourceGroupName); } - /** The stage of the ConfigurationStore definition allowing to specify sku. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The sku of the configuration store.. - * + * * @param sku The sku of the configuration store. * @return the next definition stage. */ WithCreate withSku(Sku sku); } + /** * The stage of the ConfigurationStore definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithEncryption, - DefinitionStages.WithPublicNetworkAccess, - DefinitionStages.WithDisableLocalAuth, - DefinitionStages.WithSoftDeleteRetentionInDays, - DefinitionStages.WithEnablePurgeProtection, - DefinitionStages.WithCreateMode { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, + DefinitionStages.WithEncryption, DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithDisableLocalAuth, DefinitionStages.WithSoftDeleteRetentionInDays, + DefinitionStages.WithEnablePurgeProtection, DefinitionStages.WithDataPlaneProxy, + DefinitionStages.WithCreateMode, DefinitionStages.WithTelemetry, DefinitionStages.WithExperimentation { /** * Executes the create request. - * + * * @return the created resource. */ ConfigurationStore create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ ConfigurationStore create(Context context); } - /** The stage of the ConfigurationStore definition allowing to specify tags. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the ConfigurationStore definition allowing to specify identity. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The managed identity information, if configured.. - * + * * @param identity The managed identity information, if configured. * @return the next definition stage. */ WithCreate withIdentity(ResourceIdentity identity); } - /** The stage of the ConfigurationStore definition allowing to specify encryption. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify encryption. + */ interface WithEncryption { /** * Specifies the encryption property: The encryption settings of the configuration store.. - * + * * @param encryption The encryption settings of the configuration store. * @return the next definition stage. */ WithCreate withEncryption(EncryptionProperties encryption); } - /** The stage of the ConfigurationStore definition allowing to specify publicNetworkAccess. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify publicNetworkAccess. + */ interface WithPublicNetworkAccess { /** * Specifies the publicNetworkAccess property: Control permission for data plane traffic coming from public * networks while private endpoint is enabled.. - * + * * @param publicNetworkAccess Control permission for data plane traffic coming from public networks while - * private endpoint is enabled. + * private endpoint is enabled. * @return the next definition stage. */ WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); } - /** The stage of the ConfigurationStore definition allowing to specify disableLocalAuth. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify disableLocalAuth. + */ interface WithDisableLocalAuth { /** * Specifies the disableLocalAuth property: Disables all authentication methods other than AAD * authentication.. - * + * * @param disableLocalAuth Disables all authentication methods other than AAD authentication. * @return the next definition stage. */ WithCreate withDisableLocalAuth(Boolean disableLocalAuth); } - /** The stage of the ConfigurationStore definition allowing to specify softDeleteRetentionInDays. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify softDeleteRetentionInDays. + */ interface WithSoftDeleteRetentionInDays { /** * Specifies the softDeleteRetentionInDays property: The amount of time in days that the configuration store * will be retained when it is soft deleted.. - * + * * @param softDeleteRetentionInDays The amount of time in days that the configuration store will be retained - * when it is soft deleted. + * when it is soft deleted. * @return the next definition stage. */ WithCreate withSoftDeleteRetentionInDays(Integer softDeleteRetentionInDays); } - /** The stage of the ConfigurationStore definition allowing to specify enablePurgeProtection. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify enablePurgeProtection. + */ interface WithEnablePurgeProtection { /** * Specifies the enablePurgeProtection property: Property specifying whether protection against purge is * enabled for this configuration store.. - * + * * @param enablePurgeProtection Property specifying whether protection against purge is enabled for this - * configuration store. + * configuration store. * @return the next definition stage. */ WithCreate withEnablePurgeProtection(Boolean enablePurgeProtection); } - /** The stage of the ConfigurationStore definition allowing to specify createMode. */ + + /** + * The stage of the ConfigurationStore definition allowing to specify dataPlaneProxy. + */ + interface WithDataPlaneProxy { + /** + * Specifies the dataPlaneProxy property: Property specifying the configuration of data plane proxy for + * Azure Resource Manager (ARM).. + * + * @param dataPlaneProxy Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * @return the next definition stage. + */ + WithCreate withDataPlaneProxy(DataPlaneProxyProperties dataPlaneProxy); + } + + /** + * The stage of the ConfigurationStore definition allowing to specify createMode. + */ interface WithCreateMode { /** * Specifies the createMode property: Indicates whether the configuration store need to be recovered.. - * + * * @param createMode Indicates whether the configuration store need to be recovered. * @return the next definition stage. */ 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); + } } + /** * Begins update for the ConfigurationStore resource. - * + * * @return the stage of resource update. */ ConfigurationStore.Update update(); - /** The template for ConfigurationStore update. */ + /** + * The template for ConfigurationStore update. + */ interface Update - extends UpdateStages.WithTags, - UpdateStages.WithIdentity, - UpdateStages.WithSku, - UpdateStages.WithEncryption, - UpdateStages.WithDisableLocalAuth, - UpdateStages.WithPublicNetworkAccess, - UpdateStages.WithEnablePurgeProtection { + extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku, UpdateStages.WithEncryption, + UpdateStages.WithDisableLocalAuth, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithEnablePurgeProtection, + UpdateStages.WithDataPlaneProxy, UpdateStages.WithTelemetry, UpdateStages.WithExperimentation { /** * Executes the update request. - * + * * @return the updated resource. */ ConfigurationStore apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ ConfigurationStore apply(Context context); } - /** The ConfigurationStore update stages. */ + + /** + * The ConfigurationStore update stages. + */ interface UpdateStages { - /** The stage of the ConfigurationStore update allowing to specify tags. */ + /** + * The stage of the ConfigurationStore update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: The ARM resource tags.. - * + * * @param tags The ARM resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the ConfigurationStore update allowing to specify identity. */ + + /** + * The stage of the ConfigurationStore update allowing to specify identity. + */ interface WithIdentity { /** * Specifies the identity property: The managed identity information for the configuration store.. - * + * * @param identity The managed identity information for the configuration store. * @return the next definition stage. */ Update withIdentity(ResourceIdentity identity); } - /** The stage of the ConfigurationStore update allowing to specify sku. */ + + /** + * The stage of the ConfigurationStore update allowing to specify sku. + */ interface WithSku { /** * Specifies the sku property: The SKU of the configuration store.. - * + * * @param sku The SKU of the configuration store. * @return the next definition stage. */ Update withSku(Sku sku); } - /** The stage of the ConfigurationStore update allowing to specify encryption. */ + + /** + * The stage of the ConfigurationStore update allowing to specify encryption. + */ interface WithEncryption { /** * Specifies the encryption property: The encryption settings of the configuration store.. - * + * * @param encryption The encryption settings of the configuration store. * @return the next definition stage. */ Update withEncryption(EncryptionProperties encryption); } - /** The stage of the ConfigurationStore update allowing to specify disableLocalAuth. */ + + /** + * The stage of the ConfigurationStore update allowing to specify disableLocalAuth. + */ interface WithDisableLocalAuth { /** * Specifies the disableLocalAuth property: Disables all authentication methods other than AAD * authentication.. - * + * * @param disableLocalAuth Disables all authentication methods other than AAD authentication. * @return the next definition stage. */ Update withDisableLocalAuth(Boolean disableLocalAuth); } - /** The stage of the ConfigurationStore update allowing to specify publicNetworkAccess. */ + + /** + * The stage of the ConfigurationStore update allowing to specify publicNetworkAccess. + */ interface WithPublicNetworkAccess { /** * Specifies the publicNetworkAccess property: Control permission for data plane traffic coming from public * networks while private endpoint is enabled.. - * + * * @param publicNetworkAccess Control permission for data plane traffic coming from public networks while - * private endpoint is enabled. + * private endpoint is enabled. * @return the next definition stage. */ Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); } - /** The stage of the ConfigurationStore update allowing to specify enablePurgeProtection. */ + + /** + * The stage of the ConfigurationStore update allowing to specify enablePurgeProtection. + */ interface WithEnablePurgeProtection { /** * Specifies the enablePurgeProtection property: Property specifying whether protection against purge is * enabled for this configuration store.. - * + * * @param enablePurgeProtection Property specifying whether protection against purge is enabled for this - * configuration store. + * configuration store. * @return the next definition stage. */ Update withEnablePurgeProtection(Boolean enablePurgeProtection); } + + /** + * The stage of the ConfigurationStore update allowing to specify dataPlaneProxy. + */ + interface WithDataPlaneProxy { + /** + * Specifies the dataPlaneProxy property: Property specifying the configuration of data plane proxy for + * Azure Resource Manager (ARM).. + * + * @param dataPlaneProxy Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * @return the next definition stage. + */ + 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); + } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ ConfigurationStore refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -467,7 +637,7 @@ interface WithEnablePurgeProtection { /** * Lists the access key for the specified configuration store. - * + * * @throws com.azure.core.management.exception.ManagementException 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 list API keys as paginated response with {@link PagedIterable}. @@ -476,10 +646,10 @@ interface WithEnablePurgeProtection { /** * Lists the access key for the specified configuration store. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -490,7 +660,7 @@ interface WithEnablePurgeProtection { /** * Regenerates an access key for the specified configuration store. - * + * * @param regenerateKeyParameters The parameters for regenerating an access key. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -502,7 +672,7 @@ interface WithEnablePurgeProtection { /** * Regenerates an access key for the specified configuration store. - * + * * @param regenerateKeyParameters The parameters for regenerating an access key. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -510,4 +680,50 @@ interface WithEnablePurgeProtection { * @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 all SAS tokens of a given kind (primary/secondary). + * + * @param resetSasTokensParameters The object containing information for the SAS token 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 {@link Response}. + */ + Response resetSasTokensWithResponse(ResetSasTokensParameters resetSasTokensParameters, Context context); + + /** + * Reset all SAS tokens of a given kind (primary/secondary). + * + * @param resetSasTokensParameters The object containing information for the SAS token 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. + */ + void resetSasTokens(ResetSasTokensParameters resetSasTokensParameters); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStoreListResult.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStoreListResult.java index 5b6225407ae6e..bbeddca7905ba 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStoreListResult.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStoreListResult.java @@ -5,32 +5,38 @@ 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 com.azure.resourcemanager.appconfiguration.fluent.models.ConfigurationStoreInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The result of a request to list configuration stores. */ +/** + * The result of a request to list configuration stores. + */ @Fluent -public final class ConfigurationStoreListResult { +public final class ConfigurationStoreListResult implements JsonSerializable { /* * The collection value. */ - @JsonProperty(value = "value") private List value; /* * The URI that can be used to request the next set of paged results. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of ConfigurationStoreListResult class. */ + /** + * Creates an instance of ConfigurationStoreListResult class. + */ public ConfigurationStoreListResult() { } /** * Get the value property: The collection value. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The collection value. - * + * * @param value the value value to set. * @return the ConfigurationStoreListResult object itself. */ @@ -50,7 +56,7 @@ public ConfigurationStoreListResult withValue(List valu /** * Get the nextLink property: The URI that can be used to request the next set of paged results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URI that can be used to request the next set of paged results. - * + * * @param nextLink the nextLink value to set. * @return the ConfigurationStoreListResult object itself. */ @@ -70,7 +76,7 @@ public ConfigurationStoreListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationStoreListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationStoreListResult 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 ConfigurationStoreListResult. + */ + public static ConfigurationStoreListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationStoreListResult deserializedConfigurationStoreListResult = new ConfigurationStoreListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConfigurationStoreInner.fromJson(reader1)); + deserializedConfigurationStoreListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConfigurationStoreListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationStoreListResult; + }); + } } 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 e2a99b4350c4c..d7b04cdaeec09 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 @@ -5,46 +5,48 @@ 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 com.azure.resourcemanager.appconfiguration.fluent.models.ConfigurationStorePropertiesUpdateParameters; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** The parameters for updating a configuration store. */ +/** + * The parameters for updating a configuration store. + */ @Fluent -public final class ConfigurationStoreUpdateParameters { +public final class ConfigurationStoreUpdateParameters implements JsonSerializable { /* * The properties for updating a configuration store. */ - @JsonProperty(value = "properties") private ConfigurationStorePropertiesUpdateParameters innerProperties; /* * The managed identity information for the configuration store. */ - @JsonProperty(value = "identity") private ResourceIdentity identity; /* * The SKU of the configuration store. */ - @JsonProperty(value = "sku") private Sku sku; /* * The ARM resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of ConfigurationStoreUpdateParameters class. */ + /** + * Creates an instance of ConfigurationStoreUpdateParameters class. + */ public ConfigurationStoreUpdateParameters() { } /** * Get the innerProperties property: The properties for updating a configuration store. - * + * * @return the innerProperties value. */ private ConfigurationStorePropertiesUpdateParameters innerProperties() { @@ -53,7 +55,7 @@ private ConfigurationStorePropertiesUpdateParameters innerProperties() { /** * Get the identity property: The managed identity information for the configuration store. - * + * * @return the identity value. */ public ResourceIdentity identity() { @@ -62,7 +64,7 @@ public ResourceIdentity identity() { /** * Set the identity property: The managed identity information for the configuration store. - * + * * @param identity the identity value to set. * @return the ConfigurationStoreUpdateParameters object itself. */ @@ -73,7 +75,7 @@ public ConfigurationStoreUpdateParameters withIdentity(ResourceIdentity identity /** * Get the sku property: The SKU of the configuration store. - * + * * @return the sku value. */ public Sku sku() { @@ -82,7 +84,7 @@ public Sku sku() { /** * Set the sku property: The SKU of the configuration store. - * + * * @param sku the sku value to set. * @return the ConfigurationStoreUpdateParameters object itself. */ @@ -93,7 +95,7 @@ public ConfigurationStoreUpdateParameters withSku(Sku sku) { /** * Get the tags property: The ARM resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -102,7 +104,7 @@ public Map tags() { /** * Set the tags property: The ARM resource tags. - * + * * @param tags the tags value to set. * @return the ConfigurationStoreUpdateParameters object itself. */ @@ -113,7 +115,7 @@ public ConfigurationStoreUpdateParameters withTags(Map tags) { /** * Get the encryption property: The encryption settings of the configuration store. - * + * * @return the encryption value. */ public EncryptionProperties encryption() { @@ -122,7 +124,7 @@ public EncryptionProperties encryption() { /** * Set the encryption property: The encryption settings of the configuration store. - * + * * @param encryption the encryption value to set. * @return the ConfigurationStoreUpdateParameters object itself. */ @@ -136,7 +138,7 @@ public ConfigurationStoreUpdateParameters withEncryption(EncryptionProperties en /** * Get the disableLocalAuth property: Disables all authentication methods other than AAD authentication. - * + * * @return the disableLocalAuth value. */ public Boolean disableLocalAuth() { @@ -145,7 +147,7 @@ public Boolean disableLocalAuth() { /** * Set the disableLocalAuth property: Disables all authentication methods other than AAD authentication. - * + * * @param disableLocalAuth the disableLocalAuth value to set. * @return the ConfigurationStoreUpdateParameters object itself. */ @@ -160,7 +162,7 @@ public ConfigurationStoreUpdateParameters withDisableLocalAuth(Boolean disableLo /** * Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -170,7 +172,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while * private endpoint is enabled. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the ConfigurationStoreUpdateParameters object itself. */ @@ -185,7 +187,7 @@ public ConfigurationStoreUpdateParameters withPublicNetworkAccess(PublicNetworkA /** * Get the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this * configuration store. - * + * * @return the enablePurgeProtection value. */ public Boolean enablePurgeProtection() { @@ -195,7 +197,7 @@ public Boolean enablePurgeProtection() { /** * Set the enablePurgeProtection property: Property specifying whether protection against purge is enabled for this * configuration store. - * + * * @param enablePurgeProtection the enablePurgeProtection value to set. * @return the ConfigurationStoreUpdateParameters object itself. */ @@ -207,9 +209,84 @@ public ConfigurationStoreUpdateParameters withEnablePurgeProtection(Boolean enab return this; } + /** + * Get the dataPlaneProxy property: Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * + * @return the dataPlaneProxy value. + */ + public DataPlaneProxyProperties dataPlaneProxy() { + return this.innerProperties() == null ? null : this.innerProperties().dataPlaneProxy(); + } + + /** + * Set the dataPlaneProxy property: Property specifying the configuration of data plane proxy for Azure Resource + * Manager (ARM). + * + * @param dataPlaneProxy the dataPlaneProxy value to set. + * @return the ConfigurationStoreUpdateParameters object itself. + */ + public ConfigurationStoreUpdateParameters withDataPlaneProxy(DataPlaneProxyProperties dataPlaneProxy) { + if (this.innerProperties() == null) { + this.innerProperties = new ConfigurationStorePropertiesUpdateParameters(); + } + this.innerProperties().withDataPlaneProxy(dataPlaneProxy); + 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. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -223,4 +300,52 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationStoreUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationStoreUpdateParameters 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 ConfigurationStoreUpdateParameters. + */ + public static ConfigurationStoreUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationStoreUpdateParameters deserializedConfigurationStoreUpdateParameters + = new ConfigurationStoreUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedConfigurationStoreUpdateParameters.innerProperties + = ConfigurationStorePropertiesUpdateParameters.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedConfigurationStoreUpdateParameters.identity = ResourceIdentity.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedConfigurationStoreUpdateParameters.sku = Sku.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConfigurationStoreUpdateParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationStoreUpdateParameters; + }); + } } 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 441ce96fd92da..42cc233aeefe1 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ConfigurationStores. */ +/** + * Resource collection API of ConfigurationStores. + */ public interface ConfigurationStores { /** * Lists the configuration stores for a given subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to list configuration stores as paginated response with {@link PagedIterable}. @@ -21,10 +23,10 @@ public interface ConfigurationStores { /** * Lists the configuration stores for a given subscription. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -35,7 +37,7 @@ public interface ConfigurationStores { /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -46,11 +48,11 @@ public interface ConfigurationStores { /** * Lists the configuration stores for a given resource group. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -61,7 +63,7 @@ public interface ConfigurationStores { /** * Gets the properties 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 context The context to associate with this operation. @@ -70,12 +72,12 @@ public interface ConfigurationStores { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of the specified configuration store along with {@link Response}. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String configStoreName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String configStoreName, + Context context); /** * Gets the properties 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -87,7 +89,7 @@ Response getByResourceGroupWithResponse( /** * Deletes a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -98,7 +100,7 @@ Response getByResourceGroupWithResponse( /** * Deletes a 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 context The context to associate with this operation. @@ -110,7 +112,7 @@ Response getByResourceGroupWithResponse( /** * Lists the access key for 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. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,12 +124,12 @@ Response getByResourceGroupWithResponse( /** * Lists the access key for 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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. @@ -138,7 +140,7 @@ Response getByResourceGroupWithResponse( /** * Regenerates an access key for 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 regenerateKeyParameters The parameters for regenerating an access key. @@ -148,15 +150,12 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an API key used for authenticating with a configuration store endpoint along with {@link Response}. */ - Response regenerateKeyWithResponse( - String resourceGroupName, - String configStoreName, - RegenerateKeyParameters regenerateKeyParameters, - Context context); + Response regenerateKeyWithResponse(String resourceGroupName, String configStoreName, + RegenerateKeyParameters regenerateKeyParameters, Context context); /** * Regenerates an access key for 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 regenerateKeyParameters The parameters for regenerating an access key. @@ -165,34 +164,91 @@ Response regenerateKeyWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an API key used for authenticating with a configuration store endpoint. */ - ApiKey regenerateKey( - String resourceGroupName, String configStoreName, RegenerateKeyParameters regenerateKeyParameters); + 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 all SAS tokens of a given kind (primary/secondary). + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasTokensParameters The object containing information for the SAS token 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 {@link Response}. + */ + Response resetSasTokensWithResponse(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters, Context context); + + /** + * Reset all SAS tokens of a given kind (primary/secondary). + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param configStoreName The name of the configuration store. + * @param resetSasTokensParameters The object containing information for the SAS token 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. + */ + void resetSasTokens(String resourceGroupName, String configStoreName, + ResetSasTokensParameters resetSasTokensParameters); /** * Gets information about the deleted configuration stores in a subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted configuration stores in a subscription as paginated response with {@link - * PagedIterable}. + * @return information about the deleted configuration stores in a subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable listDeleted(); /** * Gets information about the deleted configuration stores in a subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about the deleted configuration stores in a subscription as paginated response with {@link - * PagedIterable}. + * @return information about the deleted configuration stores in a subscription as paginated response with + * {@link PagedIterable}. */ PagedIterable listDeleted(Context context); /** * Gets a deleted Azure app configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. @@ -201,12 +257,12 @@ ApiKey regenerateKey( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a deleted Azure app configuration store along with {@link Response}. */ - Response getDeletedWithResponse( - String location, String configStoreName, Context context); + Response getDeletedWithResponse(String location, String configStoreName, + Context context); /** * Gets a deleted Azure app configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -218,7 +274,7 @@ Response getDeletedWithResponse( /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -229,7 +285,7 @@ Response getDeletedWithResponse( /** * Permanently deletes the specified configuration store. - * + * * @param location The location in which uniqueness will be verified. * @param configStoreName The name of the configuration store. * @param context The context to associate with this operation. @@ -241,7 +297,7 @@ Response getDeletedWithResponse( /** * Gets the properties of the specified configuration store. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -252,7 +308,7 @@ Response getDeletedWithResponse( /** * Gets the properties of the specified configuration store. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -264,7 +320,7 @@ Response getDeletedWithResponse( /** * Deletes a configuration store. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -274,7 +330,7 @@ Response getDeletedWithResponse( /** * Deletes a configuration store. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -285,7 +341,7 @@ Response getDeletedWithResponse( /** * Begins definition for a new ConfigurationStore resource. - * + * * @param name resource name. * @return the first stage of the new ConfigurationStore definition. */ diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConnectionStatus.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConnectionStatus.java index 34120f28e73dc..64b266239ee3c 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConnectionStatus.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConnectionStatus.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The private link service connection status. */ +/** + * The private link service connection status. + */ public final class ConnectionStatus extends ExpandableStringEnum { - /** Static value Pending for ConnectionStatus. */ + /** + * Static value Pending for ConnectionStatus. + */ public static final ConnectionStatus PENDING = fromString("Pending"); - /** Static value Approved for ConnectionStatus. */ + /** + * Static value Approved for ConnectionStatus. + */ public static final ConnectionStatus APPROVED = fromString("Approved"); - /** Static value Rejected for ConnectionStatus. */ + /** + * Static value Rejected for ConnectionStatus. + */ public static final ConnectionStatus REJECTED = fromString("Rejected"); - /** Static value Disconnected for ConnectionStatus. */ + /** + * Static value Disconnected for ConnectionStatus. + */ public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); /** * Creates a new instance of ConnectionStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public ConnectionStatus() { /** * Creates or finds a ConnectionStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ConnectionStatus. */ - @JsonCreator public static ConnectionStatus fromString(String name) { return fromString(name, ConnectionStatus.class); } /** * Gets known ConnectionStatus values. - * + * * @return known ConnectionStatus values. */ public static Collection values() { diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CreateMode.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CreateMode.java index e6934c6dad827..226da02844fc0 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CreateMode.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/CreateMode.java @@ -4,18 +4,23 @@ package com.azure.resourcemanager.appconfiguration.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Indicates whether the configuration store need to be recovered. */ +/** + * Indicates whether the configuration store need to be recovered. + */ public enum CreateMode { - /** Enum value Recover. */ + /** + * Enum value Recover. + */ RECOVER("Recover"), - /** Enum value Default. */ + /** + * Enum value Default. + */ DEFAULT("Default"); - /** The actual serialized value for a CreateMode instance. */ + /** + * The actual serialized value for a CreateMode instance. + */ private final String value; CreateMode(String value) { @@ -24,11 +29,10 @@ public enum CreateMode { /** * Parses a serialized value to a CreateMode instance. - * + * * @param value the serialized value to parse. * @return the parsed CreateMode object, or null if unable to parse. */ - @JsonCreator public static CreateMode fromString(String value) { if (value == null) { return null; @@ -42,8 +46,9 @@ public static CreateMode fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DataPlaneProxyProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DataPlaneProxyProperties.java new file mode 100644 index 0000000000000..cee043b5c71d3 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DataPlaneProxyProperties.java @@ -0,0 +1,131 @@ +// 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; + +/** + * The data plane proxy settings for a configuration store. + */ +@Fluent +public final class DataPlaneProxyProperties implements JsonSerializable { + /* + * The data plane proxy authentication mode. This property manages the authentication mode of request to the data + * plane resources. + */ + private AuthenticationMode authenticationMode; + + /* + * The data plane proxy private link delegation. This property manages if a request from delegated ARM private link + * is allowed when the data plane resource requires private link. + */ + private PrivateLinkDelegation privateLinkDelegation; + + /** + * Creates an instance of DataPlaneProxyProperties class. + */ + public DataPlaneProxyProperties() { + } + + /** + * Get the authenticationMode property: The data plane proxy authentication mode. This property manages the + * authentication mode of request to the data plane resources. + * + * @return the authenticationMode value. + */ + public AuthenticationMode authenticationMode() { + return this.authenticationMode; + } + + /** + * Set the authenticationMode property: The data plane proxy authentication mode. This property manages the + * authentication mode of request to the data plane resources. + * + * @param authenticationMode the authenticationMode value to set. + * @return the DataPlaneProxyProperties object itself. + */ + public DataPlaneProxyProperties withAuthenticationMode(AuthenticationMode authenticationMode) { + this.authenticationMode = authenticationMode; + return this; + } + + /** + * Get the privateLinkDelegation property: The data plane proxy private link delegation. This property manages if a + * request from delegated ARM private link is allowed when the data plane resource requires private link. + * + * @return the privateLinkDelegation value. + */ + public PrivateLinkDelegation privateLinkDelegation() { + return this.privateLinkDelegation; + } + + /** + * Set the privateLinkDelegation property: The data plane proxy private link delegation. This property manages if a + * request from delegated ARM private link is allowed when the data plane resource requires private link. + * + * @param privateLinkDelegation the privateLinkDelegation value to set. + * @return the DataPlaneProxyProperties object itself. + */ + public DataPlaneProxyProperties withPrivateLinkDelegation(PrivateLinkDelegation privateLinkDelegation) { + this.privateLinkDelegation = privateLinkDelegation; + 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("authenticationMode", + this.authenticationMode == null ? null : this.authenticationMode.toString()); + jsonWriter.writeStringField("privateLinkDelegation", + this.privateLinkDelegation == null ? null : this.privateLinkDelegation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataPlaneProxyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataPlaneProxyProperties 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 DataPlaneProxyProperties. + */ + public static DataPlaneProxyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataPlaneProxyProperties deserializedDataPlaneProxyProperties = new DataPlaneProxyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authenticationMode".equals(fieldName)) { + deserializedDataPlaneProxyProperties.authenticationMode + = AuthenticationMode.fromString(reader.getString()); + } else if ("privateLinkDelegation".equals(fieldName)) { + deserializedDataPlaneProxyProperties.privateLinkDelegation + = PrivateLinkDelegation.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataPlaneProxyProperties; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DeletedConfigurationStore.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DeletedConfigurationStore.java index 5a16f89f072b5..a59f2721d7b9b 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DeletedConfigurationStore.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DeletedConfigurationStore.java @@ -8,74 +8,76 @@ import java.time.OffsetDateTime; import java.util.Map; -/** An immutable client-side representation of DeletedConfigurationStore. */ +/** + * An immutable client-side representation of DeletedConfigurationStore. + */ public interface DeletedConfigurationStore { /** * Gets the id property: The resource ID for the deleted configuration store. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the configuration store. - * + * * @return the name value. */ String name(); /** * Gets the type property: The resource type of the configuration store. - * + * * @return the type value. */ String type(); /** * Gets the configurationStoreId property: The resource id of the original configuration store. - * + * * @return the configurationStoreId value. */ String configurationStoreId(); /** * Gets the location property: The location of the original configuration store. - * + * * @return the location value. */ String location(); /** * Gets the deletionDate property: The deleted date. - * + * * @return the deletionDate value. */ OffsetDateTime deletionDate(); /** * Gets the scheduledPurgeDate property: The scheduled purged date. - * + * * @return the scheduledPurgeDate value. */ OffsetDateTime scheduledPurgeDate(); /** * Gets the tags property: Tags of the original configuration store. - * + * * @return the tags value. */ Map tags(); /** * Gets the purgeProtectionEnabled property: Purge protection status of the original configuration store. - * + * * @return the purgeProtectionEnabled value. */ Boolean purgeProtectionEnabled(); /** * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.DeletedConfigurationStoreInner object. - * + * * @return the inner object. */ DeletedConfigurationStoreInner innerModel(); diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DeletedConfigurationStoreListResult.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DeletedConfigurationStoreListResult.java index 914e38a4b2009..884a0ef6e3c2e 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DeletedConfigurationStoreListResult.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/DeletedConfigurationStoreListResult.java @@ -5,32 +5,39 @@ 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 com.azure.resourcemanager.appconfiguration.fluent.models.DeletedConfigurationStoreInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of deleted configuration stores. */ +/** + * List of deleted configuration stores. + */ @Fluent -public final class DeletedConfigurationStoreListResult { +public final class DeletedConfigurationStoreListResult + implements JsonSerializable { /* * The list of deleted configuration store. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of deleted configuration stores. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of DeletedConfigurationStoreListResult class. */ + /** + * Creates an instance of DeletedConfigurationStoreListResult class. + */ public DeletedConfigurationStoreListResult() { } /** * Get the value property: The list of deleted configuration store. - * + * * @return the value value. */ public List value() { @@ -39,7 +46,7 @@ public List value() { /** * Set the value property: The list of deleted configuration store. - * + * * @param value the value value to set. * @return the DeletedConfigurationStoreListResult object itself. */ @@ -50,7 +57,7 @@ public DeletedConfigurationStoreListResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedConfigurationStoreListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedConfigurationStoreListResult 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 DeletedConfigurationStoreListResult. + */ + public static DeletedConfigurationStoreListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedConfigurationStoreListResult deserializedDeletedConfigurationStoreListResult + = new DeletedConfigurationStoreListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DeletedConfigurationStoreInner.fromJson(reader1)); + deserializedDeletedConfigurationStoreListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDeletedConfigurationStoreListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedConfigurationStoreListResult; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/EncryptionProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/EncryptionProperties.java index 10c231ae710c3..2f0c238819d92 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/EncryptionProperties.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/EncryptionProperties.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 encryption settings for a configuration store. */ +/** + * The encryption settings for a configuration store. + */ @Fluent -public final class EncryptionProperties { +public final class EncryptionProperties implements JsonSerializable { /* * Key vault properties. */ - @JsonProperty(value = "keyVaultProperties") private KeyVaultProperties keyVaultProperties; - /** Creates an instance of EncryptionProperties class. */ + /** + * Creates an instance of EncryptionProperties class. + */ public EncryptionProperties() { } /** * Get the keyVaultProperties property: Key vault properties. - * + * * @return the keyVaultProperties value. */ public KeyVaultProperties keyVaultProperties() { @@ -31,7 +38,7 @@ public KeyVaultProperties keyVaultProperties() { /** * Set the keyVaultProperties property: Key vault properties. - * + * * @param keyVaultProperties the keyVaultProperties value to set. * @return the EncryptionProperties object itself. */ @@ -42,7 +49,7 @@ public EncryptionProperties withKeyVaultProperties(KeyVaultProperties keyVaultPr /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { keyVaultProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("keyVaultProperties", this.keyVaultProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionProperties 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 EncryptionProperties. + */ + public static EncryptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionProperties deserializedEncryptionProperties = new EncryptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultProperties".equals(fieldName)) { + deserializedEncryptionProperties.keyVaultProperties = KeyVaultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionProperties; + }); + } } 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 0000000000000..5ed41ba627195 --- /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/IdentityType.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/IdentityType.java index f7d062ca7f909..0221fe7b5e93a 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/IdentityType.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/IdentityType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,21 +12,29 @@ * identity and a set of user-assigned identities. The type 'None' will remove any identities. */ public final class IdentityType extends ExpandableStringEnum { - /** Static value None for IdentityType. */ + /** + * Static value None for IdentityType. + */ public static final IdentityType NONE = fromString("None"); - /** Static value SystemAssigned for IdentityType. */ + /** + * Static value SystemAssigned for IdentityType. + */ public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - /** Static value UserAssigned for IdentityType. */ + /** + * Static value UserAssigned for IdentityType. + */ public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); - /** Static value SystemAssigned, UserAssigned for IdentityType. */ + /** + * Static value SystemAssigned, UserAssigned for IdentityType. + */ public static final IdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned, UserAssigned"); /** * Creates a new instance of IdentityType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +43,17 @@ public IdentityType() { /** * Creates or finds a IdentityType from its string representation. - * + * * @param name a name to look for. * @return the corresponding IdentityType. */ - @JsonCreator public static IdentityType fromString(String name) { return fromString(name, IdentityType.class); } /** * Gets known IdentityType values. - * + * * @return known IdentityType values. */ public static Collection values() { diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValue.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValue.java index 5bb09a3903d63..111ce6b7f51cb 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValue.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValue.java @@ -9,123 +9,136 @@ import java.time.OffsetDateTime; import java.util.Map; -/** An immutable client-side representation of KeyValue. */ +/** + * An immutable client-side representation of KeyValue. + */ public interface KeyValue { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the key property: The primary identifier of a key-value. The key is used in unison with the label to - * uniquely identify a key-value. - * + * Gets the key property: The primary identifier of a key-value. + * The key is used in unison with the label to uniquely identify a key-value. + * * @return the key value. */ String key(); /** - * Gets the label property: A value used to group key-values. The label is used in unison with the key to uniquely - * identify a key-value. - * + * Gets the label property: A value used to group key-values. + * The label is used in unison with the key to uniquely identify a key-value. + * * @return the label value. */ String label(); /** * Gets the value property: The value of the key-value. - * + * * @return the value value. */ String value(); /** - * Gets the contentType property: The content type of the key-value's value. Providing a proper content-type can - * enable transformations of values when they are retrieved by applications. - * + * Gets the contentType property: The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values when they are retrieved by applications. + * * @return the contentType value. */ String contentType(); /** * Gets the etag property: An ETag indicating the state of a key-value within a configuration store. - * + * * @return the etag value. */ String etag(); /** * Gets the lastModified property: The last time a modifying operation was performed on the given key-value. - * + * * @return the lastModified value. */ OffsetDateTime lastModified(); /** - * Gets the locked property: A value indicating whether the key-value is locked. A locked key-value may not be - * modified until it is unlocked. - * + * Gets the locked property: A value indicating whether the key-value is locked. + * A locked key-value may not be modified until it is unlocked. + * * @return the locked value. */ Boolean locked(); /** * Gets the tags property: A dictionary of tags that can help identify what a key-value may be applicable for. - * + * * @return the tags value. */ Map tags(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.KeyValueInner object. - * + * * @return the inner object. */ KeyValueInner innerModel(); - /** The entirety of the KeyValue definition. */ + /** + * The entirety of the KeyValue definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The KeyValue definition stages. */ + + /** + * The KeyValue definition stages. + */ interface DefinitionStages { - /** The first stage of the KeyValue definition. */ + /** + * The first stage of the KeyValue definition. + */ interface Blank extends WithParentResource { } - /** The stage of the KeyValue definition allowing to specify parent resource. */ + + /** + * The stage of the KeyValue definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, configStoreName. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @return the next definition stage. */ WithCreate withExistingConfigurationStore(String resourceGroupName, String configStoreName); } + /** * The stage of the KeyValue definition which contains all the minimum required properties for the resource to * be created, but also allows for any other optional properties to be specified. @@ -134,123 +147,151 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithValue, DefinitionStages.WithContentType { /** * Executes the create request. - * + * * @return the created resource. */ KeyValue create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ KeyValue create(Context context); } - /** The stage of the KeyValue definition allowing to specify tags. */ + + /** + * The stage of the KeyValue definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: A dictionary of tags that can help identify what a key-value may be * applicable for.. - * + * * @param tags A dictionary of tags that can help identify what a key-value may be applicable for. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the KeyValue definition allowing to specify value. */ + + /** + * The stage of the KeyValue definition allowing to specify value. + */ interface WithValue { /** * Specifies the value property: The value of the key-value.. - * + * * @param value The value of the key-value. * @return the next definition stage. */ WithCreate withValue(String value); } - /** The stage of the KeyValue definition allowing to specify contentType. */ + + /** + * The stage of the KeyValue definition allowing to specify contentType. + */ interface WithContentType { /** - * Specifies the contentType property: The content type of the key-value's value. Providing a proper - * content-type can enable transformations of values when they are retrieved by applications.. - * - * @param contentType The content type of the key-value's value. Providing a proper content-type can enable - * transformations of values when they are retrieved by applications. + * Specifies the contentType property: The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values when they are retrieved by + * applications.. + * + * @param contentType The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values when they are retrieved by + * applications. * @return the next definition stage. */ WithCreate withContentType(String contentType); } } + /** * Begins update for the KeyValue resource. - * + * * @return the stage of resource update. */ KeyValue.Update update(); - /** The template for KeyValue update. */ + /** + * The template for KeyValue update. + */ interface Update extends UpdateStages.WithTags, UpdateStages.WithValue, UpdateStages.WithContentType { /** * Executes the update request. - * + * * @return the updated resource. */ KeyValue apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ KeyValue apply(Context context); } - /** The KeyValue update stages. */ + + /** + * The KeyValue update stages. + */ interface UpdateStages { - /** The stage of the KeyValue update allowing to specify tags. */ + /** + * The stage of the KeyValue update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: A dictionary of tags that can help identify what a key-value may be * applicable for.. - * + * * @param tags A dictionary of tags that can help identify what a key-value may be applicable for. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the KeyValue update allowing to specify value. */ + + /** + * The stage of the KeyValue update allowing to specify value. + */ interface WithValue { /** * Specifies the value property: The value of the key-value.. - * + * * @param value The value of the key-value. * @return the next definition stage. */ Update withValue(String value); } - /** The stage of the KeyValue update allowing to specify contentType. */ + + /** + * The stage of the KeyValue update allowing to specify contentType. + */ interface WithContentType { /** - * Specifies the contentType property: The content type of the key-value's value. Providing a proper - * content-type can enable transformations of values when they are retrieved by applications.. - * - * @param contentType The content type of the key-value's value. Providing a proper content-type can enable - * transformations of values when they are retrieved by applications. + * Specifies the contentType property: The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values when they are retrieved by + * applications.. + * + * @param contentType The content type of the key-value's value. + * Providing a proper content-type can enable transformations of values when they are retrieved by + * applications. * @return the next definition stage. */ Update withContentType(String contentType); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ KeyValue refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValueFilter.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValueFilter.java new file mode 100644 index 0000000000000..027e82b4f5fbb --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValueFilter.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +/** + * Enables filtering of key-values. + */ +@Fluent +public final class KeyValueFilter implements JsonSerializable { + /* + * Filters key-values by their key field. + */ + private String key; + + /* + * Filters key-values by their label field. + */ + private String label; + + /** + * Creates an instance of KeyValueFilter class. + */ + public KeyValueFilter() { + } + + /** + * Get the key property: Filters key-values by their key field. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: Filters key-values by their key field. + * + * @param key the key value to set. + * @return the KeyValueFilter object itself. + */ + public KeyValueFilter withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the label property: Filters key-values by their label field. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Filters key-values by their label field. + * + * @param label the label value to set. + * @return the KeyValueFilter object itself. + */ + public KeyValueFilter withLabel(String label) { + this.label = label; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (key() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property key in model KeyValueFilter")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyValueFilter.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("label", this.label); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyValueFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyValueFilter 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 KeyValueFilter. + */ + public static KeyValueFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyValueFilter deserializedKeyValueFilter = new KeyValueFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedKeyValueFilter.key = reader.getString(); + } else if ("label".equals(fieldName)) { + deserializedKeyValueFilter.label = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyValueFilter; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValues.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValues.java index 174491c40d04a..22390f085638c 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValues.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyValues.java @@ -7,31 +7,37 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of KeyValues. */ +/** + * Resource collection API of KeyValues. + */ public interface KeyValues { /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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 properties of the specified key-value along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String configStoreName, String keyValueName, Context context); + Response getWithResponse(String resourceGroupName, String configStoreName, String keyValueName, + Context context); /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -40,12 +46,13 @@ Response getWithResponse( KeyValue get(String resourceGroupName, String configStoreName, String keyValueName); /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -53,12 +60,13 @@ Response getWithResponse( void delete(String resourceGroupName, String configStoreName, String keyValueName); /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param keyValueName Identifier of key and label combination. Key and label are joined by $ character. Label is - * optional. + * optional. * @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. @@ -67,8 +75,10 @@ Response getWithResponse( void delete(String resourceGroupName, String configStoreName, String keyValueName, Context context); /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -78,8 +88,10 @@ Response getWithResponse( KeyValue getById(String id); /** - * Gets the properties of the specified key-value. - * + * Gets the properties of the specified key-value. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration key-values the data plane API should be used + * instead. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -90,8 +102,9 @@ Response getWithResponse( Response getByIdWithResponse(String id, Context context); /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -100,8 +113,9 @@ Response getWithResponse( void deleteById(String id); /** - * Deletes a key-value. - * + * Deletes a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other + * scenarios involving App Configuration key-values the data plane API should be used instead. + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -112,7 +126,7 @@ Response getWithResponse( /** * Begins definition for a new KeyValue resource. - * + * * @param name resource name. * @return the first stage of the new KeyValue definition. */ diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyVaultProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyVaultProperties.java index cc359b18b6685..65d4214b05a13 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyVaultProperties.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KeyVaultProperties.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Settings concerning key vault encryption for a configuration store. */ +/** + * Settings concerning key vault encryption for a configuration store. + */ @Fluent -public final class KeyVaultProperties { +public final class KeyVaultProperties implements JsonSerializable { /* * The URI of the key vault key used to encrypt data. */ - @JsonProperty(value = "keyIdentifier") private String keyIdentifier; /* * The client id of the identity which will be used to access key vault. */ - @JsonProperty(value = "identityClientId") private String identityClientId; - /** Creates an instance of KeyVaultProperties class. */ + /** + * Creates an instance of KeyVaultProperties class. + */ public KeyVaultProperties() { } /** * Get the keyIdentifier property: The URI of the key vault key used to encrypt data. - * + * * @return the keyIdentifier value. */ public String keyIdentifier() { @@ -37,7 +43,7 @@ public String keyIdentifier() { /** * Set the keyIdentifier property: The URI of the key vault key used to encrypt data. - * + * * @param keyIdentifier the keyIdentifier value to set. * @return the KeyVaultProperties object itself. */ @@ -48,7 +54,7 @@ public KeyVaultProperties withKeyIdentifier(String keyIdentifier) { /** * Get the identityClientId property: The client id of the identity which will be used to access key vault. - * + * * @return the identityClientId value. */ public String identityClientId() { @@ -57,7 +63,7 @@ public String identityClientId() { /** * Set the identityClientId property: The client id of the identity which will be used to access key vault. - * + * * @param identityClientId the identityClientId value to set. * @return the KeyVaultProperties object itself. */ @@ -68,9 +74,48 @@ public KeyVaultProperties withIdentityClientId(String identityClientId) { /** * 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("keyIdentifier", this.keyIdentifier); + jsonWriter.writeStringField("identityClientId", this.identityClientId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultProperties 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 KeyVaultProperties. + */ + public static KeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultProperties deserializedKeyVaultProperties = new KeyVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyIdentifier".equals(fieldName)) { + deserializedKeyVaultProperties.keyIdentifier = reader.getString(); + } else if ("identityClientId".equals(fieldName)) { + deserializedKeyVaultProperties.identityClientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultProperties; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KvResourceParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KvResourceParameters.java new file mode 100644 index 0000000000000..7a9c881fdf710 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/KvResourceParameters.java @@ -0,0 +1,176 @@ +// 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 parameters to define the key value resource scope that the SAS token is authorized to access. + */ +@Fluent +public final class KvResourceParameters extends ResourceParameters { + /* + * 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 KvResourceParameters class. + */ + public KvResourceParameters() { + } + + /** + * 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 KvResourceParameters object itself. + */ + public KvResourceParameters 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 KvResourceParameters object itself. + */ + public KvResourceParameters 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 KvResourceParameters object itself. + */ + public KvResourceParameters withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.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 KvResourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KvResourceParameters 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 KvResourceParameters. + */ + public static KvResourceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KvResourceParameters deserializedKvResourceParameters = new KvResourceParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedKvResourceParameters.resourceType = ResourceType.fromString(reader.getString()); + } else if ("key".equals(fieldName)) { + deserializedKvResourceParameters.key = reader.getString(); + } else if ("label".equals(fieldName)) { + deserializedKvResourceParameters.label = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> reader1.getString()); + deserializedKvResourceParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedKvResourceParameters; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/LogSpecification.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/LogSpecification.java index c610779ce22e0..2caba17a20532 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/LogSpecification.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/LogSpecification.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Specifications of the Log for Azure Monitoring. */ +/** + * Specifications of the Log for Azure Monitoring. + */ @Fluent -public final class LogSpecification { +public final class LogSpecification implements JsonSerializable { /* * Name of the log */ - @JsonProperty(value = "name") private String name; /* * Localized friendly display name of the log */ - @JsonProperty(value = "displayName") private String displayName; /* * Blob duration of the log */ - @JsonProperty(value = "blobDuration") private String blobDuration; - /** Creates an instance of LogSpecification class. */ + /** + * Creates an instance of LogSpecification class. + */ public LogSpecification() { } /** * Get the name property: Name of the log. - * + * * @return the name value. */ public String name() { @@ -43,7 +48,7 @@ public String name() { /** * Set the name property: Name of the log. - * + * * @param name the name value to set. * @return the LogSpecification object itself. */ @@ -54,7 +59,7 @@ public LogSpecification withName(String name) { /** * Get the displayName property: Localized friendly display name of the log. - * + * * @return the displayName value. */ public String displayName() { @@ -63,7 +68,7 @@ public String displayName() { /** * Set the displayName property: Localized friendly display name of the log. - * + * * @param displayName the displayName value to set. * @return the LogSpecification object itself. */ @@ -74,7 +79,7 @@ public LogSpecification withDisplayName(String displayName) { /** * Get the blobDuration property: Blob duration of the log. - * + * * @return the blobDuration value. */ public String blobDuration() { @@ -83,7 +88,7 @@ public String blobDuration() { /** * Set the blobDuration property: Blob duration of the log. - * + * * @param blobDuration the blobDuration value to set. * @return the LogSpecification object itself. */ @@ -94,9 +99,51 @@ public LogSpecification withBlobDuration(String blobDuration) { /** * 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("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("blobDuration", this.blobDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogSpecification 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 LogSpecification. + */ + public static LogSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogSpecification deserializedLogSpecification = new LogSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLogSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedLogSpecification.displayName = reader.getString(); + } else if ("blobDuration".equals(fieldName)) { + deserializedLogSpecification.blobDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogSpecification; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/MetricDimension.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/MetricDimension.java index 6fa515df4a3c3..ccbc6748b3d56 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/MetricDimension.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/MetricDimension.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Specifications of the Dimension of metrics. */ +/** + * Specifications of the Dimension of metrics. + */ @Fluent -public final class MetricDimension { +public final class MetricDimension implements JsonSerializable { /* * Name of the dimension */ - @JsonProperty(value = "name") private String name; /* * Localized friendly display name of the dimension */ - @JsonProperty(value = "displayName") private String displayName; /* * Internal name of the dimension. */ - @JsonProperty(value = "internalName") private String internalName; - /** Creates an instance of MetricDimension class. */ + /** + * Creates an instance of MetricDimension class. + */ public MetricDimension() { } /** * Get the name property: Name of the dimension. - * + * * @return the name value. */ public String name() { @@ -43,7 +48,7 @@ public String name() { /** * Set the name property: Name of the dimension. - * + * * @param name the name value to set. * @return the MetricDimension object itself. */ @@ -54,7 +59,7 @@ public MetricDimension withName(String name) { /** * Get the displayName property: Localized friendly display name of the dimension. - * + * * @return the displayName value. */ public String displayName() { @@ -63,7 +68,7 @@ public String displayName() { /** * Set the displayName property: Localized friendly display name of the dimension. - * + * * @param displayName the displayName value to set. * @return the MetricDimension object itself. */ @@ -74,7 +79,7 @@ public MetricDimension withDisplayName(String displayName) { /** * Get the internalName property: Internal name of the dimension. - * + * * @return the internalName value. */ public String internalName() { @@ -83,7 +88,7 @@ public String internalName() { /** * Set the internalName property: Internal name of the dimension. - * + * * @param internalName the internalName value to set. * @return the MetricDimension object itself. */ @@ -94,9 +99,51 @@ public MetricDimension withInternalName(String internalName) { /** * 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("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("internalName", this.internalName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricDimension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricDimension 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 MetricDimension. + */ + public static MetricDimension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricDimension deserializedMetricDimension = new MetricDimension(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetricDimension.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMetricDimension.displayName = reader.getString(); + } else if ("internalName".equals(fieldName)) { + deserializedMetricDimension.internalName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricDimension; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/MetricSpecification.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/MetricSpecification.java index b27167f4cb320..a5baafcd1be8b 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/MetricSpecification.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/MetricSpecification.java @@ -5,67 +5,67 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; -/** Specifications of the Metrics for Azure Monitoring. */ +/** + * Specifications of the Metrics for Azure Monitoring. + */ @Fluent -public final class MetricSpecification { +public final class MetricSpecification implements JsonSerializable { /* * Name of the metric */ - @JsonProperty(value = "name") private String name; /* * Localized friendly display name of the metric */ - @JsonProperty(value = "displayName") private String displayName; /* * Localized friendly description of the metric */ - @JsonProperty(value = "displayDescription") private String displayDescription; /* * Unit that makes sense for the metric */ - @JsonProperty(value = "unit") private String unit; /* * Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. */ - @JsonProperty(value = "aggregationType") private String aggregationType; /* * Internal metric name. */ - @JsonProperty(value = "internalMetricName") private String internalMetricName; /* * Dimensions of the metric */ - @JsonProperty(value = "dimensions") private List dimensions; /* * Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. */ - @JsonProperty(value = "fillGapWithZero") private Boolean fillGapWithZero; - /** Creates an instance of MetricSpecification class. */ + /** + * Creates an instance of MetricSpecification class. + */ public MetricSpecification() { } /** * Get the name property: Name of the metric. - * + * * @return the name value. */ public String name() { @@ -74,7 +74,7 @@ public String name() { /** * Set the name property: Name of the metric. - * + * * @param name the name value to set. * @return the MetricSpecification object itself. */ @@ -85,7 +85,7 @@ public MetricSpecification withName(String name) { /** * Get the displayName property: Localized friendly display name of the metric. - * + * * @return the displayName value. */ public String displayName() { @@ -94,7 +94,7 @@ public String displayName() { /** * Set the displayName property: Localized friendly display name of the metric. - * + * * @param displayName the displayName value to set. * @return the MetricSpecification object itself. */ @@ -105,7 +105,7 @@ public MetricSpecification withDisplayName(String displayName) { /** * Get the displayDescription property: Localized friendly description of the metric. - * + * * @return the displayDescription value. */ public String displayDescription() { @@ -114,7 +114,7 @@ public String displayDescription() { /** * Set the displayDescription property: Localized friendly description of the metric. - * + * * @param displayDescription the displayDescription value to set. * @return the MetricSpecification object itself. */ @@ -125,7 +125,7 @@ public MetricSpecification withDisplayDescription(String displayDescription) { /** * Get the unit property: Unit that makes sense for the metric. - * + * * @return the unit value. */ public String unit() { @@ -134,7 +134,7 @@ public String unit() { /** * Set the unit property: Unit that makes sense for the metric. - * + * * @param unit the unit value to set. * @return the MetricSpecification object itself. */ @@ -146,7 +146,7 @@ public MetricSpecification withUnit(String unit) { /** * Get the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, * Total, Count. - * + * * @return the aggregationType value. */ public String aggregationType() { @@ -156,7 +156,7 @@ public String aggregationType() { /** * Set the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, * Total, Count. - * + * * @param aggregationType the aggregationType value to set. * @return the MetricSpecification object itself. */ @@ -167,7 +167,7 @@ public MetricSpecification withAggregationType(String aggregationType) { /** * Get the internalMetricName property: Internal metric name. - * + * * @return the internalMetricName value. */ public String internalMetricName() { @@ -176,7 +176,7 @@ public String internalMetricName() { /** * Set the internalMetricName property: Internal metric name. - * + * * @param internalMetricName the internalMetricName value to set. * @return the MetricSpecification object itself. */ @@ -187,7 +187,7 @@ public MetricSpecification withInternalMetricName(String internalMetricName) { /** * Get the dimensions property: Dimensions of the metric. - * + * * @return the dimensions value. */ public List dimensions() { @@ -196,7 +196,7 @@ public List dimensions() { /** * Set the dimensions property: Dimensions of the metric. - * + * * @param dimensions the dimensions value to set. * @return the MetricSpecification object itself. */ @@ -208,7 +208,7 @@ public MetricSpecification withDimensions(List dimensions) { /** * Get the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no * metric is emitted/published. - * + * * @return the fillGapWithZero value. */ public Boolean fillGapWithZero() { @@ -218,7 +218,7 @@ public Boolean fillGapWithZero() { /** * Set the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no * metric is emitted/published. - * + * * @param fillGapWithZero the fillGapWithZero value to set. * @return the MetricSpecification object itself. */ @@ -229,7 +229,7 @@ public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -237,4 +237,62 @@ public void validate() { dimensions().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("displayDescription", this.displayDescription); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeStringField("aggregationType", this.aggregationType); + jsonWriter.writeStringField("internalMetricName", this.internalMetricName); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("fillGapWithZero", this.fillGapWithZero); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricSpecification 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 MetricSpecification. + */ + public static MetricSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricSpecification deserializedMetricSpecification = new MetricSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetricSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMetricSpecification.displayName = reader.getString(); + } else if ("displayDescription".equals(fieldName)) { + deserializedMetricSpecification.displayDescription = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedMetricSpecification.unit = reader.getString(); + } else if ("aggregationType".equals(fieldName)) { + deserializedMetricSpecification.aggregationType = reader.getString(); + } else if ("internalMetricName".equals(fieldName)) { + deserializedMetricSpecification.internalMetricName = reader.getString(); + } else if ("dimensions".equals(fieldName)) { + List dimensions = reader.readArray(reader1 -> MetricDimension.fromJson(reader1)); + deserializedMetricSpecification.dimensions = dimensions; + } else if ("fillGapWithZero".equals(fieldName)) { + deserializedMetricSpecification.fillGapWithZero = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricSpecification; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/NameAvailabilityStatus.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/NameAvailabilityStatus.java index b30da4778e2f2..0b34b3e833b9d 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/NameAvailabilityStatus.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/NameAvailabilityStatus.java @@ -6,11 +6,13 @@ import com.azure.resourcemanager.appconfiguration.fluent.models.NameAvailabilityStatusInner; -/** An immutable client-side representation of NameAvailabilityStatus. */ +/** + * An immutable client-side representation of NameAvailabilityStatus. + */ public interface NameAvailabilityStatus { /** * Gets the nameAvailable property: The value indicating whether the resource name is available. - * + * * @return the nameAvailable value. */ Boolean nameAvailable(); @@ -18,21 +20,21 @@ public interface NameAvailabilityStatus { /** * Gets the message property: If any, the error message that provides more detail for the reason that the name is * not available. - * + * * @return the message value. */ String message(); /** * Gets the reason property: If any, the reason that the name is not available. - * + * * @return the reason value. */ String reason(); /** * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.NameAvailabilityStatusInner object. - * + * * @return the inner object. */ NameAvailabilityStatusInner innerModel(); diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinition.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinition.java index fd8968790487c..c4562846be7a1 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinition.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinition.java @@ -6,46 +6,48 @@ import com.azure.resourcemanager.appconfiguration.fluent.models.OperationDefinitionInner; -/** An immutable client-side representation of OperationDefinition. */ +/** + * An immutable client-side representation of OperationDefinition. + */ public interface OperationDefinition { /** * Gets the name property: Operation name: {provider}/{resource}/{operation}. - * + * * @return the name value. */ String name(); /** * Gets the isDataAction property: Indicates whether the operation is a data action. - * + * * @return the isDataAction value. */ Boolean isDataAction(); /** * Gets the display property: The display information for the configuration store operation. - * + * * @return the display value. */ OperationDefinitionDisplay display(); /** * Gets the origin property: Origin of the operation. - * + * * @return the origin value. */ String origin(); /** * Gets the properties property: Properties of the operation. - * + * * @return the properties value. */ OperationProperties properties(); /** * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.OperationDefinitionInner object. - * + * * @return the inner object. */ OperationDefinitionInner innerModel(); diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinitionDisplay.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinitionDisplay.java index 5cd85d86ad3f5..f712f3472f2c5 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinitionDisplay.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinitionDisplay.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 display information for a configuration store operation. */ +/** + * The display information for a configuration store operation. + */ @Fluent -public final class OperationDefinitionDisplay { +public final class OperationDefinitionDisplay implements JsonSerializable { /* * The resource provider name: Microsoft App Configuration." */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* * The resource on which the operation is performed. */ - @JsonProperty(value = "resource") private String resource; /* * The operation that users can perform. */ - @JsonProperty(value = "operation") private String operation; /* * The description for the operation. */ - @JsonProperty(value = "description") private String description; - /** Creates an instance of OperationDefinitionDisplay class. */ + /** + * Creates an instance of OperationDefinitionDisplay class. + */ public OperationDefinitionDisplay() { } /** * Get the provider property: The resource provider name: Microsoft App Configuration.". - * + * * @return the provider value. */ public String provider() { @@ -49,7 +53,7 @@ public String provider() { /** * Get the resource property: The resource on which the operation is performed. - * + * * @return the resource value. */ public String resource() { @@ -58,7 +62,7 @@ public String resource() { /** * Set the resource property: The resource on which the operation is performed. - * + * * @param resource the resource value to set. * @return the OperationDefinitionDisplay object itself. */ @@ -69,7 +73,7 @@ public OperationDefinitionDisplay withResource(String resource) { /** * Get the operation property: The operation that users can perform. - * + * * @return the operation value. */ public String operation() { @@ -78,7 +82,7 @@ public String operation() { /** * Set the operation property: The operation that users can perform. - * + * * @param operation the operation value to set. * @return the OperationDefinitionDisplay object itself. */ @@ -89,7 +93,7 @@ public OperationDefinitionDisplay withOperation(String operation) { /** * Get the description property: The description for the operation. - * + * * @return the description value. */ public String description() { @@ -98,7 +102,7 @@ public String description() { /** * Set the description property: The description for the operation. - * + * * @param description the description value to set. * @return the OperationDefinitionDisplay object itself. */ @@ -109,9 +113,53 @@ public OperationDefinitionDisplay withDescription(String description) { /** * 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("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDefinitionDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDefinitionDisplay 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 OperationDefinitionDisplay. + */ + public static OperationDefinitionDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDefinitionDisplay deserializedOperationDefinitionDisplay = new OperationDefinitionDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDefinitionDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDefinitionDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDefinitionDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDefinitionDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDefinitionDisplay; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinitionListResult.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinitionListResult.java index c055051163fe1..9ead4b05f3774 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinitionListResult.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationDefinitionListResult.java @@ -5,32 +5,38 @@ 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 com.azure.resourcemanager.appconfiguration.fluent.models.OperationDefinitionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The result of a request to list configuration store operations. */ +/** + * The result of a request to list configuration store operations. + */ @Fluent -public final class OperationDefinitionListResult { +public final class OperationDefinitionListResult implements JsonSerializable { /* * The collection value. */ - @JsonProperty(value = "value") private List value; /* * The URI that can be used to request the next set of paged results. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of OperationDefinitionListResult class. */ + /** + * Creates an instance of OperationDefinitionListResult class. + */ public OperationDefinitionListResult() { } /** * Get the value property: The collection value. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The collection value. - * + * * @param value the value value to set. * @return the OperationDefinitionListResult object itself. */ @@ -50,7 +56,7 @@ public OperationDefinitionListResult withValue(List va /** * Get the nextLink property: The URI that can be used to request the next set of paged results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URI that can be used to request the next set of paged results. - * + * * @param nextLink the nextLink value to set. * @return the OperationDefinitionListResult object itself. */ @@ -70,7 +76,7 @@ public OperationDefinitionListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,46 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDefinitionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDefinitionListResult 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 OperationDefinitionListResult. + */ + public static OperationDefinitionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDefinitionListResult deserializedOperationDefinitionListResult + = new OperationDefinitionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OperationDefinitionInner.fromJson(reader1)); + deserializedOperationDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationDefinitionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDefinitionListResult; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationProperties.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationProperties.java index 4e7673de43e71..1429288df9783 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationProperties.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/OperationProperties.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Extra Operation properties. */ +/** + * Extra Operation properties. + */ @Fluent -public final class OperationProperties { +public final class OperationProperties implements JsonSerializable { /* * Service specifications of the operation */ - @JsonProperty(value = "serviceSpecification") private ServiceSpecification serviceSpecification; - /** Creates an instance of OperationProperties class. */ + /** + * Creates an instance of OperationProperties class. + */ public OperationProperties() { } /** * Get the serviceSpecification property: Service specifications of the operation. - * + * * @return the serviceSpecification value. */ public ServiceSpecification serviceSpecification() { @@ -31,7 +38,7 @@ public ServiceSpecification serviceSpecification() { /** * Set the serviceSpecification property: Service specifications of the operation. - * + * * @param serviceSpecification the serviceSpecification value to set. * @return the OperationProperties object itself. */ @@ -42,7 +49,7 @@ public OperationProperties withServiceSpecification(ServiceSpecification service /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -50,4 +57,40 @@ public void validate() { serviceSpecification().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationProperties 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 OperationProperties. + */ + public static OperationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationProperties deserializedOperationProperties = new OperationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSpecification".equals(fieldName)) { + deserializedOperationProperties.serviceSpecification = ServiceSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationProperties; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Operations.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Operations.java index 30b53f49bf497..17dd434a001c5 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Operations.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Operations.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * Checks whether the configuration store name is available for use. - * + * * @param checkNameAvailabilityParameters The object containing information for the availability request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -25,7 +27,7 @@ Response checkNameAvailabilityWithResponse( /** * Checks whether the configuration store name is available for use. - * + * * @param checkNameAvailabilityParameters The object containing information for the availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -36,32 +38,32 @@ Response checkNameAvailabilityWithResponse( /** * Lists the operations available from this provider. - * + * * @throws com.azure.core.management.exception.ManagementException 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 list configuration store operations as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list configuration store operations as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * Lists the operations available from this provider. - * + * * @param skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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 list configuration store operations as paginated response with {@link - * PagedIterable}. + * @return the result of a request to list configuration store operations as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String skipToken, Context context); /** * Checks whether the configuration store name is available for use. - * + * * @param location The location in which uniqueness will be verified. * @param checkNameAvailabilityParameters The object containing information for the availability request. * @param context The context to associate with this operation. @@ -70,12 +72,12 @@ Response checkNameAvailabilityWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to check the availability of a resource name along with {@link Response}. */ - Response regionalCheckNameAvailabilityWithResponse( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context); + Response regionalCheckNameAvailabilityWithResponse(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context); /** * Checks whether the configuration store name is available for use. - * + * * @param location The location in which uniqueness will be verified. * @param checkNameAvailabilityParameters The object containing information for the availability request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -83,6 +85,6 @@ Response regionalCheckNameAvailabilityWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the result of a request to check the availability of a resource name. */ - NameAvailabilityStatus regionalCheckNameAvailability( - String location, CheckNameAvailabilityParameters checkNameAvailabilityParameters); + NameAvailabilityStatus regionalCheckNameAvailability(String location, + CheckNameAvailabilityParameters checkNameAvailabilityParameters); } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpoint.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpoint.java index 7a62f227e538d..d4fff81800b8a 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpoint.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpoint.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Private endpoint which a connection belongs to. */ +/** + * Private endpoint which a connection belongs to. + */ @Fluent -public final class PrivateEndpoint { +public final class PrivateEndpoint implements JsonSerializable { /* * The resource Id for private endpoint */ - @JsonProperty(value = "id") private String id; - /** Creates an instance of PrivateEndpoint class. */ + /** + * Creates an instance of PrivateEndpoint class. + */ public PrivateEndpoint() { } /** * Get the id property: The resource Id for private endpoint. - * + * * @return the id value. */ public String id() { @@ -31,7 +38,7 @@ public String id() { /** * Set the id property: The resource Id for private endpoint. - * + * * @param id the id value to set. * @return the PrivateEndpoint object itself. */ @@ -42,9 +49,45 @@ public PrivateEndpoint withId(String id) { /** * 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("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint 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 PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnection.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnection.java index 31c78f407334a..4f444388927f3 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnection.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnection.java @@ -7,39 +7,41 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.appconfiguration.fluent.models.PrivateEndpointConnectionInner; -/** An immutable client-side representation of PrivateEndpointConnection. */ +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ public interface PrivateEndpointConnection { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the provisioningState property: The provisioning status of the private endpoint connection. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the privateEndpoint property: The resource of private endpoint. - * + * * @return the privateEndpoint value. */ PrivateEndpoint privateEndpoint(); @@ -47,45 +49,56 @@ public interface PrivateEndpointConnection { /** * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the * connection between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.PrivateEndpointConnectionInner object. - * + * * @return the inner object. */ PrivateEndpointConnectionInner innerModel(); - /** The entirety of the PrivateEndpointConnection definition. */ + /** + * The entirety of the PrivateEndpointConnection definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The PrivateEndpointConnection definition stages. */ + + /** + * The PrivateEndpointConnection definition stages. + */ interface DefinitionStages { - /** The first stage of the PrivateEndpointConnection definition. */ + /** + * The first stage of the PrivateEndpointConnection definition. + */ interface Blank extends WithParentResource { } - /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, configStoreName. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @return the next definition stage. */ WithCreate withExistingConfigurationStore(String resourceGroupName, String configStoreName); } + /** * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for * the resource to be created, but also allows for any other optional properties to be specified. @@ -94,29 +107,33 @@ interface WithCreate extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { /** * Executes the create request. - * + * * @return the created resource. */ PrivateEndpointConnection create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ PrivateEndpointConnection create(Context context); } - /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. + */ interface WithPrivateEndpoint { /** * Specifies the privateEndpoint property: The resource of private endpoint.. - * + * * @param privateEndpoint The resource of private endpoint. * @return the next definition stage. */ WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); } + /** * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. */ @@ -124,75 +141,87 @@ interface WithPrivateLinkServiceConnectionState { /** * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of * the connection between service consumer and provider.. - * + * * @param privateLinkServiceConnectionState A collection of information about the state of the connection - * between service consumer and provider. + * between service consumer and provider. * @return the next definition stage. */ WithCreate withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState); } } + /** * Begins update for the PrivateEndpointConnection resource. - * + * * @return the stage of resource update. */ PrivateEndpointConnection.Update update(); - /** The template for PrivateEndpointConnection update. */ + /** + * The template for PrivateEndpointConnection update. + */ interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { /** * Executes the update request. - * + * * @return the updated resource. */ PrivateEndpointConnection apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ PrivateEndpointConnection apply(Context context); } - /** The PrivateEndpointConnection update stages. */ + + /** + * The PrivateEndpointConnection update stages. + */ interface UpdateStages { - /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. + */ interface WithPrivateEndpoint { /** * Specifies the privateEndpoint property: The resource of private endpoint.. - * + * * @param privateEndpoint The resource of private endpoint. * @return the next definition stage. */ Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); } - /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + + /** + * The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. + */ interface WithPrivateLinkServiceConnectionState { /** * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of * the connection between service consumer and provider.. - * + * * @param privateLinkServiceConnectionState A collection of information about the state of the connection - * between service consumer and provider. + * between service consumer and provider. * @return the next definition stage. */ Update withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ PrivateEndpointConnection refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnectionListResult.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnectionListResult.java index 7f78bca1336b0..93e87695f2b3a 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnectionListResult.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnectionListResult.java @@ -5,32 +5,39 @@ 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 com.azure.resourcemanager.appconfiguration.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A list of private endpoint connections. */ +/** + * A list of private endpoint connections. + */ @Fluent -public final class PrivateEndpointConnectionListResult { +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { /* * The collection value. */ - @JsonProperty(value = "value") private List value; /* * The URI that can be used to request the next set of paged results. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of PrivateEndpointConnectionListResult class. */ + /** + * Creates an instance of PrivateEndpointConnectionListResult class. + */ public PrivateEndpointConnectionListResult() { } /** * Get the value property: The collection value. - * + * * @return the value value. */ public List value() { @@ -39,7 +46,7 @@ public List value() { /** * Set the value property: The collection value. - * + * * @param value the value value to set. * @return the PrivateEndpointConnectionListResult object itself. */ @@ -50,7 +57,7 @@ public PrivateEndpointConnectionListResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult 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 PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnectionReference.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnectionReference.java index 078faebad9ef5..274d659ac0001 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnectionReference.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnectionReference.java @@ -5,43 +5,47 @@ 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 com.azure.resourcemanager.appconfiguration.fluent.models.PrivateEndpointConnectionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** A reference to a related private endpoint connection. */ +/** + * A reference to a related private endpoint connection. + */ @Fluent -public final class PrivateEndpointConnectionReference { +public final class PrivateEndpointConnectionReference implements JsonSerializable { /* * The resource ID. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The name of the resource. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The type of the resource. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * The properties of a private endpoint connection. */ - @JsonProperty(value = "properties") private PrivateEndpointConnectionProperties innerProperties; - /** Creates an instance of PrivateEndpointConnectionReference class. */ + /** + * Creates an instance of PrivateEndpointConnectionReference class. + */ public PrivateEndpointConnectionReference() { } /** * Get the id property: The resource ID. - * + * * @return the id value. */ public String id() { @@ -50,7 +54,7 @@ public String id() { /** * Get the name property: The name of the resource. - * + * * @return the name value. */ public String name() { @@ -59,7 +63,7 @@ public String name() { /** * Get the type property: The type of the resource. - * + * * @return the type value. */ public String type() { @@ -68,7 +72,7 @@ public String type() { /** * Get the innerProperties property: The properties of a private endpoint connection. - * + * * @return the innerProperties value. */ private PrivateEndpointConnectionProperties innerProperties() { @@ -77,7 +81,7 @@ private PrivateEndpointConnectionProperties innerProperties() { /** * Get the provisioningState property: The provisioning status of the private endpoint connection. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -86,7 +90,7 @@ public ProvisioningState provisioningState() { /** * Get the privateEndpoint property: The resource of private endpoint. - * + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -95,7 +99,7 @@ public PrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: The resource of private endpoint. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionReference object itself. */ @@ -110,7 +114,7 @@ public PrivateEndpointConnectionReference withPrivateEndpoint(PrivateEndpoint pr /** * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -120,12 +124,12 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection * between service consumer and provider. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionReference object itself. */ - public PrivateEndpointConnectionReference withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionReference + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { if (this.innerProperties() == null) { this.innerProperties = new PrivateEndpointConnectionProperties(); } @@ -135,7 +139,7 @@ public PrivateEndpointConnectionReference withPrivateLinkServiceConnectionState( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -143,4 +147,48 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionReference 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 PrivateEndpointConnectionReference. + */ + public static PrivateEndpointConnectionReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionReference deserializedPrivateEndpointConnectionReference + = new PrivateEndpointConnectionReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionReference.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionReference.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionReference.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionReference.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionReference; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnections.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnections.java index 78083e32b47c3..1fbdb4aeb9b8d 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnections.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateEndpointConnections.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of PrivateEndpointConnections. */ +/** + * Resource collection API of PrivateEndpointConnections. + */ public interface PrivateEndpointConnections { /** * Lists all private endpoint connections for a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface PrivateEndpointConnections { /** * Lists all private endpoint connections for a 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 context The context to associate with this operation. @@ -33,12 +35,12 @@ public interface PrivateEndpointConnections { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. */ - PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, Context context); + PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName, + Context context); /** * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName Private endpoint connection name. @@ -46,15 +48,15 @@ PagedIterable listByConfigurationStore( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the configuration store along with {@link - * Response}. + * @return the specified private endpoint connection associated with the configuration store along with + * {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context); + Response getWithResponse(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName, Context context); /** * Gets the specified private endpoint connection associated with the 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 privateEndpointConnectionName Private endpoint connection name. @@ -63,12 +65,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the configuration store. */ - PrivateEndpointConnection get( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName); + PrivateEndpointConnection get(String resourceGroupName, String configStoreName, + String privateEndpointConnectionName); /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -80,7 +82,7 @@ PrivateEndpointConnection get( /** * Deletes a private endpoint connection. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param privateEndpointConnectionName Private endpoint connection name. @@ -89,37 +91,37 @@ PrivateEndpointConnection get( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete( - String resourceGroupName, String configStoreName, String privateEndpointConnectionName, Context context); + void delete(String resourceGroupName, String configStoreName, String privateEndpointConnectionName, + Context context); /** * Gets the specified private endpoint connection associated with the configuration store. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the configuration store along with {@link - * Response}. + * @return the specified private endpoint connection associated with the configuration store along with + * {@link Response}. */ PrivateEndpointConnection getById(String id); /** * Gets the specified private endpoint connection associated with the configuration store. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the configuration store along with {@link - * Response}. + * @return the specified private endpoint connection associated with the configuration store along with + * {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** * Deletes a private endpoint connection. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -129,7 +131,7 @@ void delete( /** * Deletes a private endpoint connection. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,7 +142,7 @@ void delete( /** * Begins definition for a new PrivateEndpointConnection resource. - * + * * @param name resource name. * @return the first stage of the new PrivateEndpointConnection definition. */ diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkDelegation.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkDelegation.java new file mode 100644 index 0000000000000..52ff5a7bde8e5 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkDelegation.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The data plane proxy private link delegation. This property manages if a request from delegated ARM private link is + * allowed when the data plane resource requires private link. + */ +public final class PrivateLinkDelegation extends ExpandableStringEnum { + /** + * Static value Enabled for PrivateLinkDelegation. + */ + public static final PrivateLinkDelegation ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PrivateLinkDelegation. + */ + public static final PrivateLinkDelegation DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PrivateLinkDelegation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateLinkDelegation() { + } + + /** + * Creates or finds a PrivateLinkDelegation from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateLinkDelegation. + */ + public static PrivateLinkDelegation fromString(String name) { + return fromString(name, PrivateLinkDelegation.class); + } + + /** + * Gets known PrivateLinkDelegation values. + * + * @return known PrivateLinkDelegation values. + */ + public static Collection values() { + return values(PrivateLinkDelegation.class); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResource.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResource.java index 0f299272305cc..bfe807b688873 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResource.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResource.java @@ -7,53 +7,55 @@ import com.azure.resourcemanager.appconfiguration.fluent.models.PrivateLinkResourceInner; import java.util.List; -/** An immutable client-side representation of PrivateLinkResource. */ +/** + * An immutable client-side representation of PrivateLinkResource. + */ public interface PrivateLinkResource { /** * Gets the id property: The resource ID. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the groupId property: The private link resource group id. - * + * * @return the groupId value. */ String groupId(); /** * Gets the requiredMembers property: The private link resource required member names. - * + * * @return the requiredMembers value. */ List requiredMembers(); /** * Gets the requiredZoneNames property: The list of required DNS zone names of the private link resource. - * + * * @return the requiredZoneNames value. */ List requiredZoneNames(); /** * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.PrivateLinkResourceInner object. - * + * * @return the inner object. */ PrivateLinkResourceInner innerModel(); diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResourceListResult.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResourceListResult.java index 8780076621e70..aa5da08becbc6 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResourceListResult.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResourceListResult.java @@ -5,32 +5,38 @@ 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 com.azure.resourcemanager.appconfiguration.fluent.models.PrivateLinkResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A list of private link resources. */ +/** + * A list of private link resources. + */ @Fluent -public final class PrivateLinkResourceListResult { +public final class PrivateLinkResourceListResult implements JsonSerializable { /* * The collection value. */ - @JsonProperty(value = "value") private List value; /* * The URI that can be used to request the next set of paged results. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of PrivateLinkResourceListResult class. */ + /** + * Creates an instance of PrivateLinkResourceListResult class. + */ public PrivateLinkResourceListResult() { } /** * Get the value property: The collection value. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The collection value. - * + * * @param value the value value to set. * @return the PrivateLinkResourceListResult object itself. */ @@ -50,7 +56,7 @@ public PrivateLinkResourceListResult withValue(List va /** * Get the nextLink property: The URI that can be used to request the next set of paged results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URI that can be used to request the next set of paged results. - * + * * @param nextLink the nextLink value to set. * @return the PrivateLinkResourceListResult object itself. */ @@ -70,7 +76,7 @@ public PrivateLinkResourceListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,46 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResult 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 PrivateLinkResourceListResult. + */ + public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResult deserializedPrivateLinkResourceListResult + = new PrivateLinkResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResult; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResources.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResources.java index f348493d3587c..c77f24ca64cea 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResources.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkResources.java @@ -8,24 +8,26 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of PrivateLinkResources. */ +/** + * Resource collection API of PrivateLinkResources. + */ public interface PrivateLinkResources { /** * Gets the private link resources that need to be created for a configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a configuration store as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName); /** * Gets the private link resources that need to be created for a 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 context The context to associate with this operation. @@ -33,14 +35,14 @@ public interface PrivateLinkResources { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a configuration store as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ - PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, Context context); + PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName, + Context context); /** * Gets a private link resource that need to be created for a 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 groupName The name of the private link resource group. @@ -50,12 +52,12 @@ PagedIterable listByConfigurationStore( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a private link resource that need to be created for a configuration store along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String configStoreName, String groupName, Context context); + Response getWithResponse(String resourceGroupName, String configStoreName, String groupName, + Context context); /** * Gets a private link resource that need to be created for a 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 groupName The name of the private link resource group. diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkServiceConnectionState.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkServiceConnectionState.java index 95a645e6ab25a..b2b0d0af80f61 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkServiceConnectionState.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PrivateLinkServiceConnectionState.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 state of a private link service connection. */ +/** + * The state of a private link service connection. + */ @Fluent -public final class PrivateLinkServiceConnectionState { +public final class PrivateLinkServiceConnectionState implements JsonSerializable { /* * The private link service connection status. */ - @JsonProperty(value = "status") private ConnectionStatus status; /* * The private link service connection description. */ - @JsonProperty(value = "description") private String description; /* * Any action that is required beyond basic workflow (approve/ reject/ disconnect) */ - @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) private ActionsRequired actionsRequired; - /** Creates an instance of PrivateLinkServiceConnectionState class. */ + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ public PrivateLinkServiceConnectionState() { } /** * Get the status property: The private link service connection status. - * + * * @return the status value. */ public ConnectionStatus status() { @@ -43,7 +48,7 @@ public ConnectionStatus status() { /** * Set the status property: The private link service connection status. - * + * * @param status the status value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -54,7 +59,7 @@ public PrivateLinkServiceConnectionState withStatus(ConnectionStatus status) { /** * Get the description property: The private link service connection description. - * + * * @return the description value. */ public String description() { @@ -63,7 +68,7 @@ public String description() { /** * Set the description property: The private link service connection description. - * + * * @param description the description value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -75,7 +80,7 @@ public PrivateLinkServiceConnectionState withDescription(String description) { /** * Get the actionsRequired property: Any action that is required beyond basic workflow (approve/ reject/ * disconnect). - * + * * @return the actionsRequired value. */ public ActionsRequired actionsRequired() { @@ -84,9 +89,53 @@ public ActionsRequired actionsRequired() { /** * 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("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState 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 PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = ConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired + = ActionsRequired.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ProvisioningState.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ProvisioningState.java index 9006ba2c82329..09944213f4e19 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ProvisioningState.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ProvisioningState.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the configuration store. */ +/** + * The provisioning state of the configuration store. + */ public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Creating for ProvisioningState. */ + /** + * Static value Creating for ProvisioningState. + */ public static final ProvisioningState CREATING = fromString("Creating"); - /** Static value Updating for ProvisioningState. */ + /** + * Static value Updating for ProvisioningState. + */ public static final ProvisioningState UPDATING = fromString("Updating"); - /** Static value Deleting for ProvisioningState. */ + /** + * Static value Deleting for ProvisioningState. + */ public static final ProvisioningState DELETING = fromString("Deleting"); - /** Static value Succeeded for ProvisioningState. */ + /** + * Static value Succeeded for ProvisioningState. + */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ProvisioningState. */ + /** + * Static value Failed for ProvisioningState. + */ public static final ProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ProvisioningState. */ + /** + * Static value Canceled for ProvisioningState. + */ public static final ProvisioningState CANCELED = fromString("Canceled"); /** * Creates a new instance of ProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public ProvisioningState() { /** * Creates or finds a ProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningState. */ - @JsonCreator public static ProvisioningState fromString(String name) { return fromString(name, ProvisioningState.class); } /** * Gets known ProvisioningState values. - * + * * @return known ProvisioningState values. */ public static Collection values() { diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PublicNetworkAccess.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PublicNetworkAccess.java index d609588c0c57c..eaed72764a8fb 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PublicNetworkAccess.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/PublicNetworkAccess.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Control permission for data plane traffic coming from public networks while private endpoint is enabled. */ +/** + * Control permission for data plane traffic coming from public networks while private endpoint is enabled. + */ public final class PublicNetworkAccess extends ExpandableStringEnum { - /** Static value Enabled for PublicNetworkAccess. */ + /** + * Static value Enabled for PublicNetworkAccess. + */ public static final PublicNetworkAccess ENABLED = fromString("Enabled"); - /** Static value Disabled for PublicNetworkAccess. */ + /** + * Static value Disabled for PublicNetworkAccess. + */ public static final PublicNetworkAccess DISABLED = fromString("Disabled"); /** * Creates a new instance of PublicNetworkAccess value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public PublicNetworkAccess() { /** * Creates or finds a PublicNetworkAccess from its string representation. - * + * * @param name a name to look for. * @return the corresponding PublicNetworkAccess. */ - @JsonCreator public static PublicNetworkAccess fromString(String name) { return fromString(name, PublicNetworkAccess.class); } /** * Gets known PublicNetworkAccess values. - * + * * @return known PublicNetworkAccess values. */ public static Collection values() { diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/RegenerateKeyParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/RegenerateKeyParameters.java index ae7940c14a14b..e0ef133d214f6 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/RegenerateKeyParameters.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/RegenerateKeyParameters.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 parameters used to regenerate an API key. */ +/** + * The parameters used to regenerate an API key. + */ @Fluent -public final class RegenerateKeyParameters { +public final class RegenerateKeyParameters implements JsonSerializable { /* * The id of the key to regenerate. */ - @JsonProperty(value = "id") private String id; - /** Creates an instance of RegenerateKeyParameters class. */ + /** + * Creates an instance of RegenerateKeyParameters class. + */ public RegenerateKeyParameters() { } /** * Get the id property: The id of the key to regenerate. - * + * * @return the id value. */ public String id() { @@ -31,7 +38,7 @@ public String id() { /** * Set the id property: The id of the key to regenerate. - * + * * @param id the id value to set. * @return the RegenerateKeyParameters object itself. */ @@ -42,9 +49,45 @@ public RegenerateKeyParameters withId(String id) { /** * 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("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegenerateKeyParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegenerateKeyParameters 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 RegenerateKeyParameters. + */ + public static RegenerateKeyParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegenerateKeyParameters deserializedRegenerateKeyParameters = new RegenerateKeyParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRegenerateKeyParameters.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegenerateKeyParameters; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Replica.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Replica.java index c90606ec3dbc8..24feec7801447 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Replica.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Replica.java @@ -9,98 +9,111 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.appconfiguration.fluent.models.ReplicaInner; -/** An immutable client-side representation of Replica. */ +/** + * An immutable client-side representation of Replica. + */ public interface Replica { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The location of the replica. - * + * * @return the location value. */ String location(); /** * Gets the systemData property: Resource system metadata. - * + * * @return the systemData value. */ SystemData systemData(); /** * Gets the endpoint property: The URI of the replica where the replica API will be available. - * + * * @return the endpoint value. */ String endpoint(); /** * Gets the provisioningState property: The provisioning state of the replica. - * + * * @return the provisioningState value. */ ReplicaProvisioningState provisioningState(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.ReplicaInner object. - * + * * @return the inner object. */ ReplicaInner innerModel(); - /** The entirety of the Replica definition. */ + /** + * The entirety of the Replica definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The Replica definition stages. */ + + /** + * The Replica definition stages. + */ interface DefinitionStages { - /** The first stage of the Replica definition. */ + /** + * The first stage of the Replica definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Replica definition allowing to specify parent resource. */ + + /** + * The stage of the Replica definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, configStoreName. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @return the next definition stage. */ WithCreate withExistingConfigurationStore(String resourceGroupName, String configStoreName); } + /** * The stage of the Replica definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. @@ -108,24 +121,27 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithLocation { /** * Executes the create request. - * + * * @return the created resource. */ Replica create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Replica create(Context context); } - /** The stage of the Replica definition allowing to specify location. */ + + /** + * The stage of the Replica definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The location of the replica. * @return the next definition stage. */ @@ -133,23 +149,24 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The location of the replica. * @return the next definition stage. */ WithCreate withRegion(String location); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Replica refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ReplicaListResult.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ReplicaListResult.java index 7040be3d80ef1..e8e0a3ef09b21 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ReplicaListResult.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ReplicaListResult.java @@ -5,32 +5,38 @@ 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 com.azure.resourcemanager.appconfiguration.fluent.models.ReplicaInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** The result of a request to list replicas. */ +/** + * The result of a request to list replicas. + */ @Fluent -public final class ReplicaListResult { +public final class ReplicaListResult implements JsonSerializable { /* * The collection value. */ - @JsonProperty(value = "value") private List value; /* * The URI that can be used to request the next set of paged results. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of ReplicaListResult class. */ + /** + * Creates an instance of ReplicaListResult class. + */ public ReplicaListResult() { } /** * Get the value property: The collection value. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The collection value. - * + * * @param value the value value to set. * @return the ReplicaListResult object itself. */ @@ -50,7 +56,7 @@ public ReplicaListResult withValue(List value) { /** * Get the nextLink property: The URI that can be used to request the next set of paged results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URI that can be used to request the next set of paged results. - * + * * @param nextLink the nextLink value to set. * @return the ReplicaListResult object itself. */ @@ -70,7 +76,7 @@ public ReplicaListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,44 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReplicaListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReplicaListResult 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 ReplicaListResult. + */ + public static ReplicaListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReplicaListResult deserializedReplicaListResult = new ReplicaListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ReplicaInner.fromJson(reader1)); + deserializedReplicaListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedReplicaListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReplicaListResult; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ReplicaProvisioningState.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ReplicaProvisioningState.java index 5247d2a26f6f7..3be16c1941e2e 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ReplicaProvisioningState.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ReplicaProvisioningState.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The provisioning state of the replica. */ +/** + * The provisioning state of the replica. + */ public final class ReplicaProvisioningState extends ExpandableStringEnum { - /** Static value Creating for ReplicaProvisioningState. */ + /** + * Static value Creating for ReplicaProvisioningState. + */ public static final ReplicaProvisioningState CREATING = fromString("Creating"); - /** Static value Succeeded for ReplicaProvisioningState. */ + /** + * Static value Succeeded for ReplicaProvisioningState. + */ public static final ReplicaProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Deleting for ReplicaProvisioningState. */ + /** + * Static value Deleting for ReplicaProvisioningState. + */ public static final ReplicaProvisioningState DELETING = fromString("Deleting"); - /** Static value Failed for ReplicaProvisioningState. */ + /** + * Static value Failed for ReplicaProvisioningState. + */ public static final ReplicaProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ReplicaProvisioningState. */ + /** + * Static value Canceled for ReplicaProvisioningState. + */ public static final ReplicaProvisioningState CANCELED = fromString("Canceled"); /** * Creates a new instance of ReplicaProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public ReplicaProvisioningState() { /** * Creates or finds a ReplicaProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ReplicaProvisioningState. */ - @JsonCreator public static ReplicaProvisioningState fromString(String name) { return fromString(name, ReplicaProvisioningState.class); } /** * Gets known ReplicaProvisioningState values. - * + * * @return known ReplicaProvisioningState values. */ public static Collection values() { diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Replicas.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Replicas.java index e866c8ae38140..febb0e4bea0f7 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Replicas.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Replicas.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Replicas. */ +/** + * Resource collection API of Replicas. + */ public interface Replicas { /** * Lists the replicas for a given configuration store. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,24 +26,24 @@ public interface Replicas { /** * Lists the replicas for a given 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 skipToken A skip token is used to continue retrieving items after an operation returns a partial result. - * If a previous response contains a nextLink element, the value of the nextLink element will include a - * skipToken parameter that specifies a starting point to use for subsequent calls. + * If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken + * parameter that specifies a starting point to use for subsequent calls. * @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 list replicas as paginated response with {@link PagedIterable}. */ - PagedIterable listByConfigurationStore( - String resourceGroupName, String configStoreName, String skipToken, Context context); + PagedIterable listByConfigurationStore(String resourceGroupName, String configStoreName, String skipToken, + Context context); /** * Gets the properties of the specified replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -51,12 +53,12 @@ PagedIterable listByConfigurationStore( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of the specified replica along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String configStoreName, String replicaName, Context context); + Response getWithResponse(String resourceGroupName, String configStoreName, String replicaName, + Context context); /** * Gets the properties of the specified replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -69,7 +71,7 @@ Response getWithResponse( /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -81,7 +83,7 @@ Response getWithResponse( /** * Deletes a replica. - * + * * @param resourceGroupName The name of the resource group to which the container registry belongs. * @param configStoreName The name of the configuration store. * @param replicaName The name of the replica. @@ -94,7 +96,7 @@ Response getWithResponse( /** * Gets the properties of the specified replica. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -105,7 +107,7 @@ Response getWithResponse( /** * Gets the properties of the specified replica. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -117,7 +119,7 @@ Response getWithResponse( /** * Deletes a replica. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -127,7 +129,7 @@ Response getWithResponse( /** * Deletes a replica. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -138,7 +140,7 @@ Response getWithResponse( /** * Begins definition for a new Replica resource. - * + * * @param name resource name. * @return the first stage of the new Replica definition. */ diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResetSasTokensParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResetSasTokensParameters.java new file mode 100644 index 0000000000000..54213925097fb --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResetSasTokensParameters.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 token. + */ +@Fluent +public final class ResetSasTokensParameters implements JsonSerializable { + /* + * The kind of the SAS token. + */ + private SasTokenKind kind; + + /** + * Creates an instance of ResetSasTokensParameters class. + */ + public ResetSasTokensParameters() { + } + + /** + * Get the kind property: The kind of the SAS token. + * + * @return the kind value. + */ + public SasTokenKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the SAS token. + * + * @param kind the kind value to set. + * @return the ResetSasTokensParameters object itself. + */ + public ResetSasTokensParameters withKind(SasTokenKind kind) { + this.kind = kind; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kind() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property kind in model ResetSasTokensParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResetSasTokensParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResetSasTokensParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResetSasTokensParameters 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 ResetSasTokensParameters. + */ + public static ResetSasTokensParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResetSasTokensParameters deserializedResetSasTokensParameters = new ResetSasTokensParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedResetSasTokensParameters.kind = SasTokenKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResetSasTokensParameters; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResourceIdentity.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResourceIdentity.java index f6a4b418dc2d2..f70a048e1cd4b 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResourceIdentity.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResourceIdentity.java @@ -5,50 +5,53 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +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.Map; -/** An identity that can be associated with a resource. */ +/** + * An identity that can be associated with a resource. + */ @Fluent -public final class ResourceIdentity { +public final class ResourceIdentity implements JsonSerializable { /* * The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created * identity and a set of user-assigned identities. The type 'None' will remove any identities. */ - @JsonProperty(value = "type") private IdentityType type; /* * The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}'. */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; /* * The principal id of the identity. This property will only be provided for a system-assigned identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private String principalId; /* * The tenant id associated with the resource's identity. This property will only be provided for a system-assigned * identity. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; - /** Creates an instance of ResourceIdentity class. */ + /** + * Creates an instance of ResourceIdentity class. + */ public ResourceIdentity() { } /** * Get the type property: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both * an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. - * + * * @return the type value. */ public IdentityType type() { @@ -58,7 +61,7 @@ public IdentityType type() { /** * Set the type property: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both * an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. - * + * * @param type the type value to set. * @return the ResourceIdentity object itself. */ @@ -71,7 +74,7 @@ public ResourceIdentity withType(IdentityType type) { * Get the userAssignedIdentities property: The list of user-assigned identities associated with the resource. The * user-assigned identity dictionary keys will be ARM resource ids in the form: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * + * * @return the userAssignedIdentities value. */ public Map userAssignedIdentities() { @@ -82,7 +85,7 @@ public Map userAssignedIdentities() { * Set the userAssignedIdentities property: The list of user-assigned identities associated with the resource. The * user-assigned identity dictionary keys will be ARM resource ids in the form: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * + * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the ResourceIdentity object itself. */ @@ -94,7 +97,7 @@ public ResourceIdentity withUserAssignedIdentities(Map use /** * Get the principalId property: The principal id of the identity. This property will only be provided for a * system-assigned identity. - * + * * @return the principalId value. */ public String principalId() { @@ -104,7 +107,7 @@ public String principalId() { /** * Get the tenantId property: The tenant id associated with the resource's identity. This property will only be * provided for a system-assigned identity. - * + * * @return the tenantId value. */ public String tenantId() { @@ -113,19 +116,62 @@ public String tenantId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (userAssignedIdentities() != null) { - userAssignedIdentities() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceIdentity 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 ResourceIdentity. + */ + public static ResourceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceIdentity deserializedResourceIdentity = new ResourceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedResourceIdentity.type = IdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserIdentity.fromJson(reader1)); + deserializedResourceIdentity.userAssignedIdentities = userAssignedIdentities; + } else if ("principalId".equals(fieldName)) { + deserializedResourceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedResourceIdentity.tenantId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceIdentity; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResourceParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResourceParameters.java new file mode 100644 index 0000000000000..95133a819d211 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ResourceParameters.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 parameters to define the data plane resource scope that the SAS token is authorized to access. + */ +@Immutable +public class ResourceParameters implements JsonSerializable { + /* + * The resourceType property. + */ + private ResourceType resourceType = ResourceType.fromString("ResourceParameters"); + + /** + * Creates an instance of ResourceParameters class. + */ + public ResourceParameters() { + } + + /** + * 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 ResourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceParameters 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 ResourceParameters. + */ + public static ResourceParameters 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 KvResourceParameters.fromJson(readerToUse.reset()); + } else if ("Snapshot".equals(discriminatorValue)) { + return SnapshotResourceParameters.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ResourceParameters fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceParameters deserializedResourceParameters = new ResourceParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedResourceParameters.resourceType = ResourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceParameters; + }); + } +} 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 0000000000000..4f524d0529d38 --- /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/SasTokenGenerationParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenGenerationParameters.java new file mode 100644 index 0000000000000..6a5ea898238b7 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenGenerationParameters.java @@ -0,0 +1,211 @@ +// 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 parameters to define the data plane resource scope that the SAS token is authorized to access. + */ + private ResourceParameters resourceParameters; + + /* + * 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 SasTokenKind kind; + + /** + * Creates an instance of SasTokenGenerationParameters class. + */ + public SasTokenGenerationParameters() { + } + + /** + * Get the resourceParameters property: The parameters to define the data plane resource scope that the SAS token is + * authorized to access. + * + * @return the resourceParameters value. + */ + public ResourceParameters resourceParameters() { + return this.resourceParameters; + } + + /** + * Set the resourceParameters property: The parameters to define the data plane resource scope that the SAS token is + * authorized to access. + * + * @param resourceParameters the resourceParameters value to set. + * @return the SasTokenGenerationParameters object itself. + */ + public SasTokenGenerationParameters withResourceParameters(ResourceParameters resourceParameters) { + this.resourceParameters = resourceParameters; + 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 SasTokenKind 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(SasTokenKind kind) { + this.kind = kind; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceParameters() != null) { + resourceParameters().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.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.writeJsonField("resourceParameters", this.resourceParameters); + 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 ("expires".equals(fieldName)) { + deserializedSasTokenGenerationParameters.expires = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("kind".equals(fieldName)) { + deserializedSasTokenGenerationParameters.kind = SasTokenKind.fromString(reader.getString()); + } else if ("resourceParameters".equals(fieldName)) { + deserializedSasTokenGenerationParameters.resourceParameters = ResourceParameters.fromJson(reader); + } 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 0000000000000..345d3b2e69db8 --- /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 resourceParameters property: The parameters to define the data plane resource scope. + * + * @return the resourceParameters value. + */ + ResourceParameters resourceParameters(); + + /** + * 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. + */ + SasTokenKind 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/SasTokenKind.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenKind.java new file mode 100644 index 0000000000000..1fb82523dfbe6 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SasTokenKind.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 SasTokenKind extends ExpandableStringEnum { + /** + * Static value Primary for SasTokenKind. + */ + public static final SasTokenKind PRIMARY = fromString("Primary"); + + /** + * Static value Secondary for SasTokenKind. + */ + public static final SasTokenKind SECONDARY = fromString("Secondary"); + + /** + * Creates a new instance of SasTokenKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SasTokenKind() { + } + + /** + * Creates or finds a SasTokenKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding SasTokenKind. + */ + public static SasTokenKind fromString(String name) { + return fromString(name, SasTokenKind.class); + } + + /** + * Gets known SasTokenKind values. + * + * @return known SasTokenKind values. + */ + public static Collection values() { + return values(SasTokenKind.class); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ServiceSpecification.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ServiceSpecification.java index ddf7c1f1edab7..ff4db5c62bab6 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ServiceSpecification.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ServiceSpecification.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; -/** Service specification payload. */ +/** + * Service specification payload. + */ @Fluent -public final class ServiceSpecification { +public final class ServiceSpecification implements JsonSerializable { /* * Specifications of the Log for Azure Monitoring */ - @JsonProperty(value = "logSpecifications") private List logSpecifications; /* * Specifications of the Metrics for Azure Monitoring */ - @JsonProperty(value = "metricSpecifications") private List metricSpecifications; - /** Creates an instance of ServiceSpecification class. */ + /** + * Creates an instance of ServiceSpecification class. + */ public ServiceSpecification() { } /** * Get the logSpecifications property: Specifications of the Log for Azure Monitoring. - * + * * @return the logSpecifications value. */ public List logSpecifications() { @@ -38,7 +44,7 @@ public List logSpecifications() { /** * Set the logSpecifications property: Specifications of the Log for Azure Monitoring. - * + * * @param logSpecifications the logSpecifications value to set. * @return the ServiceSpecification object itself. */ @@ -49,7 +55,7 @@ public ServiceSpecification withLogSpecifications(List logSpec /** * Get the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. - * + * * @return the metricSpecifications value. */ public List metricSpecifications() { @@ -58,7 +64,7 @@ public List metricSpecifications() { /** * Set the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. - * + * * @param metricSpecifications the metricSpecifications value to set. * @return the ServiceSpecification object itself. */ @@ -69,7 +75,7 @@ public ServiceSpecification withMetricSpecifications(List m /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -80,4 +86,49 @@ public void validate() { metricSpecifications().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("logSpecifications", this.logSpecifications, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("metricSpecifications", this.metricSpecifications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceSpecification 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 ServiceSpecification. + */ + public static ServiceSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceSpecification deserializedServiceSpecification = new ServiceSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logSpecifications".equals(fieldName)) { + List logSpecifications + = reader.readArray(reader1 -> LogSpecification.fromJson(reader1)); + deserializedServiceSpecification.logSpecifications = logSpecifications; + } else if ("metricSpecifications".equals(fieldName)) { + List metricSpecifications + = reader.readArray(reader1 -> MetricSpecification.fromJson(reader1)); + deserializedServiceSpecification.metricSpecifications = metricSpecifications; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceSpecification; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Sku.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Sku.java index 22920fc8122fb..73dae1c00e094 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Sku.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Sku.java @@ -6,24 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Describes a configuration store SKU. */ +/** + * Describes a configuration store SKU. + */ @Fluent -public final class Sku { +public final class Sku implements JsonSerializable { /* * The SKU name of the configuration store. */ - @JsonProperty(value = "name", required = true) private String name; - /** Creates an instance of Sku class. */ + /** + * Creates an instance of Sku class. + */ public Sku() { } /** * Get the name property: The SKU name of the configuration store. - * + * * @return the name value. */ public String name() { @@ -32,7 +39,7 @@ public String name() { /** * Set the name property: The SKU name of the configuration store. - * + * * @param name the name value to set. * @return the Sku object itself. */ @@ -43,15 +50,51 @@ public Sku withName(String name) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); } } private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku 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 Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Snapshot.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Snapshot.java new file mode 100644 index 0000000000000..9b1e8774373e8 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Snapshot.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.appconfiguration.fluent.models.SnapshotInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of Snapshot. + */ +public interface Snapshot { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the provisioningState property: The provisioning state of the snapshot. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the status property: The current status of the snapshot. + * + * @return the status value. + */ + SnapshotStatus status(); + + /** + * Gets the filters property: A list of filters used to filter the key-values included in the snapshot. + * + * @return the filters value. + */ + List filters(); + + /** + * Gets the compositionType property: The composition type describes how the key-values within the snapshot are + * composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' + * composition type ensures there are no two key-values containing the same key and label. + * + * @return the compositionType value. + */ + CompositionType compositionType(); + + /** + * Gets the created property: The time that the snapshot was created. + * + * @return the created value. + */ + OffsetDateTime created(); + + /** + * Gets the expires property: The time that the snapshot will expire. + * + * @return the expires value. + */ + OffsetDateTime expires(); + + /** + * Gets the retentionPeriod property: The amount of time, in seconds, that a snapshot will remain in the archived + * state before expiring. This property is only writable during the creation of a snapshot. If not specified, the + * default lifetime of key-value revisions will be used. + * + * @return the retentionPeriod value. + */ + Long retentionPeriod(); + + /** + * Gets the size property: The size in bytes of the snapshot. + * + * @return the size value. + */ + Long size(); + + /** + * Gets the itemsCount property: The amount of key-values in the snapshot. + * + * @return the itemsCount value. + */ + Long itemsCount(); + + /** + * Gets the tags property: The tags of the snapshot. NOTE: These are data plane tags, not ARM tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the etag property: A value representing the current state of the snapshot. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the inner com.azure.resourcemanager.appconfiguration.fluent.models.SnapshotInner object. + * + * @return the inner object. + */ + SnapshotInner innerModel(); + + /** + * The entirety of the Snapshot definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Snapshot definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Snapshot definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the Snapshot definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, configStoreName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @return the next definition stage. + */ + WithCreate withExistingConfigurationStore(String resourceGroupName, String configStoreName); + } + + /** + * The stage of the Snapshot definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithFilters, + DefinitionStages.WithCompositionType, DefinitionStages.WithRetentionPeriod { + /** + * Executes the create request. + * + * @return the created resource. + */ + Snapshot create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Snapshot create(Context context); + } + + /** + * The stage of the Snapshot definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: The tags of the snapshot. NOTE: These are data plane tags, not ARM tags.. + * + * @param tags The tags of the snapshot. NOTE: These are data plane tags, not ARM tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Snapshot definition allowing to specify filters. + */ + interface WithFilters { + /** + * Specifies the filters property: A list of filters used to filter the key-values included in the + * snapshot.. + * + * @param filters A list of filters used to filter the key-values included in the snapshot. + * @return the next definition stage. + */ + WithCreate withFilters(List filters); + } + + /** + * The stage of the Snapshot definition allowing to specify compositionType. + */ + interface WithCompositionType { + /** + * Specifies the compositionType property: The composition type describes how the key-values within the + * snapshot are composed. The 'key' composition type ensures there are no two key-values containing the same + * key. The 'key_label' composition type ensures there are no two key-values containing the same key and + * label.. + * + * @param compositionType The composition type describes how the key-values within the snapshot are + * composed. The 'key' composition type ensures there are no two key-values containing the same key. The + * 'key_label' composition type ensures there are no two key-values containing the same key and label. + * @return the next definition stage. + */ + WithCreate withCompositionType(CompositionType compositionType); + } + + /** + * The stage of the Snapshot definition allowing to specify retentionPeriod. + */ + interface WithRetentionPeriod { + /** + * Specifies the retentionPeriod property: The amount of time, in seconds, that a snapshot will remain in + * the archived state before expiring. This property is only writable during the creation of a snapshot. If + * not specified, the default lifetime of key-value revisions will be used.. + * + * @param retentionPeriod The amount of time, in seconds, that a snapshot will remain in the archived state + * before expiring. This property is only writable during the creation of a snapshot. If not specified, the + * default lifetime of key-value revisions will be used. + * @return the next definition stage. + */ + WithCreate withRetentionPeriod(Long retentionPeriod); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Snapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Snapshot refresh(Context context); +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SnapshotResourceParameters.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SnapshotResourceParameters.java new file mode 100644 index 0000000000000..ce54ea0097bc4 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SnapshotResourceParameters.java @@ -0,0 +1,121 @@ +// 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 parameters to define the snapshot resource scope that the SAS token is authorized to access. + */ +@Fluent +public final class SnapshotResourceParameters extends ResourceParameters { + /* + * The resourceType property. + */ + private ResourceType resourceType = ResourceType.SNAPSHOT; + + /* + * The name of the snapshot. + */ + private String name; + + /** + * Creates an instance of SnapshotResourceParameters class. + */ + public SnapshotResourceParameters() { + } + + /** + * 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 SnapshotResourceParameters object itself. + */ + public SnapshotResourceParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (name() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property name in model SnapshotResourceParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SnapshotResourceParameters.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 SnapshotResourceParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SnapshotResourceParameters 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 SnapshotResourceParameters. + */ + public static SnapshotResourceParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SnapshotResourceParameters deserializedSnapshotResourceParameters = new SnapshotResourceParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSnapshotResourceParameters.name = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + deserializedSnapshotResourceParameters.resourceType = ResourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSnapshotResourceParameters; + }); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SnapshotStatus.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SnapshotStatus.java new file mode 100644 index 0000000000000..154657d052225 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/SnapshotStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current status of the snapshot. + */ +public final class SnapshotStatus extends ExpandableStringEnum { + /** + * Static value Provisioning for SnapshotStatus. + */ + public static final SnapshotStatus PROVISIONING = fromString("Provisioning"); + + /** + * Static value Ready for SnapshotStatus. + */ + public static final SnapshotStatus READY = fromString("Ready"); + + /** + * Static value Archived for SnapshotStatus. + */ + public static final SnapshotStatus ARCHIVED = fromString("Archived"); + + /** + * Static value Failed for SnapshotStatus. + */ + public static final SnapshotStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of SnapshotStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SnapshotStatus() { + } + + /** + * Creates or finds a SnapshotStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SnapshotStatus. + */ + public static SnapshotStatus fromString(String name) { + return fromString(name, SnapshotStatus.class); + } + + /** + * Gets known SnapshotStatus values. + * + * @return known SnapshotStatus values. + */ + public static Collection values() { + return values(SnapshotStatus.class); + } +} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Snapshots.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Snapshots.java new file mode 100644 index 0000000000000..091230c898735 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/Snapshots.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Snapshots. + */ +public interface Snapshots { + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @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 properties of the specified snapshot along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String configStoreName, String snapshotName, + Context context); + + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param configStoreName The name of the configuration store. + * @param snapshotName The name of the snapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified snapshot. + */ + Snapshot get(String resourceGroupName, String configStoreName, String snapshotName); + + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified snapshot along with {@link Response}. + */ + Snapshot getById(String id); + + /** + * Gets the properties of the specified snapshot. NOTE: This operation is intended for use in ARM Template + * deployments. For all other scenarios involving App Configuration snapshots the data plane API should be used + * instead. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified snapshot along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Snapshot resource. + * + * @param name resource name. + * @return the first stage of the new Snapshot definition. + */ + Snapshot.DefinitionStages.Blank define(String name); +} 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 0000000000000..8d20b51967f71 --- /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/java/com/azure/resourcemanager/appconfiguration/models/UserIdentity.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/UserIdentity.java index 65969b7c5338d..d813a8211cf3a 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/UserIdentity.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/UserIdentity.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.appconfiguration.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** A resource identity that is managed by the user of the service. */ +/** + * A resource identity that is managed by the user of the service. + */ @Immutable -public final class UserIdentity { +public final class UserIdentity implements JsonSerializable { /* * The principal ID of the user-assigned identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private String principalId; /* * The client ID of the user-assigned identity. */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private String clientId; - /** Creates an instance of UserIdentity class. */ + /** + * Creates an instance of UserIdentity class. + */ public UserIdentity() { } /** * Get the principalId property: The principal ID of the user-assigned identity. - * + * * @return the principalId value. */ public String principalId() { @@ -37,7 +43,7 @@ public String principalId() { /** * Get the clientId property: The client ID of the user-assigned identity. - * + * * @return the clientId value. */ public String clientId() { @@ -46,9 +52,46 @@ public String clientId() { /** * 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 UserIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserIdentity 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 UserIdentity. + */ + public static UserIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserIdentity deserializedUserIdentity = new UserIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserIdentity; + }); + } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/package-info.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/package-info.java index 5254e86a43798..2b374f6bd33eb 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/package-info.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for AppConfigurationManagementClient. null. */ +/** + * Package containing the data models for AppConfigurationManagementClient. + * null. + */ package com.azure.resourcemanager.appconfiguration.models; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/package-info.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/package-info.java index 41ab7f252f7c0..4a0a4425ccb22 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/package-info.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for AppConfigurationManagementClient. null. */ +/** + * Package containing the classes for AppConfigurationManagementClient. + * null. + */ package com.azure.resourcemanager.appconfiguration; diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/module-info.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/module-info.java index 55569345a921e..043b699d3add3 100644 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/module-info.java +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.appconfiguration { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.appconfiguration; exports com.azure.resourcemanager.appconfiguration.fluent; exports com.azure.resourcemanager.appconfiguration.fluent.models; exports com.azure.resourcemanager.appconfiguration.models; - - opens com.azure.resourcemanager.appconfiguration.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.appconfiguration.models to - com.azure.core, - com.fasterxml.jackson.databind; -} + opens com.azure.resourcemanager.appconfiguration.fluent.models to com.azure.core; + opens com.azure.resourcemanager.appconfiguration.models to com.azure.core; +} \ No newline at end of file diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-appconfiguration/proxy-config.json b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-appconfiguration/proxy-config.json new file mode 100644 index 0000000000000..fde5986065519 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-appconfiguration/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.appconfiguration.implementation.ConfigurationStoresClientImpl$ConfigurationStoresService" ], [ "com.azure.resourcemanager.appconfiguration.implementation.KeyValuesClientImpl$KeyValuesService" ], [ "com.azure.resourcemanager.appconfiguration.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.appconfiguration.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService" ], [ "com.azure.resourcemanager.appconfiguration.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService" ], [ "com.azure.resourcemanager.appconfiguration.implementation.ReplicasClientImpl$ReplicasService" ], [ "com.azure.resourcemanager.appconfiguration.implementation.SnapshotsClientImpl$SnapshotsService" ] ] \ No newline at end of file diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-appconfiguration/reflect-config.json b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-appconfiguration/reflect-config.json new file mode 100644 index 0000000000000..8878e547a7984 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-appconfiguration/reflect-config.json @@ -0,0 +1 @@ +[ ] \ No newline at end of file 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 4819d70575fcc..bebfd19dbe869 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 @@ -4,27 +4,35 @@ package com.azure.resourcemanager.appconfiguration.generated; +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.Sku; +import com.azure.resourcemanager.appconfiguration.models.TelemetryProperties; import com.azure.resourcemanager.appconfiguration.models.UserIdentity; import java.util.HashMap; import java.util.Map; -/** Samples for ConfigurationStores Create. */ +/** + * Samples for ConfigurationStores Create. + */ public final class ConfigurationStoresCreateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreate.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreate.json */ /** * Sample code: ConfigurationStores_Create. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresCreate( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .configurationStores() + public static void + configurationStoresCreate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() .define("contoso") .withRegion("westus") .withExistingResourceGroup("myResourceGroup") @@ -34,44 +42,65 @@ public static void configurationStoresCreate( } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateWithIdentity.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateWithIdentity.json */ /** * Sample code: ConfigurationStores_Create_With_Identity. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCreateWithIdentity( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .configurationStores() + manager.configurationStores() .define("contoso") .withRegion("westus") .withExistingResourceGroup("myResourceGroup") .withSku(new Sku().withName("Standard")) .withTags(mapOf("myTag", "myTagValue")) - .withIdentity( - new ResourceIdentity() - .withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", - new UserIdentity()))) + .withIdentity(new ResourceIdentity().withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentity()))) + .create(); + } + + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateWithDataPlaneProxy.json + */ + /** + * Sample code: ConfigurationStores_Create_With_Data_Plane_Proxy. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresCreateWithDataPlaneProxy( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .define("contoso") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName("Standard")) + .withDataPlaneProxy(new DataPlaneProxyProperties().withAuthenticationMode(AuthenticationMode.PASS_THROUGH) + .withPrivateLinkDelegation(PrivateLinkDelegation.ENABLED)) .create(); } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateWithLocalAuthDisabled.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateWithLocalAuthDisabled.json */ /** * Sample code: ConfigurationStores_Create_With_Local_Auth_Disabled. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCreateWithLocalAuthDisabled( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .configurationStores() + manager.configurationStores() .define("contoso") .withRegion("westus") .withExistingResourceGroup("myResourceGroup") @@ -80,6 +109,33 @@ public static void configurationStoresCreateWithLocalAuthDisabled( .create(); } + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-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(); + } + + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 2f9bec3a55231..d3e4c51db1d6a 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for ConfigurationStores Delete. */ +/** + * Samples for ConfigurationStores Delete. + */ public final class ConfigurationStoresDeleteSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDelete.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresDelete.json */ /** * Sample code: ConfigurationStores_Delete. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresDelete( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + configurationStoresDelete(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().delete("myResourceGroup", "contoso", com.azure.core.util.Context.NONE); } } 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 0000000000000..eadd14c2c524f --- /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.KvResourceParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenGenerationParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenKind; +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-09-01-preview/examples/ + * ConfigurationStoresSasTokenGeneration.json + */ + /** + * Sample code: ConfigurationStores_SasTokenGeneration. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void configurationStoresSasTokenGeneration( + com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .generateSasTokenWithResponse("myResourceGroup", "contoso", + new SasTokenGenerationParameters() + .withResourceParameters(new KvResourceParameters().withKey("fakeTokenPlaceholder") + .withLabel("prod") + .withTags(Arrays.asList("group=test-group", "region=eastus"))) + .withExpires(OffsetDateTime.parse("2024-09-01T00:00:00")) + .withCacheControlMaxAge(3600.0F) + .withKind(SasTokenKind.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 a7c5415720a54..cb80e0b12cf01 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for ConfigurationStores GetByResourceGroup. */ +/** + * Samples for ConfigurationStores GetByResourceGroup. + */ public final class ConfigurationStoresGetByResourceGroupSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGet.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresGet.json */ /** * Sample code: ConfigurationStores_Get. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresGet( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .configurationStores() + public static void + configurationStoresGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE); } } 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 9d9d6e857d4e2..1f403e8fb1488 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for ConfigurationStores GetDeleted. */ +/** + * Samples for ConfigurationStores GetDeleted. + */ public final class ConfigurationStoresGetDeletedSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresGet.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * DeletedConfigurationStoresGet.json */ /** * Sample code: DeletedConfigurationStores_Get. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void deletedConfigurationStoresGet( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + deletedConfigurationStoresGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().getDeletedWithResponse("westus", "contoso", com.azure.core.util.Context.NONE); } } 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 4005824bb117e..17481516d4a39 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for ConfigurationStores ListByResourceGroup. */ +/** + * Samples for ConfigurationStores ListByResourceGroup. + */ public final class ConfigurationStoresListByResourceGroupSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListByResourceGroup.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresListByResourceGroup.json */ /** * Sample code: ConfigurationStores_ListByResourceGroup. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresListByResourceGroup( 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 67c20b5927a2e..50f538208e3c4 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for ConfigurationStores ListDeleted. */ +/** + * Samples for ConfigurationStores ListDeleted. + */ public final class ConfigurationStoresListDeletedSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresList.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * DeletedConfigurationStoresList.json */ /** * Sample code: DeletedConfigurationStores_List. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void deletedConfigurationStoresList( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + deletedConfigurationStoresList(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().listDeleted(com.azure.core.util.Context.NONE); } } 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 3fb1ea65d6946..e89dc75ae3b10 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for ConfigurationStores ListKeys. */ +/** + * Samples for ConfigurationStores ListKeys. + */ public final class ConfigurationStoresListKeysSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListKeys.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresListKeys.json */ /** * Sample code: ConfigurationStores_ListKeys. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresListKeys( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + configurationStoresListKeys(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().listKeys("myResourceGroup", "contoso", null, com.azure.core.util.Context.NONE); } } 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 3d02a661693d4..ca7103d4691f0 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for ConfigurationStores List. */ +/** + * Samples for ConfigurationStores List. + */ public final class ConfigurationStoresListSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresList.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresList.json */ /** * Sample code: ConfigurationStores_List. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresList( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + configurationStoresList(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().list(null, com.azure.core.util.Context.NONE); } } 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 67b10663c14ca..ddad0fcc65b2d 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for ConfigurationStores PurgeDeleted. */ +/** + * Samples for ConfigurationStores PurgeDeleted. + */ public final class ConfigurationStoresPurgeDeletedSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/DeletedConfigurationStoresPurge.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * DeletedConfigurationStoresPurge.json */ /** * Sample code: Purge a deleted configuration store. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void purgeADeletedConfigurationStore( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + public static void + purgeADeletedConfigurationStore(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { manager.configurationStores().purgeDeleted("westus", "contoso", com.azure.core.util.Context.NONE); } } 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 7808059d3daca..dd73552ff3be0 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 @@ -6,24 +6,24 @@ import com.azure.resourcemanager.appconfiguration.models.RegenerateKeyParameters; -/** Samples for ConfigurationStores RegenerateKey. */ +/** + * Samples for ConfigurationStores RegenerateKey. + */ public final class ConfigurationStoresRegenerateKeySamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresRegenerateKey.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresRegenerateKey.json */ /** * Sample code: ConfigurationStores_RegenerateKey. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresRegenerateKey( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .configurationStores() - .regenerateKeyWithResponse( - "myResourceGroup", - "contoso", - new RegenerateKeyParameters().withId("439AD01B4BE67DB1"), - com.azure.core.util.Context.NONE); + public static void + configurationStoresRegenerateKey(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .regenerateKeyWithResponse("myResourceGroup", "contoso", + new RegenerateKeyParameters().withId("439AD01B4BE67DB1"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresResetSasTokensSamples.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresResetSasTokensSamples.java new file mode 100644 index 0000000000000..7abc4fce41c11 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresResetSasTokensSamples.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.ResetSasTokensParameters; +import com.azure.resourcemanager.appconfiguration.models.SasTokenKind; + +/** + * Samples for ConfigurationStores ResetSasTokens. + */ +public final class ConfigurationStoresResetSasTokensSamples { + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresResetSasTokens.json + */ + /** + * Sample code: ConfigurationStores_ResetSasTokens. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void + configurationStoresResetSasTokens(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.configurationStores() + .resetSasTokensWithResponse("myResourceGroup", "contoso", + new ResetSasTokensParameters().withKind(SasTokenKind.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 5037b6fcb250c..591ef472b3c04 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 @@ -12,73 +12,72 @@ import java.util.HashMap; import java.util.Map; -/** Samples for ConfigurationStores Update. */ +/** + * Samples for ConfigurationStores Update. + */ public final class ConfigurationStoresUpdateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdateDisableLocalAuth.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresUpdateDisableLocalAuth.json */ /** * Sample code: ConfigurationStores_Update_Disable_Local_Auth. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresUpdateDisableLocalAuth( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - ConfigurationStore resource = - manager - .configurationStores() - .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) - .getValue(); + ConfigurationStore resource = manager.configurationStores() + .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withSku(new Sku().withName("Standard")).withDisableLocalAuth(true).apply(); } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdate.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresUpdate.json */ /** * Sample code: ConfigurationStores_Update. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void configurationStoresUpdate( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - ConfigurationStore resource = - manager - .configurationStores() - .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) - .getValue(); + public static void + configurationStoresUpdate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + ConfigurationStore resource = manager.configurationStores() + .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withTags(mapOf("Category", "Marketing")).withSku(new Sku().withName("Standard")).apply(); } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdateWithIdentity.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresUpdateWithIdentity.json */ /** * Sample code: ConfigurationStores_Update_With_Identity. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresUpdateWithIdentity( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - ConfigurationStore resource = - manager - .configurationStores() - .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + ConfigurationStore resource = manager.configurationStores() + .getByResourceGroupWithResponse("myResourceGroup", "contoso", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withTags(mapOf("Category", "Marketing")) - .withIdentity( - new ResourceIdentity() - .withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", - new UserIdentity()))) + .withIdentity(new ResourceIdentity().withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentity()))) .withSku(new Sku().withName("Standard")) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 0682aeb0dd5e5..812f959801fd2 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 @@ -7,20 +7,23 @@ import java.util.HashMap; import java.util.Map; -/** Samples for KeyValues CreateOrUpdate. */ +/** + * Samples for KeyValues CreateOrUpdate. + */ public final class KeyValuesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateKeyValue.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateKeyValue.json */ /** * Sample code: KeyValues_CreateOrUpdate. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void keyValuesCreateOrUpdate( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .keyValues() + public static void + keyValuesCreateOrUpdate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.keyValues() .define("myKey$myLabel") .withExistingConfigurationStore("myResourceGroup", "contoso") .withTags(mapOf("tag1", "tagValue1", "tag2", "tagValue2")) @@ -28,6 +31,7 @@ public static void keyValuesCreateOrUpdate( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 4741d59e1e2aa..80671d57cc128 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for KeyValues Delete. */ +/** + * Samples for KeyValues Delete. + */ public final class KeyValuesDeleteSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeleteKeyValue.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresDeleteKeyValue.json */ /** * Sample code: KeyValues_Delete. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void keyValuesDelete(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { 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 6ffb8d1bde963..7b0041a1597f0 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for KeyValues Get. */ +/** + * Samples for KeyValues Get. + */ public final class KeyValuesGetSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetKeyValue.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresGetKeyValue.json */ /** * Sample code: KeyValues_Get. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void keyValuesGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .keyValues() + manager.keyValues() .getWithResponse("myResourceGroup", "contoso", "myKey$myLabel", com.azure.core.util.Context.NONE); } } 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 c0afedd410c56..7b7bb5c6ef9e1 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 @@ -7,42 +7,44 @@ import com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters; import com.azure.resourcemanager.appconfiguration.models.ConfigurationResourceType; -/** Samples for Operations CheckNameAvailability. */ +/** + * Samples for Operations CheckNameAvailability. + */ public final class OperationsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/CheckNameAvailable.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * CheckNameAvailable.json */ /** * Sample code: ConfigurationStores_CheckNameAvailable. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCheckNameAvailable( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .operations() + manager.operations() .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityParameters() - .withName("contoso") + new CheckNameAvailabilityParameters().withName("contoso") .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/CheckNameNotAvailable.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * CheckNameNotAvailable.json */ /** * Sample code: ConfigurationStores_CheckNameNotAvailable. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCheckNameNotAvailable( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .operations() + manager.operations() .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityParameters() - .withName("contoso") + new CheckNameAvailabilityParameters().withName("contoso") .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES), com.azure.core.util.Context.NONE); } 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 6dc48a46464ce..78cd2b8cfcecc 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/OperationsList.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * OperationsList.json */ /** * Sample code: Operations_List. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void operationsList(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { 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 8db1fd1bae728..ff78c5376ba29 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 @@ -7,44 +7,44 @@ import com.azure.resourcemanager.appconfiguration.models.CheckNameAvailabilityParameters; import com.azure.resourcemanager.appconfiguration.models.ConfigurationResourceType; -/** Samples for Operations RegionalCheckNameAvailability. */ +/** + * Samples for Operations RegionalCheckNameAvailability. + */ public final class OperationsRegionalCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/RegionalCheckNameAvailable.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * RegionalCheckNameAvailable.json */ /** * Sample code: ConfigurationStores_CheckNameAvailable. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCheckNameAvailable( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .operations() - .regionalCheckNameAvailabilityWithResponse( - "westus", - new CheckNameAvailabilityParameters() - .withName("contoso") + manager.operations() + .regionalCheckNameAvailabilityWithResponse("westus", + new CheckNameAvailabilityParameters().withName("contoso") .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/RegionalCheckNameNotAvailable.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * RegionalCheckNameNotAvailable.json */ /** * Sample code: ConfigurationStores_CheckNameNotAvailable. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void configurationStoresCheckNameNotAvailable( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .operations() - .regionalCheckNameAvailabilityWithResponse( - "westus", - new CheckNameAvailabilityParameters() - .withName("contoso") + manager.operations() + .regionalCheckNameAvailabilityWithResponse("westus", + new CheckNameAvailabilityParameters().withName("contoso") .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES), com.azure.core.util.Context.NONE); } 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 c38f2c7eddad3..5505e408ad6c3 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 @@ -8,28 +8,28 @@ import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnection; import com.azure.resourcemanager.appconfiguration.models.PrivateLinkServiceConnectionState; -/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresUpdatePrivateEndpointConnection.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresUpdatePrivateEndpointConnection.json */ /** * Sample code: PrivateEndpointConnection_Update. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void privateEndpointConnectionUpdate( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - PrivateEndpointConnection resource = - manager - .privateEndpointConnections() - .getWithResponse("myResourceGroup", "contoso", "myConnection", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() + public static void + privateEndpointConnectionUpdate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + PrivateEndpointConnection resource = manager.privateEndpointConnections() + .getWithResponse("myResourceGroup", "contoso", "myConnection", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(ConnectionStatus.APPROVED) + new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED) .withDescription("Auto-Approved")) .apply(); } 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 f306db44b32ac..81256044524f1 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for PrivateEndpointConnections Delete. */ +/** + * Samples for PrivateEndpointConnections Delete. + */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeletePrivateEndpointConnection.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresDeletePrivateEndpointConnection.json */ /** * Sample code: PrivateEndpointConnections_Delete. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void privateEndpointConnectionsDelete( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateEndpointConnections() + public static void + privateEndpointConnectionsDelete(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.privateEndpointConnections() .delete("myResourceGroup", "contoso", "myConnection", com.azure.core.util.Context.NONE); } } 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 c474f43ee8f6e..5a72afb11f919 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for PrivateEndpointConnections Get. */ +/** + * Samples for PrivateEndpointConnections Get. + */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetPrivateEndpointConnection.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresGetPrivateEndpointConnection.json */ /** * Sample code: PrivateEndpointConnection_GetConnection. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void privateEndpointConnectionGetConnection( com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateEndpointConnections() + manager.privateEndpointConnections() .getWithResponse("myResourceGroup", "contoso", "myConnection", com.azure.core.util.Context.NONE); } } 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 91e7087c469b6..b2b8622d63af7 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for PrivateEndpointConnections ListByConfigurationStore. */ +/** + * Samples for PrivateEndpointConnections ListByConfigurationStore. + */ public final class PrivateEndpointConnectionsListByConfigurationStoreSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListPrivateEndpointConnections.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresListPrivateEndpointConnections.json */ /** * Sample code: PrivateEndpointConnection_List. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void privateEndpointConnectionList( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateEndpointConnections() + public static void + privateEndpointConnectionList(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.privateEndpointConnections() .listByConfigurationStore("myResourceGroup", "contoso", com.azure.core.util.Context.NONE); } } 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 b9e2d65acb20a..4f605039f3775 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for PrivateLinkResources Get. */ +/** + * Samples for PrivateLinkResources Get. + */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourceGet.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * PrivateLinkResourceGet.json */ /** * Sample code: PrivateLinkResources_Get. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void privateLinkResourcesGet( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateLinkResources() + public static void + privateLinkResourcesGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.privateLinkResources() .getWithResponse("myResourceGroup", "contoso", "configurationStores", com.azure.core.util.Context.NONE); } } 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 45b8563557ba9..6c16abce720c3 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for PrivateLinkResources ListByConfigurationStore. */ +/** + * Samples for PrivateLinkResources ListByConfigurationStore. + */ public final class PrivateLinkResourcesListByConfigurationStoreSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/PrivateLinkResourcesListByConfigurationStore.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * PrivateLinkResourcesListByConfigurationStore.json */ /** * Sample code: PrivateLinkResources_ListGroupIds. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void privateLinkResourcesListGroupIds( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .privateLinkResources() + public static void + privateLinkResourcesListGroupIds(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.privateLinkResources() .listByConfigurationStore("myResourceGroup", "contoso", com.azure.core.util.Context.NONE); } } 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 5350b50ba5527..e7a90ff0ec198 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for Replicas Create. */ +/** + * Samples for Replicas Create. + */ public final class ReplicasCreateSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresCreateReplica.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateReplica.json */ /** * Sample code: Replicas_Create. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void replicasCreate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .replicas() + manager.replicas() .define("myReplicaEus") .withExistingConfigurationStore("myResourceGroup", "contoso") .withRegion("eastus") 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 7f9ecd35328da..335776da257dd 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for Replicas Delete. */ +/** + * Samples for Replicas Delete. + */ public final class ReplicasDeleteSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresDeleteReplica.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresDeleteReplica.json */ /** * Sample code: Replicas_Delete. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void replicasDelete(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { 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 00403f70e85f0..593b9a94709f4 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for Replicas Get. */ +/** + * Samples for Replicas Get. + */ public final class ReplicasGetSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresGetReplica.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresGetReplica.json */ /** * Sample code: Replicas_Get. - * + * * @param manager Entry point to AppConfigurationManager. */ public static void replicasGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .replicas() + manager.replicas() .getWithResponse("myResourceGroup", "contoso", "myReplicaEus", com.azure.core.util.Context.NONE); } } 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 d7d201355ef55..8e8895bd8af68 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 @@ -4,20 +4,23 @@ package com.azure.resourcemanager.appconfiguration.generated; -/** Samples for Replicas ListByConfigurationStore. */ +/** + * Samples for Replicas ListByConfigurationStore. + */ public final class ReplicasListByConfigurationStoreSamples { /* - * x-ms-original-file: specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/stable/2023-03-01/examples/ConfigurationStoresListReplicas.json + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresListReplicas.json */ /** * Sample code: Replicas_ListByConfigurationStore. - * + * * @param manager Entry point to AppConfigurationManager. */ - public static void replicasListByConfigurationStore( - com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { - manager - .replicas() + public static void + replicasListByConfigurationStore(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.replicas() .listByConfigurationStore("myResourceGroup", "contoso", null, com.azure.core.util.Context.NONE); } } 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 new file mode 100644 index 0000000000000..8294ea0ee039d --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/SnapshotsCreateSamples.java @@ -0,0 +1,32 @@ +// 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.KeyValueFilter; +import java.util.Arrays; + +/** + * Samples for Snapshots Create. + */ +public final class SnapshotsCreateSamples { + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresCreateSnapshot.json + */ + /** + * Sample code: Snapshots_Create. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void snapshotsCreate(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.snapshots() + .define("mySnapshot") + .withExistingConfigurationStore("myResourceGroup", "contoso") + .withFilters(Arrays.asList(new KeyValueFilter().withKey("fakeTokenPlaceholder").withLabel("Production"))) + .withRetentionPeriod(3600L) + .create(); + } +} 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 new file mode 100644 index 0000000000000..f1a2548cac592 --- /dev/null +++ b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/samples/java/com/azure/resourcemanager/appconfiguration/generated/SnapshotsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appconfiguration.generated; + +/** + * Samples for Snapshots Get. + */ +public final class SnapshotsGetSamples { + /* + * x-ms-original-file: + * specification/appconfiguration/resource-manager/Microsoft.AppConfiguration/preview/2024-09-01-preview/examples/ + * ConfigurationStoresGetSnapshot.json + */ + /** + * Sample code: Snapshots_Get. + * + * @param manager Entry point to AppConfigurationManager. + */ + public static void snapshotsGet(com.azure.resourcemanager.appconfiguration.AppConfigurationManager manager) { + manager.snapshots() + .getWithResponse("myResourceGroup", "contoso", "mySnapshot", com.azure.core.util.Context.NONE); + } +} 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 edc89f22e5616..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ApiKeyInnerTests.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.fluent.models.ApiKeyInner; - -public final class ApiKeyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiKeyInner model = - BinaryData - .fromString( - "{\"id\":\"fqpte\",\"name\":\"zzvypyqrimzinp\",\"value\":\"wjdk\",\"connectionString\":\"soodqxhcrmnoh\",\"lastModified\":\"2021-01-19T09:55:19Z\",\"readOnly\":true}") - .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 c2a040608e378..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ApiKeyListResultTests.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.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\":\"kyfi\",\"name\":\"fidfvzw\",\"value\":\"uht\",\"connectionString\":\"wisdkft\",\"lastModified\":\"2021-06-08T12:42:14Z\",\"readOnly\":true},{\"id\":\"eiwaopvkmi\",\"name\":\"mmxdcu\",\"value\":\"fsrpymzidnse\",\"connectionString\":\"xtbzsgfyccsne\",\"lastModified\":\"2021-01-16T10:20:52Z\",\"readOnly\":false}],\"nextLink\":\"eiachboosflnr\"}") - .toObject(ApiKeyListResult.class); - Assertions.assertEquals("eiachboosflnr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiKeyListResult model = - new ApiKeyListResult() - .withValue(Arrays.asList(new ApiKeyInner(), new ApiKeyInner())) - .withNextLink("eiachboosflnr"); - model = BinaryData.fromObject(model).toObject(ApiKeyListResult.class); - Assertions.assertEquals("eiachboosflnr", 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 7085033c9cd6d..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/CheckNameAvailabilityParametersTests.java +++ /dev/null @@ -1,35 +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\":\"hmuouqfprwzwbn\",\"type\":\"Microsoft.AppConfiguration/configurationStores\"}") - .toObject(CheckNameAvailabilityParameters.class); - Assertions.assertEquals("hmuouqfprwzwbn", 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("hmuouqfprwzwbn") - .withType(ConfigurationResourceType.MICROSOFT_APP_CONFIGURATION_CONFIGURATION_STORES); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityParameters.class); - Assertions.assertEquals("hmuouqfprwzwbn", 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/ConfigurationStoreInnerTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoreInnerTests.java deleted file mode 100644 index 092f0a17fc869..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoreInnerTests.java +++ /dev/null @@ -1,87 +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.ConfigurationStoreInner; -import com.azure.resourcemanager.appconfiguration.models.CreateMode; -import com.azure.resourcemanager.appconfiguration.models.EncryptionProperties; -import com.azure.resourcemanager.appconfiguration.models.IdentityType; -import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; -import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; -import com.azure.resourcemanager.appconfiguration.models.Sku; -import com.azure.resourcemanager.appconfiguration.models.UserIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationStoreInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationStoreInner model = - BinaryData - .fromString( - "{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"o\":{\"principalId\":\"pjoxzjnch\",\"clientId\":\"jspodmailzyde\"}},\"principalId\":\"yahux\",\"tenantId\":\"pmqnja\"},\"properties\":{\"provisioningState\":\"Deleting\",\"creationDate\":\"2021-08-22T00:38:37Z\",\"endpoint\":\"r\",\"encryption\":{},\"privateEndpointConnections\":[{\"id\":\"tegjvwmf\",\"name\":\"t\",\"type\":\"mdvpjhulsu\"},{\"id\":\"kjozkrwfnd\",\"name\":\"djpslw\",\"type\":\"dpvwryoqpsoaccta\"},{\"id\":\"ljlahbcryf\",\"name\":\"fdosyg\",\"type\":\"paojakhmsbzjh\"}],\"publicNetworkAccess\":\"Disabled\",\"disableLocalAuth\":true,\"softDeleteRetentionInDays\":656929943,\"enablePurgeProtection\":false,\"createMode\":\"Default\"},\"sku\":{\"name\":\"lthqtrgqjbp\"},\"location\":\"fsinzgvfcjrwzoxx\",\"tags\":{\"eqfpj\":\"elluwfziton\",\"ninmayhuyb\":\"jlxofpdvhpfxxyp\",\"ooginuvamih\":\"kpode\",\"vyevcciqi\":\"ognarxzxtheotus\"},\"id\":\"nhungbw\",\"name\":\"zrnf\",\"type\":\"gxg\"}") - .toObject(ConfigurationStoreInner.class); - Assertions.assertEquals("fsinzgvfcjrwzoxx", model.location()); - Assertions.assertEquals("elluwfziton", model.tags().get("eqfpj")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("lthqtrgqjbp", model.sku().name()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(656929943, model.softDeleteRetentionInDays()); - Assertions.assertEquals(false, model.enablePurgeProtection()); - Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationStoreInner model = - new ConfigurationStoreInner() - .withLocation("fsinzgvfcjrwzoxx") - .withTags( - mapOf( - "eqfpj", - "elluwfziton", - "ninmayhuyb", - "jlxofpdvhpfxxyp", - "ooginuvamih", - "kpode", - "vyevcciqi", - "ognarxzxtheotus")) - .withIdentity( - new ResourceIdentity() - .withType(IdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("o", new UserIdentity()))) - .withSku(new Sku().withName("lthqtrgqjbp")) - .withEncryption(new EncryptionProperties()) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withDisableLocalAuth(true) - .withSoftDeleteRetentionInDays(656929943) - .withEnablePurgeProtection(false) - .withCreateMode(CreateMode.DEFAULT); - model = BinaryData.fromObject(model).toObject(ConfigurationStoreInner.class); - Assertions.assertEquals("fsinzgvfcjrwzoxx", model.location()); - Assertions.assertEquals("elluwfziton", model.tags().get("eqfpj")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("lthqtrgqjbp", model.sku().name()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(656929943, model.softDeleteRetentionInDays()); - Assertions.assertEquals(false, model.enablePurgeProtection()); - Assertions.assertEquals(CreateMode.DEFAULT, model.createMode()); - } - - @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/ConfigurationStoreListResultTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoreListResultTests.java deleted file mode 100644 index 3ed5a56178a26..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoreListResultTests.java +++ /dev/null @@ -1,112 +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.ConfigurationStoreInner; -import com.azure.resourcemanager.appconfiguration.models.ConfigurationStoreListResult; -import com.azure.resourcemanager.appconfiguration.models.CreateMode; -import com.azure.resourcemanager.appconfiguration.models.IdentityType; -import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; -import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; -import com.azure.resourcemanager.appconfiguration.models.Sku; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationStoreListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationStoreListResult model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{},\"principalId\":\"jxpybczmeh\",\"tenantId\":\"zopbsphrupidgs\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"creationDate\":\"2021-10-09T17:42:33Z\",\"endpoint\":\"hoycm\",\"privateEndpointConnections\":[],\"publicNetworkAccess\":\"Enabled\",\"disableLocalAuth\":true,\"softDeleteRetentionInDays\":1615603178,\"enablePurgeProtection\":false,\"createMode\":\"Recover\"},\"sku\":{\"name\":\"oqjzehtbmufpowno\"},\"location\":\"hwlrx\",\"tags\":{\"dmbpazlobcufpdz\":\"soqijg\",\"qqjnqgl\":\"rbt\",\"foooj\":\"qgn\"},\"id\":\"wifsq\",\"name\":\"saagdf\",\"type\":\"glzlhjxrifkwmrv\"},{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{},\"principalId\":\"to\",\"tenantId\":\"pa\"},\"properties\":{\"provisioningState\":\"Failed\",\"creationDate\":\"2021-05-16T08:34:45Z\",\"endpoint\":\"ucmpoyfd\",\"privateEndpointConnections\":[],\"publicNetworkAccess\":\"Disabled\",\"disableLocalAuth\":false,\"softDeleteRetentionInDays\":1139572680,\"enablePurgeProtection\":false,\"createMode\":\"Default\"},\"sku\":{\"name\":\"deqsrdeupewn\"},\"location\":\"eitjz\",\"tags\":{\"hs\":\"usarhmofc\",\"xukcdmpar\":\"yurkdtmlxhekuksj\"},\"id\":\"ryuanzwuxzdxtay\",\"name\":\"lhmwhfpmrqobm\",\"type\":\"u\"},{\"identity\":{\"type\":\"SystemAssigned," - + " UserAssigned\",\"userAssignedIdentities\":{},\"principalId\":\"tihfx\",\"tenantId\":\"jbpzvgnwzsymg\"},\"properties\":{\"provisioningState\":\"Deleting\",\"creationDate\":\"2021-01-28T09:29:32Z\",\"endpoint\":\"kohdbiha\",\"privateEndpointConnections\":[],\"publicNetworkAccess\":\"Disabled\",\"disableLocalAuth\":false,\"softDeleteRetentionInDays\":43632750,\"enablePurgeProtection\":false,\"createMode\":\"Default\"},\"sku\":{\"name\":\"th\"},\"location\":\"hab\",\"tags\":{\"byscnp\":\"ikxwc\",\"hiv\":\"x\",\"rtfw\":\"qniwbybrkxvdumj\",\"cs\":\"ukxgaud\"},\"id\":\"h\",\"name\":\"jcny\",\"type\":\"j\"}],\"nextLink\":\"ryhtnapczwlokjy\"}") - .toObject(ConfigurationStoreListResult.class); - Assertions.assertEquals("hwlrx", model.value().get(0).location()); - Assertions.assertEquals("soqijg", model.value().get(0).tags().get("dmbpazlobcufpdz")); - Assertions.assertEquals(IdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("oqjzehtbmufpowno", model.value().get(0).sku().name()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals(true, model.value().get(0).disableLocalAuth()); - Assertions.assertEquals(1615603178, model.value().get(0).softDeleteRetentionInDays()); - Assertions.assertEquals(false, model.value().get(0).enablePurgeProtection()); - Assertions.assertEquals(CreateMode.RECOVER, model.value().get(0).createMode()); - Assertions.assertEquals("ryhtnapczwlokjy", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationStoreListResult model = - new ConfigurationStoreListResult() - .withValue( - Arrays - .asList( - new ConfigurationStoreInner() - .withLocation("hwlrx") - .withTags(mapOf("dmbpazlobcufpdz", "soqijg", "qqjnqgl", "rbt", "foooj", "qgn")) - .withIdentity( - new ResourceIdentity() - .withType(IdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withSku(new Sku().withName("oqjzehtbmufpowno")) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withDisableLocalAuth(true) - .withSoftDeleteRetentionInDays(1615603178) - .withEnablePurgeProtection(false) - .withCreateMode(CreateMode.RECOVER), - new ConfigurationStoreInner() - .withLocation("eitjz") - .withTags(mapOf("hs", "usarhmofc", "xukcdmpar", "yurkdtmlxhekuksj")) - .withIdentity( - new ResourceIdentity() - .withType(IdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withSku(new Sku().withName("deqsrdeupewn")) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withDisableLocalAuth(false) - .withSoftDeleteRetentionInDays(1139572680) - .withEnablePurgeProtection(false) - .withCreateMode(CreateMode.DEFAULT), - new ConfigurationStoreInner() - .withLocation("hab") - .withTags( - mapOf("byscnp", "ikxwc", "hiv", "x", "rtfw", "qniwbybrkxvdumj", "cs", "ukxgaud")) - .withIdentity( - new ResourceIdentity() - .withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withSku(new Sku().withName("th")) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withDisableLocalAuth(false) - .withSoftDeleteRetentionInDays(43632750) - .withEnablePurgeProtection(false) - .withCreateMode(CreateMode.DEFAULT))) - .withNextLink("ryhtnapczwlokjy"); - model = BinaryData.fromObject(model).toObject(ConfigurationStoreListResult.class); - Assertions.assertEquals("hwlrx", model.value().get(0).location()); - Assertions.assertEquals("soqijg", model.value().get(0).tags().get("dmbpazlobcufpdz")); - Assertions.assertEquals(IdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("oqjzehtbmufpowno", model.value().get(0).sku().name()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals(true, model.value().get(0).disableLocalAuth()); - Assertions.assertEquals(1615603178, model.value().get(0).softDeleteRetentionInDays()); - Assertions.assertEquals(false, model.value().get(0).enablePurgeProtection()); - Assertions.assertEquals(CreateMode.RECOVER, model.value().get(0).createMode()); - Assertions.assertEquals("ryhtnapczwlokjy", model.nextLink()); - } - - @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/ConfigurationStoreUpdateParametersTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoreUpdateParametersTests.java deleted file mode 100644 index 733715f0ffe73..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoreUpdateParametersTests.java +++ /dev/null @@ -1,69 +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.ConfigurationStoreUpdateParameters; -import com.azure.resourcemanager.appconfiguration.models.EncryptionProperties; -import com.azure.resourcemanager.appconfiguration.models.IdentityType; -import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; -import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; -import com.azure.resourcemanager.appconfiguration.models.Sku; -import com.azure.resourcemanager.appconfiguration.models.UserIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ConfigurationStoreUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConfigurationStoreUpdateParameters model = - BinaryData - .fromString( - "{\"properties\":{\"encryption\":{},\"disableLocalAuth\":false,\"publicNetworkAccess\":\"Disabled\",\"enablePurgeProtection\":true},\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"uqktap\":{\"principalId\":\"mmnkzsmodmgl\",\"clientId\":\"gpbkwtmut\"},\"gbbjfddgmbmbe\":{\"principalId\":\"wgcu\",\"clientId\":\"tumkdosvqwhbm\"}},\"principalId\":\"pbhtqqrolfpfpsa\",\"tenantId\":\"bquxigjy\"},\"sku\":{\"name\":\"zjaoyfhrtxil\"},\"tags\":{\"wrlyxwjkcprb\":\"kujysvlejuvfq\",\"vpys\":\"wbxgjvt\"}}") - .toObject(ConfigurationStoreUpdateParameters.class); - Assertions.assertEquals(IdentityType.NONE, model.identity().type()); - Assertions.assertEquals("zjaoyfhrtxil", model.sku().name()); - Assertions.assertEquals("kujysvlejuvfq", model.tags().get("wrlyxwjkcprb")); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals(true, model.enablePurgeProtection()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConfigurationStoreUpdateParameters model = - new ConfigurationStoreUpdateParameters() - .withIdentity( - new ResourceIdentity() - .withType(IdentityType.NONE) - .withUserAssignedIdentities( - mapOf("uqktap", new UserIdentity(), "gbbjfddgmbmbe", new UserIdentity()))) - .withSku(new Sku().withName("zjaoyfhrtxil")) - .withTags(mapOf("wrlyxwjkcprb", "kujysvlejuvfq", "vpys", "wbxgjvt")) - .withEncryption(new EncryptionProperties()) - .withDisableLocalAuth(false) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withEnablePurgeProtection(true); - model = BinaryData.fromObject(model).toObject(ConfigurationStoreUpdateParameters.class); - Assertions.assertEquals(IdentityType.NONE, model.identity().type()); - Assertions.assertEquals("zjaoyfhrtxil", model.sku().name()); - Assertions.assertEquals("kujysvlejuvfq", model.tags().get("wrlyxwjkcprb")); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals(true, model.enablePurgeProtection()); - } - - @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/ConfigurationStoresCreateMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresCreateMockTests.java deleted file mode 100644 index c65bb59cbce26..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresCreateMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ConfigurationStore; -import com.azure.resourcemanager.appconfiguration.models.CreateMode; -import com.azure.resourcemanager.appconfiguration.models.EncryptionProperties; -import com.azure.resourcemanager.appconfiguration.models.IdentityType; -import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; -import com.azure.resourcemanager.appconfiguration.models.ResourceIdentity; -import com.azure.resourcemanager.appconfiguration.models.Sku; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{},\"principalId\":\"nxknalaulp\",\"tenantId\":\"gdtpnapnyiro\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"creationDate\":\"2020-12-20T18:46:56Z\",\"endpoint\":\"pgylg\",\"encryption\":{},\"privateEndpointConnections\":[],\"publicNetworkAccess\":\"Disabled\",\"disableLocalAuth\":false,\"softDeleteRetentionInDays\":119641642,\"enablePurgeProtection\":true,\"createMode\":\"Recover\"},\"sku\":{\"name\":\"qwwncw\"},\"location\":\"hxg\",\"tags\":{\"kteo\":\"mgucna\",\"pfqbuaceopzf\":\"llwptfdy\"},\"id\":\"rhhuaopppcqeqx\",\"name\":\"lzdahzxctobgbkdm\",\"type\":\"izpost\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AppConfigurationManager manager = - AppConfigurationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConfigurationStore response = - manager - .configurationStores() - .define("vawjvzunlu") - .withRegion("ttouwaboekqvkel") - .withExistingResourceGroup("zlmwlxkvugfhz") - .withSku(new Sku().withName("luu")) - .withTags(mapOf("aalnjixi", "vbxwyjsflhh")) - .withIdentity(new ResourceIdentity().withType(IdentityType.NONE).withUserAssignedIdentities(mapOf())) - .withEncryption(new EncryptionProperties()) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withDisableLocalAuth(false) - .withSoftDeleteRetentionInDays(820009390) - .withEnablePurgeProtection(false) - .withCreateMode(CreateMode.RECOVER) - .create(); - - Assertions.assertEquals("hxg", response.location()); - Assertions.assertEquals("mgucna", response.tags().get("kteo")); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("qwwncw", response.sku().name()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.publicNetworkAccess()); - Assertions.assertEquals(false, response.disableLocalAuth()); - Assertions.assertEquals(119641642, response.softDeleteRetentionInDays()); - Assertions.assertEquals(true, response.enablePurgeProtection()); - Assertions.assertEquals(CreateMode.RECOVER, response.createMode()); - } - - @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/ConfigurationStoresDeleteMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresDeleteMockTests.java deleted file mode 100644 index d48f78c0ca79e..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresDeleteMockTests.java +++ /dev/null @@ -1,61 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("uhcdhm", "ualaexqpvfadmw", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetByResourceGroupWithResponseMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 333861d768f12..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,81 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ConfigurationStore; -import com.azure.resourcemanager.appconfiguration.models.CreateMode; -import com.azure.resourcemanager.appconfiguration.models.IdentityType; -import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{},\"principalId\":\"obglaocqxtcc\",\"tenantId\":\"yudxytlmoy\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"creationDate\":\"2021-03-16T12:34:31Z\",\"endpoint\":\"wpzntxhdzh\",\"encryption\":{},\"privateEndpointConnections\":[],\"publicNetworkAccess\":\"Enabled\",\"disableLocalAuth\":false,\"softDeleteRetentionInDays\":869075022,\"enablePurgeProtection\":false,\"createMode\":\"Default\"},\"sku\":{\"name\":\"bkyvp\"},\"location\":\"anuzbpzkafkuw\",\"tags\":{\"seyvj\":\"nwbmeh\"},\"id\":\"srtslhspkdeem\",\"name\":\"ofmxagkvtmelmqkr\",\"type\":\"ahvljuaha\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AppConfigurationManager manager = - AppConfigurationManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConfigurationStore response = - manager - .configurationStores() - .getByResourceGroupWithResponse("azqugxywpmueefj", "wfqkquj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("anuzbpzkafkuw", response.location()); - Assertions.assertEquals("nwbmeh", response.tags().get("seyvj")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("bkyvp", response.sku().name()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.publicNetworkAccess()); - Assertions.assertEquals(false, response.disableLocalAuth()); - Assertions.assertEquals(869075022, response.softDeleteRetentionInDays()); - Assertions.assertEquals(false, response.enablePurgeProtection()); - Assertions.assertEquals(CreateMode.DEFAULT, response.createMode()); - } -} 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 e064c5d3764b9..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresGetDeletedWithResponseMockTests.java +++ /dev/null @@ -1,67 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.DeletedConfigurationStore; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresGetDeletedWithResponseMockTests { - @Test - public void testGetDeletedWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"zjuzgwyz\",\"name\":\"txon\",\"type\":\"ts\",\"properties\":{\"configurationStoreId\":\"cbpwxqpsrknft\",\"location\":\"vriuhprwmdyvx\",\"deletionDate\":\"2021-05-28T21:07:01Z\",\"scheduledPurgeDate\":\"2021-09-21T09:24:54Z\",\"tags\":{\"bycnojvkn\":\"wroyqbexrmcq\"},\"purgeProtectionEnabled\":true}}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("jkbegibtnmxiebww", "loayqcgw", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListByResourceGroupMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListByResourceGroupMockTests.java deleted file mode 100644 index a55cc1d04b6e4..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListByResourceGroupMockTests.java +++ /dev/null @@ -1,81 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ConfigurationStore; -import com.azure.resourcemanager.appconfiguration.models.CreateMode; -import com.azure.resourcemanager.appconfiguration.models.IdentityType; -import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"type\":\"SystemAssigned," - + " UserAssigned\",\"userAssignedIdentities\":{},\"principalId\":\"apskrdqm\",\"tenantId\":\"jdhtldwkyzxu\"},\"properties\":{\"provisioningState\":\"Creating\",\"creationDate\":\"2021-06-12T03:44:06Z\",\"endpoint\":\"cwsvlxotog\",\"encryption\":{},\"privateEndpointConnections\":[],\"publicNetworkAccess\":\"Enabled\",\"disableLocalAuth\":false,\"softDeleteRetentionInDays\":1364621442,\"enablePurgeProtection\":false,\"createMode\":\"Default\"},\"sku\":{\"name\":\"vce\"},\"location\":\"eil\",\"tags\":{\"jfcn\":\"oty\",\"x\":\"bkc\",\"nv\":\"hbttkphyw\",\"qnermclfplphoxu\":\"t\"},\"id\":\"crpab\",\"name\":\"ye\",\"type\":\"sbj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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().listByResourceGroup("a", "ckhsmtxpsieb", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("eil", response.iterator().next().location()); - Assertions.assertEquals("oty", response.iterator().next().tags().get("jfcn")); - Assertions - .assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("vce", response.iterator().next().sku().name()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals(false, response.iterator().next().disableLocalAuth()); - Assertions.assertEquals(1364621442, response.iterator().next().softDeleteRetentionInDays()); - Assertions.assertEquals(false, response.iterator().next().enablePurgeProtection()); - Assertions.assertEquals(CreateMode.DEFAULT, response.iterator().next().createMode()); - } -} 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 db69c002e10b9..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListDeletedMockTests.java +++ /dev/null @@ -1,65 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.DeletedConfigurationStore; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresListDeletedMockTests { - @Test - public void testListDeleted() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"ni\",\"name\":\"x\",\"type\":\"kpycgklwndnhjd\",\"properties\":{\"configurationStoreId\":\"hvylwzbt\",\"location\":\"xujznbmpowu\",\"deletionDate\":\"2020-12-27T11:29:17Z\",\"scheduledPurgeDate\":\"2021-07-21T15:39:33Z\",\"tags\":{\"obbc\":\"eualupjmkhf\",\"tghfgblcgwxzvl\":\"wsrtjriplrbpbe\"},\"purgeProtectionEnabled\":true}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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 35d7ccd22b0ec..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListKeysMockTests.java +++ /dev/null @@ -1,65 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ApiKey; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresListKeysMockTests { - @Test - public void testListKeys() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"nbbelda\",\"name\":\"zbaliourqha\",\"value\":\"uhashsfwx\",\"connectionString\":\"owzxcu\",\"lastModified\":\"2021-06-04T05:08:46Z\",\"readOnly\":true}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("rcrgvx", "vgomz", "fmisg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListMockTests.java b/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListMockTests.java deleted file mode 100644 index cd2433f195e8b..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresListMockTests.java +++ /dev/null @@ -1,79 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ConfigurationStore; -import com.azure.resourcemanager.appconfiguration.models.CreateMode; -import com.azure.resourcemanager.appconfiguration.models.IdentityType; -import com.azure.resourcemanager.appconfiguration.models.PublicNetworkAccess; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{},\"principalId\":\"cuh\",\"tenantId\":\"tcty\"},\"properties\":{\"provisioningState\":\"Creating\",\"creationDate\":\"2021-09-08T21:14:09Z\",\"endpoint\":\"vplwzbhv\",\"encryption\":{},\"privateEndpointConnections\":[],\"publicNetworkAccess\":\"Disabled\",\"disableLocalAuth\":true,\"softDeleteRetentionInDays\":1013735837,\"enablePurgeProtection\":false,\"createMode\":\"Recover\"},\"sku\":{\"name\":\"ukkfplgmgs\"},\"location\":\"kjz\",\"tags\":{\"i\":\"slpvlop\"},\"id\":\"ighxpk\",\"name\":\"wzbaiue\",\"type\":\"baumnyqupedeoj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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().list("gnxytxhpzxbz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kjz", response.iterator().next().location()); - Assertions.assertEquals("slpvlop", response.iterator().next().tags().get("i")); - Assertions.assertEquals(IdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("ukkfplgmgs", response.iterator().next().sku().name()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals(true, response.iterator().next().disableLocalAuth()); - Assertions.assertEquals(1013735837, response.iterator().next().softDeleteRetentionInDays()); - Assertions.assertEquals(false, response.iterator().next().enablePurgeProtection()); - Assertions.assertEquals(CreateMode.RECOVER, response.iterator().next().createMode()); - } -} 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 f1d0f6f9ce3da..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresPurgeDeletedMockTests.java +++ /dev/null @@ -1,61 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresPurgeDeletedMockTests { - @Test - public void testPurgeDeleted() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("qsgzvahapj", "zhpvgqzcjrvxd", 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 c8aa1117fd7dc..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ConfigurationStoresRegenerateKeyWithResponseMockTests.java +++ /dev/null @@ -1,72 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ApiKey; -import com.azure.resourcemanager.appconfiguration.models.RegenerateKeyParameters; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConfigurationStoresRegenerateKeyWithResponseMockTests { - @Test - public void testRegenerateKeyWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"uojgj\",\"name\":\"jueiotwmcdytd\",\"value\":\"it\",\"connectionString\":\"rjaw\",\"lastModified\":\"2021-05-13T06:47:58Z\",\"readOnly\":true}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "oxdjebwpuc", - "wfvovbv", - new RegenerateKeyParameters().withId("uecivyhz"), - com.azure.core.util.Context.NONE) - .getValue(); - } -} 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 b7a0d9faa899a..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStoreInnerTests.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.fluent.models.DeletedConfigurationStoreInner; - -public final class DeletedConfigurationStoreInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeletedConfigurationStoreInner model = - BinaryData - .fromString( - "{\"id\":\"uko\",\"name\":\"yaxuconuqszfkb\",\"type\":\"pewr\",\"properties\":{\"configurationStoreId\":\"wv\",\"location\":\"ektcxsen\",\"deletionDate\":\"2021-11-28T07:09:02Z\",\"scheduledPurgeDate\":\"2021-08-04T00:26:01Z\",\"tags\":{\"lihkaetcktvfc\":\"rzpwvlqdqgbiq\",\"nkymuctqhjfbebrj\":\"vf\",\"wutttxfvjrbi\":\"xerf\"},\"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 038be952ac443..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStoreListResultTests.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.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\":\"de\",\"name\":\"jzicwifsjt\",\"type\":\"zfbishcbkhaj\",\"properties\":{\"configurationStoreId\":\"eamdp\",\"location\":\"g\",\"deletionDate\":\"2021-05-30T00:59:07Z\",\"scheduledPurgeDate\":\"2021-01-24T10:22:55Z\",\"tags\":{},\"purgeProtectionEnabled\":true}},{\"id\":\"pwhonowkg\",\"name\":\"wankixzbi\",\"type\":\"eputtmrywnuzoqf\",\"properties\":{\"configurationStoreId\":\"qzrnkcqvyxlwhz\",\"location\":\"icohoqqnwvl\",\"deletionDate\":\"2021-02-08T19:31:14Z\",\"scheduledPurgeDate\":\"2021-11-09T22:07:11Z\",\"tags\":{},\"purgeProtectionEnabled\":false}}],\"nextLink\":\"nmmqhgyxzkon\"}") - .toObject(DeletedConfigurationStoreListResult.class); - Assertions.assertEquals("nmmqhgyxzkon", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeletedConfigurationStoreListResult model = - new DeletedConfigurationStoreListResult() - .withValue(Arrays.asList(new DeletedConfigurationStoreInner(), new DeletedConfigurationStoreInner())) - .withNextLink("nmmqhgyxzkon"); - model = BinaryData.fromObject(model).toObject(DeletedConfigurationStoreListResult.class); - Assertions.assertEquals("nmmqhgyxzkon", 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 8436fa44eb98f..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/DeletedConfigurationStorePropertiesTests.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.fluent.models.DeletedConfigurationStoreProperties; - -public final class DeletedConfigurationStorePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeletedConfigurationStoreProperties model = - BinaryData - .fromString( - "{\"configurationStoreId\":\"epcyvahfnlj\",\"location\":\"qxj\",\"deletionDate\":\"2021-01-29T11:34:22Z\",\"scheduledPurgeDate\":\"2021-01-04T05:40:41Z\",\"tags\":{\"yoxgvcltbgsnc\":\"dokgjl\",\"htxfvgxbfsmxnehm\":\"hkjeszzhbi\"},\"purgeProtectionEnabled\":false}") - .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 f491d601f7b42..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/KeyValuesDeleteMockTests.java +++ /dev/null @@ -1,61 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class KeyValuesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("bcvkcvqvpkeq", "cvdrhvoodsot", "obzdopcjwvnhdl", 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 f9cc417112d78..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/LogSpecificationTests.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.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\":\"jj\",\"displayName\":\"v\",\"blobDuration\":\"dgwdslfhot\"}") - .toObject(LogSpecification.class); - Assertions.assertEquals("jj", model.name()); - Assertions.assertEquals("v", model.displayName()); - Assertions.assertEquals("dgwdslfhot", model.blobDuration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogSpecification model = - new LogSpecification().withName("jj").withDisplayName("v").withBlobDuration("dgwdslfhot"); - model = BinaryData.fromObject(model).toObject(LogSpecification.class); - Assertions.assertEquals("jj", model.name()); - Assertions.assertEquals("v", model.displayName()); - Assertions.assertEquals("dgwdslfhot", 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 f7392dff78405..0000000000000 --- 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\":\"ectehf\",\"displayName\":\"scjeypv\",\"internalName\":\"zrkgqhcjrefovg\"}") - .toObject(MetricDimension.class); - Assertions.assertEquals("ectehf", model.name()); - Assertions.assertEquals("scjeypv", model.displayName()); - Assertions.assertEquals("zrkgqhcjrefovg", model.internalName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricDimension model = - new MetricDimension().withName("ectehf").withDisplayName("scjeypv").withInternalName("zrkgqhcjrefovg"); - model = BinaryData.fromObject(model).toObject(MetricDimension.class); - Assertions.assertEquals("ectehf", model.name()); - Assertions.assertEquals("scjeypv", model.displayName()); - Assertions.assertEquals("zrkgqhcjrefovg", 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 2629cb839610d..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/MetricSpecificationTests.java +++ /dev/null @@ -1,67 +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\":\"cynpwlbjnp\",\"displayName\":\"cftadeh\",\"displayDescription\":\"ltyfsop\",\"unit\":\"suesnzw\",\"aggregationType\":\"jbavorxzdm\",\"internalMetricName\":\"ctbqvudwx\",\"dimensions\":[{\"name\":\"vo\",\"displayName\":\"ujjugwdkcglh\",\"internalName\":\"azjdyggd\"},{\"name\":\"ixhbkuofqweykhm\",\"displayName\":\"evfyexfwhybcib\",\"internalName\":\"vdcsitynn\"}],\"fillGapWithZero\":true}") - .toObject(MetricSpecification.class); - Assertions.assertEquals("cynpwlbjnp", model.name()); - Assertions.assertEquals("cftadeh", model.displayName()); - Assertions.assertEquals("ltyfsop", model.displayDescription()); - Assertions.assertEquals("suesnzw", model.unit()); - Assertions.assertEquals("jbavorxzdm", model.aggregationType()); - Assertions.assertEquals("ctbqvudwx", model.internalMetricName()); - Assertions.assertEquals("vo", model.dimensions().get(0).name()); - Assertions.assertEquals("ujjugwdkcglh", model.dimensions().get(0).displayName()); - Assertions.assertEquals("azjdyggd", 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("cynpwlbjnp") - .withDisplayName("cftadeh") - .withDisplayDescription("ltyfsop") - .withUnit("suesnzw") - .withAggregationType("jbavorxzdm") - .withInternalMetricName("ctbqvudwx") - .withDimensions( - Arrays - .asList( - new MetricDimension() - .withName("vo") - .withDisplayName("ujjugwdkcglh") - .withInternalName("azjdyggd"), - new MetricDimension() - .withName("ixhbkuofqweykhm") - .withDisplayName("evfyexfwhybcib") - .withInternalName("vdcsitynn"))) - .withFillGapWithZero(true); - model = BinaryData.fromObject(model).toObject(MetricSpecification.class); - Assertions.assertEquals("cynpwlbjnp", model.name()); - Assertions.assertEquals("cftadeh", model.displayName()); - Assertions.assertEquals("ltyfsop", model.displayDescription()); - Assertions.assertEquals("suesnzw", model.unit()); - Assertions.assertEquals("jbavorxzdm", model.aggregationType()); - Assertions.assertEquals("ctbqvudwx", model.internalMetricName()); - Assertions.assertEquals("vo", model.dimensions().get(0).name()); - Assertions.assertEquals("ujjugwdkcglh", model.dimensions().get(0).displayName()); - Assertions.assertEquals("azjdyggd", 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 3df7d115bbfc3..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/NameAvailabilityStatusInnerTests.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.fluent.models.NameAvailabilityStatusInner; - -public final class NameAvailabilityStatusInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NameAvailabilityStatusInner model = - BinaryData - .fromString("{\"nameAvailable\":false,\"message\":\"wu\",\"reason\":\"gazxuf\"}") - .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 92760dcd7218a..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionDisplayTests.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.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\":\"fcyddg\",\"resource\":\"jthjqkwpyei\",\"operation\":\"mqc\",\"description\":\"q\"}") - .toObject(OperationDefinitionDisplay.class); - Assertions.assertEquals("jthjqkwpyei", model.resource()); - Assertions.assertEquals("mqc", model.operation()); - Assertions.assertEquals("q", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDefinitionDisplay model = - new OperationDefinitionDisplay().withResource("jthjqkwpyei").withOperation("mqc").withDescription("q"); - model = BinaryData.fromObject(model).toObject(OperationDefinitionDisplay.class); - Assertions.assertEquals("jthjqkwpyei", model.resource()); - Assertions.assertEquals("mqc", model.operation()); - Assertions.assertEquals("q", 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 ea9a73c54e8aa..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionInnerTests.java +++ /dev/null @@ -1,57 +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.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\":\"axcfjpgddtocjjx\",\"isDataAction\":true,\"display\":{\"provider\":\"uexhdzx\",\"resource\":\"qeojnxqbzvddntw\",\"operation\":\"eic\",\"description\":\"w\"},\"origin\":\"zao\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[],\"metricSpecifications\":[]}}}") - .toObject(OperationDefinitionInner.class); - Assertions.assertEquals("axcfjpgddtocjjx", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("qeojnxqbzvddntw", model.display().resource()); - Assertions.assertEquals("eic", model.display().operation()); - Assertions.assertEquals("w", model.display().description()); - Assertions.assertEquals("zao", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDefinitionInner model = - new OperationDefinitionInner() - .withName("axcfjpgddtocjjx") - .withIsDataAction(true) - .withDisplay( - new OperationDefinitionDisplay() - .withResource("qeojnxqbzvddntw") - .withOperation("eic") - .withDescription("w")) - .withOrigin("zao") - .withProperties( - new OperationProperties() - .withServiceSpecification( - new ServiceSpecification() - .withLogSpecifications(Arrays.asList()) - .withMetricSpecifications(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(OperationDefinitionInner.class); - Assertions.assertEquals("axcfjpgddtocjjx", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("qeojnxqbzvddntw", model.display().resource()); - Assertions.assertEquals("eic", model.display().operation()); - Assertions.assertEquals("w", model.display().description()); - Assertions.assertEquals("zao", model.origin()); - } -} 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 f1cdf964ae778..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationDefinitionListResultTests.java +++ /dev/null @@ -1,79 +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.OperationDefinitionDisplay; -import com.azure.resourcemanager.appconfiguration.models.OperationDefinitionListResult; -import com.azure.resourcemanager.appconfiguration.models.OperationProperties; -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\":\"pgrjbz\",\"isDataAction\":true,\"display\":{\"provider\":\"xv\",\"resource\":\"byxqabn\",\"operation\":\"cpc\",\"description\":\"hurzafblj\"},\"origin\":\"pbtoqcjmkl\",\"properties\":{}},{\"name\":\"qidtqajzyu\",\"isDataAction\":true,\"display\":{\"provider\":\"jkrlkhbzhfepg\",\"resource\":\"qex\",\"operation\":\"ocxscpaierhhbcs\",\"description\":\"ummajtjaod\"},\"origin\":\"bnbdxkqpxokajion\",\"properties\":{}},{\"name\":\"xg\",\"isDataAction\":false,\"display\":{\"provider\":\"po\",\"resource\":\"maajrmvdjwzrlo\",\"operation\":\"clwhijcoejctbz\",\"description\":\"s\"},\"origin\":\"y\",\"properties\":{}}],\"nextLink\":\"fkgukdkexxppof\"}") - .toObject(OperationDefinitionListResult.class); - Assertions.assertEquals("pgrjbz", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("byxqabn", model.value().get(0).display().resource()); - Assertions.assertEquals("cpc", model.value().get(0).display().operation()); - Assertions.assertEquals("hurzafblj", model.value().get(0).display().description()); - Assertions.assertEquals("pbtoqcjmkl", model.value().get(0).origin()); - Assertions.assertEquals("fkgukdkexxppof", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDefinitionListResult model = - new OperationDefinitionListResult() - .withValue( - Arrays - .asList( - new OperationDefinitionInner() - .withName("pgrjbz") - .withIsDataAction(true) - .withDisplay( - new OperationDefinitionDisplay() - .withResource("byxqabn") - .withOperation("cpc") - .withDescription("hurzafblj")) - .withOrigin("pbtoqcjmkl") - .withProperties(new OperationProperties()), - new OperationDefinitionInner() - .withName("qidtqajzyu") - .withIsDataAction(true) - .withDisplay( - new OperationDefinitionDisplay() - .withResource("qex") - .withOperation("ocxscpaierhhbcs") - .withDescription("ummajtjaod")) - .withOrigin("bnbdxkqpxokajion") - .withProperties(new OperationProperties()), - new OperationDefinitionInner() - .withName("xg") - .withIsDataAction(false) - .withDisplay( - new OperationDefinitionDisplay() - .withResource("maajrmvdjwzrlo") - .withOperation("clwhijcoejctbz") - .withDescription("s")) - .withOrigin("y") - .withProperties(new OperationProperties()))) - .withNextLink("fkgukdkexxppof"); - model = BinaryData.fromObject(model).toObject(OperationDefinitionListResult.class); - Assertions.assertEquals("pgrjbz", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("byxqabn", model.value().get(0).display().resource()); - Assertions.assertEquals("cpc", model.value().get(0).display().operation()); - Assertions.assertEquals("hurzafblj", model.value().get(0).display().description()); - Assertions.assertEquals("pbtoqcjmkl", model.value().get(0).origin()); - Assertions.assertEquals("fkgukdkexxppof", 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 d28f70e241356..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationPropertiesTests.java +++ /dev/null @@ -1,80 +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.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\":\"xuigdtopbobj\",\"displayName\":\"hm\",\"blobDuration\":\"u\"}],\"metricSpecifications\":[{\"name\":\"hrzayvvtpgvdf\",\"displayName\":\"otkftutqxlngx\",\"displayDescription\":\"fgugnxkrxdqmid\",\"unit\":\"hzrvqd\",\"aggregationType\":\"bhj\",\"internalMetricName\":\"igeho\",\"dimensions\":[],\"fillGapWithZero\":true}]}}") - .toObject(OperationProperties.class); - Assertions.assertEquals("xuigdtopbobj", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("hm", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("u", model.serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("hrzayvvtpgvdf", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions - .assertEquals("otkftutqxlngx", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions - .assertEquals( - "fgugnxkrxdqmid", model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("hzrvqd", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("bhj", model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions - .assertEquals("igeho", model.serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals(true, 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("xuigdtopbobj") - .withDisplayName("hm") - .withBlobDuration("u"))) - .withMetricSpecifications( - Arrays - .asList( - new MetricSpecification() - .withName("hrzayvvtpgvdf") - .withDisplayName("otkftutqxlngx") - .withDisplayDescription("fgugnxkrxdqmid") - .withUnit("hzrvqd") - .withAggregationType("bhj") - .withInternalMetricName("igeho") - .withDimensions(Arrays.asList()) - .withFillGapWithZero(true)))); - model = BinaryData.fromObject(model).toObject(OperationProperties.class); - Assertions.assertEquals("xuigdtopbobj", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("hm", model.serviceSpecification().logSpecifications().get(0).displayName()); - Assertions.assertEquals("u", model.serviceSpecification().logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("hrzayvvtpgvdf", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions - .assertEquals("otkftutqxlngx", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions - .assertEquals( - "fgugnxkrxdqmid", model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("hzrvqd", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("bhj", model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions - .assertEquals("igeho", model.serviceSpecification().metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals(true, 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 cb163ac02d8cf..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,72 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsCheckNameAvailabilityWithResponseMockTests { - @Test - public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"nameAvailable\":true,\"message\":\"qjhhkxbpv\",\"reason\":\"mjh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("grcfb") - .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 523ca36b166b9..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsListMockTests.java +++ /dev/null @@ -1,73 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.OperationDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"swbxqz\",\"isDataAction\":false,\"display\":{\"provider\":\"auvjfdxxivet\",\"resource\":\"cqaqtdoqmcbx\",\"operation\":\"vxysl\",\"description\":\"hsfxoblytkb\"},\"origin\":\"pe\",\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[],\"metricSpecifications\":[]}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("xjyngudivk", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("swbxqz", response.iterator().next().name()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - Assertions.assertEquals("cqaqtdoqmcbx", response.iterator().next().display().resource()); - Assertions.assertEquals("vxysl", response.iterator().next().display().operation()); - Assertions.assertEquals("hsfxoblytkb", response.iterator().next().display().description()); - Assertions.assertEquals("pe", response.iterator().next().origin()); - } -} 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 b838a953900f8..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/OperationsRegionalCheckNameAvailabilityWithResponseMockTests.java +++ /dev/null @@ -1,73 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsRegionalCheckNameAvailabilityWithResponseMockTests { - @Test - public void testRegionalCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"nameAvailable\":true,\"message\":\"ruvw\",\"reason\":\"sqfsubcgjbirxb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "krvrns", - new CheckNameAvailabilityParameters() - .withName("shqjohxcrsbf") - .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 7d054c7ec9844..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionInnerTests.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.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\":\"Creating\",\"privateEndpoint\":{\"id\":\"nqecanoaeup\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"ltrpmopj\",\"actionsRequired\":\"None\"}},\"id\":\"atuokthfuiu\",\"name\":\"odsfcpkvxodpuozm\",\"type\":\"zydagfuaxbezyiuo\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("nqecanoaeup", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ltrpmopj", model.privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model = - new PrivateEndpointConnectionInner() - .withPrivateEndpoint(new PrivateEndpoint().withId("nqecanoaeup")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(ConnectionStatus.DISCONNECTED) - .withDescription("ltrpmopj")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("nqecanoaeup", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ltrpmopj", 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 6264a6f95498d..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionListResultTests.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.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnectionListResult; -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\":\"Succeeded\"},\"id\":\"yvxyqjp\",\"name\":\"cattpngjcrcczsq\",\"type\":\"jh\"}],\"nextLink\":\"daj\"}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals("daj", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = - new PrivateEndpointConnectionListResult() - .withValue(Arrays.asList(new PrivateEndpointConnectionInner())) - .withNextLink("daj"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals("daj", 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 d8a20ce058fc3..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionPropertiesTests.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.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\":\"ypnddhsgcb\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"ejk\",\"actionsRequired\":\"Recreate\"}}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("ypnddhsgcb", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ejk", model.privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model = - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpoint().withId("ypnddhsgcb")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(ConnectionStatus.DISCONNECTED) - .withDescription("ejk")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("ypnddhsgcb", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ejk", 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 1e5e0e335d79c..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionReferenceTests.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.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\":\"qxhocdgeablgphut\",\"name\":\"ndv\",\"type\":\"ozwyiftyhxhuro\",\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"lniwpwcukjfkgiaw\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"ypl\",\"actionsRequired\":\"None\"}}}") - .toObject(PrivateEndpointConnectionReference.class); - Assertions.assertEquals("lniwpwcukjfkgiaw", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ypl", model.privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionReference model = - new PrivateEndpointConnectionReference() - .withPrivateEndpoint(new PrivateEndpoint().withId("lniwpwcukjfkgiaw")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(ConnectionStatus.DISCONNECTED) - .withDescription("ypl")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionReference.class); - Assertions.assertEquals("lniwpwcukjfkgiaw", model.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ypl", 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 efa9be3cf24da..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,81 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -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.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"tfz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"v\",\"actionsRequired\":\"None\"}},\"id\":\"r\",\"name\":\"odkwobd\",\"type\":\"gxtibqdxbxw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("tmweriofzpyq") - .withExistingConfigurationStore("erscdntne", "fiwjmygtdssls") - .withPrivateEndpoint(new PrivateEndpoint().withId("n")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(ConnectionStatus.DISCONNECTED) - .withDescription("hszhedplvwiwu")) - .create(); - - Assertions.assertEquals("tfz", response.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.PENDING, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("v", 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 216779b28b591..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ /dev/null @@ -1,63 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("mnvdfzn", "daodvxzbncblyl", "stdbhhxsrzdzu", 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 049656d541890..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"avhqlkth\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"olbgycduiertgccy\",\"actionsRequired\":\"None\"}},\"id\":\"olpsslqlf\",\"name\":\"mdnbbglzpswiy\",\"type\":\"mcwyhzdxssadb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("mifthnzdnd", "l", "nayqi", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("avhqlkth", response.privateEndpoint().id()); - Assertions.assertEquals(ConnectionStatus.DISCONNECTED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("olbgycduiertgccy", 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 f232a4cc12a45..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateEndpointConnectionsListByConfigurationStoreMockTests.java +++ /dev/null @@ -1,76 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.ConnectionStatus; -import com.azure.resourcemanager.appconfiguration.models.PrivateEndpointConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByConfigurationStoreMockTests { - @Test - public void testListByConfigurationStore() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"bexilzznfqqnv\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"taruoujmkcj\",\"actionsRequired\":\"Recreate\"}},\"id\":\"ytjrybnwjewgdr\",\"name\":\"ervnaenqpehi\",\"type\":\"doy\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("ybsrfbjfdtwss", "t", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bexilzznfqqnv", response.iterator().next().privateEndpoint().id()); - Assertions - .assertEquals( - ConnectionStatus.DISCONNECTED, response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("taruoujmkcj", 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 e02d2d7241e5f..0000000000000 --- 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\":\"qgoulznd\"}").toObject(PrivateEndpoint.class); - Assertions.assertEquals("qgoulznd", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint().withId("qgoulznd"); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - Assertions.assertEquals("qgoulznd", 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 5e9fc56685a8a..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourceInnerTests.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.fluent.models.PrivateLinkResourceInner; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = - BinaryData - .fromString( - "{\"id\":\"gidyjrrf\",\"name\":\"aos\",\"type\":\"xc\",\"properties\":{\"groupId\":\"pclhocohslk\",\"requiredMembers\":[\"eggzfb\",\"hfmvfaxkffe\"],\"requiredZoneNames\":[\"hl\"]}}") - .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 840360cef8068..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourceListResultTests.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.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\":\"hrdxwzywqsmbs\",\"name\":\"exim\",\"type\":\"yocf\",\"properties\":{\"groupId\":\"s\",\"requiredMembers\":[],\"requiredZoneNames\":[]}},{\"id\":\"ys\",\"name\":\"i\",\"type\":\"xhqyudxorrqnb\",\"properties\":{\"groupId\":\"zvyifqrvkdvj\",\"requiredMembers\":[],\"requiredZoneNames\":[]}},{\"id\":\"mvvd\",\"name\":\"atkpnp\",\"type\":\"exxbczwtr\",\"properties\":{\"groupId\":\"qzbqjvsov\",\"requiredMembers\":[],\"requiredZoneNames\":[]}},{\"id\":\"acspkwl\",\"name\":\"dobpxjmflbvvn\",\"type\":\"rkcciwwzjuqk\",\"properties\":{\"groupId\":\"ajiwkuo\",\"requiredMembers\":[],\"requiredZoneNames\":[]}}],\"nextLink\":\"ghsauuimjmvxied\"}") - .toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("ghsauuimjmvxied", 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("ghsauuimjmvxied"); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - Assertions.assertEquals("ghsauuimjmvxied", 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 81495053e89e2..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcePropertiesTests.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.fluent.models.PrivateLinkResourceProperties; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"ez\",\"requiredMembers\":[\"hxmzsbbzoggig\",\"xwburvjxxjns\",\"ydptkoen\",\"ou\"],\"requiredZoneNames\":[\"udwtiukbl\",\"ngkpocipazy\",\"o\",\"gukgjnpiucgygevq\"]}") - .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 90dd20aa3b09e..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"ikdowwquuvx\",\"name\":\"clvit\",\"type\":\"qzonosggbhcohf\",\"properties\":{\"groupId\":\"jnkaljutiiswacff\",\"requiredMembers\":[\"zzewkfvhqcrai\"],\"requiredZoneNames\":[\"n\",\"pfuflrw\"]}}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("hjpglkf", "ohdneuel", "phsdyhto", 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 44ae0dd46aab1..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/PrivateLinkResourcesListByConfigurationStoreMockTests.java +++ /dev/null @@ -1,67 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.PrivateLinkResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByConfigurationStoreMockTests { - @Test - public void testListByConfigurationStore() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"xmubyyntwlrbq\",\"name\":\"oievseotgqrlltm\",\"type\":\"lauwzizxbmpgcjef\",\"properties\":{\"groupId\":\"uvpb\",\"requiredMembers\":[\"um\"],\"requiredZoneNames\":[\"pxebmnzbt\"]}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("kbogqxndlkzgx", "uriplbpodxunkb", 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 5a50f948cba46..0000000000000 --- 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\":\"yqkgfg\",\"actionsRequired\":\"Recreate\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(ConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("yqkgfg", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model = - new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.PENDING).withDescription("yqkgfg"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(ConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("yqkgfg", 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 c183f5e13b98f..0000000000000 --- 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\":\"dsoifiyipj\"}").toObject(RegenerateKeyParameters.class); - Assertions.assertEquals("dsoifiyipj", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegenerateKeyParameters model = new RegenerateKeyParameters().withId("dsoifiyipj"); - model = BinaryData.fromObject(model).toObject(RegenerateKeyParameters.class); - Assertions.assertEquals("dsoifiyipj", 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 bf257ef9c6451..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaInnerTests.java +++ /dev/null @@ -1,28 +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\":\"eyueaxibxujwb\",\"properties\":{\"endpoint\":\"lmuzy\",\"provisioningState\":\"Succeeded\"},\"id\":\"epdkzja\",\"name\":\"cuxrhdwbavx\",\"type\":\"niwdjsw\"}") - .toObject(ReplicaInner.class); - Assertions.assertEquals("eyueaxibxujwb", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaInner model = new ReplicaInner().withLocation("eyueaxibxujwb"); - model = BinaryData.fromObject(model).toObject(ReplicaInner.class); - Assertions.assertEquals("eyueaxibxujwb", 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 7f41905047aac..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaListResultTests.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.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\":\"odebfqkkrbmpu\",\"properties\":{\"endpoint\":\"wflzlfbxzpuzy\",\"provisioningState\":\"Deleting\"},\"id\":\"pnq\",\"name\":\"ahmgkbrp\",\"type\":\"y\"},{\"location\":\"ibnuqqkpik\",\"properties\":{\"endpoint\":\"vtq\",\"provisioningState\":\"Canceled\"},\"id\":\"buynhijggm\",\"name\":\"bfs\",\"type\":\"arbu\"},{\"location\":\"cvpnazzmhjrunmpx\",\"properties\":{\"endpoint\":\"hrbnlankxmyskpbh\",\"provisioningState\":\"Canceled\"},\"id\":\"tkcxywnytnrsy\",\"name\":\"lqidyby\",\"type\":\"czfc\"},{\"location\":\"aaxdbabphlwrq\",\"properties\":{\"endpoint\":\"sthsu\",\"provisioningState\":\"Canceled\"},\"id\":\"mnyyazt\",\"name\":\"bt\",\"type\":\"wrqpue\"}],\"nextLink\":\"kzywbiex\"}") - .toObject(ReplicaListResult.class); - Assertions.assertEquals("odebfqkkrbmpu", model.value().get(0).location()); - Assertions.assertEquals("kzywbiex", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaListResult model = - new ReplicaListResult() - .withValue( - Arrays - .asList( - new ReplicaInner().withLocation("odebfqkkrbmpu"), - new ReplicaInner().withLocation("ibnuqqkpik"), - new ReplicaInner().withLocation("cvpnazzmhjrunmpx"), - new ReplicaInner().withLocation("aaxdbabphlwrq"))) - .withNextLink("kzywbiex"); - model = BinaryData.fromObject(model).toObject(ReplicaListResult.class); - Assertions.assertEquals("odebfqkkrbmpu", model.value().get(0).location()); - Assertions.assertEquals("kzywbiex", 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 28084268e84da..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicaPropertiesTests.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.fluent.models.ReplicaProperties; - -public final class ReplicaPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReplicaProperties model = - BinaryData - .fromString("{\"endpoint\":\"s\",\"provisioningState\":\"Deleting\"}") - .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 6723b19b399e2..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasCreateMockTests.java +++ /dev/null @@ -1,72 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.Replica; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReplicasCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"uvfbtkuwh\",\"properties\":{\"endpoint\":\"k\",\"provisioningState\":\"Succeeded\"},\"id\":\"xafnndlpichko\",\"name\":\"mkcdyhbpkkpwdre\",\"type\":\"novvqfovljxy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("kcnqxwbpo") - .withExistingConfigurationStore("wo", "nwashrtd") - .withRegion("lpiujwaa") - .create(); - - Assertions.assertEquals("uvfbtkuwh", 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 70815979c5f31..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasDeleteMockTests.java +++ /dev/null @@ -1,61 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReplicasDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("luszdtmhrkwof", "yvoqa", "piexpbtgiw", 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 785fbb5620627..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.Replica; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReplicasGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"pvhelxprg\",\"properties\":{\"endpoint\":\"dd\",\"provisioningState\":\"Deleting\"},\"id\":\"bcuejrjxgci\",\"name\":\"ibrhosxsdqr\",\"type\":\"zoymibmrqyibahw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("gkopkwhojvpajqgx", "smocmbq", "qvmkcxo", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pvhelxprg", 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 9f3b2e939634b..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ReplicasListByConfigurationStoreMockTests.java +++ /dev/null @@ -1,70 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appconfiguration.AppConfigurationManager; -import com.azure.resourcemanager.appconfiguration.models.Replica; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReplicasListByConfigurationStoreMockTests { - @Test - public void testListByConfigurationStore() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"fouyf\",\"properties\":{\"endpoint\":\"cpwi\",\"provisioningState\":\"Succeeded\"},\"id\":\"qtmnubexkpzk\",\"name\":\"mond\",\"type\":\"mquxvypo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("vmbmp", "xmodf", "uefywsbpfvmwy", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fouyf", 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 fce4e8639b89f..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ResourceIdentityTests.java +++ /dev/null @@ -1,54 +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," - + " UserAssigned\",\"userAssignedIdentities\":{\"aeqjhqjbasvms\":{\"principalId\":\"tzfkufubl\",\"clientId\":\"fxqeof\"},\"douskcqvkocrcjdk\":{\"principalId\":\"qulngsntnbybkzgc\",\"clientId\":\"wclxxwrl\"},\"p\":{\"principalId\":\"nh\",\"clientId\":\"njbiksqrglssain\"}},\"principalId\":\"nzl\",\"tenantId\":\"fmppe\"}") - .toObject(ResourceIdentity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceIdentity model = - new ResourceIdentity() - .withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "aeqjhqjbasvms", - new UserIdentity(), - "douskcqvkocrcjdk", - new UserIdentity(), - "p", - new UserIdentity())); - model = BinaryData.fromObject(model).toObject(ResourceIdentity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - @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 afa0c2e84c5dd..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/ServiceSpecificationTests.java +++ /dev/null @@ -1,82 +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.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\":\"anyktzlcuiywg\",\"displayName\":\"wgndrvynhzgpp\",\"blobDuration\":\"cgyncocpecf\"},{\"name\":\"mcoo\",\"displayName\":\"xlzevgbmqjqabcy\",\"blobDuration\":\"ivkwlzuvccfwnfnb\"}],\"metricSpecifications\":[{\"name\":\"onlebxetqgtzxdpn\",\"displayName\":\"qqwx\",\"displayDescription\":\"feallnwsu\",\"unit\":\"snjampmng\",\"aggregationType\":\"scxaq\",\"internalMetricName\":\"ochcbonqvpkvl\",\"dimensions\":[],\"fillGapWithZero\":false},{\"name\":\"seiphe\",\"displayName\":\"lokeyy\",\"displayDescription\":\"nj\",\"unit\":\"lwtgrhpdj\",\"aggregationType\":\"umasxazjpq\",\"internalMetricName\":\"gual\",\"dimensions\":[],\"fillGapWithZero\":false}]}") - .toObject(ServiceSpecification.class); - Assertions.assertEquals("anyktzlcuiywg", model.logSpecifications().get(0).name()); - Assertions.assertEquals("wgndrvynhzgpp", model.logSpecifications().get(0).displayName()); - Assertions.assertEquals("cgyncocpecf", model.logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("onlebxetqgtzxdpn", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("qqwx", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("feallnwsu", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("snjampmng", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("scxaq", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("ochcbonqvpkvl", model.metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals(false, 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("anyktzlcuiywg") - .withDisplayName("wgndrvynhzgpp") - .withBlobDuration("cgyncocpecf"), - new LogSpecification() - .withName("mcoo") - .withDisplayName("xlzevgbmqjqabcy") - .withBlobDuration("ivkwlzuvccfwnfnb"))) - .withMetricSpecifications( - Arrays - .asList( - new MetricSpecification() - .withName("onlebxetqgtzxdpn") - .withDisplayName("qqwx") - .withDisplayDescription("feallnwsu") - .withUnit("snjampmng") - .withAggregationType("scxaq") - .withInternalMetricName("ochcbonqvpkvl") - .withDimensions(Arrays.asList()) - .withFillGapWithZero(false), - new MetricSpecification() - .withName("seiphe") - .withDisplayName("lokeyy") - .withDisplayDescription("nj") - .withUnit("lwtgrhpdj") - .withAggregationType("umasxazjpq") - .withInternalMetricName("gual") - .withDimensions(Arrays.asList()) - .withFillGapWithZero(false))); - model = BinaryData.fromObject(model).toObject(ServiceSpecification.class); - Assertions.assertEquals("anyktzlcuiywg", model.logSpecifications().get(0).name()); - Assertions.assertEquals("wgndrvynhzgpp", model.logSpecifications().get(0).displayName()); - Assertions.assertEquals("cgyncocpecf", model.logSpecifications().get(0).blobDuration()); - Assertions.assertEquals("onlebxetqgtzxdpn", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("qqwx", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("feallnwsu", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("snjampmng", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("scxaq", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("ochcbonqvpkvl", model.metricSpecifications().get(0).internalMetricName()); - Assertions.assertEquals(false, 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 ef4d3719aa53f..0000000000000 --- 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\":\"adgakeqsrxybz\"}").toObject(Sku.class); - Assertions.assertEquals("adgakeqsrxybz", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName("adgakeqsrxybz"); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("adgakeqsrxybz", 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 332904a879e53..0000000000000 --- a/sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/test/java/com/azure/resourcemanager/appconfiguration/generated/UserIdentityTests.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.UserIdentity; - -public final class UserIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserIdentity model = - BinaryData - .fromString("{\"principalId\":\"vmgxsab\",\"clientId\":\"qduujitcjczdz\"}") - .toObject(UserIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentity model = new UserIdentity(); - model = BinaryData.fromObject(model).toObject(UserIdentity.class); - } -}