diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/CHANGELOG.md b/sdk/healthbot/azure-resourcemanager-healthbot/CHANGELOG.md index ecb9b1a40ec6..00e6b0b40104 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/CHANGELOG.md +++ b/sdk/healthbot/azure-resourcemanager-healthbot/CHANGELOG.md @@ -1,14 +1,60 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-04-30) + +- Azure Resource Manager Healthbot client library for Java. This package contains Microsoft Azure SDK for Healthbot Management SDK. Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package tag package-2024-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.UserAssignedIdentity` was added -### Bugs Fixed +* `models.HealthBotKey` was added -### Other Changes +* `models.ResourceIdentityType` was added + +* `models.Identity` was added + +* `models.KeyVaultProperties` was added + +* `models.HealthBotKeysResponse` was added + +#### `models.HealthBotUpdateParameters` was modified + +* `identity()` was added +* `withProperties(models.HealthBotProperties)` was added +* `location()` was added +* `withIdentity(models.Identity)` was added +* `properties()` was added +* `withLocation(java.lang.String)` was added + +#### `models.HealthBot$Definition` was modified + +* `withIdentity(models.Identity)` was added + +#### `models.HealthBotProperties` was modified + +* `keyVaultProperties()` was added +* `withKeyVaultProperties(models.KeyVaultProperties)` was added + +#### `models.HealthBot` was modified + +* `listSecrets()` was added +* `regenerateApiJwtSecret()` was added +* `regenerateApiJwtSecretWithResponse(com.azure.core.util.Context)` was added +* `identity()` was added +* `listSecretsWithResponse(com.azure.core.util.Context)` was added + +#### `models.Bots` was modified + +* `listSecretsWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `listSecrets(java.lang.String,java.lang.String)` was added +* `regenerateApiJwtSecret(java.lang.String,java.lang.String)` was added +* `regenerateApiJwtSecretWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.HealthBot$Update` was modified + +* `withProperties(models.HealthBotProperties)` was added +* `withIdentity(models.Identity)` was added ## 1.0.0 (2024-12-23) diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/README.md b/sdk/healthbot/azure-resourcemanager-healthbot/README.md index 45d44c361cb5..25e925300808 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/README.md +++ b/sdk/healthbot/azure-resourcemanager-healthbot/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Healthbot client library for Java. -This package contains Microsoft Azure SDK for Healthbot Management SDK. Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package tag package-2020-12-08. 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 Healthbot Management SDK. Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package tag package-2024-02. 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 @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ HealthbotManager manager = HealthbotManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/SAMPLE.md b/sdk/healthbot/azure-resourcemanager-healthbot/SAMPLE.md index 87ddb2e594ac..9049b85d9a84 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/SAMPLE.md +++ b/sdk/healthbot/azure-resourcemanager-healthbot/SAMPLE.md @@ -8,6 +8,8 @@ - [GetByResourceGroup](#bots_getbyresourcegroup) - [List](#bots_list) - [ListByResourceGroup](#bots_listbyresourcegroup) +- [ListSecrets](#bots_listsecrets) +- [RegenerateApiJwtSecret](#bots_regenerateapijwtsecret) - [Update](#bots_update) ## Operations @@ -16,29 +18,22 @@ ### Bots_Create ```java -import com.azure.resourcemanager.healthbot.models.Sku; -import com.azure.resourcemanager.healthbot.models.SkuName; - /** - * Samples for Bots Create. + * Samples for Bots ListByResourceGroup. */ -public final class BotsCreateSamples { +public final class BotsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ResourceCreationPut.json + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ListBotsByResourceGroup. + * json */ /** - * Sample code: BotCreate. + * Sample code: List Bots by Resource Group. * * @param manager Entry point to HealthbotManager. */ - public static void botCreate(com.azure.resourcemanager.healthbot.HealthbotManager manager) { - manager.bots() - .define("samplebotname") - .withRegion("East US") - .withExistingResourceGroup("healthbotClient") - .withSku(new Sku().withName(SkuName.F0)) - .create(); + public static void listBotsByResourceGroup(com.azure.resourcemanager.healthbot.HealthbotManager manager) { + manager.bots().listByResourceGroup("OneResourceGroupName", com.azure.core.util.Context.NONE); } } ``` @@ -52,7 +47,7 @@ public final class BotsCreateSamples { public final class BotsDeleteSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ResourceDeletionDelete. + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ResourceDeletionDelete. * json */ /** @@ -69,22 +64,28 @@ public final class BotsDeleteSamples { ### Bots_GetByResourceGroup ```java +import com.azure.resourcemanager.healthbot.models.HealthBot; +import com.azure.resourcemanager.healthbot.models.Sku; +import com.azure.resourcemanager.healthbot.models.SkuName; + /** - * Samples for Bots GetByResourceGroup. + * Samples for Bots Update. */ -public final class BotsGetByResourceGroupSamples { +public final class BotsUpdateSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ResourceInfoGet.json + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ResourceUpdatePatch.json */ /** - * Sample code: ResourceInfoGet. + * Sample code: BotUpdate. * * @param manager Entry point to HealthbotManager. */ - public static void resourceInfoGet(com.azure.resourcemanager.healthbot.HealthbotManager manager) { - manager.bots() - .getByResourceGroupWithResponse("healthbotClient", "samplebotname", com.azure.core.util.Context.NONE); + public static void botUpdate(com.azure.resourcemanager.healthbot.HealthbotManager manager) { + HealthBot resource = manager.bots() + .getByResourceGroupWithResponse("healthbotClient", "samplebotname", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSku(new Sku().withName(SkuName.F0)).apply(); } } ``` @@ -98,7 +99,7 @@ public final class BotsGetByResourceGroupSamples { public final class BotsListSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ListBotsBySubscription. + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ListBotsBySubscription. * json */ /** @@ -116,21 +117,66 @@ public final class BotsListSamples { ```java /** - * Samples for Bots ListByResourceGroup. + * Samples for Bots RegenerateApiJwtSecret. */ -public final class BotsListByResourceGroupSamples { +public final class BotsRegenerateApiJwtSecretSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ListBotsByResourceGroup. + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/RegenerateApiJwtSecret. * json */ /** - * Sample code: List Bots by Resource Group. + * Sample code: Bot Regenerate API JWT Secret. * * @param manager Entry point to HealthbotManager. */ - public static void listBotsByResourceGroup(com.azure.resourcemanager.healthbot.HealthbotManager manager) { - manager.bots().listByResourceGroup("OneResourceGroupName", com.azure.core.util.Context.NONE); + public static void botRegenerateAPIJWTSecret(com.azure.resourcemanager.healthbot.HealthbotManager manager) { + manager.bots() + .regenerateApiJwtSecretWithResponse("healthbotClient", "samplebotname", com.azure.core.util.Context.NONE); + } +} +``` + +### Bots_ListSecrets + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/GetOperations.json + */ + /** + * Sample code: Get Operations. + * + * @param manager Entry point to HealthbotManager. + */ + public static void getOperations(com.azure.resourcemanager.healthbot.HealthbotManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Bots_RegenerateApiJwtSecret + +```java +/** + * Samples for Bots ListSecrets. + */ +public final class BotsListSecretsSamples { + /* + * x-ms-original-file: + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ListSecrets.json + */ + /** + * Sample code: Bot List Secrets. + * + * @param manager Entry point to HealthbotManager. + */ + public static void botListSecrets(com.azure.resourcemanager.healthbot.HealthbotManager manager) { + manager.bots().listSecretsWithResponse("healthbotClient", "samplebotname", com.azure.core.util.Context.NONE); } } ``` @@ -138,28 +184,52 @@ public final class BotsListByResourceGroupSamples { ### Bots_Update ```java -import com.azure.resourcemanager.healthbot.models.HealthBot; +import com.azure.resourcemanager.healthbot.models.Identity; +import com.azure.resourcemanager.healthbot.models.ResourceIdentityType; import com.azure.resourcemanager.healthbot.models.Sku; import com.azure.resourcemanager.healthbot.models.SkuName; +import com.azure.resourcemanager.healthbot.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; /** - * Samples for Bots Update. + * Samples for Bots Create. */ -public final class BotsUpdateSamples { +public final class BotsCreateSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ResourceUpdatePatch.json + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ResourceCreationPut.json */ /** - * Sample code: BotUpdate. + * Sample code: BotCreate. * * @param manager Entry point to HealthbotManager. */ - public static void botUpdate(com.azure.resourcemanager.healthbot.HealthbotManager manager) { - HealthBot resource = manager.bots() - .getByResourceGroupWithResponse("healthbotClient", "samplebotname", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withSku(new Sku().withName(SkuName.F0)).apply(); + public static void botCreate(com.azure.resourcemanager.healthbot.HealthbotManager manager) { + manager.bots() + .define("samplebotname") + .withRegion("East US") + .withExistingResourceGroup("healthbotClient") + .withSku(new Sku().withName(SkuName.F0)) + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi", + new UserAssignedIdentity(), + "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2", + new UserAssignedIdentity()))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` @@ -168,20 +238,21 @@ public final class BotsUpdateSamples { ```java /** - * Samples for Operations List. + * Samples for Bots GetByResourceGroup. */ -public final class OperationsListSamples { +public final class BotsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/GetOperations.json + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ResourceInfoGet.json */ /** - * Sample code: Get Operations. + * Sample code: ResourceInfoGet. * * @param manager Entry point to HealthbotManager. */ - public static void getOperations(com.azure.resourcemanager.healthbot.HealthbotManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void resourceInfoGet(com.azure.resourcemanager.healthbot.HealthbotManager manager) { + manager.bots() + .getByResourceGroupWithResponse("healthbotClient", "samplebotname", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml b/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml index 64dc48bce08c..35ad751ce214 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml +++ b/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Healthbot Management - This package contains Microsoft Azure SDK for Healthbot Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package tag package-2020-12-08. + This package contains Microsoft Azure SDK for Healthbot Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package tag package-2024-02. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/HealthbotManager.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/HealthbotManager.java index 83e00cbb5019..e43b654f0e7f 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/HealthbotManager.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/HealthbotManager.java @@ -22,6 +22,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.healthbot.fluent.HealthbotClient; import com.azure.resourcemanager.healthbot.implementation.BotsImpl; @@ -33,14 +34,14 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; /** * Entry point to HealthbotManager. - * Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy - * their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce - * costs. + * Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their + * compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. */ public final class HealthbotManager { private Bots bots; @@ -99,6 +100,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-healthbot.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -206,12 +210,14 @@ public HealthbotManager authenticate(TokenCredential credential, AzureProfile pr Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.healthbot") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/BotsClient.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/BotsClient.java index 3035f02530b4..ea4c07e35f66 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/BotsClient.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/BotsClient.java @@ -12,6 +12,8 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.healthbot.fluent.models.HealthBotInner; +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeyInner; +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeysResponseInner; import com.azure.resourcemanager.healthbot.models.HealthBotUpdateParameters; /** @@ -19,61 +21,61 @@ */ public interface BotsClient { /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 healthBot resource definition. + * @return the {@link SyncPoller} for polling of azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, HealthBotInner> beginCreate(String resourceGroupName, String botName, HealthBotInner parameters); /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @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 healthBot resource definition. + * @return the {@link SyncPoller} for polling of azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, HealthBotInner> beginCreate(String resourceGroupName, String botName, HealthBotInner parameters, Context context); /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return healthBot resource definition. + * @return azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) HealthBotInner create(String resourceGroupName, String botName, HealthBotInner parameters); /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @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 healthBot resource definition. + * @return azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) HealthBotInner create(String resourceGroupName, String botName, HealthBotInner parameters, Context context); @@ -110,15 +112,30 @@ SyncPoller, HealthBotInner> beginCreate(String resour * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the required bot. + * @param parameters The parameters to provide for the required Azure Health Bot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 azure Health Bot resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HealthBotInner> beginUpdate(String resourceGroupName, String botName, + HealthBotUpdateParameters parameters); + + /** + * Patch a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @param parameters The parameters to provide for the required Azure Health Bot. * @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 healthBot resource definition along with {@link Response}. + * @return the {@link SyncPoller} for polling of azure Health Bot resource definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String botName, + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, HealthBotInner> beginUpdate(String resourceGroupName, String botName, HealthBotUpdateParameters parameters, Context context); /** @@ -126,15 +143,31 @@ Response updateWithResponse(String resourceGroupName, String bot * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the required bot. + * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return healthBot resource definition. + * @return azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) HealthBotInner update(String resourceGroupName, String botName, HealthBotUpdateParameters parameters); + /** + * Patch a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @param parameters The parameters to provide for the required Azure Health Bot. + * @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 azure Health Bot resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HealthBotInner update(String resourceGroupName, String botName, HealthBotUpdateParameters parameters, + Context context); + /** * Delete a HealthBot. * @@ -187,6 +220,62 @@ Response updateWithResponse(String resourceGroupName, String bot @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String botName, Context context); + /** + * List all secrets of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @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 health Bot Keys Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse(String resourceGroupName, String botName, + Context context); + + /** + * List all secrets of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health Bot Keys Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HealthBotKeysResponseInner listSecrets(String resourceGroupName, String botName); + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @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 an entry of HealthBotKeysResponse along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateApiJwtSecretWithResponse(String resourceGroupName, String botName, + Context context); + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 entry of HealthBotKeysResponse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HealthBotKeyInner regenerateApiJwtSecret(String resourceGroupName, String botName); + /** * Returns all the resources of a particular type belonging to a resource group. * @@ -194,7 +283,7 @@ Response updateWithResponse(String resourceGroupName, String bot * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -207,7 +296,7 @@ Response updateWithResponse(String resourceGroupName, String bot * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -217,7 +306,7 @@ Response updateWithResponse(String resourceGroupName, String bot * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -229,7 +318,7 @@ Response updateWithResponse(String resourceGroupName, String bot * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/OperationsClient.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/OperationsClient.java index e232f9658e67..f115cb7a7bfb 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/OperationsClient.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/OperationsClient.java @@ -15,7 +15,7 @@ */ public interface OperationsClient { /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -25,7 +25,7 @@ public interface OperationsClient { PagedIterable list(); /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotInner.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotInner.java index f380569292a3..7f6bc2a18077 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotInner.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotInner.java @@ -12,22 +12,28 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.healthbot.models.HealthBotProperties; +import com.azure.resourcemanager.healthbot.models.Identity; import com.azure.resourcemanager.healthbot.models.Sku; import java.io.IOException; import java.util.Map; /** - * HealthBot resource definition. + * Azure Health Bot resource definition. */ @Fluent public final class HealthBotInner extends Resource { /* - * SKU of the HealthBot. + * SKU of the Azure Health Bot. */ private Sku sku; /* - * The set of properties specific to Healthbot resource. + * The identity of the Azure Health Bot. + */ + private Identity identity; + + /* + * The set of properties specific to Azure Health Bot resource. */ private HealthBotProperties properties; @@ -58,7 +64,7 @@ public HealthBotInner() { } /** - * Get the sku property: SKU of the HealthBot. + * Get the sku property: SKU of the Azure Health Bot. * * @return the sku value. */ @@ -67,7 +73,7 @@ public Sku sku() { } /** - * Set the sku property: SKU of the HealthBot. + * Set the sku property: SKU of the Azure Health Bot. * * @param sku the sku value to set. * @return the HealthBotInner object itself. @@ -78,7 +84,27 @@ public HealthBotInner withSku(Sku sku) { } /** - * Get the properties property: The set of properties specific to Healthbot resource. + * Get the identity property: The identity of the Azure Health Bot. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the Azure Health Bot. + * + * @param identity the identity value to set. + * @return the HealthBotInner object itself. + */ + public HealthBotInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the properties property: The set of properties specific to Azure Health Bot resource. * * @return the properties value. */ @@ -87,7 +113,7 @@ public HealthBotProperties properties() { } /** - * Set the properties property: The set of properties specific to Healthbot resource. + * Set the properties property: The set of properties specific to Azure Health Bot resource. * * @param properties the properties value to set. * @return the HealthBotInner object itself. @@ -166,6 +192,9 @@ public void validate() { } else { sku().validate(); } + if (identity() != null) { + identity().validate(); + } if (properties() != null) { properties().validate(); } @@ -182,6 +211,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { 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.properties); return jsonWriter.writeEndObject(); } @@ -215,6 +245,8 @@ public static HealthBotInner fromJson(JsonReader jsonReader) throws IOException deserializedHealthBotInner.withTags(tags); } else if ("sku".equals(fieldName)) { deserializedHealthBotInner.sku = Sku.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedHealthBotInner.identity = Identity.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedHealthBotInner.properties = HealthBotProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotKeyInner.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotKeyInner.java new file mode 100644 index 000000000000..0a60b570841b --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotKeyInner.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.healthbot.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 java.io.IOException; + +/** + * An entry of HealthBotKeysResponse. + */ +@Fluent +public final class HealthBotKeyInner implements JsonSerializable { + /* + * The name of the key. + */ + private String keyName; + + /* + * The value of the key. + */ + private String value; + + /** + * Creates an instance of HealthBotKeyInner class. + */ + public HealthBotKeyInner() { + } + + /** + * Get the keyName property: The name of the key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of the key. + * + * @param keyName the keyName value to set. + * @return the HealthBotKeyInner object itself. + */ + public HealthBotKeyInner withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the value property: The value of the key. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the key. + * + * @param value the value value to set. + * @return the HealthBotKeyInner object itself. + */ + public HealthBotKeyInner withValue(String value) { + this.value = value; + 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("keyName", this.keyName); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HealthBotKeyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HealthBotKeyInner 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 HealthBotKeyInner. + */ + public static HealthBotKeyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HealthBotKeyInner deserializedHealthBotKeyInner = new HealthBotKeyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyName".equals(fieldName)) { + deserializedHealthBotKeyInner.keyName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedHealthBotKeyInner.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHealthBotKeyInner; + }); + } +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotKeysResponseInner.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotKeysResponseInner.java new file mode 100644 index 000000000000..3192d133d767 --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotKeysResponseInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthbot.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 java.io.IOException; +import java.util.List; + +/** + * Health Bot Keys Response. + */ +@Fluent +public final class HealthBotKeysResponseInner implements JsonSerializable { + /* + * Array of Azure Health Bot Secrets. + */ + private List secrets; + + /** + * Creates an instance of HealthBotKeysResponseInner class. + */ + public HealthBotKeysResponseInner() { + } + + /** + * Get the secrets property: Array of Azure Health Bot Secrets. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Array of Azure Health Bot Secrets. + * + * @param secrets the secrets value to set. + * @return the HealthBotKeysResponseInner object itself. + */ + public HealthBotKeysResponseInner withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("secrets", this.secrets, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HealthBotKeysResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HealthBotKeysResponseInner 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 HealthBotKeysResponseInner. + */ + public static HealthBotKeysResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HealthBotKeysResponseInner deserializedHealthBotKeysResponseInner = new HealthBotKeysResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("secrets".equals(fieldName)) { + List secrets = reader.readArray(reader1 -> HealthBotKeyInner.fromJson(reader1)); + deserializedHealthBotKeysResponseInner.secrets = secrets; + } else { + reader.skipChildren(); + } + } + + return deserializedHealthBotKeysResponseInner; + }); + } +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/package-info.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/package-info.java index 3c97220f90a6..95b29dfd2aba 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/package-info.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/package-info.java @@ -4,8 +4,7 @@ /** * Package containing the inner data models for HealthbotClient. - * Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy - * their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce - * costs. + * Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their + * compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. */ package com.azure.resourcemanager.healthbot.fluent.models; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/package-info.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/package-info.java index a3b0bd56eeb4..e61192f5b5d7 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/package-info.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/package-info.java @@ -4,8 +4,7 @@ /** * Package containing the service clients for HealthbotClient. - * Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy - * their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce - * costs. + * Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their + * compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. */ package com.azure.resourcemanager.healthbot.fluent; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsClientImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsClientImpl.java index a2983cde8256..810fd510c774 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsClientImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -34,6 +35,8 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.healthbot.fluent.BotsClient; import com.azure.resourcemanager.healthbot.fluent.models.HealthBotInner; +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeyInner; +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeysResponseInner; import com.azure.resourcemanager.healthbot.models.BotResponseList; import com.azure.resourcemanager.healthbot.models.HealthBotUpdateParameters; import java.nio.ByteBuffer; @@ -94,7 +97,7 @@ Mono> getByResourceGroup(@HostParam("$host") String end @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") @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("botName") String botName, @QueryParam("api-version") String apiVersion, @@ -110,6 +113,24 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/listSecrets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSecrets(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/regenerateApiJwtSecret") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateApiJwtSecret(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots") @ExpectedResponses({ 200 }) @@ -144,15 +165,16 @@ Mono> listNext(@PathParam(value = "nextLink", encoded } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return healthBot resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return azure Health Bot resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync(String resourceGroupName, String botName, @@ -185,16 +207,17 @@ private Mono>> createWithResponseAsync(String resource } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @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 healthBot resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return azure Health Bot resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync(String resourceGroupName, String botName, @@ -226,15 +249,15 @@ private Mono>> createWithResponseAsync(String resource } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 healthBot resource definition. + * @return the {@link PollerFlux} for polling of azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, HealthBotInner> beginCreateAsync(String resourceGroupName, @@ -245,16 +268,16 @@ private PollerFlux, HealthBotInner> beginCreateAsync( } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @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 healthBot resource definition. + * @return the {@link PollerFlux} for polling of azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, HealthBotInner> beginCreateAsync(String resourceGroupName, @@ -267,15 +290,15 @@ private PollerFlux, HealthBotInner> beginCreateAsync( } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 healthBot resource definition. + * @return the {@link SyncPoller} for polling of azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, HealthBotInner> beginCreate(String resourceGroupName, String botName, @@ -284,16 +307,16 @@ public SyncPoller, HealthBotInner> beginCreate(String } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @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 healthBot resource definition. + * @return the {@link SyncPoller} for polling of azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, HealthBotInner> beginCreate(String resourceGroupName, String botName, @@ -302,15 +325,15 @@ public SyncPoller, HealthBotInner> beginCreate(String } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return healthBot resource definition on successful completion of {@link Mono}. + * @return azure Health Bot resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String botName, HealthBotInner parameters) { @@ -319,16 +342,16 @@ private Mono createAsync(String resourceGroupName, String botNam } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @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 healthBot resource definition on successful completion of {@link Mono}. + * @return azure Health Bot resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String botName, HealthBotInner parameters, @@ -338,15 +361,15 @@ private Mono createAsync(String resourceGroupName, String botNam } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return healthBot resource definition. + * @return azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public HealthBotInner create(String resourceGroupName, String botName, HealthBotInner parameters) { @@ -354,16 +377,16 @@ public HealthBotInner create(String resourceGroupName, String botName, HealthBot } /** - * Create a new HealthBot. + * Create a new Azure Health Bot. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the created bot. + * @param parameters The parameters to provide for the created Azure Health Bot. * @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 healthBot resource definition. + * @return azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public HealthBotInner create(String resourceGroupName, String botName, HealthBotInner parameters, Context context) { @@ -494,14 +517,15 @@ public HealthBotInner getByResourceGroup(String resourceGroupName, String botNam * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the required bot. + * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return healthBot resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return azure Health Bot resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String botName, + private Mono>> updateWithResponseAsync(String resourceGroupName, String botName, HealthBotUpdateParameters parameters) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -535,15 +559,16 @@ private Mono> updateWithResponseAsync(String resourceGr * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the required bot. + * @param parameters The parameters to provide for the required Azure Health Bot. * @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 healthBot resource definition along with {@link Response} on successful completion of {@link Mono}. + * @return azure Health Bot resource definition along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String botName, + private Mono>> updateWithResponseAsync(String resourceGroupName, String botName, HealthBotUpdateParameters parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -576,17 +601,93 @@ private Mono> updateWithResponseAsync(String resourceGr * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the required bot. + * @param parameters The parameters to provide for the required Azure Health Bot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Health Bot resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, HealthBotInner> beginUpdateAsync(String resourceGroupName, + String botName, HealthBotUpdateParameters parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, botName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + HealthBotInner.class, HealthBotInner.class, this.client.getContext()); + } + + /** + * Patch a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @param parameters The parameters to provide for the required Azure Health Bot. + * @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 azure Health Bot resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, HealthBotInner> beginUpdateAsync(String resourceGroupName, + String botName, HealthBotUpdateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, botName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + HealthBotInner.class, HealthBotInner.class, context); + } + + /** + * Patch a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @param parameters The parameters to provide for the required Azure Health Bot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 azure Health Bot resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HealthBotInner> beginUpdate(String resourceGroupName, String botName, + HealthBotUpdateParameters parameters) { + return this.beginUpdateAsync(resourceGroupName, botName, parameters).getSyncPoller(); + } + + /** + * Patch a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @param parameters The parameters to provide for the required Azure Health Bot. + * @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 azure Health Bot resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HealthBotInner> beginUpdate(String resourceGroupName, String botName, + HealthBotUpdateParameters parameters, Context context) { + return this.beginUpdateAsync(resourceGroupName, botName, parameters, context).getSyncPoller(); + } + + /** + * Patch a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return healthBot resource definition on successful completion of {@link Mono}. + * @return azure Health Bot resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String botName, HealthBotUpdateParameters parameters) { - return updateWithResponseAsync(resourceGroupName, botName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return beginUpdateAsync(resourceGroupName, botName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -594,17 +695,18 @@ private Mono updateAsync(String resourceGroupName, String botNam * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the required bot. + * @param parameters The parameters to provide for the required Azure Health Bot. * @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 healthBot resource definition along with {@link Response}. + * @return azure Health Bot resource definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String botName, + private Mono updateAsync(String resourceGroupName, String botName, HealthBotUpdateParameters parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, botName, parameters, context).block(); + return beginUpdateAsync(resourceGroupName, botName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -612,15 +714,33 @@ public Response updateWithResponse(String resourceGroupName, Str * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param botName The name of the Bot resource. - * @param parameters The parameters to provide for the required bot. + * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return healthBot resource definition. + * @return azure Health Bot resource definition. */ @ServiceMethod(returns = ReturnType.SINGLE) public HealthBotInner update(String resourceGroupName, String botName, HealthBotUpdateParameters parameters) { - return updateWithResponse(resourceGroupName, botName, parameters, Context.NONE).getValue(); + return updateAsync(resourceGroupName, botName, parameters).block(); + } + + /** + * Patch a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @param parameters The parameters to provide for the required Azure Health Bot. + * @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 azure Health Bot resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HealthBotInner update(String resourceGroupName, String botName, HealthBotUpdateParameters parameters, + Context context) { + return updateAsync(resourceGroupName, botName, parameters, context).block(); } /** @@ -821,6 +941,243 @@ public void delete(String resourceGroupName, String botName, Context context) { deleteAsync(resourceGroupName, botName, context).block(); } + /** + * List all secrets of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health Bot Keys Response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync(String resourceGroupName, + String botName) { + 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 (botName == null) { + return Mono.error(new IllegalArgumentException("Parameter botName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, botName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all secrets of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @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 health Bot Keys Response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync(String resourceGroupName, + String botName, 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 (botName == null) { + return Mono.error(new IllegalArgumentException("Parameter botName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + botName, this.client.getApiVersion(), accept, context); + } + + /** + * List all secrets of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health Bot Keys Response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync(String resourceGroupName, String botName) { + return listSecretsWithResponseAsync(resourceGroupName, botName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all secrets of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @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 health Bot Keys Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse(String resourceGroupName, String botName, + Context context) { + return listSecretsWithResponseAsync(resourceGroupName, botName, context).block(); + } + + /** + * List all secrets of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health Bot Keys Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HealthBotKeysResponseInner listSecrets(String resourceGroupName, String botName) { + return listSecretsWithResponse(resourceGroupName, botName, Context.NONE).getValue(); + } + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 entry of HealthBotKeysResponse along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateApiJwtSecretWithResponseAsync(String resourceGroupName, + String botName) { + 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 (botName == null) { + return Mono.error(new IllegalArgumentException("Parameter botName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.regenerateApiJwtSecret(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, botName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @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 an entry of HealthBotKeysResponse along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateApiJwtSecretWithResponseAsync(String resourceGroupName, + String botName, 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 (botName == null) { + return Mono.error(new IllegalArgumentException("Parameter botName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.regenerateApiJwtSecret(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, botName, this.client.getApiVersion(), accept, context); + } + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 entry of HealthBotKeysResponse on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateApiJwtSecretAsync(String resourceGroupName, String botName) { + return regenerateApiJwtSecretWithResponseAsync(resourceGroupName, botName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @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 an entry of HealthBotKeysResponse along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateApiJwtSecretWithResponse(String resourceGroupName, String botName, + Context context) { + return regenerateApiJwtSecretWithResponseAsync(resourceGroupName, botName, context).block(); + } + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 entry of HealthBotKeysResponse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HealthBotKeyInner regenerateApiJwtSecret(String resourceGroupName, String botName) { + return regenerateApiJwtSecretWithResponse(resourceGroupName, botName, Context.NONE).getValue(); + } + /** * Returns all the resources of a particular type belonging to a resource group. * @@ -828,8 +1185,8 @@ public void delete(String resourceGroupName, String botName, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -862,8 +1219,8 @@ private Mono> listByResourceGroupSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, @@ -896,7 +1253,7 @@ private Mono> listByResourceGroupSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedFlux}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -912,7 +1269,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedFlux}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -927,7 +1284,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -942,7 +1299,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -954,8 +1311,8 @@ public PagedIterable listByResourceGroup(String resourceGroupNam * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -983,8 +1340,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1010,7 +1367,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedFlux}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1024,7 +1381,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedFlux}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1037,7 +1394,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1051,7 +1408,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -1065,8 +1422,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1094,8 +1451,8 @@ private Mono> listByResourceGroupNextSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, @@ -1121,8 +1478,8 @@ private Mono> listByResourceGroupNextSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1148,8 +1505,8 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsImpl.java index b14326bcdff3..721301798b4d 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsImpl.java @@ -11,8 +11,12 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.healthbot.fluent.BotsClient; import com.azure.resourcemanager.healthbot.fluent.models.HealthBotInner; +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeyInner; +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeysResponseInner; import com.azure.resourcemanager.healthbot.models.Bots; import com.azure.resourcemanager.healthbot.models.HealthBot; +import com.azure.resourcemanager.healthbot.models.HealthBotKey; +import com.azure.resourcemanager.healthbot.models.HealthBotKeysResponse; public final class BotsImpl implements Bots { private static final ClientLogger LOGGER = new ClientLogger(BotsImpl.class); @@ -55,6 +59,48 @@ public void delete(String resourceGroupName, String botName, Context context) { this.serviceClient().delete(resourceGroupName, botName, context); } + public Response listSecretsWithResponse(String resourceGroupName, String botName, + Context context) { + Response inner + = this.serviceClient().listSecretsWithResponse(resourceGroupName, botName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HealthBotKeysResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HealthBotKeysResponse listSecrets(String resourceGroupName, String botName) { + HealthBotKeysResponseInner inner = this.serviceClient().listSecrets(resourceGroupName, botName); + if (inner != null) { + return new HealthBotKeysResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateApiJwtSecretWithResponse(String resourceGroupName, String botName, + Context context) { + Response inner + = this.serviceClient().regenerateApiJwtSecretWithResponse(resourceGroupName, botName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new HealthBotKeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public HealthBotKey regenerateApiJwtSecret(String resourceGroupName, String botName) { + HealthBotKeyInner inner = this.serviceClient().regenerateApiJwtSecret(resourceGroupName, botName); + if (inner != null) { + return new HealthBotKeyImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager())); diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotImpl.java index 4218c5012544..d3827d687026 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotImpl.java @@ -4,13 +4,17 @@ package com.azure.resourcemanager.healthbot.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.healthbot.fluent.models.HealthBotInner; import com.azure.resourcemanager.healthbot.models.HealthBot; +import com.azure.resourcemanager.healthbot.models.HealthBotKey; +import com.azure.resourcemanager.healthbot.models.HealthBotKeysResponse; import com.azure.resourcemanager.healthbot.models.HealthBotProperties; import com.azure.resourcemanager.healthbot.models.HealthBotUpdateParameters; +import com.azure.resourcemanager.healthbot.models.Identity; import com.azure.resourcemanager.healthbot.models.Sku; import java.util.Collections; import java.util.Map; @@ -49,6 +53,10 @@ public Sku sku() { return this.innerModel().sku(); } + public Identity identity() { + return this.innerModel().identity(); + } + public HealthBotProperties properties() { return this.innerModel().properties(); } @@ -115,16 +123,13 @@ public HealthBotImpl update() { public HealthBot apply() { this.innerObject = serviceManager.serviceClient() .getBots() - .updateWithResponse(resourceGroupName, botName, updateParameters, Context.NONE) - .getValue(); + .update(resourceGroupName, botName, updateParameters, Context.NONE); return this; } public HealthBot apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getBots() - .updateWithResponse(resourceGroupName, botName, updateParameters, context) - .getValue(); + this.innerObject + = serviceManager.serviceClient().getBots().update(resourceGroupName, botName, updateParameters, context); return this; } @@ -151,6 +156,22 @@ public HealthBot refresh(Context context) { return this; } + public Response listSecretsWithResponse(Context context) { + return serviceManager.bots().listSecretsWithResponse(resourceGroupName, botName, context); + } + + public HealthBotKeysResponse listSecrets() { + return serviceManager.bots().listSecrets(resourceGroupName, botName); + } + + public Response regenerateApiJwtSecretWithResponse(Context context) { + return serviceManager.bots().regenerateApiJwtSecretWithResponse(resourceGroupName, botName, context); + } + + public HealthBotKey regenerateApiJwtSecret() { + return serviceManager.bots().regenerateApiJwtSecret(resourceGroupName, botName); + } + public HealthBotImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -181,9 +202,24 @@ public HealthBotImpl withTags(Map tags) { } } + public HealthBotImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + public HealthBotImpl withProperties(HealthBotProperties properties) { - this.innerModel().withProperties(properties); - return this; + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateParameters.withProperties(properties); + return this; + } } private boolean isInCreateMode() { diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeyImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeyImpl.java new file mode 100644 index 000000000000..06f8b9d56b9d --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeyImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthbot.implementation; + +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeyInner; +import com.azure.resourcemanager.healthbot.models.HealthBotKey; + +public final class HealthBotKeyImpl implements HealthBotKey { + private HealthBotKeyInner innerObject; + + private final com.azure.resourcemanager.healthbot.HealthbotManager serviceManager; + + HealthBotKeyImpl(HealthBotKeyInner innerObject, + com.azure.resourcemanager.healthbot.HealthbotManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String keyName() { + return this.innerModel().keyName(); + } + + public String value() { + return this.innerModel().value(); + } + + public HealthBotKeyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.healthbot.HealthbotManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeysResponseImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeysResponseImpl.java new file mode 100644 index 000000000000..06d843b817cc --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeysResponseImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthbot.implementation; + +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeyInner; +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeysResponseInner; +import com.azure.resourcemanager.healthbot.models.HealthBotKey; +import com.azure.resourcemanager.healthbot.models.HealthBotKeysResponse; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class HealthBotKeysResponseImpl implements HealthBotKeysResponse { + private HealthBotKeysResponseInner innerObject; + + private final com.azure.resourcemanager.healthbot.HealthbotManager serviceManager; + + HealthBotKeysResponseImpl(HealthBotKeysResponseInner innerObject, + com.azure.resourcemanager.healthbot.HealthbotManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List secrets() { + List inner = this.innerModel().secrets(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new HealthBotKeyImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public HealthBotKeysResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.healthbot.HealthbotManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotClientImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotClientImpl.java index e2550295e60d..1e853d368435 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotClientImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotClientImpl.java @@ -169,7 +169,7 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-12-08"; + this.apiVersion = "2024-02-01"; this.bots = new BotsClientImpl(this); this.operations = new OperationsClientImpl(this); } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsClientImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsClientImpl.java index e0aa2b1211c9..e0ec5565cf58 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsClientImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsClientImpl.java @@ -78,7 +78,7 @@ Mono> listNext(@PathParam(value = "nextLink", enco } /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -101,7 +101,7 @@ private Mono> listSinglePageAsync() { } /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +124,7 @@ private Mono> listSinglePageAsync(Context co } /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -136,7 +136,7 @@ private PagedFlux listAsync() { } /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -151,7 +151,7 @@ private PagedFlux listAsync(Context context) { } /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -163,7 +163,7 @@ public PagedIterable list() { } /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/package-info.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/package-info.java index 4959900627d6..49fb29b674c4 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/package-info.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/package-info.java @@ -4,8 +4,7 @@ /** * Package containing the implementations for HealthbotClient. - * Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy - * their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce - * costs. + * Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their + * compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. */ package com.azure.resourcemanager.healthbot.implementation; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/BotResponseList.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/BotResponseList.java index 2e6eda6ce9a8..8dc65ca3fc69 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/BotResponseList.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/BotResponseList.java @@ -14,7 +14,7 @@ import java.util.List; /** - * The list of Healthbot operation response. + * The list of Azure Health Bot operation response. */ @Immutable public final class BotResponseList implements JsonSerializable { @@ -24,7 +24,7 @@ public final class BotResponseList implements JsonSerializable private String nextLink; /* - * Gets the list of Healthbot results and their properties. + * Gets the list of Azure Health Bot results and their properties. */ private List value; @@ -44,7 +44,7 @@ public String nextLink() { } /** - * Get the value property: Gets the list of Healthbot results and their properties. + * Get the value property: Gets the list of Azure Health Bot results and their properties. * * @return the value value. */ diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Bots.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Bots.java index bf945d468f76..a6fce596ad43 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Bots.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Bots.java @@ -60,6 +60,57 @@ public interface Bots { */ void delete(String resourceGroupName, String botName, Context context); + /** + * List all secrets of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @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 health Bot Keys Response along with {@link Response}. + */ + Response listSecretsWithResponse(String resourceGroupName, String botName, Context context); + + /** + * List all secrets of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health Bot Keys Response. + */ + HealthBotKeysResponse listSecrets(String resourceGroupName, String botName); + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @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 an entry of HealthBotKeysResponse along with {@link Response}. + */ + Response regenerateApiJwtSecretWithResponse(String resourceGroupName, String botName, + Context context); + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param botName The name of the Bot resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 entry of HealthBotKeysResponse. + */ + HealthBotKey regenerateApiJwtSecret(String resourceGroupName, String botName); + /** * Returns all the resources of a particular type belonging to a resource group. * @@ -67,7 +118,7 @@ public interface Bots { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -79,7 +130,7 @@ public interface Bots { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -88,7 +139,7 @@ public interface Bots { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -99,7 +150,7 @@ public interface Bots { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Healthbot operation response as paginated response with {@link PagedIterable}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBot.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBot.java index e324009a4be3..10d5cfc7eab4 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBot.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBot.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.healthbot.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; @@ -50,14 +51,21 @@ public interface HealthBot { Map tags(); /** - * Gets the sku property: SKU of the HealthBot. + * Gets the sku property: SKU of the Azure Health Bot. * * @return the sku value. */ Sku sku(); /** - * Gets the properties property: The set of properties specific to Healthbot resource. + * Gets the identity property: The identity of the Azure Health Bot. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the properties property: The set of properties specific to Azure Health Bot resource. * * @return the properties value. */ @@ -154,9 +162,9 @@ interface WithResourceGroup { */ interface WithSku { /** - * Specifies the sku property: SKU of the HealthBot.. + * Specifies the sku property: SKU of the Azure Health Bot.. * - * @param sku SKU of the HealthBot. + * @param sku SKU of the Azure Health Bot. * @return the next definition stage. */ WithCreate withSku(Sku sku); @@ -166,7 +174,8 @@ interface WithSku { * The stage of the HealthBot 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.WithProperties { + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithProperties { /** * Executes the create request. * @@ -196,14 +205,27 @@ interface WithTags { WithCreate withTags(Map tags); } + /** + * The stage of the HealthBot definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the Azure Health Bot.. + * + * @param identity The identity of the Azure Health Bot. + * @return the next definition stage. + */ + WithCreate withIdentity(Identity identity); + } + /** * The stage of the HealthBot definition allowing to specify properties. */ interface WithProperties { /** - * Specifies the properties property: The set of properties specific to Healthbot resource.. + * Specifies the properties property: The set of properties specific to Azure Health Bot resource.. * - * @param properties The set of properties specific to Healthbot resource. + * @param properties The set of properties specific to Azure Health Bot resource. * @return the next definition stage. */ WithCreate withProperties(HealthBotProperties properties); @@ -220,7 +242,8 @@ interface WithProperties { /** * The template for HealthBot update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { + interface Update + extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithSku, UpdateStages.WithIdentity { /** * Executes the update request. * @@ -246,26 +269,52 @@ interface UpdateStages { */ interface WithTags { /** - * Specifies the tags property: Tags for a HealthBot.. + * Specifies the tags property: Tags for a Azure Health Bot.. * - * @param tags Tags for a HealthBot. + * @param tags Tags for a Azure Health Bot. * @return the next definition stage. */ Update withTags(Map tags); } + /** + * The stage of the HealthBot update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of Azure Health Bot.. + * + * @param properties Properties of Azure Health Bot. + * @return the next definition stage. + */ + Update withProperties(HealthBotProperties properties); + } + /** * The stage of the HealthBot update allowing to specify sku. */ interface WithSku { /** - * Specifies the sku property: SKU of the HealthBot.. + * Specifies the sku property: SKU of the Azure Health Bot.. * - * @param sku SKU of the HealthBot. + * @param sku SKU of the Azure Health Bot. * @return the next definition stage. */ Update withSku(Sku sku); } + + /** + * The stage of the HealthBot update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the Azure Health Bot.. + * + * @param identity The identity of the Azure Health Bot. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } } /** @@ -282,4 +331,44 @@ interface WithSku { * @return the refreshed resource. */ HealthBot refresh(Context context); + + /** + * List all secrets of a HealthBot. + * + * @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 health Bot Keys Response along with {@link Response}. + */ + Response listSecretsWithResponse(Context context); + + /** + * List all secrets of a HealthBot. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return health Bot Keys Response. + */ + HealthBotKeysResponse listSecrets(); + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @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 an entry of HealthBotKeysResponse along with {@link Response}. + */ + Response regenerateApiJwtSecretWithResponse(Context context); + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @throws com.azure.core.management.exception.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 entry of HealthBotKeysResponse. + */ + HealthBotKey regenerateApiJwtSecret(); } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKey.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKey.java new file mode 100644 index 000000000000..0b4efacdc4ec --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKey.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthbot.models; + +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeyInner; + +/** + * An immutable client-side representation of HealthBotKey. + */ +public interface HealthBotKey { + /** + * Gets the keyName property: The name of the key. + * + * @return the keyName value. + */ + String keyName(); + + /** + * Gets the value property: The value of the key. + * + * @return the value value. + */ + String value(); + + /** + * Gets the inner com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeyInner object. + * + * @return the inner object. + */ + HealthBotKeyInner innerModel(); +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKeysResponse.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKeysResponse.java new file mode 100644 index 000000000000..240722534efd --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKeysResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthbot.models; + +import com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeysResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of HealthBotKeysResponse. + */ +public interface HealthBotKeysResponse { + /** + * Gets the secrets property: Array of Azure Health Bot Secrets. + * + * @return the secrets value. + */ + List secrets(); + + /** + * Gets the inner com.azure.resourcemanager.healthbot.fluent.models.HealthBotKeysResponseInner object. + * + * @return the inner object. + */ + HealthBotKeysResponseInner innerModel(); +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotProperties.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotProperties.java index 0ada0546b970..4886f3c381d0 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotProperties.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotProperties.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.healthbot.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,14 +14,14 @@ /** * HealthBotProperties * - * The properties of a HealthBot. The Health Bot Service is a cloud platform that empowers developers in Healthcare - * organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help - * them improve processes and reduce costs. + * The properties of a Azure Health Bot. The Health Bot Service is a cloud platform that empowers developers in + * Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, + * that help them improve processes and reduce costs. */ -@Immutable +@Fluent public final class HealthBotProperties implements JsonSerializable { /* - * The provisioning state of the Healthbot resource. + * The provisioning state of the Azure Health Bot resource. */ private String provisioningState; @@ -30,6 +30,11 @@ public final class HealthBotProperties implements JsonSerializable { /* - * Tags for a HealthBot. + * Properties of Azure Health Bot. + */ + private HealthBotProperties properties; + + /* + * Tags for a Azure Health Bot. */ private Map tags; /* - * SKU of the HealthBot. + * SKU of the Azure Health Bot. */ private Sku sku; + /* + * The identity of the Azure Health Bot. + */ + private Identity identity; + + /* + * The location property. + */ + private String location; + /** * Creates an instance of HealthBotUpdateParameters class. */ @@ -34,7 +49,27 @@ public HealthBotUpdateParameters() { } /** - * Get the tags property: Tags for a HealthBot. + * Get the properties property: Properties of Azure Health Bot. + * + * @return the properties value. + */ + public HealthBotProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Azure Health Bot. + * + * @param properties the properties value to set. + * @return the HealthBotUpdateParameters object itself. + */ + public HealthBotUpdateParameters withProperties(HealthBotProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Tags for a Azure Health Bot. * * @return the tags value. */ @@ -43,7 +78,7 @@ public Map tags() { } /** - * Set the tags property: Tags for a HealthBot. + * Set the tags property: Tags for a Azure Health Bot. * * @param tags the tags value to set. * @return the HealthBotUpdateParameters object itself. @@ -54,7 +89,7 @@ public HealthBotUpdateParameters withTags(Map tags) { } /** - * Get the sku property: SKU of the HealthBot. + * Get the sku property: SKU of the Azure Health Bot. * * @return the sku value. */ @@ -63,7 +98,7 @@ public Sku sku() { } /** - * Set the sku property: SKU of the HealthBot. + * Set the sku property: SKU of the Azure Health Bot. * * @param sku the sku value to set. * @return the HealthBotUpdateParameters object itself. @@ -73,15 +108,61 @@ public HealthBotUpdateParameters withSku(Sku sku) { return this; } + /** + * Get the identity property: The identity of the Azure Health Bot. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the Azure Health Bot. + * + * @param identity the identity value to set. + * @return the HealthBotUpdateParameters object itself. + */ + public HealthBotUpdateParameters withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the location property: The location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location property. + * + * @param location the location value to set. + * @return the HealthBotUpdateParameters object itself. + */ + public HealthBotUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (properties() != null) { + properties().validate(); + } if (sku() != null) { sku().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -90,8 +171,11 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -110,11 +194,17 @@ public static HealthBotUpdateParameters fromJson(JsonReader jsonReader) throws I String fieldName = reader.getFieldName(); reader.nextToken(); - if ("tags".equals(fieldName)) { + if ("properties".equals(fieldName)) { + deserializedHealthBotUpdateParameters.properties = HealthBotProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedHealthBotUpdateParameters.tags = tags; } else if ("sku".equals(fieldName)) { deserializedHealthBotUpdateParameters.sku = Sku.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedHealthBotUpdateParameters.identity = Identity.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedHealthBotUpdateParameters.location = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Identity.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Identity.java new file mode 100644 index 000000000000..1de2a7925197 --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Identity.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthbot.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Identity for the resource. + */ +@Fluent +public final class Identity implements JsonSerializable { + /* + * The principal ID of resource identity. This property will only be provided for a system assigned identity. + */ + private String principalId; + + /* + * The tenant ID of resource. This property will only be provided for a system assigned identity. + */ + private String tenantId; + + /* + * The identity type. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set + * of user assigned identities. The type 'None' will remove any identities from the Azure Health Bot + */ + private ResourceIdentityType type; + + /* + * The list of user identities associated with the resource. The user identity dictionary key references will be ARM + * resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}'. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of Identity class. + */ + public Identity() { + } + + /** + * Get the principalId property: The principal ID of resource identity. This property will only be provided for a + * system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. This property will only be provided for a system assigned + * identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The identity type. The type 'SystemAssigned, UserAssigned' includes both an implicitly + * created identity and a set of user assigned identities. The type 'None' will remove any identities from the Azure + * Health Bot. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. The type 'SystemAssigned, UserAssigned' includes both an implicitly + * created identity and a set of user assigned identities. The type 'None' will remove any identities from the Azure + * Health Bot. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references 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 Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * 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(); + } + }); + } + } + + /** + * {@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 Identity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Identity 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 Identity. + */ + public static Identity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Identity deserializedIdentity = new Identity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedIdentity.tenantId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIdentity.type = ResourceIdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedIdentity; + }); + } +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/KeyVaultProperties.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/KeyVaultProperties.java new file mode 100644 index 000000000000..8aeef2fd7a35 --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/KeyVaultProperties.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthbot.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; + +/** + * Properties of the key vault. + */ +@Fluent +public final class KeyVaultProperties implements JsonSerializable { + /* + * The name of the key vault key. + */ + private String keyName; + + /* + * The version of the key vault key. + */ + private String keyVersion; + + /* + * The Uri of the key vault. + */ + private String keyVaultUri; + + /* + * The user assigned identity (ARM resource id) that has access to the key. + */ + private String userIdentity; + + /** + * Creates an instance of KeyVaultProperties class. + */ + public KeyVaultProperties() { + } + + /** + * Get the keyName property: The name of the key vault key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of the key vault key. + * + * @param keyName the keyName value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: The version of the key vault key. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: The version of the key vault key. + * + * @param keyVersion the keyVersion value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the keyVaultUri property: The Uri of the key vault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: The Uri of the key vault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the userIdentity property: The user assigned identity (ARM resource id) that has access to the key. + * + * @return the userIdentity value. + */ + public String userIdentity() { + return this.userIdentity; + } + + /** + * Set the userIdentity property: The user assigned identity (ARM resource id) that has access to the key. + * + * @param userIdentity the userIdentity value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withUserIdentity(String userIdentity) { + this.userIdentity = userIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyName in model KeyVaultProperties")); + } + if (keyVaultUri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property keyVaultUri in model KeyVaultProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyName", this.keyName); + jsonWriter.writeStringField("keyVaultUri", this.keyVaultUri); + jsonWriter.writeStringField("keyVersion", this.keyVersion); + jsonWriter.writeStringField("userIdentity", this.userIdentity); + 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 IllegalStateException If the deserialized JSON object was missing any required properties. + * @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 ("keyName".equals(fieldName)) { + deserializedKeyVaultProperties.keyName = reader.getString(); + } else if ("keyVaultUri".equals(fieldName)) { + deserializedKeyVaultProperties.keyVaultUri = reader.getString(); + } else if ("keyVersion".equals(fieldName)) { + deserializedKeyVaultProperties.keyVersion = reader.getString(); + } else if ("userIdentity".equals(fieldName)) { + deserializedKeyVaultProperties.userIdentity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultProperties; + }); + } +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Operations.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Operations.java index 5bae8954fef1..d56b82255264 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Operations.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Operations.java @@ -12,7 +12,7 @@ */ public interface Operations { /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -21,7 +21,7 @@ public interface Operations { PagedIterable list(); /** - * Lists all the available HealthBot operations. + * Lists all the available Azure Health Bot operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/ResourceIdentityType.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/ResourceIdentityType.java new file mode 100644 index 000000000000..f52b9dde19b2 --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/ResourceIdentityType.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthbot.models; + +/** + * The identity type. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of + * user assigned identities. The type 'None' will remove any identities from the Azure Health Bot. + */ +public enum ResourceIdentityType { + /** + * Enum value SystemAssigned. + */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** + * Enum value UserAssigned. + */ + USER_ASSIGNED("UserAssigned"), + + /** + * Enum value SystemAssigned, UserAssigned. + */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** + * Enum value None. + */ + NONE("None"); + + /** + * The actual serialized value for a ResourceIdentityType instance. + */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + public static ResourceIdentityType fromString(String value) { + if (value == null) { + return null; + } + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Sku.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Sku.java index 63cdb075dce6..293d36784c5d 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Sku.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Sku.java @@ -18,7 +18,7 @@ @Fluent public final class Sku implements JsonSerializable { /* - * The name of the HealthBot SKU + * The name of the Azure Health Bot SKU */ private SkuName name; @@ -29,7 +29,7 @@ public Sku() { } /** - * Get the name property: The name of the HealthBot SKU. + * Get the name property: The name of the Azure Health Bot SKU. * * @return the name value. */ @@ -38,7 +38,7 @@ public SkuName name() { } /** - * Set the name property: The name of the HealthBot SKU. + * Set the name property: The name of the Azure Health Bot SKU. * * @param name the name value to set. * @return the Sku object itself. diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/SkuName.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/SkuName.java index 691a71d5700b..b2ebaba82b33 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/SkuName.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/SkuName.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.healthbot.models; /** - * The name of the HealthBot SKU. + * The name of the Azure Health Bot SKU. */ public enum SkuName { /** @@ -21,7 +21,17 @@ public enum SkuName { /** * Enum value C0. */ - C0("C0"); + C0("C0"), + + /** + * Enum value PES. + */ + PES("PES"), + + /** + * Enum value C1. + */ + C1("C1"); /** * The actual serialized value for a SkuName instance. diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/UserAssignedIdentity.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..673e1a47ad42 --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/UserAssignedIdentity.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthbot.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 details of the user assigned managed identity used by the Video Analyzer resource. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of user assigned identity. + */ + private String principalId; + + /* + * The client ID of user assigned identity. + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.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 UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity 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 UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/package-info.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/package-info.java index 461f5991a473..f6facf9f41cd 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/package-info.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/package-info.java @@ -4,8 +4,7 @@ /** * Package containing the data models for HealthbotClient. - * Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy - * their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce - * costs. + * Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their + * compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. */ package com.azure.resourcemanager.healthbot.models; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/package-info.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/package-info.java index 96de8c959242..969055bc46ac 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/package-info.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/package-info.java @@ -4,8 +4,7 @@ /** * Package containing the classes for HealthbotClient. - * Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy - * their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce - * costs. + * Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their + * compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. */ package com.azure.resourcemanager.healthbot; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/resources/azure-resourcemanager-healthbot.properties b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/resources/azure-resourcemanager-healthbot.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/resources/azure-resourcemanager-healthbot.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsCreateSamples.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsCreateSamples.java index 014747a96f90..ead293ae6502 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsCreateSamples.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsCreateSamples.java @@ -4,8 +4,13 @@ package com.azure.resourcemanager.healthbot.generated; +import com.azure.resourcemanager.healthbot.models.Identity; +import com.azure.resourcemanager.healthbot.models.ResourceIdentityType; import com.azure.resourcemanager.healthbot.models.Sku; import com.azure.resourcemanager.healthbot.models.SkuName; +import com.azure.resourcemanager.healthbot.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; /** * Samples for Bots Create. @@ -13,7 +18,7 @@ public final class BotsCreateSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ResourceCreationPut.json + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ResourceCreationPut.json */ /** * Sample code: BotCreate. @@ -26,6 +31,24 @@ public static void botCreate(com.azure.resourcemanager.healthbot.HealthbotManage .withRegion("East US") .withExistingResourceGroup("healthbotClient") .withSku(new Sku().withName(SkuName.F0)) + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi", + new UserAssignedIdentity(), + "/subscriptions/subscription-id/resourcegroups/myrg/providers/microsoft.managedidentity/userassignedidentities/my-mi2", + new UserAssignedIdentity()))) .create(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsDeleteSamples.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsDeleteSamples.java index 19859e19245f..8e7cb53ac847 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsDeleteSamples.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsDeleteSamples.java @@ -10,7 +10,7 @@ public final class BotsDeleteSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ResourceDeletionDelete. + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ResourceDeletionDelete. * json */ /** diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsGetByResourceGroupSamples.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsGetByResourceGroupSamples.java index 905a08bfa698..f02902cadbd7 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsGetByResourceGroupSamples.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class BotsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ResourceInfoGet.json + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ResourceInfoGet.json */ /** * Sample code: ResourceInfoGet. diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListByResourceGroupSamples.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListByResourceGroupSamples.java index b9a2559400fc..2442959f5c29 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListByResourceGroupSamples.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class BotsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ListBotsByResourceGroup. + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ListBotsByResourceGroup. * json */ /** diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListSamples.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListSamples.java index 8ca26ce0e86c..3a5135eb01ef 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListSamples.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListSamples.java @@ -10,7 +10,7 @@ public final class BotsListSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ListBotsBySubscription. + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ListBotsBySubscription. * json */ /** diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListSecretsSamples.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListSecretsSamples.java new file mode 100644 index 000000000000..8a3492ce0467 --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsListSecretsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.healthbot.generated; + +/** + * Samples for Bots ListSecrets. + */ +public final class BotsListSecretsSamples { + /* + * x-ms-original-file: + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ListSecrets.json + */ + /** + * Sample code: Bot List Secrets. + * + * @param manager Entry point to HealthbotManager. + */ + public static void botListSecrets(com.azure.resourcemanager.healthbot.HealthbotManager manager) { + manager.bots().listSecretsWithResponse("healthbotClient", "samplebotname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsRegenerateApiJwtSecretSamples.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsRegenerateApiJwtSecretSamples.java new file mode 100644 index 000000000000..17f07feddef8 --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsRegenerateApiJwtSecretSamples.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.healthbot.generated; + +/** + * Samples for Bots RegenerateApiJwtSecret. + */ +public final class BotsRegenerateApiJwtSecretSamples { + /* + * x-ms-original-file: + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/RegenerateApiJwtSecret. + * json + */ + /** + * Sample code: Bot Regenerate API JWT Secret. + * + * @param manager Entry point to HealthbotManager. + */ + public static void botRegenerateAPIJWTSecret(com.azure.resourcemanager.healthbot.HealthbotManager manager) { + manager.bots() + .regenerateApiJwtSecretWithResponse("healthbotClient", "samplebotname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsUpdateSamples.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsUpdateSamples.java index 2962984d3198..8f411f0d93ea 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsUpdateSamples.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/BotsUpdateSamples.java @@ -14,7 +14,7 @@ public final class BotsUpdateSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/ResourceUpdatePatch.json + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/ResourceUpdatePatch.json */ /** * Sample code: BotUpdate. diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/OperationsListSamples.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/OperationsListSamples.java index d29128149fac..95293095ec86 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/OperationsListSamples.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/samples/java/com/azure/resourcemanager/healthbot/generated/OperationsListSamples.java @@ -10,7 +10,7 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2020-12-08/examples/GetOperations.json + * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2024-02-01/examples/GetOperations.json */ /** * Sample code: Get Operations. diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/AvailableOperationsTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/AvailableOperationsTests.java deleted file mode 100644 index 829a359bfaa9..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/AvailableOperationsTests.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.healthbot.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.healthbot.fluent.models.OperationDetailInner; -import com.azure.resourcemanager.healthbot.models.AvailableOperations; -import com.azure.resourcemanager.healthbot.models.OperationDisplay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AvailableOperationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableOperations model = BinaryData.fromString( - "{\"value\":[{\"name\":\"dfdosygexp\",\"isDataAction\":true,\"display\":{\"provider\":\"hmsbzjhcrzevdp\",\"resource\":\"xaolth\",\"operation\":\"rgqjbpfzfsinzg\",\"description\":\"cjrwzoxxjtfellu\"},\"origin\":\"zitonpeqfpjkjl\",\"properties\":\"datafpdvhpfxxypi\"},{\"name\":\"nmayhuybb\",\"isDataAction\":true,\"display\":{\"provider\":\"po\",\"resource\":\"inuvamiheogn\",\"operation\":\"xzxtheo\",\"description\":\"si\"},\"origin\":\"evcciqihnhun\",\"properties\":\"datawjzrnfygxgisp\"},{\"name\":\"vtz\",\"isDataAction\":false,\"display\":{\"provider\":\"bljofxqeof\",\"resource\":\"e\",\"operation\":\"hqjbasvmsmj\",\"description\":\"lngsntnbybkzgcwr\"},\"origin\":\"lxxwrljdouskc\",\"properties\":\"datakocrcjdkwtnhx\"},{\"name\":\"jbiksqrglssai\",\"isDataAction\":false,\"display\":{\"provider\":\"nzl\",\"resource\":\"fmppe\",\"operation\":\"vmgxsab\",\"description\":\"qduujitcjczdz\"},\"origin\":\"ndhkrw\",\"properties\":\"dataappd\"}],\"nextLink\":\"dkvwrwjfe\"}") - .toObject(AvailableOperations.class); - Assertions.assertEquals("dfdosygexp", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("hmsbzjhcrzevdp", model.value().get(0).display().provider()); - Assertions.assertEquals("xaolth", model.value().get(0).display().resource()); - Assertions.assertEquals("rgqjbpfzfsinzg", model.value().get(0).display().operation()); - Assertions.assertEquals("cjrwzoxxjtfellu", model.value().get(0).display().description()); - Assertions.assertEquals("zitonpeqfpjkjl", model.value().get(0).origin()); - Assertions.assertEquals("dkvwrwjfe", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableOperations model = new AvailableOperations().withValue(Arrays.asList( - new OperationDetailInner().withName("dfdosygexp") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("hmsbzjhcrzevdp") - .withResource("xaolth") - .withOperation("rgqjbpfzfsinzg") - .withDescription("cjrwzoxxjtfellu")) - .withOrigin("zitonpeqfpjkjl") - .withProperties("datafpdvhpfxxypi"), - new OperationDetailInner().withName("nmayhuybb") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("po") - .withResource("inuvamiheogn") - .withOperation("xzxtheo") - .withDescription("si")) - .withOrigin("evcciqihnhun") - .withProperties("datawjzrnfygxgisp"), - new OperationDetailInner().withName("vtz") - .withIsDataAction(false) - .withDisplay(new OperationDisplay().withProvider("bljofxqeof") - .withResource("e") - .withOperation("hqjbasvmsmj") - .withDescription("lngsntnbybkzgcwr")) - .withOrigin("lxxwrljdouskc") - .withProperties("datakocrcjdkwtnhx"), - new OperationDetailInner().withName("jbiksqrglssai") - .withIsDataAction(false) - .withDisplay(new OperationDisplay().withProvider("nzl") - .withResource("fmppe") - .withOperation("vmgxsab") - .withDescription("qduujitcjczdz")) - .withOrigin("ndhkrw") - .withProperties("dataappd"))) - .withNextLink("dkvwrwjfe"); - model = BinaryData.fromObject(model).toObject(AvailableOperations.class); - Assertions.assertEquals("dfdosygexp", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("hmsbzjhcrzevdp", model.value().get(0).display().provider()); - Assertions.assertEquals("xaolth", model.value().get(0).display().resource()); - Assertions.assertEquals("rgqjbpfzfsinzg", model.value().get(0).display().operation()); - Assertions.assertEquals("cjrwzoxxjtfellu", model.value().get(0).display().description()); - Assertions.assertEquals("zitonpeqfpjkjl", model.value().get(0).origin()); - Assertions.assertEquals("dkvwrwjfe", model.nextLink()); - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotResponseListTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotResponseListTests.java deleted file mode 100644 index 49562d9faa8c..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotResponseListTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.healthbot.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.healthbot.models.BotResponseList; - -public final class BotResponseListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BotResponseList model = BinaryData.fromString( - "{\"nextLink\":\"knygjofjddeq\",\"value\":[{\"sku\":{\"name\":\"F0\"},\"properties\":{\"provisioningState\":\"ewnwreitjzyfl\",\"botManagementPortalLink\":\"arhmofcqhsmy\"},\"location\":\"kdtmlxhekuk\",\"tags\":{\"ryuanzwuxzdxtay\":\"xukcdmpar\",\"u\":\"lhmwhfpmrqobm\"},\"id\":\"knryrtihfxtij\",\"name\":\"pzvgnwzsymglzufc\",\"type\":\"zk\"},{\"sku\":{\"name\":\"S1\"},\"properties\":{\"provisioningState\":\"ihanuf\",\"botManagementPortalLink\":\"cbjy\"},\"location\":\"git\",\"tags\":{\"fpikxwczb\":\"hab\",\"n\":\"scnpqxuhivy\",\"rkxvdum\":\"wby\",\"xgaudccs\":\"grtfwvu\"},\"id\":\"h\",\"name\":\"jcny\",\"type\":\"j\"},{\"sku\":{\"name\":\"C0\"},\"properties\":{\"provisioningState\":\"htnapczwlokjyem\",\"botManagementPortalLink\":\"vnipjox\"},\"location\":\"nchgej\",\"tags\":{\"ahuxinpm\":\"dmailzydehojw\",\"vcputegj\":\"njaqwixjspro\",\"uuvmkjozkrwfnd\":\"wmfdatscmdvpjhul\"},\"id\":\"odjpslwejd\",\"name\":\"vwryoqpso\",\"type\":\"cctazakljlahbc\"}]}") - .toObject(BotResponseList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BotResponseList model = new BotResponseList(); - model = BinaryData.fromObject(model).toObject(BotResponseList.class); - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsCreateMockTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsCreateMockTests.java deleted file mode 100644 index c35c3e8f0496..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsCreateMockTests.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.healthbot.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.healthbot.HealthbotManager; -import com.azure.resourcemanager.healthbot.models.HealthBot; -import com.azure.resourcemanager.healthbot.models.HealthBotProperties; -import com.azure.resourcemanager.healthbot.models.Sku; -import com.azure.resourcemanager.healthbot.models.SkuName; -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 reactor.core.publisher.Mono; - -public final class BotsCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"sku\":{\"name\":\"C0\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"botManagementPortalLink\":\"pbtoqcjmkl\"},\"location\":\"vbqid\",\"tags\":{\"dj\":\"jzyulpk\",\"xzlocxscp\":\"rlkhbzhfepgzgq\"},\"id\":\"ierhhbcsglummaj\",\"name\":\"j\",\"type\":\"odxobnbdxkqpxok\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HealthbotManager manager = HealthbotManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - HealthBot response = manager.bots() - .define("flnrosfqpteehzz") - .withRegion("rmnohj") - .withExistingResourceGroup("mdwzjeiachboo") - .withSku(new Sku().withName(SkuName.C0)) - .withTags(mapOf("xsqwpgrjbznorc", "whdsoifiyip")) - .withProperties(new HealthBotProperties()) - .create(); - - Assertions.assertEquals("vbqid", response.location()); - Assertions.assertEquals("jzyulpk", response.tags().get("dj")); - Assertions.assertEquals(SkuName.C0, response.sku().name()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsDeleteMockTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsDeleteMockTests.java deleted file mode 100644 index fb3936bfc562..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsDeleteMockTests.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.healthbot.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.healthbot.HealthbotManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BotsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HealthbotManager manager = HealthbotManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.bots().delete("hbmdgbbjfdd", "mbmbexppbh", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsGetByResourceGroupWithResponseMockTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 9189bb071fdf..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.healthbot.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.healthbot.HealthbotManager; -import com.azure.resourcemanager.healthbot.models.HealthBot; -import com.azure.resourcemanager.healthbot.models.SkuName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BotsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"sku\":{\"name\":\"S1\"},\"properties\":{\"provisioningState\":\"xybz\",\"botManagementPortalLink\":\"e\"},\"location\":\"ytb\",\"tags\":{\"mglougpbkw\":\"fouflmmnkzsmo\"},\"id\":\"mutduqktaps\",\"name\":\"wgcu\",\"type\":\"rtumkdosvq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HealthbotManager manager = HealthbotManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - HealthBot response = manager.bots() - .getByResourceGroupWithResponse("kgfg", "bmadgak", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ytb", response.location()); - Assertions.assertEquals("fouflmmnkzsmo", response.tags().get("mglougpbkw")); - Assertions.assertEquals(SkuName.S1, response.sku().name()); - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsListByResourceGroupMockTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsListByResourceGroupMockTests.java deleted file mode 100644 index e7564db8e856..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsListByResourceGroupMockTests.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.healthbot.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.healthbot.HealthbotManager; -import com.azure.resourcemanager.healthbot.models.HealthBot; -import com.azure.resourcemanager.healthbot.models.SkuName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BotsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"sku\":{\"name\":\"C0\"},\"properties\":{\"provisioningState\":\"fpfpsalgbquxigj\",\"botManagementPortalLink\":\"gzjaoyfhrtxilne\"},\"location\":\"ujysvle\",\"tags\":{\"kcprbnw\":\"fqawrlyxw\",\"ysszdnrujqguh\":\"xgjvtbv\",\"prwzwbnguitnwui\":\"uouq\",\"zuckyfi\":\"gazxuf\"},\"id\":\"rfidfvzwdz\",\"name\":\"htymw\",\"type\":\"sdkf\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HealthbotManager manager = HealthbotManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.bots().listByResourceGroup("q", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ujysvle", response.iterator().next().location()); - Assertions.assertEquals("fqawrlyxw", response.iterator().next().tags().get("kcprbnw")); - Assertions.assertEquals(SkuName.C0, response.iterator().next().sku().name()); - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsListMockTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsListMockTests.java deleted file mode 100644 index 79d0de4da879..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/BotsListMockTests.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.healthbot.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.healthbot.HealthbotManager; -import com.azure.resourcemanager.healthbot.models.HealthBot; -import com.azure.resourcemanager.healthbot.models.SkuName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class BotsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"sku\":{\"name\":\"C0\"},\"properties\":{\"provisioningState\":\"mnteiwao\",\"botManagementPortalLink\":\"km\"},\"location\":\"c\",\"tags\":{\"fsrpymzidnse\":\"dcuf\"},\"id\":\"cxtbzsg\",\"name\":\"yc\",\"type\":\"sne\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HealthbotManager manager = HealthbotManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.bots().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("c", response.iterator().next().location()); - Assertions.assertEquals("dcuf", response.iterator().next().tags().get("fsrpymzidnse")); - Assertions.assertEquals(SkuName.C0, response.iterator().next().sku().name()); - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/HealthBotInnerTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/HealthBotInnerTests.java deleted file mode 100644 index 0e9d4030ff94..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/HealthBotInnerTests.java +++ /dev/null @@ -1,50 +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.healthbot.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.healthbot.fluent.models.HealthBotInner; -import com.azure.resourcemanager.healthbot.models.HealthBotProperties; -import com.azure.resourcemanager.healthbot.models.Sku; -import com.azure.resourcemanager.healthbot.models.SkuName; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class HealthBotInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthBotInner model = BinaryData.fromString( - "{\"sku\":{\"name\":\"C0\"},\"properties\":{\"provisioningState\":\"quvgjxpybczme\",\"botManagementPortalLink\":\"tzopbsphrupidgsy\"},\"location\":\"ejhphoyc\",\"tags\":{\"hdxbmtqio\":\"ao\",\"ufpo\":\"jzehtb\",\"hwlrx\":\"noi\",\"dmbpazlobcufpdz\":\"bqsoqijg\"},\"id\":\"rbt\",\"name\":\"qqjnqgl\",\"type\":\"qgn\"}") - .toObject(HealthBotInner.class); - Assertions.assertEquals("ejhphoyc", model.location()); - Assertions.assertEquals("ao", model.tags().get("hdxbmtqio")); - Assertions.assertEquals(SkuName.C0, model.sku().name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthBotInner model = new HealthBotInner().withLocation("ejhphoyc") - .withTags(mapOf("hdxbmtqio", "ao", "ufpo", "jzehtb", "hwlrx", "noi", "dmbpazlobcufpdz", "bqsoqijg")) - .withSku(new Sku().withName(SkuName.C0)) - .withProperties(new HealthBotProperties()); - model = BinaryData.fromObject(model).toObject(HealthBotInner.class); - Assertions.assertEquals("ejhphoyc", model.location()); - Assertions.assertEquals("ao", model.tags().get("hdxbmtqio")); - Assertions.assertEquals(SkuName.C0, model.sku().name()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/HealthBotPropertiesTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/HealthBotPropertiesTests.java deleted file mode 100644 index c40064e437d7..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/HealthBotPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.healthbot.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.healthbot.models.HealthBotProperties; - -public final class HealthBotPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthBotProperties model - = BinaryData.fromString("{\"provisioningState\":\"oo\",\"botManagementPortalLink\":\"wifsq\"}") - .toObject(HealthBotProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthBotProperties model = new HealthBotProperties(); - model = BinaryData.fromObject(model).toObject(HealthBotProperties.class); - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/HealthBotUpdateParametersTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/HealthBotUpdateParametersTests.java deleted file mode 100644 index e5ff29304e15..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/HealthBotUpdateParametersTests.java +++ /dev/null @@ -1,46 +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.healthbot.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.healthbot.models.HealthBotUpdateParameters; -import com.azure.resourcemanager.healthbot.models.Sku; -import com.azure.resourcemanager.healthbot.models.SkuName; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class HealthBotUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthBotUpdateParameters model = BinaryData.fromString( - "{\"tags\":{\"xrifkwmrvkts\":\"agdfmglzlh\",\"ucmpoyfd\":\"zntocipaouajps\"},\"sku\":{\"name\":\"F0\"}}") - .toObject(HealthBotUpdateParameters.class); - Assertions.assertEquals("agdfmglzlh", model.tags().get("xrifkwmrvkts")); - Assertions.assertEquals(SkuName.F0, model.sku().name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthBotUpdateParameters model = new HealthBotUpdateParameters() - .withTags(mapOf("xrifkwmrvkts", "agdfmglzlh", "ucmpoyfd", "zntocipaouajps")) - .withSku(new Sku().withName(SkuName.F0)); - model = BinaryData.fromObject(model).toObject(HealthBotUpdateParameters.class); - Assertions.assertEquals("agdfmglzlh", model.tags().get("xrifkwmrvkts")); - Assertions.assertEquals(SkuName.F0, model.sku().name()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDetailInnerTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDetailInnerTests.java deleted file mode 100644 index 0d693849507d..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDetailInnerTests.java +++ /dev/null @@ -1,46 +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.healthbot.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.healthbot.fluent.models.OperationDetailInner; -import com.azure.resourcemanager.healthbot.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDetailInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDetailInner model = BinaryData.fromString( - "{\"name\":\"nhutjeltmrldhugj\",\"isDataAction\":true,\"display\":{\"provider\":\"qxhocdgeablgphut\",\"resource\":\"ndv\",\"operation\":\"ozwyiftyhxhuro\",\"description\":\"tyxolniwpwc\"},\"origin\":\"jfkgiawxk\",\"properties\":\"dataypl\"}") - .toObject(OperationDetailInner.class); - Assertions.assertEquals("nhutjeltmrldhugj", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("qxhocdgeablgphut", model.display().provider()); - Assertions.assertEquals("ndv", model.display().resource()); - Assertions.assertEquals("ozwyiftyhxhuro", model.display().operation()); - Assertions.assertEquals("tyxolniwpwc", model.display().description()); - Assertions.assertEquals("jfkgiawxk", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDetailInner model = new OperationDetailInner().withName("nhutjeltmrldhugj") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("qxhocdgeablgphut") - .withResource("ndv") - .withOperation("ozwyiftyhxhuro") - .withDescription("tyxolniwpwc")) - .withOrigin("jfkgiawxk") - .withProperties("dataypl"); - model = BinaryData.fromObject(model).toObject(OperationDetailInner.class); - Assertions.assertEquals("nhutjeltmrldhugj", model.name()); - Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("qxhocdgeablgphut", model.display().provider()); - Assertions.assertEquals("ndv", model.display().resource()); - Assertions.assertEquals("ozwyiftyhxhuro", model.display().operation()); - Assertions.assertEquals("tyxolniwpwc", model.display().description()); - Assertions.assertEquals("jfkgiawxk", model.origin()); - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDisplayTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDisplayTests.java deleted file mode 100644 index fad17fb6bca2..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDisplayTests.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.healthbot.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.healthbot.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"kbasyypn\",\"resource\":\"hsgcbacphejkot\",\"operation\":\"qgoulznd\",\"description\":\"kwy\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("kbasyypn", model.provider()); - Assertions.assertEquals("hsgcbacphejkot", model.resource()); - Assertions.assertEquals("qgoulznd", model.operation()); - Assertions.assertEquals("kwy", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("kbasyypn") - .withResource("hsgcbacphejkot") - .withOperation("qgoulznd") - .withDescription("kwy"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("kbasyypn", model.provider()); - Assertions.assertEquals("hsgcbacphejkot", model.resource()); - Assertions.assertEquals("qgoulznd", model.operation()); - Assertions.assertEquals("kwy", model.description()); - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationsListMockTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationsListMockTests.java deleted file mode 100644 index 44542dfe2526..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationsListMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.healthbot.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.healthbot.HealthbotManager; -import com.azure.resourcemanager.healthbot.models.OperationDetail; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"ionpimexg\",\"isDataAction\":false,\"display\":{\"provider\":\"po\",\"resource\":\"maajrmvdjwzrlo\",\"operation\":\"clwhijcoejctbz\",\"description\":\"s\"},\"origin\":\"y\",\"properties\":\"datakbfkg\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - HealthbotManager manager = HealthbotManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ionpimexg", response.iterator().next().name()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - Assertions.assertEquals("po", response.iterator().next().display().provider()); - Assertions.assertEquals("maajrmvdjwzrlo", response.iterator().next().display().resource()); - Assertions.assertEquals("clwhijcoejctbz", response.iterator().next().display().operation()); - Assertions.assertEquals("s", response.iterator().next().display().description()); - Assertions.assertEquals("y", response.iterator().next().origin()); - } -} diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/SkuTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/SkuTests.java deleted file mode 100644 index 637909428d24..000000000000 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/SkuTests.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.healthbot.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.healthbot.models.Sku; -import com.azure.resourcemanager.healthbot.models.SkuName; -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\":\"C0\"}").toObject(Sku.class); - Assertions.assertEquals(SkuName.C0, model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName(SkuName.C0); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals(SkuName.C0, model.name()); - } -}