diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/CHANGELOG.md b/sdk/durabletask/azure-resourcemanager-durabletask/CHANGELOG.md index ef25979b9188d..ab41c8edc33af 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/CHANGELOG.md +++ b/sdk/durabletask/azure-resourcemanager-durabletask/CHANGELOG.md @@ -1,14 +1,112 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0-beta.1 (2026-10-20) + +- Azure Resource Manager Durable Task client library for Java. This package contains Microsoft Azure SDK for Durable Task Management SDK. Package api-version 2026-07-01-preview. 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.TaskQueueThroughput` was added + +* `models.DetectorDataset` was added + +* `models.TransparentDataEncryptionKeySource` was added + +* `models.TaskQueue$Definition` was added + +* `models.DetectorStatusId` was added + +* `models.DetectorMetadata` was added + +* `models.TaskQueue$UpdateStages` was added + +* `models.DetectorTableColumn` was added + +* `models.UserAssignedIdentity` was added + +* `models.TaskQueue` was added + +* `models.ManagedServiceIdentity` was added + +* `models.DetectorRenderingProperties` was added + +* `models.DetectorStatus` was added + +* `models.ReplicationRole` was added + +* `models.FailoverState` was added + +* `models.TaskQueueUpdate` was added + +* `models.TaskQueues` was added + +* `models.FailoverInstanceProperties` was added + +* `models.FailoverInstances` was added + +* `models.DetectorType` was added + +* `models.TransparentDataEncryptionProperties` was added + +* `models.Detectors` was added + +* `models.DetectorProperties` was added + +* `models.TransparentDataEncryption` was added -### Bugs Fixed +* `models.TaskQueue$DefinitionStages` was added + +* `models.TransparentDataEncryptions` was added + +* `models.ManagedServiceIdentityType` was added + +* `models.TaskQueue$Update` was added + +* `models.FailoverInstance` was added + +* `models.TaskQueueProperties` was added + +* `models.DetectorRenderingType` was added + +* `models.DetectorTable` was added + +* `models.Detector` was added + +#### `models.Scheduler$Definition` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.Schedulers` was modified + +* `restart(java.lang.String,java.lang.String)` was added +* `restartWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `DurableTaskManager` was modified + +* `taskQueues()` was added +* `detectors()` was added +* `failoverInstances()` was added +* `transparentDataEncryptions()` was added + +#### `models.Scheduler` was modified + +* `restart()` was added +* `identity()` was added +* `restartWithResponse(com.azure.core.util.Context)` was added + +#### `models.Scheduler$Update` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.TaskHubProperties` was modified + +* `withCapabilities(java.util.List)` was added +* `capabilities()` was added + +#### `models.SchedulerUpdate` was modified -### Other Changes +* `withIdentity(models.ManagedServiceIdentity)` was added +* `identity()` was added ## 1.1.0 (2026-03-09) diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/README.md b/sdk/durabletask/azure-resourcemanager-durabletask/README.md index 007d17977e86c..4c9cac2f8c7f0 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/README.md +++ b/sdk/durabletask/azure-resourcemanager-durabletask/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Durable Task client library for Java. -This package contains Microsoft Azure SDK for Durable Task Management SDK. Package api-version 2026-02-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Durable Task Management SDK. Package api-version 2026-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-durabletask - 1.1.0 + 1.2.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/SAMPLE.md b/sdk/durabletask/azure-resourcemanager-durabletask/SAMPLE.md index 8545ffd6fcd1b..bac68472250f9 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/SAMPLE.md +++ b/sdk/durabletask/azure-resourcemanager-durabletask/SAMPLE.md @@ -1,6 +1,20 @@ # Code snippets and samples +## Detectors + +- [Get](#detectors_get) +- [ListByScheduler](#detectors_listbyscheduler) + +## FailoverInstances + +- [CreateOrReplace](#failoverinstances_createorreplace) +- [Delete](#failoverinstances_delete) +- [Failover](#failoverinstances_failover) +- [ForceFailoverAllowDataLoss](#failoverinstances_forcefailoverallowdataloss) +- [Get](#failoverinstances_get) +- [ListByScheduler](#failoverinstances_listbyscheduler) + ## Operations - [List](#operations_list) @@ -26,6 +40,7 @@ - [ListByResourceGroup](#schedulers_listbyresourcegroup) - [ListPrivateEndpointConnections](#schedulers_listprivateendpointconnections) - [ListPrivateLinks](#schedulers_listprivatelinks) +- [Restart](#schedulers_restart) - [Update](#schedulers_update) - [UpdatePrivateEndpointConnection](#schedulers_updateprivateendpointconnection) @@ -35,6 +50,203 @@ - [Delete](#taskhubs_delete) - [Get](#taskhubs_get) - [ListByScheduler](#taskhubs_listbyscheduler) + +## TaskQueues + +- [CreateOrUpdate](#taskqueues_createorupdate) +- [Delete](#taskqueues_delete) +- [Get](#taskqueues_get) +- [ListByTaskHub](#taskqueues_listbytaskhub) +- [Update](#taskqueues_update) + +## TransparentDataEncryptions + +- [CreateOrReplace](#transparentdataencryptions_createorreplace) +- [Delete](#transparentdataencryptions_delete) +- [Get](#transparentdataencryptions_get) +- [ListByScheduler](#transparentdataencryptions_listbyscheduler) +### Detectors_Get + +```java +/** + * Samples for Detectors Get. + */ +public final class DetectorsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Detectors_Get.json + */ + /** + * Sample code: Detectors_Get. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void detectorsGet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.detectors() + .getWithResponse("rgopenapi", "testscheduler", "cpuhealth", com.azure.core.util.Context.NONE); + } +} +``` + +### Detectors_ListByScheduler + +```java +/** + * Samples for Detectors ListByScheduler. + */ +public final class DetectorsListBySchedulerSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Detectors_ListByScheduler.json + */ + /** + * Sample code: Detectors_ListByScheduler. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void detectorsListByScheduler(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.detectors().listByScheduler("rgopenapi", "testscheduler", com.azure.core.util.Context.NONE); + } +} +``` + +### FailoverInstances_CreateOrReplace + +```java +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; +import com.azure.resourcemanager.durabletask.models.FailoverInstanceProperties; + +/** + * Samples for FailoverInstances CreateOrReplace. + */ +public final class FailoverInstancesCreateOrReplaceSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_CreateOrReplace_MaximumSet_Gen.json + */ + /** + * Sample code: FailoverInstances_CreateOrReplace_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + failoverInstancesCreateOrReplaceMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances() + .createOrReplace("rgdurabletask", "testscheduler", new FailoverInstanceInner() + .withProperties(new FailoverInstanceProperties().withPartnerSchedulerResourceId( + "/subscriptions/194D3C1E-462F-4738-9025-092A628C06EB/resourceGroups/rgdurabletask-secondary/providers/Microsoft.DurableTask/schedulers/testscheduler-secondary")), + com.azure.core.util.Context.NONE); + } +} +``` + +### FailoverInstances_Delete + +```java +/** + * Samples for FailoverInstances Delete. + */ +public final class FailoverInstancesDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: FailoverInstances_Delete_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + failoverInstancesDeleteMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances().delete("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} +``` + +### FailoverInstances_Failover + +```java +/** + * Samples for FailoverInstances Failover. + */ +public final class FailoverInstancesFailoverSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_Failover.json + */ + /** + * Sample code: FailoverInstances_Failover. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void failoverInstancesFailover(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances().failover("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} +``` + +### FailoverInstances_ForceFailoverAllowDataLoss + +```java +/** + * Samples for FailoverInstances ForceFailoverAllowDataLoss. + */ +public final class FailoverInstancesForceFailoverAllowDataLossSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_ForceFailoverAllowDataLoss.json + */ + /** + * Sample code: FailoverInstances_ForceFailoverAllowDataLoss. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + failoverInstancesForceFailoverAllowDataLoss(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances() + .forceFailoverAllowDataLoss("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} +``` + +### FailoverInstances_Get + +```java +/** + * Samples for FailoverInstances Get. + */ +public final class FailoverInstancesGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_Get_MaximumSet_Gen.json + */ + /** + * Sample code: FailoverInstances_Get_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + failoverInstancesGetMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances().getWithResponse("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} +``` + +### FailoverInstances_ListByScheduler + +```java +/** + * Samples for FailoverInstances ListByScheduler. + */ +public final class FailoverInstancesListBySchedulerSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_ListByScheduler_MaximumSet_Gen.json + */ + /** + * Sample code: FailoverInstances_ListByScheduler_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + failoverInstancesListBySchedulerMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances().listByScheduler("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} +``` + ### Operations_List ```java @@ -43,7 +255,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2026-02-01/Operations_List.json + * x-ms-original-file: 2026-07-01-preview/Operations_List.json */ /** * Sample code: Operations_List. @@ -70,7 +282,7 @@ import java.util.Arrays; */ public final class RetentionPoliciesCreateOrReplaceSamples { /* - * x-ms-original-file: 2026-02-01/RetentionPolicies_CreateOrReplace_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/RetentionPolicies_CreateOrReplace_MaximumSet_Gen.json */ /** * Sample code: RetentionPolicies_CreateOrReplace_MaximumSet. @@ -98,7 +310,7 @@ public final class RetentionPoliciesCreateOrReplaceSamples { */ public final class RetentionPoliciesDeleteSamples { /* - * x-ms-original-file: 2026-02-01/RetentionPolicies_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Delete_MaximumSet_Gen.json */ /** * Sample code: RetentionPolicies_Delete_MaximumSet. @@ -120,7 +332,7 @@ public final class RetentionPoliciesDeleteSamples { */ public final class RetentionPoliciesGetSamples { /* - * x-ms-original-file: 2026-02-01/RetentionPolicies_Get_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Get_MaximumSet_Gen.json */ /** * Sample code: RetentionPolicies_Get_MaximumSet. @@ -142,7 +354,7 @@ public final class RetentionPoliciesGetSamples { */ public final class RetentionPoliciesListBySchedulerSamples { /* - * x-ms-original-file: 2026-02-01/RetentionPolicies_ListByScheduler_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/RetentionPolicies_ListByScheduler_MaximumSet_Gen.json */ /** * Sample code: RetentionPolicies_ListByScheduler_MaximumSet. @@ -170,7 +382,7 @@ import java.util.Arrays; */ public final class RetentionPoliciesUpdateSamples { /* - * x-ms-original-file: 2026-02-01/RetentionPolicies_Update_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Update_MaximumSet_Gen.json */ /** * Sample code: RetentionPolicies_Update_MaximumSet. @@ -195,9 +407,12 @@ public final class RetentionPoliciesUpdateSamples { ### Schedulers_CreateOrUpdate ```java +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.SchedulerProperties; import com.azure.resourcemanager.durabletask.models.SchedulerSku; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; +import com.azure.resourcemanager.durabletask.models.UserAssignedIdentity; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -207,7 +422,7 @@ import java.util.Map; */ public final class SchedulersCreateOrUpdateSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_CreateOrUpdate.json */ /** * Sample code: Schedulers_CreateOrUpdate. @@ -222,6 +437,10 @@ public final class SchedulersCreateOrUpdateSamples { .withTags(mapOf("department", "research", "development", "true")) .withProperties(new SchedulerProperties().withIpAllowlist(Arrays.asList("10.0.0.0/8")) .withSku(new SchedulerSku().withName(SchedulerSkuName.DEDICATED))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/EE9BD735-67CE-4A90-89C4-439D3F6A4C93/resourceGroups/rgopenapi/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity", + new UserAssignedIdentity()))) .create(); } @@ -252,7 +471,7 @@ import com.azure.resourcemanager.durabletask.models.PrivateLinkServiceConnection */ public final class SchedulersCreateOrUpdatePrivateEndpointConnectionSamples { /* - * x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Create_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Create_MaximumSet. @@ -283,7 +502,7 @@ public final class SchedulersCreateOrUpdatePrivateEndpointConnectionSamples { */ public final class SchedulersDeleteSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_Delete.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_Delete.json */ /** * Sample code: Schedulers_Delete. @@ -304,7 +523,7 @@ public final class SchedulersDeleteSamples { */ public final class SchedulersDeletePrivateEndpointConnectionSamples { /* - * x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Delete_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Delete_MaximumSet. @@ -328,7 +547,7 @@ public final class SchedulersDeletePrivateEndpointConnectionSamples { */ public final class SchedulersGetByResourceGroupSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_Get.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_Get.json */ /** * Sample code: Schedulers_Get. @@ -350,7 +569,7 @@ public final class SchedulersGetByResourceGroupSamples { */ public final class SchedulersGetPrivateEndpointConnectionSamples { /* - * x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Get_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Get_MaximumSet. @@ -374,7 +593,7 @@ public final class SchedulersGetPrivateEndpointConnectionSamples { */ public final class SchedulersGetPrivateLinkSamples { /* - * x-ms-original-file: 2026-02-01/PrivateLinkResources_Get_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateLinkResources_Get_MaximumSet_Gen.json */ /** * Sample code: PrivateLinkResources_Get_MaximumSet. @@ -398,7 +617,7 @@ public final class SchedulersGetPrivateLinkSamples { */ public final class SchedulersListSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_ListBySubscription.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_ListBySubscription.json */ /** * Sample code: Schedulers_ListBySubscription. @@ -419,7 +638,7 @@ public final class SchedulersListSamples { */ public final class SchedulersListByResourceGroupSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_ListByResourceGroup.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_ListByResourceGroup.json */ /** * Sample code: Schedulers_ListByResourceGroup. @@ -440,7 +659,7 @@ public final class SchedulersListByResourceGroupSamples { */ public final class SchedulersListPrivateEndpointConnectionsSamples { /* - * x-ms-original-file: 2026-02-01/PrivateEndpointConnections_List_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_List_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_List_MaximumSet. @@ -463,7 +682,7 @@ public final class SchedulersListPrivateEndpointConnectionsSamples { */ public final class SchedulersListPrivateLinksSamples { /* - * x-ms-original-file: 2026-02-01/PrivateLinkResources_List_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateLinkResources_List_MaximumSet_Gen.json */ /** * Sample code: PrivateLinkResources_List_MaximumSet. @@ -477,9 +696,32 @@ public final class SchedulersListPrivateLinksSamples { } ``` +### Schedulers_Restart + +```java +/** + * Samples for Schedulers Restart. + */ +public final class SchedulersRestartSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Schedulers_Restart.json + */ + /** + * Sample code: Schedulers_Restart. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void schedulersRestart(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.schedulers().restartWithResponse("rgopenapi", "testscheduler", com.azure.core.util.Context.NONE); + } +} +``` + ### Schedulers_Update ```java +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.Scheduler; import com.azure.resourcemanager.durabletask.models.SchedulerPropertiesUpdate; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; @@ -493,7 +735,7 @@ import java.util.Map; */ public final class SchedulersUpdateSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_Update.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_Update.json */ /** * Sample code: Schedulers_Update. @@ -508,6 +750,7 @@ public final class SchedulersUpdateSamples { .withTags(mapOf("hello", "world")) .withProperties(new SchedulerPropertiesUpdate().withIpAllowlist(Arrays.asList("10.0.0.0/8")) .withSku(new SchedulerSkuUpdate().withName(SchedulerSkuName.DEDICATED).withCapacity(3))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) .apply(); } @@ -538,7 +781,7 @@ import com.azure.resourcemanager.durabletask.models.PrivateLinkServiceConnection */ public final class SchedulersUpdatePrivateEndpointConnectionSamples { /* - * x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Update.json + * x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Update.json */ /** * Sample code: PrivateEndpointConnections_Update. @@ -563,13 +806,14 @@ public final class SchedulersUpdatePrivateEndpointConnectionSamples { ```java import com.azure.resourcemanager.durabletask.models.TaskHubProperties; +import java.util.Arrays; /** * Samples for TaskHubs CreateOrUpdate. */ public final class TaskHubsCreateOrUpdateSamples { /* - * x-ms-original-file: 2026-02-01/TaskHubs_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01-preview/TaskHubs_CreateOrUpdate.json */ /** * Sample code: TaskHubs_CreateOrUpdate. @@ -580,7 +824,7 @@ public final class TaskHubsCreateOrUpdateSamples { manager.taskHubs() .define("testtaskhub") .withExistingScheduler("rgopenapi", "testscheduler") - .withProperties(new TaskHubProperties()) + .withProperties(new TaskHubProperties().withCapabilities(Arrays.asList("ExampleFutureCapability"))) .create(); } } @@ -594,7 +838,7 @@ public final class TaskHubsCreateOrUpdateSamples { */ public final class TaskHubsDeleteSamples { /* - * x-ms-original-file: 2026-02-01/TaskHubs_Delete.json + * x-ms-original-file: 2026-07-01-preview/TaskHubs_Delete.json */ /** * Sample code: TaskHubs_Delete. @@ -615,7 +859,7 @@ public final class TaskHubsDeleteSamples { */ public final class TaskHubsGetSamples { /* - * x-ms-original-file: 2026-02-01/TaskHubs_Get.json + * x-ms-original-file: 2026-07-01-preview/TaskHubs_Get.json */ /** * Sample code: TaskHubs_Get. @@ -637,7 +881,7 @@ public final class TaskHubsGetSamples { */ public final class TaskHubsListBySchedulerSamples { /* - * x-ms-original-file: 2026-02-01/TaskHubs_ListByScheduler.json + * x-ms-original-file: 2026-07-01-preview/TaskHubs_ListByScheduler.json */ /** * Sample code: TaskHubs_ListByScheduler. @@ -650,3 +894,246 @@ public final class TaskHubsListBySchedulerSamples { } ``` +### TaskQueues_CreateOrUpdate + +```java +import com.azure.resourcemanager.durabletask.models.TaskQueueProperties; +import com.azure.resourcemanager.durabletask.models.TaskQueueThroughput; + +/** + * Samples for TaskQueues CreateOrUpdate. + */ +public final class TaskQueuesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_CreateOrUpdate.json + */ + /** + * Sample code: TaskQueues_CreateOrUpdate. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void taskQueuesCreateOrUpdate(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.taskQueues() + .define("QueueA") + .withExistingTaskHub("rgopenapi", "testscheduler", "testtaskhub") + .withProperties( + new TaskQueueProperties().withThroughput(new TaskQueueThroughput().withActionsPerSecond(40))) + .create(); + } + + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_CreateOrUpdate_MinimumSet.json + */ + /** + * Sample code: TaskQueues_CreateOrUpdate_MinimumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + taskQueuesCreateOrUpdateMinimumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.taskQueues() + .define("QueueA") + .withExistingTaskHub("rgopenapi", "testscheduler", "testtaskhub") + .withProperties(new TaskQueueProperties()) + .create(); + } +} +``` + +### TaskQueues_Delete + +```java +/** + * Samples for TaskQueues Delete. + */ +public final class TaskQueuesDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_Delete.json + */ + /** + * Sample code: TaskQueues_Delete. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void taskQueuesDelete(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.taskQueues() + .delete("rgopenapi", "testscheduler", "testtaskhub", "QueueA", com.azure.core.util.Context.NONE); + } +} +``` + +### TaskQueues_Get + +```java +/** + * Samples for TaskQueues Get. + */ +public final class TaskQueuesGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_Get.json + */ + /** + * Sample code: TaskQueues_Get. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void taskQueuesGet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.taskQueues() + .getWithResponse("rgopenapi", "testscheduler", "testtaskhub", "QueueA", com.azure.core.util.Context.NONE); + } +} +``` + +### TaskQueues_ListByTaskHub + +```java +/** + * Samples for TaskQueues ListByTaskHub. + */ +public final class TaskQueuesListByTaskHubSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_ListByTaskHub.json + */ + /** + * Sample code: TaskQueues_ListByTaskHub. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void taskQueuesListByTaskHub(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.taskQueues() + .listByTaskHub("rgopenapi", "testscheduler", "testtaskhub", com.azure.core.util.Context.NONE); + } +} +``` + +### TaskQueues_Update + +```java +import com.azure.resourcemanager.durabletask.models.TaskQueue; +import com.azure.resourcemanager.durabletask.models.TaskQueueProperties; +import com.azure.resourcemanager.durabletask.models.TaskQueueThroughput; + +/** + * Samples for TaskQueues Update. + */ +public final class TaskQueuesUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_Update.json + */ + /** + * Sample code: TaskQueues_Update. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void taskQueuesUpdate(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + TaskQueue resource = manager.taskQueues() + .getWithResponse("rgopenapi", "testscheduler", "testtaskhub", "QueueA", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new TaskQueueProperties().withThroughput(new TaskQueueThroughput().withActionsPerSecond(80))) + .apply(); + } +} +``` + +### TransparentDataEncryptions_CreateOrReplace + +```java +import com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner; +import com.azure.resourcemanager.durabletask.models.TransparentDataEncryptionKeySource; +import com.azure.resourcemanager.durabletask.models.TransparentDataEncryptionProperties; + +/** + * Samples for TransparentDataEncryptions CreateOrReplace. + */ +public final class TransparentDataEncryptionsCreateOrReplaceSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_CreateOrReplace_MaximumSet_Gen.json + */ + /** + * Sample code: TransparentDataEncryptions_CreateOrReplace_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void transparentDataEncryptionsCreateOrReplaceMaximumSet( + com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.transparentDataEncryptions() + .createOrReplace("rgdurabletask", "testscheduler", + new TransparentDataEncryptionInner().withProperties(new TransparentDataEncryptionProperties() + .withKeySource(TransparentDataEncryptionKeySource.CUSTOMER_MANAGED) + .withKeyVaultKeyUri("fakeTokenPlaceholder") + .withAutoRotationEnabled(true)), + com.azure.core.util.Context.NONE); + } +} +``` + +### TransparentDataEncryptions_Delete + +```java +/** + * Samples for TransparentDataEncryptions Delete. + */ +public final class TransparentDataEncryptionsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: TransparentDataEncryptions_Delete_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + transparentDataEncryptionsDeleteMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.transparentDataEncryptions().delete("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} +``` + +### TransparentDataEncryptions_Get + +```java +/** + * Samples for TransparentDataEncryptions Get. + */ +public final class TransparentDataEncryptionsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_Get_MaximumSet_Gen.json + */ + /** + * Sample code: TransparentDataEncryptions_Get_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + transparentDataEncryptionsGetMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.transparentDataEncryptions() + .getWithResponse("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} +``` + +### TransparentDataEncryptions_ListByScheduler + +```java +/** + * Samples for TransparentDataEncryptions ListByScheduler. + */ +public final class TransparentDataEncryptionsListBySchedulerSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_ListByScheduler_MaximumSet_Gen.json + */ + /** + * Sample code: TransparentDataEncryptions_ListByScheduler_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void transparentDataEncryptionsListBySchedulerMaximumSet( + com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.transparentDataEncryptions() + .listByScheduler("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/pom.xml b/sdk/durabletask/azure-resourcemanager-durabletask/pom.xml index 19587078a1fcf..890d41ce476f4 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/pom.xml +++ b/sdk/durabletask/azure-resourcemanager-durabletask/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Durable Task Management - This package contains Microsoft Azure SDK for Durable Task Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2026-02-01. + This package contains Microsoft Azure SDK for Durable Task Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2026-07-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/DurableTaskManager.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/DurableTaskManager.java index 1a980c20fb66e..b031ca333edf0 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/DurableTaskManager.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/DurableTaskManager.java @@ -25,15 +25,23 @@ import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.durabletask.fluent.DurableTaskManagementClient; +import com.azure.resourcemanager.durabletask.implementation.DetectorsImpl; import com.azure.resourcemanager.durabletask.implementation.DurableTaskManagementClientBuilder; +import com.azure.resourcemanager.durabletask.implementation.FailoverInstancesImpl; import com.azure.resourcemanager.durabletask.implementation.OperationsImpl; import com.azure.resourcemanager.durabletask.implementation.RetentionPoliciesImpl; import com.azure.resourcemanager.durabletask.implementation.SchedulersImpl; import com.azure.resourcemanager.durabletask.implementation.TaskHubsImpl; +import com.azure.resourcemanager.durabletask.implementation.TaskQueuesImpl; +import com.azure.resourcemanager.durabletask.implementation.TransparentDataEncryptionsImpl; +import com.azure.resourcemanager.durabletask.models.Detectors; +import com.azure.resourcemanager.durabletask.models.FailoverInstances; import com.azure.resourcemanager.durabletask.models.Operations; import com.azure.resourcemanager.durabletask.models.RetentionPolicies; import com.azure.resourcemanager.durabletask.models.Schedulers; import com.azure.resourcemanager.durabletask.models.TaskHubs; +import com.azure.resourcemanager.durabletask.models.TaskQueues; +import com.azure.resourcemanager.durabletask.models.TransparentDataEncryptions; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -48,12 +56,20 @@ public final class DurableTaskManager { private Operations operations; + private Detectors detectors; + private Schedulers schedulers; private TaskHubs taskHubs; + private TaskQueues taskQueues; + private RetentionPolicies retentionPolicies; + private TransparentDataEncryptions transparentDataEncryptions; + + private FailoverInstances failoverInstances; + private final DurableTaskManagementClient clientObject; private DurableTaskManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -281,6 +297,18 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of Detectors. + * + * @return Resource collection API of Detectors. + */ + public Detectors detectors() { + if (this.detectors == null) { + this.detectors = new DetectorsImpl(clientObject.getDetectors(), this); + } + return detectors; + } + /** * Gets the resource collection API of Schedulers. It manages Scheduler, PrivateEndpointConnection. * @@ -305,6 +333,18 @@ public TaskHubs taskHubs() { return taskHubs; } + /** + * Gets the resource collection API of TaskQueues. It manages TaskQueue. + * + * @return Resource collection API of TaskQueues. + */ + public TaskQueues taskQueues() { + if (this.taskQueues == null) { + this.taskQueues = new TaskQueuesImpl(clientObject.getTaskQueues(), this); + } + return taskQueues; + } + /** * Gets the resource collection API of RetentionPolicies. * @@ -317,6 +357,31 @@ public RetentionPolicies retentionPolicies() { return retentionPolicies; } + /** + * Gets the resource collection API of TransparentDataEncryptions. + * + * @return Resource collection API of TransparentDataEncryptions. + */ + public TransparentDataEncryptions transparentDataEncryptions() { + if (this.transparentDataEncryptions == null) { + this.transparentDataEncryptions + = new TransparentDataEncryptionsImpl(clientObject.getTransparentDataEncryptions(), this); + } + return transparentDataEncryptions; + } + + /** + * Gets the resource collection API of FailoverInstances. + * + * @return Resource collection API of FailoverInstances. + */ + public FailoverInstances failoverInstances() { + if (this.failoverInstances == null) { + this.failoverInstances = new FailoverInstancesImpl(clientObject.getFailoverInstances(), this); + } + return failoverInstances; + } + /** * Gets wrapped service client DurableTaskManagementClient providing direct access to the underlying auto-generated * API implementation, based on Azure REST API. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/DetectorsClient.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/DetectorsClient.java new file mode 100644 index 0000000000000..29435df168de2 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/DetectorsClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.durabletask.fluent.models.DetectorInner; + +/** + * An instance of this class provides access to all the operations defined in DetectorsClient. + */ +public interface DetectorsClient { + /** + * Gets a diagnostic detector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param detectorId The name of the Detector. + * @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 a diagnostic detector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String schedulerName, String detectorId, + Context context); + + /** + * Gets a diagnostic detector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param detectorId The name of the Detector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a diagnostic detector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DetectorInner get(String resourceGroupName, String schedulerName, String detectorId); + + /** + * Lists the diagnostic detectors belonging to a scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByScheduler(String resourceGroupName, String schedulerName); + + /** + * Lists the diagnostic detectors belonging to a scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByScheduler(String resourceGroupName, String schedulerName, Context context); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/DurableTaskManagementClient.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/DurableTaskManagementClient.java index 3905cde4e2312..396747d0d2630 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/DurableTaskManagementClient.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/DurableTaskManagementClient.java @@ -53,6 +53,13 @@ public interface DurableTaskManagementClient { */ OperationsClient getOperations(); + /** + * Gets the DetectorsClient object to access its operations. + * + * @return the DetectorsClient object. + */ + DetectorsClient getDetectors(); + /** * Gets the SchedulersClient object to access its operations. * @@ -67,10 +74,31 @@ public interface DurableTaskManagementClient { */ TaskHubsClient getTaskHubs(); + /** + * Gets the TaskQueuesClient object to access its operations. + * + * @return the TaskQueuesClient object. + */ + TaskQueuesClient getTaskQueues(); + /** * Gets the RetentionPoliciesClient object to access its operations. * * @return the RetentionPoliciesClient object. */ RetentionPoliciesClient getRetentionPolicies(); + + /** + * Gets the TransparentDataEncryptionsClient object to access its operations. + * + * @return the TransparentDataEncryptionsClient object. + */ + TransparentDataEncryptionsClient getTransparentDataEncryptions(); + + /** + * Gets the FailoverInstancesClient object to access its operations. + * + * @return the FailoverInstancesClient object. + */ + FailoverInstancesClient getFailoverInstances(); } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/FailoverInstancesClient.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/FailoverInstancesClient.java new file mode 100644 index 0000000000000..7311fc27eefdf --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/FailoverInstancesClient.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; + +/** + * An instance of this class provides access to all the operations defined in FailoverInstancesClient. + */ +public interface FailoverInstancesClient { + /** + * Get a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @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 a Failover Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String schedulerName, Context context); + + /** + * Get a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Failover Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FailoverInstanceInner get(String resourceGroupName, String schedulerName); + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FailoverInstanceInner> beginCreateOrReplace(String resourceGroupName, + String schedulerName, FailoverInstanceInner resource); + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FailoverInstanceInner> beginCreateOrReplace(String resourceGroupName, + String schedulerName, FailoverInstanceInner resource, Context context); + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FailoverInstanceInner createOrReplace(String resourceGroupName, String schedulerName, + FailoverInstanceInner resource); + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FailoverInstanceInner createOrReplace(String resourceGroupName, String schedulerName, + FailoverInstanceInner resource, Context context); + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName); + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName, Context context); + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String schedulerName); + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String schedulerName, Context context); + + /** + * List Failover Instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByScheduler(String resourceGroupName, String schedulerName); + + /** + * List Failover Instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByScheduler(String resourceGroupName, String schedulerName, + Context context); + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FailoverInstanceInner> beginFailover(String resourceGroupName, + String schedulerName); + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FailoverInstanceInner> beginFailover(String resourceGroupName, + String schedulerName, Context context); + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FailoverInstanceInner failover(String resourceGroupName, String schedulerName); + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FailoverInstanceInner failover(String resourceGroupName, String schedulerName, Context context); + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FailoverInstanceInner> + beginForceFailoverAllowDataLoss(String resourceGroupName, String schedulerName); + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FailoverInstanceInner> + beginForceFailoverAllowDataLoss(String resourceGroupName, String schedulerName, Context context); + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FailoverInstanceInner forceFailoverAllowDataLoss(String resourceGroupName, String schedulerName); + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FailoverInstanceInner forceFailoverAllowDataLoss(String resourceGroupName, String schedulerName, Context context); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/SchedulersClient.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/SchedulersClient.java index 2e9dbfe93c9cd..d74bfcc75e6e0 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/SchedulersClient.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/SchedulersClient.java @@ -602,4 +602,30 @@ PagedIterable listPrivateEndpointConnections(Str @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listPrivateEndpointConnections(String resourceGroupName, String schedulerName, Context context); + + /** + * Restart a Scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response restartWithResponse(String resourceGroupName, String schedulerName, Context context); + + /** + * Restart a Scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String schedulerName); } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/TaskQueuesClient.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/TaskQueuesClient.java new file mode 100644 index 0000000000000..8a91653880fef --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/TaskQueuesClient.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.durabletask.fluent.models.TaskQueueInner; +import com.azure.resourcemanager.durabletask.models.TaskQueueUpdate; + +/** + * An instance of this class provides access to all the operations defined in TaskQueuesClient. + */ +public interface TaskQueuesClient { + /** + * Get a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @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 a Task Queue along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, Context context); + + /** + * Get a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskQueueInner get(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName); + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TaskQueueInner> beginCreateOrUpdate(String resourceGroupName, + String schedulerName, String taskHubName, String taskQueueName, TaskQueueInner resource); + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TaskQueueInner> beginCreateOrUpdate(String resourceGroupName, + String schedulerName, String taskHubName, String taskQueueName, TaskQueueInner resource, Context context); + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskQueueInner createOrUpdate(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, TaskQueueInner resource); + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskQueueInner createOrUpdate(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, TaskQueueInner resource, Context context); + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TaskQueueInner> beginUpdate(String resourceGroupName, String schedulerName, + String taskHubName, String taskQueueName, TaskQueueUpdate properties); + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TaskQueueInner> beginUpdate(String resourceGroupName, String schedulerName, + String taskHubName, String taskQueueName, TaskQueueUpdate properties, Context context); + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskQueueInner update(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName, + TaskQueueUpdate properties); + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskQueueInner update(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName, + TaskQueueUpdate properties, Context context); + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName); + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, Context context); + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName); + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName, + Context context); + + /** + * List Task Queues by Task Hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTaskHub(String resourceGroupName, String schedulerName, String taskHubName); + + /** + * List Task Queues by Task Hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTaskHub(String resourceGroupName, String schedulerName, String taskHubName, + Context context); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/TransparentDataEncryptionsClient.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/TransparentDataEncryptionsClient.java new file mode 100644 index 0000000000000..1743fc9579df2 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/TransparentDataEncryptionsClient.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner; + +/** + * An instance of this class provides access to all the operations defined in TransparentDataEncryptionsClient. + */ +public interface TransparentDataEncryptionsClient { + /** + * Get a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @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 a Transparent Data Encryption along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String schedulerName, + Context context); + + /** + * Get a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transparent Data Encryption. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransparentDataEncryptionInner get(String resourceGroupName, String schedulerName); + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 a transparent data encryption resource belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TransparentDataEncryptionInner> + beginCreateOrReplace(String resourceGroupName, String schedulerName, TransparentDataEncryptionInner resource); + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @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 a transparent data encryption resource belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TransparentDataEncryptionInner> beginCreateOrReplace( + String resourceGroupName, String schedulerName, TransparentDataEncryptionInner resource, Context context); + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a transparent data encryption resource belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransparentDataEncryptionInner createOrReplace(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource); + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @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 a transparent data encryption resource belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransparentDataEncryptionInner createOrReplace(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource, Context context); + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName); + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName, Context context); + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String schedulerName); + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String schedulerName, Context context); + + /** + * List Transparent Data Encryptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByScheduler(String resourceGroupName, String schedulerName); + + /** + * List Transparent Data Encryptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByScheduler(String resourceGroupName, String schedulerName, + Context context); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/DetectorInner.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/DetectorInner.java new file mode 100644 index 0000000000000..430051c07b895 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/DetectorInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.durabletask.models.DetectorProperties; +import java.io.IOException; + +/** + * A diagnostic detector resource belonging to the scheduler. + */ +@Immutable +public final class DetectorInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private DetectorProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DetectorInner class. + */ + private DetectorInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public DetectorProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DetectorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorInner 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 DetectorInner. + */ + public static DetectorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DetectorInner deserializedDetectorInner = new DetectorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDetectorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDetectorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDetectorInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDetectorInner.properties = DetectorProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDetectorInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDetectorInner; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/FailoverInstanceInner.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/FailoverInstanceInner.java new file mode 100644 index 0000000000000..14367a1d37b27 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/FailoverInstanceInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.durabletask.models.FailoverInstanceProperties; +import java.io.IOException; + +/** + * A failover instance belonging to the scheduler. + */ +@Fluent +public final class FailoverInstanceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private FailoverInstanceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of FailoverInstanceInner class. + */ + public FailoverInstanceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public FailoverInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the FailoverInstanceInner object itself. + */ + public FailoverInstanceInner withProperties(FailoverInstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FailoverInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FailoverInstanceInner 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 FailoverInstanceInner. + */ + public static FailoverInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FailoverInstanceInner deserializedFailoverInstanceInner = new FailoverInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFailoverInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFailoverInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFailoverInstanceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFailoverInstanceInner.properties = FailoverInstanceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFailoverInstanceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFailoverInstanceInner; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerInner.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerInner.java index 06f427562c541..27af5a085eab7 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerInner.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerInner.java @@ -10,6 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity; import com.azure.resourcemanager.durabletask.models.SchedulerProperties; import java.io.IOException; import java.util.Map; @@ -24,6 +25,11 @@ public final class SchedulerInner extends Resource { */ private SchedulerProperties properties; + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -70,6 +76,26 @@ public SchedulerInner withProperties(SchedulerProperties properties) { return this; } + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the SchedulerInner object itself. + */ + public SchedulerInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -136,6 +162,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -168,6 +195,8 @@ public static SchedulerInner fromJson(JsonReader jsonReader) throws IOException deserializedSchedulerInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedSchedulerInner.properties = SchedulerProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedSchedulerInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedSchedulerInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TaskQueueInner.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TaskQueueInner.java new file mode 100644 index 0000000000000..65f2e4ca8b956 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TaskQueueInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.durabletask.models.TaskQueueProperties; +import java.io.IOException; + +/** + * A Task Queue resource belonging to a Task Hub. + */ +@Fluent +public final class TaskQueueInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private TaskQueueProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TaskQueueInner class. + */ + public TaskQueueInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public TaskQueueProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the TaskQueueInner object itself. + */ + public TaskQueueInner withProperties(TaskQueueProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TaskQueueInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TaskQueueInner 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 TaskQueueInner. + */ + public static TaskQueueInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TaskQueueInner deserializedTaskQueueInner = new TaskQueueInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTaskQueueInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTaskQueueInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTaskQueueInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTaskQueueInner.properties = TaskQueueProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTaskQueueInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTaskQueueInner; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TransparentDataEncryptionInner.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TransparentDataEncryptionInner.java new file mode 100644 index 0000000000000..4e41b97e44739 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TransparentDataEncryptionInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.durabletask.models.TransparentDataEncryptionProperties; +import java.io.IOException; + +/** + * A transparent data encryption resource belonging to the scheduler. + */ +@Fluent +public final class TransparentDataEncryptionInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private TransparentDataEncryptionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TransparentDataEncryptionInner class. + */ + public TransparentDataEncryptionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public TransparentDataEncryptionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the TransparentDataEncryptionInner object itself. + */ + public TransparentDataEncryptionInner withProperties(TransparentDataEncryptionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TransparentDataEncryptionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TransparentDataEncryptionInner 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 TransparentDataEncryptionInner. + */ + public static TransparentDataEncryptionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TransparentDataEncryptionInner deserializedTransparentDataEncryptionInner + = new TransparentDataEncryptionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTransparentDataEncryptionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTransparentDataEncryptionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTransparentDataEncryptionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTransparentDataEncryptionInner.properties + = TransparentDataEncryptionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTransparentDataEncryptionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTransparentDataEncryptionInner; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorImpl.java new file mode 100644 index 0000000000000..548951173588b --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.durabletask.fluent.models.DetectorInner; +import com.azure.resourcemanager.durabletask.models.Detector; +import com.azure.resourcemanager.durabletask.models.DetectorProperties; + +public final class DetectorImpl implements Detector { + private DetectorInner innerObject; + + private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager; + + DetectorImpl(DetectorInner innerObject, com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DetectorProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public DetectorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.durabletask.DurableTaskManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorsClientImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorsClientImpl.java new file mode 100644 index 0000000000000..756b7a6665085 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorsClientImpl.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.durabletask.fluent.DetectorsClient; +import com.azure.resourcemanager.durabletask.fluent.models.DetectorInner; +import com.azure.resourcemanager.durabletask.implementation.models.DetectorListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DetectorsClient. + */ +public final class DetectorsClientImpl implements DetectorsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DetectorsService service; + + /** + * The service client containing this operation class. + */ + private final DurableTaskManagementClientImpl client; + + /** + * Initializes an instance of DetectorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DetectorsClientImpl(DurableTaskManagementClientImpl client) { + this.service + = RestProxy.create(DetectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DurableTaskManagementClientDetectors to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DurableTaskManagementClientDetectors") + public interface DetectorsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/detectors/{detectorId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("detectorId") String detectorId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/detectors/{detectorId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("detectorId") String detectorId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/detectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByScheduler(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/detectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySchedulerSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySchedulerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySchedulerNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a diagnostic detector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param detectorId The name of the Detector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a diagnostic detector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String schedulerName, + String detectorId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, detectorId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a diagnostic detector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param detectorId The name of the Detector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a diagnostic detector on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String schedulerName, String detectorId) { + return getWithResponseAsync(resourceGroupName, schedulerName, detectorId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a diagnostic detector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param detectorId The name of the Detector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a diagnostic detector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String schedulerName, String detectorId, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, schedulerName, detectorId, accept, context); + } + + /** + * Gets a diagnostic detector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param detectorId The name of the Detector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a diagnostic detector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DetectorInner get(String resourceGroupName, String schedulerName, String detectorId) { + return getWithResponse(resourceGroupName, schedulerName, detectorId, Context.NONE).getValue(); + } + + /** + * Lists the diagnostic detectors belonging to a scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySchedulerSinglePageAsync(String resourceGroupName, + String schedulerName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByScheduler(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the diagnostic detectors belonging to a scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySchedulerAsync(String resourceGroupName, String schedulerName) { + return new PagedFlux<>(() -> listBySchedulerSinglePageAsync(resourceGroupName, schedulerName), + nextLink -> listBySchedulerNextSinglePageAsync(nextLink)); + } + + /** + * Lists the diagnostic detectors belonging to a scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerSinglePage(String resourceGroupName, String schedulerName) { + final String accept = "application/json"; + Response res + = service.listBySchedulerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the diagnostic detectors belonging to a scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerSinglePage(String resourceGroupName, String schedulerName, + Context context) { + final String accept = "application/json"; + Response res + = service.listBySchedulerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the diagnostic detectors belonging to a scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName) { + return new PagedIterable<>(() -> listBySchedulerSinglePage(resourceGroupName, schedulerName), + nextLink -> listBySchedulerNextSinglePage(nextLink)); + } + + /** + * Lists the diagnostic detectors belonging to a scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName, + Context context) { + return new PagedIterable<>(() -> listBySchedulerSinglePage(resourceGroupName, schedulerName, context), + nextLink -> listBySchedulerNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySchedulerNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySchedulerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySchedulerNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySchedulerNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorsImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorsImpl.java new file mode 100644 index 0000000000000..67e3ba9f10df6 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorsImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.durabletask.fluent.DetectorsClient; +import com.azure.resourcemanager.durabletask.fluent.models.DetectorInner; +import com.azure.resourcemanager.durabletask.models.Detector; +import com.azure.resourcemanager.durabletask.models.Detectors; + +public final class DetectorsImpl implements Detectors { + private static final ClientLogger LOGGER = new ClientLogger(DetectorsImpl.class); + + private final DetectorsClient innerClient; + + private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager; + + public DetectorsImpl(DetectorsClient innerClient, + com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String schedulerName, String detectorId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, schedulerName, detectorId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DetectorImpl(inner.getValue(), this.manager())); + } + + public Detector get(String resourceGroupName, String schedulerName, String detectorId) { + DetectorInner inner = this.serviceClient().get(resourceGroupName, schedulerName, detectorId); + if (inner != null) { + return new DetectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName) { + PagedIterable inner = this.serviceClient().listByScheduler(resourceGroupName, schedulerName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DetectorImpl(inner1, this.manager())); + } + + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName, Context context) { + PagedIterable inner + = this.serviceClient().listByScheduler(resourceGroupName, schedulerName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DetectorImpl(inner1, this.manager())); + } + + private DetectorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.durabletask.DurableTaskManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskManagementClientImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskManagementClientImpl.java index a02acad3075b0..55fbb8b6119e5 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskManagementClientImpl.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskManagementClientImpl.java @@ -26,11 +26,15 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.durabletask.fluent.DetectorsClient; import com.azure.resourcemanager.durabletask.fluent.DurableTaskManagementClient; +import com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient; import com.azure.resourcemanager.durabletask.fluent.OperationsClient; import com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient; import com.azure.resourcemanager.durabletask.fluent.SchedulersClient; import com.azure.resourcemanager.durabletask.fluent.TaskHubsClient; +import com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient; +import com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -143,6 +147,20 @@ public OperationsClient getOperations() { return this.operations; } + /** + * The DetectorsClient object to access its operations. + */ + private final DetectorsClient detectors; + + /** + * Gets the DetectorsClient object to access its operations. + * + * @return the DetectorsClient object. + */ + public DetectorsClient getDetectors() { + return this.detectors; + } + /** * The SchedulersClient object to access its operations. */ @@ -171,6 +189,20 @@ public TaskHubsClient getTaskHubs() { return this.taskHubs; } + /** + * The TaskQueuesClient object to access its operations. + */ + private final TaskQueuesClient taskQueues; + + /** + * Gets the TaskQueuesClient object to access its operations. + * + * @return the TaskQueuesClient object. + */ + public TaskQueuesClient getTaskQueues() { + return this.taskQueues; + } + /** * The RetentionPoliciesClient object to access its operations. */ @@ -185,6 +217,34 @@ public RetentionPoliciesClient getRetentionPolicies() { return this.retentionPolicies; } + /** + * The TransparentDataEncryptionsClient object to access its operations. + */ + private final TransparentDataEncryptionsClient transparentDataEncryptions; + + /** + * Gets the TransparentDataEncryptionsClient object to access its operations. + * + * @return the TransparentDataEncryptionsClient object. + */ + public TransparentDataEncryptionsClient getTransparentDataEncryptions() { + return this.transparentDataEncryptions; + } + + /** + * The FailoverInstancesClient object to access its operations. + */ + private final FailoverInstancesClient failoverInstances; + + /** + * Gets the FailoverInstancesClient object to access its operations. + * + * @return the FailoverInstancesClient object. + */ + public FailoverInstancesClient getFailoverInstances() { + return this.failoverInstances; + } + /** * Initializes an instance of DurableTaskManagementClient client. * @@ -202,11 +262,15 @@ public RetentionPoliciesClient getRetentionPolicies() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2026-02-01"; + this.apiVersion = "2026-07-01-preview"; this.operations = new OperationsClientImpl(this); + this.detectors = new DetectorsClientImpl(this); this.schedulers = new SchedulersClientImpl(this); this.taskHubs = new TaskHubsClientImpl(this); + this.taskQueues = new TaskQueuesClientImpl(this); this.retentionPolicies = new RetentionPoliciesClientImpl(this); + this.transparentDataEncryptions = new TransparentDataEncryptionsClientImpl(this); + this.failoverInstances = new FailoverInstancesClientImpl(this); } /** diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstanceImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstanceImpl.java new file mode 100644 index 0000000000000..ab99488db9e10 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstanceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; +import com.azure.resourcemanager.durabletask.models.FailoverInstance; +import com.azure.resourcemanager.durabletask.models.FailoverInstanceProperties; + +public final class FailoverInstanceImpl implements FailoverInstance { + private FailoverInstanceInner innerObject; + + private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager; + + FailoverInstanceImpl(FailoverInstanceInner innerObject, + com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FailoverInstanceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public FailoverInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.durabletask.DurableTaskManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstancesClientImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstancesClientImpl.java new file mode 100644 index 0000000000000..62b67bc12e4d0 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstancesClientImpl.java @@ -0,0 +1,1090 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient; +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; +import com.azure.resourcemanager.durabletask.implementation.models.FailoverInstanceListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FailoverInstancesClient. + */ +public final class FailoverInstancesClientImpl implements FailoverInstancesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FailoverInstancesService service; + + /** + * The service client containing this operation class. + */ + private final DurableTaskManagementClientImpl client; + + /** + * Initializes an instance of FailoverInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FailoverInstancesClientImpl(DurableTaskManagementClientImpl client) { + this.service + = RestProxy.create(FailoverInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DurableTaskManagementClientFailoverInstances to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DurableTaskManagementClientFailoverInstances") + public interface FailoverInstancesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FailoverInstanceInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrReplaceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FailoverInstanceInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByScheduler(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySchedulerSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default/failover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failover(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default/failover") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response failoverSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default/forceFailoverAllowDataLoss") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> forceFailoverAllowDataLoss(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/failoverInstances/default/forceFailoverAllowDataLoss") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response forceFailoverAllowDataLossSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySchedulerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySchedulerNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Failover Instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String schedulerName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Failover Instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String schedulerName) { + return getWithResponseAsync(resourceGroupName, schedulerName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Failover Instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String schedulerName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, schedulerName, accept, context); + } + + /** + * Get a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Failover Instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FailoverInstanceInner get(String resourceGroupName, String schedulerName) { + return getWithResponse(resourceGroupName, schedulerName, Context.NONE).getValue(); + } + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, + String schedulerName, FailoverInstanceInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrReplaceWithResponse(String resourceGroupName, String schedulerName, + FailoverInstanceInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrReplaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, contentType, accept, resource, + Context.NONE); + } + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrReplaceWithResponse(String resourceGroupName, String schedulerName, + FailoverInstanceInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrReplaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, contentType, accept, resource, context); + } + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FailoverInstanceInner> + beginCreateOrReplaceAsync(String resourceGroupName, String schedulerName, FailoverInstanceInner resource) { + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, schedulerName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FailoverInstanceInner.class, FailoverInstanceInner.class, + this.client.getContext()); + } + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FailoverInstanceInner> + beginCreateOrReplace(String resourceGroupName, String schedulerName, FailoverInstanceInner resource) { + Response response = createOrReplaceWithResponse(resourceGroupName, schedulerName, resource); + return this.client.getLroResult(response, + FailoverInstanceInner.class, FailoverInstanceInner.class, Context.NONE); + } + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @param context The 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FailoverInstanceInner> beginCreateOrReplace( + String resourceGroupName, String schedulerName, FailoverInstanceInner resource, Context context) { + Response response + = createOrReplaceWithResponse(resourceGroupName, schedulerName, resource, context); + return this.client.getLroResult(response, + FailoverInstanceInner.class, FailoverInstanceInner.class, context); + } + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String schedulerName, + FailoverInstanceInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, schedulerName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FailoverInstanceInner createOrReplace(String resourceGroupName, String schedulerName, + FailoverInstanceInner resource) { + return beginCreateOrReplace(resourceGroupName, schedulerName, resource).getFinalResult(); + } + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FailoverInstanceInner createOrReplace(String resourceGroupName, String schedulerName, + FailoverInstanceInner resource, Context context) { + return beginCreateOrReplace(resourceGroupName, schedulerName, resource, context).getFinalResult(); + } + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String schedulerName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String schedulerName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, Context.NONE); + } + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String schedulerName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, context); + } + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String schedulerName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, schedulerName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName) { + Response response = deleteWithResponse(resourceGroupName, schedulerName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, schedulerName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String schedulerName) { + return beginDeleteAsync(resourceGroupName, schedulerName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String schedulerName) { + beginDelete(resourceGroupName, schedulerName).getFinalResult(); + } + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String schedulerName, Context context) { + beginDelete(resourceGroupName, schedulerName, context).getFinalResult(); + } + + /** + * List Failover Instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySchedulerSinglePageAsync(String resourceGroupName, + String schedulerName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByScheduler(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Failover Instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySchedulerAsync(String resourceGroupName, String schedulerName) { + return new PagedFlux<>(() -> listBySchedulerSinglePageAsync(resourceGroupName, schedulerName), + nextLink -> listBySchedulerNextSinglePageAsync(nextLink)); + } + + /** + * List Failover Instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerSinglePage(String resourceGroupName, + String schedulerName) { + final String accept = "application/json"; + Response res + = service.listBySchedulerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Failover Instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerSinglePage(String resourceGroupName, + String schedulerName, Context context) { + final String accept = "application/json"; + Response res + = service.listBySchedulerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Failover Instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName) { + return new PagedIterable<>(() -> listBySchedulerSinglePage(resourceGroupName, schedulerName), + nextLink -> listBySchedulerNextSinglePage(nextLink)); + } + + /** + * List Failover Instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName, + Context context) { + return new PagedIterable<>(() -> listBySchedulerSinglePage(resourceGroupName, schedulerName, context), + nextLink -> listBySchedulerNextSinglePage(nextLink, context)); + } + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> failoverWithResponseAsync(String resourceGroupName, String schedulerName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.failover(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failoverWithResponse(String resourceGroupName, String schedulerName) { + final String accept = "application/json"; + return service.failoverSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, Context.NONE); + } + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response failoverWithResponse(String resourceGroupName, String schedulerName, Context context) { + final String accept = "application/json"; + return service.failoverSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context); + } + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FailoverInstanceInner> + beginFailoverAsync(String resourceGroupName, String schedulerName) { + Mono>> mono = failoverWithResponseAsync(resourceGroupName, schedulerName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FailoverInstanceInner.class, FailoverInstanceInner.class, + this.client.getContext()); + } + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FailoverInstanceInner> beginFailover(String resourceGroupName, + String schedulerName) { + Response response = failoverWithResponse(resourceGroupName, schedulerName); + return this.client.getLroResult(response, + FailoverInstanceInner.class, FailoverInstanceInner.class, Context.NONE); + } + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FailoverInstanceInner> beginFailover(String resourceGroupName, + String schedulerName, Context context) { + Response response = failoverWithResponse(resourceGroupName, schedulerName, context); + return this.client.getLroResult(response, + FailoverInstanceInner.class, FailoverInstanceInner.class, context); + } + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono failoverAsync(String resourceGroupName, String schedulerName) { + return beginFailoverAsync(resourceGroupName, schedulerName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FailoverInstanceInner failover(String resourceGroupName, String schedulerName) { + return beginFailover(resourceGroupName, schedulerName).getFinalResult(); + } + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FailoverInstanceInner failover(String resourceGroupName, String schedulerName, Context context) { + return beginFailover(resourceGroupName, schedulerName, context).getFinalResult(); + } + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> forceFailoverAllowDataLossWithResponseAsync(String resourceGroupName, + String schedulerName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.forceFailoverAllowDataLoss(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response forceFailoverAllowDataLossWithResponse(String resourceGroupName, + String schedulerName) { + final String accept = "application/json"; + return service.forceFailoverAllowDataLossSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, Context.NONE); + } + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response forceFailoverAllowDataLossWithResponse(String resourceGroupName, String schedulerName, + Context context) { + final String accept = "application/json"; + return service.forceFailoverAllowDataLossSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context); + } + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FailoverInstanceInner> + beginForceFailoverAllowDataLossAsync(String resourceGroupName, String schedulerName) { + Mono>> mono + = forceFailoverAllowDataLossWithResponseAsync(resourceGroupName, schedulerName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FailoverInstanceInner.class, FailoverInstanceInner.class, + this.client.getContext()); + } + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FailoverInstanceInner> + beginForceFailoverAllowDataLoss(String resourceGroupName, String schedulerName) { + Response response = forceFailoverAllowDataLossWithResponse(resourceGroupName, schedulerName); + return this.client.getLroResult(response, + FailoverInstanceInner.class, FailoverInstanceInner.class, Context.NONE); + } + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The 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 a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FailoverInstanceInner> + beginForceFailoverAllowDataLoss(String resourceGroupName, String schedulerName, Context context) { + Response response + = forceFailoverAllowDataLossWithResponse(resourceGroupName, schedulerName, context); + return this.client.getLroResult(response, + FailoverInstanceInner.class, FailoverInstanceInner.class, context); + } + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono forceFailoverAllowDataLossAsync(String resourceGroupName, + String schedulerName) { + return beginForceFailoverAllowDataLossAsync(resourceGroupName, schedulerName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FailoverInstanceInner forceFailoverAllowDataLoss(String resourceGroupName, String schedulerName) { + return beginForceFailoverAllowDataLoss(resourceGroupName, schedulerName).getFinalResult(); + } + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FailoverInstanceInner forceFailoverAllowDataLoss(String resourceGroupName, String schedulerName, + Context context) { + return beginForceFailoverAllowDataLoss(resourceGroupName, schedulerName, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySchedulerNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySchedulerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySchedulerNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySchedulerNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstancesImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstancesImpl.java new file mode 100644 index 0000000000000..cc0bc159095c3 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstancesImpl.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient; +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; +import com.azure.resourcemanager.durabletask.models.FailoverInstance; +import com.azure.resourcemanager.durabletask.models.FailoverInstances; + +public final class FailoverInstancesImpl implements FailoverInstances { + private static final ClientLogger LOGGER = new ClientLogger(FailoverInstancesImpl.class); + + private final FailoverInstancesClient innerClient; + + private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager; + + public FailoverInstancesImpl(FailoverInstancesClient innerClient, + com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String schedulerName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, schedulerName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FailoverInstanceImpl(inner.getValue(), this.manager())); + } + + public FailoverInstance get(String resourceGroupName, String schedulerName) { + FailoverInstanceInner inner = this.serviceClient().get(resourceGroupName, schedulerName); + if (inner != null) { + return new FailoverInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public FailoverInstance createOrReplace(String resourceGroupName, String schedulerName, + FailoverInstanceInner resource) { + FailoverInstanceInner inner = this.serviceClient().createOrReplace(resourceGroupName, schedulerName, resource); + if (inner != null) { + return new FailoverInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public FailoverInstance createOrReplace(String resourceGroupName, String schedulerName, + FailoverInstanceInner resource, Context context) { + FailoverInstanceInner inner + = this.serviceClient().createOrReplace(resourceGroupName, schedulerName, resource, context); + if (inner != null) { + return new FailoverInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String schedulerName) { + this.serviceClient().delete(resourceGroupName, schedulerName); + } + + public void delete(String resourceGroupName, String schedulerName, Context context) { + this.serviceClient().delete(resourceGroupName, schedulerName, context); + } + + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName) { + PagedIterable inner + = this.serviceClient().listByScheduler(resourceGroupName, schedulerName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FailoverInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName, + Context context) { + PagedIterable inner + = this.serviceClient().listByScheduler(resourceGroupName, schedulerName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FailoverInstanceImpl(inner1, this.manager())); + } + + public FailoverInstance failover(String resourceGroupName, String schedulerName) { + FailoverInstanceInner inner = this.serviceClient().failover(resourceGroupName, schedulerName); + if (inner != null) { + return new FailoverInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public FailoverInstance failover(String resourceGroupName, String schedulerName, Context context) { + FailoverInstanceInner inner = this.serviceClient().failover(resourceGroupName, schedulerName, context); + if (inner != null) { + return new FailoverInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public FailoverInstance forceFailoverAllowDataLoss(String resourceGroupName, String schedulerName) { + FailoverInstanceInner inner = this.serviceClient().forceFailoverAllowDataLoss(resourceGroupName, schedulerName); + if (inner != null) { + return new FailoverInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public FailoverInstance forceFailoverAllowDataLoss(String resourceGroupName, String schedulerName, + Context context) { + FailoverInstanceInner inner + = this.serviceClient().forceFailoverAllowDataLoss(resourceGroupName, schedulerName, context); + if (inner != null) { + return new FailoverInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + private FailoverInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.durabletask.DurableTaskManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerImpl.java index 7114cdcba90d8..45d59182cb01e 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerImpl.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerImpl.java @@ -4,10 +4,12 @@ package com.azure.resourcemanager.durabletask.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.durabletask.fluent.models.SchedulerInner; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity; import com.azure.resourcemanager.durabletask.models.Scheduler; import com.azure.resourcemanager.durabletask.models.SchedulerProperties; import com.azure.resourcemanager.durabletask.models.SchedulerPropertiesUpdate; @@ -49,6 +51,10 @@ public SchedulerProperties properties() { return this.innerModel().properties(); } + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -146,6 +152,14 @@ public Scheduler refresh(Context context) { return this; } + public Response restartWithResponse(Context context) { + return serviceManager.schedulers().restartWithResponse(resourceGroupName, schedulerName, context); + } + + public void restart() { + serviceManager.schedulers().restart(resourceGroupName, schedulerName); + } + public SchedulerImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -171,6 +185,16 @@ public SchedulerImpl withProperties(SchedulerProperties properties) { return this; } + public SchedulerImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProperties.withIdentity(identity); + return this; + } + } + public SchedulerImpl withProperties(SchedulerPropertiesUpdate properties) { this.updateProperties.withProperties(properties); return this; diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersClientImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersClientImpl.java index fc016d1bc47b4..72981e0b8b750 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersClientImpl.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersClientImpl.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; @@ -322,6 +323,24 @@ Response listPrivateEndpointConnectionsSync @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/restart") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> restart(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/restart") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response restartSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -2154,6 +2173,70 @@ public PagedIterable listPrivateEndpointConnecti nextLink -> listPrivateEndpointConnectionsNextSinglePage(nextLink, context)); } + /** + * Restart a Scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> restartWithResponseAsync(String resourceGroupName, String schedulerName) { + return FluxUtil + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restart a Scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String schedulerName) { + return restartWithResponseAsync(resourceGroupName, schedulerName).flatMap(ignored -> Mono.empty()); + } + + /** + * Restart a Scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response restartWithResponse(String resourceGroupName, String schedulerName, Context context) { + return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, context); + } + + /** + * Restart a Scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String schedulerName) { + restartWithResponse(resourceGroupName, schedulerName, Context.NONE); + } + /** * Get the next page of items. * diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersImpl.java index dbe92f373bd8b..948ed54c7fc42 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersImpl.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersImpl.java @@ -157,6 +157,14 @@ public PagedIterable listPrivateEndpointConnections(S return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } + public Response restartWithResponse(String resourceGroupName, String schedulerName, Context context) { + return this.serviceClient().restartWithResponse(resourceGroupName, schedulerName, context); + } + + public void restart(String resourceGroupName, String schedulerName) { + this.serviceClient().restart(resourceGroupName, schedulerName); + } + public Scheduler getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueueImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueueImpl.java new file mode 100644 index 0000000000000..088d7b87420a3 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueueImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.durabletask.fluent.models.TaskQueueInner; +import com.azure.resourcemanager.durabletask.models.TaskQueue; +import com.azure.resourcemanager.durabletask.models.TaskQueueProperties; +import com.azure.resourcemanager.durabletask.models.TaskQueueUpdate; + +public final class TaskQueueImpl implements TaskQueue, TaskQueue.Definition, TaskQueue.Update { + private TaskQueueInner innerObject; + + private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public TaskQueueProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public TaskQueueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.durabletask.DurableTaskManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String schedulerName; + + private String taskHubName; + + private String taskQueueName; + + private TaskQueueUpdate updateProperties; + + public TaskQueueImpl withExistingTaskHub(String resourceGroupName, String schedulerName, String taskHubName) { + this.resourceGroupName = resourceGroupName; + this.schedulerName = schedulerName; + this.taskHubName = taskHubName; + return this; + } + + public TaskQueue create() { + this.innerObject = serviceManager.serviceClient() + .getTaskQueues() + .createOrUpdate(resourceGroupName, schedulerName, taskHubName, taskQueueName, this.innerModel(), + Context.NONE); + return this; + } + + public TaskQueue create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTaskQueues() + .createOrUpdate(resourceGroupName, schedulerName, taskHubName, taskQueueName, this.innerModel(), context); + return this; + } + + TaskQueueImpl(String name, com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) { + this.innerObject = new TaskQueueInner(); + this.serviceManager = serviceManager; + this.taskQueueName = name; + } + + public TaskQueueImpl update() { + this.updateProperties = new TaskQueueUpdate(); + return this; + } + + public TaskQueue apply() { + this.innerObject = serviceManager.serviceClient() + .getTaskQueues() + .update(resourceGroupName, schedulerName, taskHubName, taskQueueName, updateProperties, Context.NONE); + return this; + } + + public TaskQueue apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTaskQueues() + .update(resourceGroupName, schedulerName, taskHubName, taskQueueName, updateProperties, context); + return this; + } + + TaskQueueImpl(TaskQueueInner innerObject, com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.schedulerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "schedulers"); + this.taskHubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "taskHubs"); + this.taskQueueName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "taskQueues"); + } + + public TaskQueue refresh() { + this.innerObject = serviceManager.serviceClient() + .getTaskQueues() + .getWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName, Context.NONE) + .getValue(); + return this; + } + + public TaskQueue refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTaskQueues() + .getWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName, context) + .getValue(); + return this; + } + + public TaskQueueImpl withProperties(TaskQueueProperties properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateProperties.withProperties(properties); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueuesClientImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueuesClientImpl.java new file mode 100644 index 0000000000000..a053934036992 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueuesClientImpl.java @@ -0,0 +1,1030 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient; +import com.azure.resourcemanager.durabletask.fluent.models.TaskQueueInner; +import com.azure.resourcemanager.durabletask.implementation.models.TaskQueueListResult; +import com.azure.resourcemanager.durabletask.models.TaskQueueUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TaskQueuesClient. + */ +public final class TaskQueuesClientImpl implements TaskQueuesClient { + /** + * The proxy service used to perform REST calls. + */ + private final TaskQueuesService service; + + /** + * The service client containing this operation class. + */ + private final DurableTaskManagementClientImpl client; + + /** + * Initializes an instance of TaskQueuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TaskQueuesClientImpl(DurableTaskManagementClientImpl client) { + this.service + = RestProxy.create(TaskQueuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DurableTaskManagementClientTaskQueues to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DurableTaskManagementClientTaskQueues") + public interface TaskQueuesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("taskHubName") String taskHubName, @PathParam("taskQueueName") String taskQueueName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("taskHubName") String taskHubName, @PathParam("taskQueueName") String taskQueueName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("taskHubName") String taskHubName, @PathParam("taskQueueName") String taskQueueName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TaskQueueInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("taskHubName") String taskHubName, @PathParam("taskQueueName") String taskQueueName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TaskQueueInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("taskHubName") String taskHubName, @PathParam("taskQueueName") String taskQueueName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TaskQueueUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("taskHubName") String taskHubName, @PathParam("taskQueueName") String taskQueueName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TaskQueueUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("taskHubName") String taskHubName, @PathParam("taskQueueName") String taskQueueName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues/{taskQueueName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("taskHubName") String taskHubName, @PathParam("taskQueueName") String taskQueueName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTaskHub(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("taskHubName") String taskHubName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}/taskQueues") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByTaskHubSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @PathParam("taskHubName") String taskHubName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTaskHubNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByTaskHubNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String schedulerName, + String taskHubName, String taskQueueName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, taskQueueName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName) { + return getWithResponseAsync(resourceGroupName, schedulerName, taskHubName, taskQueueName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, schedulerName, taskHubName, taskQueueName, accept, context); + } + + /** + * Get a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskQueueInner get(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName) { + return getWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName, Context.NONE).getValue(); + } + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String schedulerName, String taskHubName, String taskQueueName, TaskQueueInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, taskQueueName, + contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String schedulerName, + String taskHubName, String taskQueueName, TaskQueueInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, taskQueueName, contentType, + accept, resource, Context.NONE); + } + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String schedulerName, + String taskHubName, String taskQueueName, TaskQueueInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, taskQueueName, contentType, + accept, resource, context); + } + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TaskQueueInner> beginCreateOrUpdateAsync(String resourceGroupName, + String schedulerName, String taskHubName, String taskQueueName, TaskQueueInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, schedulerName, taskHubName, taskQueueName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + TaskQueueInner.class, TaskQueueInner.class, this.client.getContext()); + } + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskQueueInner> beginCreateOrUpdate(String resourceGroupName, + String schedulerName, String taskHubName, String taskQueueName, TaskQueueInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName, resource); + return this.client.getLroResult(response, TaskQueueInner.class, + TaskQueueInner.class, Context.NONE); + } + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @param context The 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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskQueueInner> beginCreateOrUpdate(String resourceGroupName, + String schedulerName, String taskHubName, String taskQueueName, TaskQueueInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, schedulerName, taskHubName, + taskQueueName, resource, context); + return this.client.getLroResult(response, TaskQueueInner.class, + TaskQueueInner.class, context); + } + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, TaskQueueInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, schedulerName, taskHubName, taskQueueName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskQueueInner createOrUpdate(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, TaskQueueInner resource) { + return beginCreateOrUpdate(resourceGroupName, schedulerName, taskHubName, taskQueueName, resource) + .getFinalResult(); + } + + /** + * Create or update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskQueueInner createOrUpdate(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, TaskQueueInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, schedulerName, taskHubName, taskQueueName, resource, context) + .getFinalResult(); + } + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String schedulerName, + String taskHubName, String taskQueueName, TaskQueueUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, taskQueueName, + contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, TaskQueueUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, taskQueueName, contentType, + accept, properties, Context.NONE); + } + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, TaskQueueUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, taskQueueName, contentType, + accept, properties, context); + } + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TaskQueueInner> beginUpdateAsync(String resourceGroupName, + String schedulerName, String taskHubName, String taskQueueName, TaskQueueUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, schedulerName, taskHubName, taskQueueName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + TaskQueueInner.class, TaskQueueInner.class, this.client.getContext()); + } + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskQueueInner> beginUpdate(String resourceGroupName, + String schedulerName, String taskHubName, String taskQueueName, TaskQueueUpdate properties) { + Response response + = updateWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName, properties); + return this.client.getLroResult(response, TaskQueueInner.class, + TaskQueueInner.class, Context.NONE); + } + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @param context The 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 a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TaskQueueInner> beginUpdate(String resourceGroupName, + String schedulerName, String taskHubName, String taskQueueName, TaskQueueUpdate properties, Context context) { + Response response + = updateWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName, properties, context); + return this.client.getLroResult(response, TaskQueueInner.class, + TaskQueueInner.class, context); + } + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, TaskQueueUpdate properties) { + return beginUpdateAsync(resourceGroupName, schedulerName, taskHubName, taskQueueName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskQueueInner update(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, TaskQueueUpdate properties) { + return beginUpdate(resourceGroupName, schedulerName, taskHubName, taskQueueName, properties).getFinalResult(); + } + + /** + * Update a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue resource belonging to a Task Hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskQueueInner update(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, TaskQueueUpdate properties, Context context) { + return beginUpdate(resourceGroupName, schedulerName, taskHubName, taskQueueName, properties, context) + .getFinalResult(); + } + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String schedulerName, + String taskHubName, String taskQueueName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, taskQueueName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, taskQueueName, + Context.NONE); + } + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, taskQueueName, context); + } + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String schedulerName, + String taskHubName, String taskQueueName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, schedulerName, taskHubName, taskQueueName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName, + String taskHubName, String taskQueueName) { + Response response + = deleteWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName, + String taskHubName, String taskQueueName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName) { + return beginDeleteAsync(resourceGroupName, schedulerName, taskHubName, taskQueueName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName) { + beginDelete(resourceGroupName, schedulerName, taskHubName, taskQueueName).getFinalResult(); + } + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName, + Context context) { + beginDelete(resourceGroupName, schedulerName, taskHubName, taskQueueName, context).getFinalResult(); + } + + /** + * List Task Queues by Task Hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTaskHubSinglePageAsync(String resourceGroupName, + String schedulerName, String taskHubName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByTaskHub(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Task Queues by Task Hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTaskHubAsync(String resourceGroupName, String schedulerName, + String taskHubName) { + return new PagedFlux<>(() -> listByTaskHubSinglePageAsync(resourceGroupName, schedulerName, taskHubName), + nextLink -> listByTaskHubNextSinglePageAsync(nextLink)); + } + + /** + * List Task Queues by Task Hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTaskHubSinglePage(String resourceGroupName, String schedulerName, + String taskHubName) { + final String accept = "application/json"; + Response res + = service.listByTaskHubSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Task Queues by Task Hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTaskHubSinglePage(String resourceGroupName, String schedulerName, + String taskHubName, Context context) { + final String accept = "application/json"; + Response res + = service.listByTaskHubSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Task Queues by Task Hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTaskHub(String resourceGroupName, String schedulerName, + String taskHubName) { + return new PagedIterable<>(() -> listByTaskHubSinglePage(resourceGroupName, schedulerName, taskHubName), + nextLink -> listByTaskHubNextSinglePage(nextLink)); + } + + /** + * List Task Queues by Task Hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTaskHub(String resourceGroupName, String schedulerName, + String taskHubName, Context context) { + return new PagedIterable<>( + () -> listByTaskHubSinglePage(resourceGroupName, schedulerName, taskHubName, context), + nextLink -> listByTaskHubNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTaskHubNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByTaskHubNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTaskHubNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByTaskHubNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByTaskHubNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByTaskHubNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueuesImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueuesImpl.java new file mode 100644 index 0000000000000..34f7de322be32 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueuesImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient; +import com.azure.resourcemanager.durabletask.fluent.models.TaskQueueInner; +import com.azure.resourcemanager.durabletask.models.TaskQueue; +import com.azure.resourcemanager.durabletask.models.TaskQueues; + +public final class TaskQueuesImpl implements TaskQueues { + private static final ClientLogger LOGGER = new ClientLogger(TaskQueuesImpl.class); + + private final TaskQueuesClient innerClient; + + private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager; + + public TaskQueuesImpl(TaskQueuesClient innerClient, + com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TaskQueueImpl(inner.getValue(), this.manager())); + } + + public TaskQueue get(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName) { + TaskQueueInner inner = this.serviceClient().get(resourceGroupName, schedulerName, taskHubName, taskQueueName); + if (inner != null) { + return new TaskQueueImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName) { + this.serviceClient().delete(resourceGroupName, schedulerName, taskHubName, taskQueueName); + } + + public void delete(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName, + Context context) { + this.serviceClient().delete(resourceGroupName, schedulerName, taskHubName, taskQueueName, context); + } + + public PagedIterable listByTaskHub(String resourceGroupName, String schedulerName, String taskHubName) { + PagedIterable inner + = this.serviceClient().listByTaskHub(resourceGroupName, schedulerName, taskHubName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TaskQueueImpl(inner1, this.manager())); + } + + public PagedIterable listByTaskHub(String resourceGroupName, String schedulerName, String taskHubName, + Context context) { + PagedIterable inner + = this.serviceClient().listByTaskHub(resourceGroupName, schedulerName, taskHubName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TaskQueueImpl(inner1, this.manager())); + } + + public TaskQueue getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers"); + if (schedulerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id))); + } + String taskHubName = ResourceManagerUtils.getValueFromIdByName(id, "taskHubs"); + if (taskHubName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskHubs'.", id))); + } + String taskQueueName = ResourceManagerUtils.getValueFromIdByName(id, "taskQueues"); + if (taskQueueName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskQueues'.", id))); + } + return this.getWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers"); + if (schedulerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id))); + } + String taskHubName = ResourceManagerUtils.getValueFromIdByName(id, "taskHubs"); + if (taskHubName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskHubs'.", id))); + } + String taskQueueName = ResourceManagerUtils.getValueFromIdByName(id, "taskQueues"); + if (taskQueueName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskQueues'.", id))); + } + return this.getWithResponse(resourceGroupName, schedulerName, taskHubName, taskQueueName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers"); + if (schedulerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id))); + } + String taskHubName = ResourceManagerUtils.getValueFromIdByName(id, "taskHubs"); + if (taskHubName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskHubs'.", id))); + } + String taskQueueName = ResourceManagerUtils.getValueFromIdByName(id, "taskQueues"); + if (taskQueueName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskQueues'.", id))); + } + this.delete(resourceGroupName, schedulerName, taskHubName, taskQueueName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers"); + if (schedulerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id))); + } + String taskHubName = ResourceManagerUtils.getValueFromIdByName(id, "taskHubs"); + if (taskHubName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskHubs'.", id))); + } + String taskQueueName = ResourceManagerUtils.getValueFromIdByName(id, "taskQueues"); + if (taskQueueName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'taskQueues'.", id))); + } + this.delete(resourceGroupName, schedulerName, taskHubName, taskQueueName, context); + } + + private TaskQueuesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.durabletask.DurableTaskManager manager() { + return this.serviceManager; + } + + public TaskQueueImpl define(String name) { + return new TaskQueueImpl(name, this.manager()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionImpl.java new file mode 100644 index 0000000000000..1873e2a93deac --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner; +import com.azure.resourcemanager.durabletask.models.TransparentDataEncryption; +import com.azure.resourcemanager.durabletask.models.TransparentDataEncryptionProperties; + +public final class TransparentDataEncryptionImpl implements TransparentDataEncryption { + private TransparentDataEncryptionInner innerObject; + + private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager; + + TransparentDataEncryptionImpl(TransparentDataEncryptionInner innerObject, + com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public TransparentDataEncryptionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public TransparentDataEncryptionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.durabletask.DurableTaskManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionsClientImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionsClientImpl.java new file mode 100644 index 0000000000000..beaad4dd05b16 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionsClientImpl.java @@ -0,0 +1,737 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient; +import com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner; +import com.azure.resourcemanager.durabletask.implementation.models.TransparentDataEncryptionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TransparentDataEncryptionsClient. + */ +public final class TransparentDataEncryptionsClientImpl implements TransparentDataEncryptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final TransparentDataEncryptionsService service; + + /** + * The service client containing this operation class. + */ + private final DurableTaskManagementClientImpl client; + + /** + * Initializes an instance of TransparentDataEncryptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TransparentDataEncryptionsClientImpl(DurableTaskManagementClientImpl client) { + this.service = RestProxy.create(TransparentDataEncryptionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DurableTaskManagementClientTransparentDataEncryptions to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "DurableTaskManagementClientTransparentDataEncryptions") + public interface TransparentDataEncryptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TransparentDataEncryptionInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrReplaceSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TransparentDataEncryptionInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions/default") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByScheduler(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/transparentDataEncryptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySchedulerSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySchedulerNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySchedulerNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transparent Data Encryption along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String schedulerName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transparent Data Encryption on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String schedulerName) { + return getWithResponseAsync(resourceGroupName, schedulerName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transparent Data Encryption along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String schedulerName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, schedulerName, accept, context); + } + + /** + * Get a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transparent Data Encryption. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransparentDataEncryptionInner get(String resourceGroupName, String schedulerName) { + return getWithResponse(resourceGroupName, schedulerName, Context.NONE).getValue(); + } + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a transparent data encryption resource belonging to the scheduler along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, + String schedulerName, TransparentDataEncryptionInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a transparent data encryption resource belonging to the scheduler along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrReplaceWithResponse(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrReplaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, contentType, accept, resource, + Context.NONE); + } + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a transparent data encryption resource belonging to the scheduler along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrReplaceWithResponse(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrReplaceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, contentType, accept, resource, context); + } + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a transparent data encryption resource belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TransparentDataEncryptionInner> + beginCreateOrReplaceAsync(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource) { + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, schedulerName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), TransparentDataEncryptionInner.class, TransparentDataEncryptionInner.class, + this.client.getContext()); + } + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 a transparent data encryption resource belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TransparentDataEncryptionInner> + beginCreateOrReplace(String resourceGroupName, String schedulerName, TransparentDataEncryptionInner resource) { + Response response = createOrReplaceWithResponse(resourceGroupName, schedulerName, resource); + return this.client.getLroResult(response, + TransparentDataEncryptionInner.class, TransparentDataEncryptionInner.class, Context.NONE); + } + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @param context The 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 a transparent data encryption resource belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TransparentDataEncryptionInner> beginCreateOrReplace( + String resourceGroupName, String schedulerName, TransparentDataEncryptionInner resource, Context context) { + Response response + = createOrReplaceWithResponse(resourceGroupName, schedulerName, resource, context); + return this.client.getLroResult(response, + TransparentDataEncryptionInner.class, TransparentDataEncryptionInner.class, context); + } + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a transparent data encryption resource belonging to the scheduler on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, schedulerName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a transparent data encryption resource belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransparentDataEncryptionInner createOrReplace(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource) { + return beginCreateOrReplace(resourceGroupName, schedulerName, resource).getFinalResult(); + } + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a transparent data encryption resource belonging to the scheduler. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransparentDataEncryptionInner createOrReplace(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource, Context context) { + return beginCreateOrReplace(resourceGroupName, schedulerName, resource, context).getFinalResult(); + } + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String schedulerName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String schedulerName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, Context.NONE); + } + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String schedulerName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, context); + } + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String schedulerName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, schedulerName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName) { + Response response = deleteWithResponse(resourceGroupName, schedulerName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String schedulerName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, schedulerName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String schedulerName) { + return beginDeleteAsync(resourceGroupName, schedulerName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String schedulerName) { + beginDelete(resourceGroupName, schedulerName).getFinalResult(); + } + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String schedulerName, Context context) { + beginDelete(resourceGroupName, schedulerName, context).getFinalResult(); + } + + /** + * List Transparent Data Encryptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySchedulerSinglePageAsync(String resourceGroupName, + String schedulerName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByScheduler(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Transparent Data Encryptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySchedulerAsync(String resourceGroupName, + String schedulerName) { + return new PagedFlux<>(() -> listBySchedulerSinglePageAsync(resourceGroupName, schedulerName), + nextLink -> listBySchedulerNextSinglePageAsync(nextLink)); + } + + /** + * List Transparent Data Encryptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerSinglePage(String resourceGroupName, + String schedulerName) { + final String accept = "application/json"; + Response res + = service.listBySchedulerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Transparent Data Encryptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerSinglePage(String resourceGroupName, + String schedulerName, Context context) { + final String accept = "application/json"; + Response res + = service.listBySchedulerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Transparent Data Encryptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByScheduler(String resourceGroupName, + String schedulerName) { + return new PagedIterable<>(() -> listBySchedulerSinglePage(resourceGroupName, schedulerName), + nextLink -> listBySchedulerNextSinglePage(nextLink)); + } + + /** + * List Transparent Data Encryptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName, + Context context) { + return new PagedIterable<>(() -> listBySchedulerSinglePage(resourceGroupName, schedulerName, context), + nextLink -> listBySchedulerNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySchedulerNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySchedulerNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySchedulerNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySchedulerNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listBySchedulerNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionsImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionsImpl.java new file mode 100644 index 0000000000000..5673b80ed7321 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionsImpl.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient; +import com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner; +import com.azure.resourcemanager.durabletask.models.TransparentDataEncryption; +import com.azure.resourcemanager.durabletask.models.TransparentDataEncryptions; + +public final class TransparentDataEncryptionsImpl implements TransparentDataEncryptions { + private static final ClientLogger LOGGER = new ClientLogger(TransparentDataEncryptionsImpl.class); + + private final TransparentDataEncryptionsClient innerClient; + + private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager; + + public TransparentDataEncryptionsImpl(TransparentDataEncryptionsClient innerClient, + com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String schedulerName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, schedulerName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TransparentDataEncryptionImpl(inner.getValue(), this.manager())); + } + + public TransparentDataEncryption get(String resourceGroupName, String schedulerName) { + TransparentDataEncryptionInner inner = this.serviceClient().get(resourceGroupName, schedulerName); + if (inner != null) { + return new TransparentDataEncryptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public TransparentDataEncryption createOrReplace(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource) { + TransparentDataEncryptionInner inner + = this.serviceClient().createOrReplace(resourceGroupName, schedulerName, resource); + if (inner != null) { + return new TransparentDataEncryptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public TransparentDataEncryption createOrReplace(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource, Context context) { + TransparentDataEncryptionInner inner + = this.serviceClient().createOrReplace(resourceGroupName, schedulerName, resource, context); + if (inner != null) { + return new TransparentDataEncryptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String schedulerName) { + this.serviceClient().delete(resourceGroupName, schedulerName); + } + + public void delete(String resourceGroupName, String schedulerName, Context context) { + this.serviceClient().delete(resourceGroupName, schedulerName, context); + } + + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName) { + PagedIterable inner + = this.serviceClient().listByScheduler(resourceGroupName, schedulerName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TransparentDataEncryptionImpl(inner1, this.manager())); + } + + public PagedIterable listByScheduler(String resourceGroupName, String schedulerName, + Context context) { + PagedIterable inner + = this.serviceClient().listByScheduler(resourceGroupName, schedulerName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TransparentDataEncryptionImpl(inner1, this.manager())); + } + + private TransparentDataEncryptionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.durabletask.DurableTaskManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/DetectorListResult.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/DetectorListResult.java new file mode 100644 index 0000000000000..1f01b2cd7644e --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/DetectorListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.durabletask.fluent.models.DetectorInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Detector list operation. + */ +@Immutable +public final class DetectorListResult implements JsonSerializable { + /* + * The Detector items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DetectorListResult class. + */ + private DetectorListResult() { + } + + /** + * Get the value property: The Detector items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DetectorListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorListResult 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 DetectorListResult. + */ + public static DetectorListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DetectorListResult deserializedDetectorListResult = new DetectorListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DetectorInner.fromJson(reader1)); + deserializedDetectorListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDetectorListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDetectorListResult; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/FailoverInstanceListResult.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/FailoverInstanceListResult.java new file mode 100644 index 0000000000000..1e7675c0d7ccb --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/FailoverInstanceListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a FailoverInstance list operation. + */ +@Immutable +public final class FailoverInstanceListResult implements JsonSerializable { + /* + * The FailoverInstance items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of FailoverInstanceListResult class. + */ + private FailoverInstanceListResult() { + } + + /** + * Get the value property: The FailoverInstance items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FailoverInstanceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FailoverInstanceListResult 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 FailoverInstanceListResult. + */ + public static FailoverInstanceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FailoverInstanceListResult deserializedFailoverInstanceListResult = new FailoverInstanceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FailoverInstanceInner.fromJson(reader1)); + deserializedFailoverInstanceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFailoverInstanceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFailoverInstanceListResult; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TaskQueueListResult.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TaskQueueListResult.java new file mode 100644 index 0000000000000..2b997405ea286 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TaskQueueListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.durabletask.fluent.models.TaskQueueInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a TaskQueue list operation. + */ +@Immutable +public final class TaskQueueListResult implements JsonSerializable { + /* + * The TaskQueue items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of TaskQueueListResult class. + */ + private TaskQueueListResult() { + } + + /** + * Get the value property: The TaskQueue items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TaskQueueListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TaskQueueListResult 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 TaskQueueListResult. + */ + public static TaskQueueListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TaskQueueListResult deserializedTaskQueueListResult = new TaskQueueListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> TaskQueueInner.fromJson(reader1)); + deserializedTaskQueueListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTaskQueueListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTaskQueueListResult; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TransparentDataEncryptionListResult.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TransparentDataEncryptionListResult.java new file mode 100644 index 0000000000000..7296b469d30c2 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TransparentDataEncryptionListResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a TransparentDataEncryption list operation. + */ +@Immutable +public final class TransparentDataEncryptionListResult + implements JsonSerializable { + /* + * The TransparentDataEncryption items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of TransparentDataEncryptionListResult class. + */ + private TransparentDataEncryptionListResult() { + } + + /** + * Get the value property: The TransparentDataEncryption items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TransparentDataEncryptionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TransparentDataEncryptionListResult 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 TransparentDataEncryptionListResult. + */ + public static TransparentDataEncryptionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TransparentDataEncryptionListResult deserializedTransparentDataEncryptionListResult + = new TransparentDataEncryptionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TransparentDataEncryptionInner.fromJson(reader1)); + deserializedTransparentDataEncryptionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTransparentDataEncryptionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTransparentDataEncryptionListResult; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Detector.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Detector.java new file mode 100644 index 0000000000000..23cd8d825c765 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Detector.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.durabletask.fluent.models.DetectorInner; + +/** + * An immutable client-side representation of Detector. + */ +public interface Detector { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + DetectorProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.durabletask.fluent.models.DetectorInner object. + * + * @return the inner object. + */ + DetectorInner innerModel(); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorDataset.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorDataset.java new file mode 100644 index 0000000000000..1b527a73cc89b --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorDataset.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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; + +/** + * A dataset produced by a detector. + */ +@Immutable +public final class DetectorDataset implements JsonSerializable { + /* + * The tabular data produced by the detector. + */ + private DetectorTable table; + + /* + * The rendering information for the tabular data. + */ + private DetectorRenderingProperties renderingProperties; + + /** + * Creates an instance of DetectorDataset class. + */ + private DetectorDataset() { + } + + /** + * Get the table property: The tabular data produced by the detector. + * + * @return the table value. + */ + public DetectorTable table() { + return this.table; + } + + /** + * Get the renderingProperties property: The rendering information for the tabular data. + * + * @return the renderingProperties value. + */ + public DetectorRenderingProperties renderingProperties() { + return this.renderingProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DetectorDataset from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorDataset 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 DetectorDataset. + */ + public static DetectorDataset fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DetectorDataset deserializedDetectorDataset = new DetectorDataset(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("table".equals(fieldName)) { + deserializedDetectorDataset.table = DetectorTable.fromJson(reader); + } else if ("renderingProperties".equals(fieldName)) { + deserializedDetectorDataset.renderingProperties = DetectorRenderingProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDetectorDataset; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorMetadata.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorMetadata.java new file mode 100644 index 0000000000000..51ea8723867dd --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorMetadata.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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; +import java.util.List; + +/** + * Metadata that identifies and describes a detector. + */ +@Immutable +public final class DetectorMetadata implements JsonSerializable { + /* + * The unique identifier of the detector. + */ + private String id; + + /* + * The display name of the detector. + */ + private String name; + + /* + * A description of the detector. + */ + private String description; + + /* + * The author of the detector when available for the caller. + */ + private String author; + + /* + * The category of the detector. + */ + private String category; + + /* + * The case-submission support topic identifiers for which the detector is enabled. + */ + private List supportTopicList; + + /* + * The analysis identifiers for which the detector is enabled. + */ + private List analysisTypes; + + /* + * The kind of diagnostic response. + */ + private DetectorType type; + + /* + * The match score when the detector is returned from a search. + */ + private Double score; + + /** + * Creates an instance of DetectorMetadata class. + */ + private DetectorMetadata() { + } + + /** + * Get the id property: The unique identifier of the detector. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The display name of the detector. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the description property: A description of the detector. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the author property: The author of the detector when available for the caller. + * + * @return the author value. + */ + public String author() { + return this.author; + } + + /** + * Get the category property: The category of the detector. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Get the supportTopicList property: The case-submission support topic identifiers for which the detector is + * enabled. + * + * @return the supportTopicList value. + */ + public List supportTopicList() { + return this.supportTopicList; + } + + /** + * Get the analysisTypes property: The analysis identifiers for which the detector is enabled. + * + * @return the analysisTypes value. + */ + public List analysisTypes() { + return this.analysisTypes; + } + + /** + * Get the type property: The kind of diagnostic response. + * + * @return the type value. + */ + public DetectorType type() { + return this.type; + } + + /** + * Get the score property: The match score when the detector is returned from a search. + * + * @return the score value. + */ + public Double score() { + return this.score; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DetectorMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorMetadata 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 DetectorMetadata. + */ + public static DetectorMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DetectorMetadata deserializedDetectorMetadata = new DetectorMetadata(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDetectorMetadata.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDetectorMetadata.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDetectorMetadata.description = reader.getString(); + } else if ("author".equals(fieldName)) { + deserializedDetectorMetadata.author = reader.getString(); + } else if ("category".equals(fieldName)) { + deserializedDetectorMetadata.category = reader.getString(); + } else if ("supportTopicList".equals(fieldName)) { + List supportTopicList = reader.readArray(reader1 -> reader1.getString()); + deserializedDetectorMetadata.supportTopicList = supportTopicList; + } else if ("analysisTypes".equals(fieldName)) { + List analysisTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedDetectorMetadata.analysisTypes = analysisTypes; + } else if ("type".equals(fieldName)) { + deserializedDetectorMetadata.type = DetectorType.fromString(reader.getString()); + } else if ("score".equals(fieldName)) { + deserializedDetectorMetadata.score = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedDetectorMetadata; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorProperties.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorProperties.java new file mode 100644 index 0000000000000..a75ee9f28218a --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorProperties.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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; +import java.util.List; + +/** + * The diagnostic response returned for a detector. + */ +@Immutable +public final class DetectorProperties implements JsonSerializable { + /* + * The provisioning state of the detector. + */ + private ProvisioningState provisioningState; + + /* + * Metadata that identifies and describes the detector. + */ + private DetectorMetadata metadata; + + /* + * The datasets produced when the detector runs. + */ + private List dataset; + + /* + * The overall result of the detector. + */ + private DetectorStatus status; + + /** + * Creates an instance of DetectorProperties class. + */ + private DetectorProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the detector. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the metadata property: Metadata that identifies and describes the detector. + * + * @return the metadata value. + */ + public DetectorMetadata metadata() { + return this.metadata; + } + + /** + * Get the dataset property: The datasets produced when the detector runs. + * + * @return the dataset value. + */ + public List dataset() { + return this.dataset; + } + + /** + * Get the status property: The overall result of the detector. + * + * @return the status value. + */ + public DetectorStatus status() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DetectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorProperties 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 DetectorProperties. + */ + public static DetectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DetectorProperties deserializedDetectorProperties = new DetectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedDetectorProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("metadata".equals(fieldName)) { + deserializedDetectorProperties.metadata = DetectorMetadata.fromJson(reader); + } else if ("dataset".equals(fieldName)) { + List dataset = reader.readArray(reader1 -> DetectorDataset.fromJson(reader1)); + deserializedDetectorProperties.dataset = dataset; + } else if ("status".equals(fieldName)) { + deserializedDetectorProperties.status = DetectorStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDetectorProperties; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorRenderingProperties.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorRenderingProperties.java new file mode 100644 index 0000000000000..b339fbf0557b8 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorRenderingProperties.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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 rendering information for a detector dataset. + */ +@Immutable +public final class DetectorRenderingProperties implements JsonSerializable { + /* + * The rendering type for the dataset. + */ + private DetectorRenderingType type; + + /* + * The optional title of the rendering block. + */ + private String title; + + /* + * The optional description of the rendering block. + */ + private String description; + + /** + * Creates an instance of DetectorRenderingProperties class. + */ + private DetectorRenderingProperties() { + } + + /** + * Get the type property: The rendering type for the dataset. + * + * @return the type value. + */ + public DetectorRenderingType type() { + return this.type; + } + + /** + * Get the title property: The optional title of the rendering block. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Get the description property: The optional description of the rendering block. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DetectorRenderingProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorRenderingProperties 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 DetectorRenderingProperties. + */ + public static DetectorRenderingProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DetectorRenderingProperties deserializedDetectorRenderingProperties = new DetectorRenderingProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedDetectorRenderingProperties.type = DetectorRenderingType.fromValue(reader.getInt()); + } else if ("title".equals(fieldName)) { + deserializedDetectorRenderingProperties.title = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDetectorRenderingProperties.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDetectorRenderingProperties; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorRenderingType.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorRenderingType.java new file mode 100644 index 0000000000000..049e713618581 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorRenderingType.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.util.ExpandableEnum; +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.ArrayList; +import java.util.Collection; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; + +/** + * The rendering type for a detector dataset. + */ +public final class DetectorRenderingType implements ExpandableEnum, JsonSerializable { + private static final Map VALUES = new ConcurrentHashMap<>(); + + private static final Function NEW_INSTANCE = DetectorRenderingType::new; + + /** + * A table rendering. + */ + public static final DetectorRenderingType TABLE = fromValue(1); + + /** + * A time series graph rendering. + */ + public static final DetectorRenderingType TIME_SERIES_GRAPH = fromValue(2); + + /** + * A time series per-instance graph rendering. + */ + public static final DetectorRenderingType TIME_SERIES_PER_INSTANCE_GRAPH = fromValue(3); + + /** + * A pie chart rendering. + */ + public static final DetectorRenderingType PIE_CHART = fromValue(4); + + /** + * A data summary rendering. + */ + public static final DetectorRenderingType DATA_SUMMARY = fromValue(5); + + /** + * An email snippet rendering. + */ + public static final DetectorRenderingType EMAIL_SNIPPET = fromValue(6); + + /** + * An insight rendering. + */ + public static final DetectorRenderingType INSIGHT = fromValue(7); + + /** + * A dynamic insight rendering. + */ + public static final DetectorRenderingType DYNAMIC_INSIGHT = fromValue(8); + + /** + * A Markdown rendering. + */ + public static final DetectorRenderingType MARKDOWN = fromValue(9); + + private final Integer value; + + private DetectorRenderingType(Integer value) { + this.value = value; + } + + /** + * Creates or finds a DetectorRenderingType. + * + * @param value a value to look for. + * @return the corresponding DetectorRenderingType. + * @throws IllegalArgumentException if value is null. + */ + public static DetectorRenderingType fromValue(Integer value) { + if (value == null) { + throw new IllegalArgumentException("'value' cannot be null."); + } + return VALUES.computeIfAbsent(value, NEW_INSTANCE); + } + + /** + * Gets known DetectorRenderingType values. + * + * @return Known DetectorRenderingType values. + */ + public static Collection values() { + return new ArrayList<>(VALUES.values()); + } + + /** + * Gets the value of the DetectorRenderingType instance. + * + * @return the value of the DetectorRenderingType instance. + */ + @Override + public Integer getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + return jsonWriter.writeInt(getValue()); + } + + /** + * Reads an instance of DetectorRenderingType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorRenderingType if the JsonReader was pointing to an instance of it, or null if the + * JsonReader was pointing to JSON null. + * @throws IOException If an error occurs while reading the DetectorRenderingType. + * @throws IllegalStateException If unexpected JSON token is found. + */ + public static DetectorRenderingType fromJson(JsonReader jsonReader) throws IOException { + JsonToken nextToken = jsonReader.nextToken(); + if (nextToken == JsonToken.NULL) { + return null; + } + if (nextToken != JsonToken.NUMBER) { + throw new IllegalStateException( + String.format("Unexpected JSON token for %s deserialization: %s", JsonToken.NUMBER, nextToken)); + } + return DetectorRenderingType.fromValue(jsonReader.getInt()); + } + + @Override + public String toString() { + return Objects.toString(this.value); + } + + @Override + public boolean equals(Object obj) { + return this == obj; + } + + @Override + public int hashCode() { + return Objects.hashCode(this.value); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorStatus.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorStatus.java new file mode 100644 index 0000000000000..7dfd966c20d36 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorStatus.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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 overall result of a detector. + */ +@Immutable +public final class DetectorStatus implements JsonSerializable { + /* + * The optional message describing the detector result. + */ + private String message; + + /* + * The status of the detector result. + */ + private DetectorStatusId statusId; + + /** + * Creates an instance of DetectorStatus class. + */ + private DetectorStatus() { + } + + /** + * Get the message property: The optional message describing the detector result. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the statusId property: The status of the detector result. + * + * @return the statusId value. + */ + public DetectorStatusId statusId() { + return this.statusId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DetectorStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorStatus 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 DetectorStatus. + */ + public static DetectorStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DetectorStatus deserializedDetectorStatus = new DetectorStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("message".equals(fieldName)) { + deserializedDetectorStatus.message = reader.getString(); + } else if ("statusId".equals(fieldName)) { + deserializedDetectorStatus.statusId = DetectorStatusId.fromValue(reader.getInt()); + } else { + reader.skipChildren(); + } + } + + return deserializedDetectorStatus; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorStatusId.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorStatusId.java new file mode 100644 index 0000000000000..d12ef62bdc4b2 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorStatusId.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.util.ExpandableEnum; +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.ArrayList; +import java.util.Collection; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; + +/** + * The status of a detector result. + */ +public final class DetectorStatusId implements ExpandableEnum, JsonSerializable { + private static final Map VALUES = new ConcurrentHashMap<>(); + + private static final Function NEW_INSTANCE = DetectorStatusId::new; + + /** + * A critical issue was detected. + */ + public static final DetectorStatusId CRITICAL = fromValue(0); + + /** + * A warning was detected. + */ + public static final DetectorStatusId WARNING = fromValue(1); + + /** + * An informational result was returned. + */ + public static final DetectorStatusId INFO = fromValue(2); + + /** + * The detector completed without detecting an issue. + */ + public static final DetectorStatusId SUCCESS = fromValue(3); + + /** + * The detector did not run or returned no insights. + */ + public static final DetectorStatusId NONE = fromValue(4); + + private final Integer value; + + private DetectorStatusId(Integer value) { + this.value = value; + } + + /** + * Creates or finds a DetectorStatusId. + * + * @param value a value to look for. + * @return the corresponding DetectorStatusId. + * @throws IllegalArgumentException if value is null. + */ + public static DetectorStatusId fromValue(Integer value) { + if (value == null) { + throw new IllegalArgumentException("'value' cannot be null."); + } + return VALUES.computeIfAbsent(value, NEW_INSTANCE); + } + + /** + * Gets known DetectorStatusId values. + * + * @return Known DetectorStatusId values. + */ + public static Collection values() { + return new ArrayList<>(VALUES.values()); + } + + /** + * Gets the value of the DetectorStatusId instance. + * + * @return the value of the DetectorStatusId instance. + */ + @Override + public Integer getValue() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + return jsonWriter.writeInt(getValue()); + } + + /** + * Reads an instance of DetectorStatusId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorStatusId if the JsonReader was pointing to an instance of it, or null if the + * JsonReader was pointing to JSON null. + * @throws IOException If an error occurs while reading the DetectorStatusId. + * @throws IllegalStateException If unexpected JSON token is found. + */ + public static DetectorStatusId fromJson(JsonReader jsonReader) throws IOException { + JsonToken nextToken = jsonReader.nextToken(); + if (nextToken == JsonToken.NULL) { + return null; + } + if (nextToken != JsonToken.NUMBER) { + throw new IllegalStateException( + String.format("Unexpected JSON token for %s deserialization: %s", JsonToken.NUMBER, nextToken)); + } + return DetectorStatusId.fromValue(jsonReader.getInt()); + } + + @Override + public String toString() { + return Objects.toString(this.value); + } + + @Override + public boolean equals(Object obj) { + return this == obj; + } + + @Override + public int hashCode() { + return Objects.hashCode(this.value); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorTable.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorTable.java new file mode 100644 index 0000000000000..49cf9fb909615 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorTable.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A table included in a detector dataset. + */ +@Immutable +public final class DetectorTable implements JsonSerializable { + /* + * The name of the table. + */ + private String tableName; + + /* + * The column definitions for the table. + */ + private List columns; + + /* + * The rows in the table. Values use the types specified by their columns. + */ + private List> rows; + + /** + * Creates an instance of DetectorTable class. + */ + private DetectorTable() { + } + + /** + * Get the tableName property: The name of the table. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the columns property: The column definitions for the table. + * + * @return the columns value. + */ + public List columns() { + return this.columns; + } + + /** + * Get the rows property: The rows in the table. Values use the types specified by their columns. + * + * @return the rows value. + */ + public List> rows() { + return this.rows; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DetectorTable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorTable 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 DetectorTable. + */ + public static DetectorTable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DetectorTable deserializedDetectorTable = new DetectorTable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tableName".equals(fieldName)) { + deserializedDetectorTable.tableName = reader.getString(); + } else if ("columns".equals(fieldName)) { + List columns + = reader.readArray(reader1 -> DetectorTableColumn.fromJson(reader1)); + deserializedDetectorTable.columns = columns; + } else if ("rows".equals(fieldName)) { + List> rows = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())))); + deserializedDetectorTable.rows = rows; + } else { + reader.skipChildren(); + } + } + + return deserializedDetectorTable; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorTableColumn.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorTableColumn.java new file mode 100644 index 0000000000000..efdbc99b3461e --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorTableColumn.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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; + +/** + * A column definition in a detector table. + */ +@Immutable +public final class DetectorTableColumn implements JsonSerializable { + /* + * The name of the column. + */ + private String columnName; + + /* + * The data type of values in the column. + */ + private String dataType; + + /* + * The optional semantic classification of the column. + */ + private String columnType; + + /** + * Creates an instance of DetectorTableColumn class. + */ + private DetectorTableColumn() { + } + + /** + * Get the columnName property: The name of the column. + * + * @return the columnName value. + */ + public String columnName() { + return this.columnName; + } + + /** + * Get the dataType property: The data type of values in the column. + * + * @return the dataType value. + */ + public String dataType() { + return this.dataType; + } + + /** + * Get the columnType property: The optional semantic classification of the column. + * + * @return the columnType value. + */ + public String columnType() { + return this.columnType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DetectorTableColumn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DetectorTableColumn 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 DetectorTableColumn. + */ + public static DetectorTableColumn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DetectorTableColumn deserializedDetectorTableColumn = new DetectorTableColumn(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("columnName".equals(fieldName)) { + deserializedDetectorTableColumn.columnName = reader.getString(); + } else if ("dataType".equals(fieldName)) { + deserializedDetectorTableColumn.dataType = reader.getString(); + } else if ("columnType".equals(fieldName)) { + deserializedDetectorTableColumn.columnType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDetectorTableColumn; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorType.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorType.java new file mode 100644 index 0000000000000..b4308a92382ad --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/DetectorType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The kind of diagnostic response. + */ +public final class DetectorType extends ExpandableStringEnum { + /** + * A diagnostic detector. + */ + public static final DetectorType DETECTOR = fromString("Detector"); + + /** + * A diagnostic analysis. + */ + public static final DetectorType ANALYSIS = fromString("Analysis"); + + /** + * A diagnostic category overview. + */ + public static final DetectorType CATEGORY_OVERVIEW = fromString("CategoryOverview"); + + /** + * Creates a new instance of DetectorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DetectorType() { + } + + /** + * Creates or finds a DetectorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DetectorType. + */ + public static DetectorType fromString(String name) { + return fromString(name, DetectorType.class); + } + + /** + * Gets known DetectorType values. + * + * @return known DetectorType values. + */ + public static Collection values() { + return values(DetectorType.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Detectors.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Detectors.java new file mode 100644 index 0000000000000..d34cf42598cc7 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Detectors.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Detectors. + */ +public interface Detectors { + /** + * Gets a diagnostic detector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param detectorId The name of the Detector. + * @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 a diagnostic detector along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String schedulerName, String detectorId, + Context context); + + /** + * Gets a diagnostic detector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param detectorId The name of the Detector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a diagnostic detector. + */ + Detector get(String resourceGroupName, String schedulerName, String detectorId); + + /** + * Lists the diagnostic detectors belonging to a scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByScheduler(String resourceGroupName, String schedulerName); + + /** + * Lists the diagnostic detectors belonging to a scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Detector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByScheduler(String resourceGroupName, String schedulerName, Context context); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstance.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstance.java new file mode 100644 index 0000000000000..cfbb01b640222 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstance.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; + +/** + * An immutable client-side representation of FailoverInstance. + */ +public interface FailoverInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + FailoverInstanceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner object. + * + * @return the inner object. + */ + FailoverInstanceInner innerModel(); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstanceProperties.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstanceProperties.java new file mode 100644 index 0000000000000..c72b8d220b48b --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstanceProperties.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The failover instance settings for the resource. + */ +@Fluent +public final class FailoverInstanceProperties implements JsonSerializable { + /* + * The status of the last operation + */ + private ProvisioningState provisioningState; + + /* + * The replication role of the parent scheduler + */ + private ReplicationRole replicationRole; + + /* + * The current state of the failover operation + */ + private FailoverState failoverState; + + /* + * The resource ID of the partner scheduler in the failover configuration + */ + private String partnerSchedulerResourceId; + + /* + * The location of the partner scheduler in the failover configuration + */ + private String partnerSchedulerLocation; + + /** + * Creates an instance of FailoverInstanceProperties class. + */ + public FailoverInstanceProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the replicationRole property: The replication role of the parent scheduler. + * + * @return the replicationRole value. + */ + public ReplicationRole replicationRole() { + return this.replicationRole; + } + + /** + * Get the failoverState property: The current state of the failover operation. + * + * @return the failoverState value. + */ + public FailoverState failoverState() { + return this.failoverState; + } + + /** + * Get the partnerSchedulerResourceId property: The resource ID of the partner scheduler in the failover + * configuration. + * + * @return the partnerSchedulerResourceId value. + */ + public String partnerSchedulerResourceId() { + return this.partnerSchedulerResourceId; + } + + /** + * Set the partnerSchedulerResourceId property: The resource ID of the partner scheduler in the failover + * configuration. + * + * @param partnerSchedulerResourceId the partnerSchedulerResourceId value to set. + * @return the FailoverInstanceProperties object itself. + */ + public FailoverInstanceProperties withPartnerSchedulerResourceId(String partnerSchedulerResourceId) { + this.partnerSchedulerResourceId = partnerSchedulerResourceId; + return this; + } + + /** + * Get the partnerSchedulerLocation property: The location of the partner scheduler in the failover configuration. + * + * @return the partnerSchedulerLocation value. + */ + public String partnerSchedulerLocation() { + return this.partnerSchedulerLocation; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("partnerSchedulerResourceId", this.partnerSchedulerResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FailoverInstanceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FailoverInstanceProperties 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 FailoverInstanceProperties. + */ + public static FailoverInstanceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FailoverInstanceProperties deserializedFailoverInstanceProperties = new FailoverInstanceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("partnerSchedulerResourceId".equals(fieldName)) { + deserializedFailoverInstanceProperties.partnerSchedulerResourceId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedFailoverInstanceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("replicationRole".equals(fieldName)) { + deserializedFailoverInstanceProperties.replicationRole + = ReplicationRole.fromString(reader.getString()); + } else if ("failoverState".equals(fieldName)) { + deserializedFailoverInstanceProperties.failoverState = FailoverState.fromString(reader.getString()); + } else if ("partnerSchedulerLocation".equals(fieldName)) { + deserializedFailoverInstanceProperties.partnerSchedulerLocation = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFailoverInstanceProperties; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstances.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstances.java new file mode 100644 index 0000000000000..8b0bfaa98a9b8 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstances.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; + +/** + * Resource collection API of FailoverInstances. + */ +public interface FailoverInstances { + /** + * Get a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @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 a Failover Instance along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String schedulerName, Context context); + + /** + * Get a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Failover Instance. + */ + FailoverInstance get(String resourceGroupName, String schedulerName); + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + FailoverInstance createOrReplace(String resourceGroupName, String schedulerName, FailoverInstanceInner resource); + + /** + * Create or Update a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @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 a failover instance belonging to the scheduler. + */ + FailoverInstance createOrReplace(String resourceGroupName, String schedulerName, FailoverInstanceInner resource, + Context context); + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String schedulerName); + + /** + * Delete a Failover Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String schedulerName, Context context); + + /** + * List Failover Instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByScheduler(String resourceGroupName, String schedulerName); + + /** + * List Failover Instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FailoverInstance list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByScheduler(String resourceGroupName, String schedulerName, Context context); + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + FailoverInstance failover(String resourceGroupName, String schedulerName); + + /** + * Trigger a graceful failover for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @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 a failover instance belonging to the scheduler. + */ + FailoverInstance failover(String resourceGroupName, String schedulerName, Context context); + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a failover instance belonging to the scheduler. + */ + FailoverInstance forceFailoverAllowDataLoss(String resourceGroupName, String schedulerName); + + /** + * Trigger a forced failover with potential data loss for the parent scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @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 a failover instance belonging to the scheduler. + */ + FailoverInstance forceFailoverAllowDataLoss(String resourceGroupName, String schedulerName, Context context); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverState.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverState.java new file mode 100644 index 0000000000000..7d28767a975ac --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/FailoverState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current state of the failover operation. + */ +public final class FailoverState extends ExpandableStringEnum { + /** + * No failover operation is active. + */ + public static final FailoverState NONE = fromString("None"); + + /** + * The failover operation is in progress. + */ + public static final FailoverState IN_PROGRESS = fromString("InProgress"); + + /** + * The failover operation completed successfully. + */ + public static final FailoverState SUCCEEDED = fromString("Succeeded"); + + /** + * The failover operation failed. + */ + public static final FailoverState FAILED = fromString("Failed"); + + /** + * Creates a new instance of FailoverState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FailoverState() { + } + + /** + * Creates or finds a FailoverState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FailoverState. + */ + public static FailoverState fromString(String name) { + return fromString(name, FailoverState.class); + } + + /** + * Gets known FailoverState values. + * + * @return known FailoverState values. + */ + public static Collection values() { + return values(FailoverState.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ManagedServiceIdentity.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..433860ab209f0 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ManagedServiceIdentity.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private String principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String tenantId; + + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned 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 the system assigned identity. 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 type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * {@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 ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity 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 ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ManagedServiceIdentityType.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..755da68ee551d --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * No managed identity. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * System assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * User assigned managed identity. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * System and user assigned managed identity. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ReplicationRole.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ReplicationRole.java new file mode 100644 index 0000000000000..0aa6928f8b0cd --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ReplicationRole.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The replication role of the scheduler. + */ +public final class ReplicationRole extends ExpandableStringEnum { + /** + * The parent scheduler is the primary in the failover configuration. + */ + public static final ReplicationRole PRIMARY = fromString("Primary"); + + /** + * The parent scheduler is the secondary in the failover configuration. + */ + public static final ReplicationRole SECONDARY = fromString("Secondary"); + + /** + * Creates a new instance of ReplicationRole value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReplicationRole() { + } + + /** + * Creates or finds a ReplicationRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationRole. + */ + public static ReplicationRole fromString(String name) { + return fromString(name, ReplicationRole.class); + } + + /** + * Gets known ReplicationRole values. + * + * @return known ReplicationRole values. + */ + public static Collection values() { + return values(ReplicationRole.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Scheduler.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Scheduler.java index f2e48234a01ab..09f9517dbc39d 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Scheduler.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Scheduler.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.durabletask.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; @@ -56,6 +57,13 @@ public interface Scheduler { */ SchedulerProperties properties(); + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -146,7 +154,8 @@ interface WithResourceGroup { * The stage of the Scheduler 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.WithProperties, DefinitionStages.WithIdentity { /** * Executes the create request. * @@ -188,6 +197,19 @@ interface WithProperties { */ WithCreate withProperties(SchedulerProperties properties); } + + /** + * The stage of the Scheduler definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } } /** @@ -200,7 +222,7 @@ interface WithProperties { /** * The template for Scheduler update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithIdentity { /** * Executes the update request. * @@ -246,6 +268,19 @@ interface WithProperties { */ Update withProperties(SchedulerPropertiesUpdate properties); } + + /** + * The stage of the Scheduler update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } } /** @@ -262,4 +297,23 @@ interface WithProperties { * @return the refreshed resource. */ Scheduler refresh(Context context); + + /** + * Restart a Scheduler. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response restartWithResponse(Context context); + + /** + * Restart a Scheduler. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(); } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerUpdate.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerUpdate.java index 38e766f5864bb..f073e51fe129c 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerUpdate.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerUpdate.java @@ -27,6 +27,11 @@ public final class SchedulerUpdate implements JsonSerializable */ private Map tags; + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + /** * Creates an instance of SchedulerUpdate class. */ @@ -73,6 +78,26 @@ public SchedulerUpdate withTags(Map tags) { return this; } + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the SchedulerUpdate object itself. + */ + public SchedulerUpdate withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + /** * {@inheritDoc} */ @@ -81,6 +106,7 @@ 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("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -104,6 +130,8 @@ public static SchedulerUpdate fromJson(JsonReader jsonReader) throws IOException } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedSchedulerUpdate.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedSchedulerUpdate.identity = ManagedServiceIdentity.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Schedulers.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Schedulers.java index b975d6bd07d99..844930ab9cbd7 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Schedulers.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/Schedulers.java @@ -249,6 +249,30 @@ PagedIterable listPrivateEndpointConnections(String r PagedIterable listPrivateEndpointConnections(String resourceGroupName, String schedulerName, Context context); + /** + * Restart a Scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response restartWithResponse(String resourceGroupName, String schedulerName, Context context); + + /** + * Restart a Scheduler. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String schedulerName); + /** * Get a Scheduler. * diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskHubProperties.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskHubProperties.java index 9de67945b9ae0..561d225fad6e6 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskHubProperties.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskHubProperties.java @@ -4,17 +4,18 @@ package com.azure.resourcemanager.durabletask.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; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * The properties of Task Hub. */ -@Immutable +@Fluent public final class TaskHubProperties implements JsonSerializable { /* * The status of the last operation @@ -26,6 +27,11 @@ public final class TaskHubProperties implements JsonSerializable capabilities; + /** * Creates an instance of TaskHubProperties class. */ @@ -50,12 +56,33 @@ public String dashboardUrl() { return this.dashboardUrl; } + /** + * Get the capabilities property: A set of Task Hub capabilities that can be enabled or disabled for a Task Hub. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: A set of Task Hub capabilities that can be enabled or disabled for a Task Hub. + * + * @param capabilities the capabilities value to set. + * @return the TaskHubProperties object itself. + */ + public TaskHubProperties withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("capabilities", this.capabilities, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -78,6 +105,9 @@ public static TaskHubProperties fromJson(JsonReader jsonReader) throws IOExcepti deserializedTaskHubProperties.provisioningState = ProvisioningState.fromString(reader.getString()); } else if ("dashboardUrl".equals(fieldName)) { deserializedTaskHubProperties.dashboardUrl = reader.getString(); + } else if ("capabilities".equals(fieldName)) { + List capabilities = reader.readArray(reader1 -> reader1.getString()); + deserializedTaskHubProperties.capabilities = capabilities; } else { reader.skipChildren(); } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueue.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueue.java new file mode 100644 index 0000000000000..576e77d69b463 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueue.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.durabletask.fluent.models.TaskQueueInner; + +/** + * An immutable client-side representation of TaskQueue. + */ +public interface TaskQueue { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + TaskQueueProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.durabletask.fluent.models.TaskQueueInner object. + * + * @return the inner object. + */ + TaskQueueInner innerModel(); + + /** + * The entirety of the TaskQueue definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The TaskQueue definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the TaskQueue definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the TaskQueue definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, schedulerName, taskHubName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @return the next definition stage. + */ + WithCreate withExistingTaskHub(String resourceGroupName, String schedulerName, String taskHubName); + } + + /** + * The stage of the TaskQueue 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + TaskQueue create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TaskQueue create(Context context); + } + + /** + * The stage of the TaskQueue definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(TaskQueueProperties properties); + } + } + + /** + * Begins update for the TaskQueue resource. + * + * @return the stage of resource update. + */ + TaskQueue.Update update(); + + /** + * The template for TaskQueue update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TaskQueue apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TaskQueue apply(Context context); + } + + /** + * The TaskQueue update stages. + */ + interface UpdateStages { + /** + * The stage of the TaskQueue update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(TaskQueueProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TaskQueue refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TaskQueue refresh(Context context); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueProperties.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueProperties.java new file mode 100644 index 0000000000000..bcf63f6a25ce5 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of a Task Queue. + */ +@Fluent +public final class TaskQueueProperties implements JsonSerializable { + /* + * The status of the last operation + */ + private ProvisioningState provisioningState; + + /* + * The throughput configuration of the Task Queue + */ + private TaskQueueThroughput throughput; + + /** + * Creates an instance of TaskQueueProperties class. + */ + public TaskQueueProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the throughput property: The throughput configuration of the Task Queue. + * + * @return the throughput value. + */ + public TaskQueueThroughput throughput() { + return this.throughput; + } + + /** + * Set the throughput property: The throughput configuration of the Task Queue. + * + * @param throughput the throughput value to set. + * @return the TaskQueueProperties object itself. + */ + public TaskQueueProperties withThroughput(TaskQueueThroughput throughput) { + this.throughput = throughput; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("throughput", this.throughput); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TaskQueueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TaskQueueProperties 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 TaskQueueProperties. + */ + public static TaskQueueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TaskQueueProperties deserializedTaskQueueProperties = new TaskQueueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedTaskQueueProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("throughput".equals(fieldName)) { + deserializedTaskQueueProperties.throughput = TaskQueueThroughput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTaskQueueProperties; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueThroughput.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueThroughput.java new file mode 100644 index 0000000000000..ce0099a0b995c --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueThroughput.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The throughput configuration of a Task Queue. + */ +@Fluent +public final class TaskQueueThroughput implements JsonSerializable { + /* + * The rate of work-item handouts per second + */ + private Integer actionsPerSecond; + + /** + * Creates an instance of TaskQueueThroughput class. + */ + public TaskQueueThroughput() { + } + + /** + * Get the actionsPerSecond property: The rate of work-item handouts per second. + * + * @return the actionsPerSecond value. + */ + public Integer actionsPerSecond() { + return this.actionsPerSecond; + } + + /** + * Set the actionsPerSecond property: The rate of work-item handouts per second. + * + * @param actionsPerSecond the actionsPerSecond value to set. + * @return the TaskQueueThroughput object itself. + */ + public TaskQueueThroughput withActionsPerSecond(Integer actionsPerSecond) { + this.actionsPerSecond = actionsPerSecond; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("actionsPerSecond", this.actionsPerSecond); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TaskQueueThroughput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TaskQueueThroughput 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 TaskQueueThroughput. + */ + public static TaskQueueThroughput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TaskQueueThroughput deserializedTaskQueueThroughput = new TaskQueueThroughput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionsPerSecond".equals(fieldName)) { + deserializedTaskQueueThroughput.actionsPerSecond = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTaskQueueThroughput; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueUpdate.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueUpdate.java new file mode 100644 index 0000000000000..9b70a9ee62efe --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueUpdate.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The update request model for a Task Queue. + */ +@Fluent +public final class TaskQueueUpdate implements JsonSerializable { + /* + * The resource-specific properties for this resource. + */ + private TaskQueueProperties properties; + + /** + * Creates an instance of TaskQueueUpdate class. + */ + public TaskQueueUpdate() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public TaskQueueProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the TaskQueueUpdate object itself. + */ + public TaskQueueUpdate withProperties(TaskQueueProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TaskQueueUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TaskQueueUpdate 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 TaskQueueUpdate. + */ + public static TaskQueueUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TaskQueueUpdate deserializedTaskQueueUpdate = new TaskQueueUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedTaskQueueUpdate.properties = TaskQueueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTaskQueueUpdate; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueues.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueues.java new file mode 100644 index 0000000000000..af5852007d35e --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueues.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of TaskQueues. + */ +public interface TaskQueues { + /** + * Get a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @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 a Task Queue along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String schedulerName, String taskHubName, + String taskQueueName, Context context); + + /** + * Get a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue. + */ + TaskQueue get(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName); + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName); + + /** + * Delete a Task Queue. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param taskQueueName The name of the TaskQueue. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String schedulerName, String taskHubName, String taskQueueName, + Context context); + + /** + * List Task Queues by Task Hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByTaskHub(String resourceGroupName, String schedulerName, String taskHubName); + + /** + * List Task Queues by Task Hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param taskHubName The name of the TaskHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TaskQueue list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByTaskHub(String resourceGroupName, String schedulerName, String taskHubName, + Context context); + + /** + * Get a Task Queue. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue along with {@link Response}. + */ + TaskQueue getById(String id); + + /** + * Get a Task Queue. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Task Queue along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Task Queue. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Task Queue. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TaskQueue resource. + * + * @param name resource name. + * @return the first stage of the new TaskQueue definition. + */ + TaskQueue.DefinitionStages.Blank define(String name); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryption.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryption.java new file mode 100644 index 0000000000000..9e2edf609529d --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryption.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner; + +/** + * An immutable client-side representation of TransparentDataEncryption. + */ +public interface TransparentDataEncryption { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + TransparentDataEncryptionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner object. + * + * @return the inner object. + */ + TransparentDataEncryptionInner innerModel(); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptionKeySource.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptionKeySource.java new file mode 100644 index 0000000000000..7579a2cda9f72 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptionKeySource.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The key source for the transparent data encryption. + */ +public final class TransparentDataEncryptionKeySource extends ExpandableStringEnum { + /** + * The key source is Microsoft-managed. + */ + public static final TransparentDataEncryptionKeySource MICROSOFT_MANAGED = fromString("MicrosoftManaged"); + + /** + * The key source is customer-managed. + */ + public static final TransparentDataEncryptionKeySource CUSTOMER_MANAGED = fromString("CustomerManaged"); + + /** + * Creates a new instance of TransparentDataEncryptionKeySource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TransparentDataEncryptionKeySource() { + } + + /** + * Creates or finds a TransparentDataEncryptionKeySource from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransparentDataEncryptionKeySource. + */ + public static TransparentDataEncryptionKeySource fromString(String name) { + return fromString(name, TransparentDataEncryptionKeySource.class); + } + + /** + * Gets known TransparentDataEncryptionKeySource values. + * + * @return known TransparentDataEncryptionKeySource values. + */ + public static Collection values() { + return values(TransparentDataEncryptionKeySource.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptionProperties.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptionProperties.java new file mode 100644 index 0000000000000..dea8848937e70 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptionProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The transparent data encryption settings for the resource. + */ +@Fluent +public final class TransparentDataEncryptionProperties + implements JsonSerializable { + /* + * The status of the last operation + */ + private ProvisioningState provisioningState; + + /* + * The key source for the transparent data encryption + */ + private TransparentDataEncryptionKeySource keySource; + + /* + * The URI of the key in Key Vault to be used for transparent data encryption + */ + private String keyVaultKeyUri; + + /* + * Indicates whether auto-rotation of the customer-managed keys is enabled for transparent data encryption + */ + private Boolean autoRotationEnabled; + + /** + * Creates an instance of TransparentDataEncryptionProperties class. + */ + public TransparentDataEncryptionProperties() { + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the keySource property: The key source for the transparent data encryption. + * + * @return the keySource value. + */ + public TransparentDataEncryptionKeySource keySource() { + return this.keySource; + } + + /** + * Set the keySource property: The key source for the transparent data encryption. + * + * @param keySource the keySource value to set. + * @return the TransparentDataEncryptionProperties object itself. + */ + public TransparentDataEncryptionProperties withKeySource(TransparentDataEncryptionKeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get the keyVaultKeyUri property: The URI of the key in Key Vault to be used for transparent data encryption. + * + * @return the keyVaultKeyUri value. + */ + public String keyVaultKeyUri() { + return this.keyVaultKeyUri; + } + + /** + * Set the keyVaultKeyUri property: The URI of the key in Key Vault to be used for transparent data encryption. + * + * @param keyVaultKeyUri the keyVaultKeyUri value to set. + * @return the TransparentDataEncryptionProperties object itself. + */ + public TransparentDataEncryptionProperties withKeyVaultKeyUri(String keyVaultKeyUri) { + this.keyVaultKeyUri = keyVaultKeyUri; + return this; + } + + /** + * Get the autoRotationEnabled property: Indicates whether auto-rotation of the customer-managed keys is enabled for + * transparent data encryption. + * + * @return the autoRotationEnabled value. + */ + public Boolean autoRotationEnabled() { + return this.autoRotationEnabled; + } + + /** + * Set the autoRotationEnabled property: Indicates whether auto-rotation of the customer-managed keys is enabled for + * transparent data encryption. + * + * @param autoRotationEnabled the autoRotationEnabled value to set. + * @return the TransparentDataEncryptionProperties object itself. + */ + public TransparentDataEncryptionProperties withAutoRotationEnabled(Boolean autoRotationEnabled) { + this.autoRotationEnabled = autoRotationEnabled; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keySource", this.keySource == null ? null : this.keySource.toString()); + jsonWriter.writeStringField("keyVaultKeyUri", this.keyVaultKeyUri); + jsonWriter.writeBooleanField("autoRotationEnabled", this.autoRotationEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TransparentDataEncryptionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TransparentDataEncryptionProperties 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 TransparentDataEncryptionProperties. + */ + public static TransparentDataEncryptionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TransparentDataEncryptionProperties deserializedTransparentDataEncryptionProperties + = new TransparentDataEncryptionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keySource".equals(fieldName)) { + deserializedTransparentDataEncryptionProperties.keySource + = TransparentDataEncryptionKeySource.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedTransparentDataEncryptionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("keyVaultKeyUri".equals(fieldName)) { + deserializedTransparentDataEncryptionProperties.keyVaultKeyUri = reader.getString(); + } else if ("autoRotationEnabled".equals(fieldName)) { + deserializedTransparentDataEncryptionProperties.autoRotationEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedTransparentDataEncryptionProperties; + }); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptions.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptions.java new file mode 100644 index 0000000000000..055a80c5a569a --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptions.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner; + +/** + * Resource collection API of TransparentDataEncryptions. + */ +public interface TransparentDataEncryptions { + /** + * Get a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @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 a Transparent Data Encryption along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String schedulerName, + Context context); + + /** + * Get a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Transparent Data Encryption. + */ + TransparentDataEncryption get(String resourceGroupName, String schedulerName); + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a transparent data encryption resource belonging to the scheduler. + */ + TransparentDataEncryption createOrReplace(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource); + + /** + * Create or Update a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param resource Resource create parameters. + * @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 a transparent data encryption resource belonging to the scheduler. + */ + TransparentDataEncryption createOrReplace(String resourceGroupName, String schedulerName, + TransparentDataEncryptionInner resource, Context context); + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String schedulerName); + + /** + * Delete a Transparent Data Encryption. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String schedulerName, Context context); + + /** + * List Transparent Data Encryptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByScheduler(String resourceGroupName, String schedulerName); + + /** + * List Transparent Data Encryptions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param schedulerName The name of the Scheduler. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TransparentDataEncryption list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByScheduler(String resourceGroupName, String schedulerName, + Context context); +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/UserAssignedIdentity.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..d77f4993abf5a --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/UserAssignedIdentity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private String principalId; + + /* + * The client ID of the assigned identity. + */ + private String clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * {@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/durabletask/azure-resourcemanager-durabletask/src/main/resources/META-INF/azure-resourcemanager-durabletask_metadata.json b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/resources/META-INF/azure-resourcemanager-durabletask_metadata.json index 4bc28af24dc5e..b2185109d7e03 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/resources/META-INF/azure-resourcemanager-durabletask_metadata.json +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/resources/META-INF/azure-resourcemanager-durabletask_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"Microsoft.DurableTask":"2026-02-01"},"crossLanguageDefinitions":{"com.azure.resourcemanager.durabletask.fluent.DurableTaskManagementClient":"Microsoft.DurableTask","com.azure.resourcemanager.durabletask.fluent.OperationsClient":"Microsoft.DurableTask.Operations","com.azure.resourcemanager.durabletask.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient":"Microsoft.DurableTask.RetentionPolicies","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.beginCreateOrReplace":"Microsoft.DurableTask.RetentionPolicies.createOrReplace","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.beginDelete":"Microsoft.DurableTask.RetentionPolicies.delete","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.beginUpdate":"Microsoft.DurableTask.RetentionPolicies.update","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.createOrReplace":"Microsoft.DurableTask.RetentionPolicies.createOrReplace","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.delete":"Microsoft.DurableTask.RetentionPolicies.delete","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.get":"Microsoft.DurableTask.RetentionPolicies.get","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.getWithResponse":"Microsoft.DurableTask.RetentionPolicies.get","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.listByScheduler":"Microsoft.DurableTask.RetentionPolicies.listByScheduler","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.update":"Microsoft.DurableTask.RetentionPolicies.update","com.azure.resourcemanager.durabletask.fluent.SchedulersClient":"Microsoft.DurableTask.Schedulers","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginCreateOrUpdate":"Microsoft.DurableTask.Schedulers.createOrUpdate","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginCreateOrUpdatePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.createOrUpdatePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginDelete":"Microsoft.DurableTask.Schedulers.delete","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginDeletePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.deletePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginUpdate":"Microsoft.DurableTask.Schedulers.update","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginUpdatePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.updatePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.createOrUpdate":"Microsoft.DurableTask.Schedulers.createOrUpdate","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.createOrUpdatePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.createOrUpdatePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.delete":"Microsoft.DurableTask.Schedulers.delete","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.deletePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.deletePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getByResourceGroup":"Microsoft.DurableTask.Schedulers.get","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getByResourceGroupWithResponse":"Microsoft.DurableTask.Schedulers.get","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getPrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.getPrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getPrivateEndpointConnectionWithResponse":"Microsoft.DurableTask.Schedulers.getPrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getPrivateLink":"Microsoft.DurableTask.Schedulers.getPrivateLink","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getPrivateLinkWithResponse":"Microsoft.DurableTask.Schedulers.getPrivateLink","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.list":"Microsoft.DurableTask.Schedulers.listBySubscription","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.listByResourceGroup":"Microsoft.DurableTask.Schedulers.listByResourceGroup","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.listPrivateEndpointConnections":"Microsoft.DurableTask.Schedulers.listPrivateEndpointConnections","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.listPrivateLinks":"Microsoft.DurableTask.Schedulers.listPrivateLinks","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.update":"Microsoft.DurableTask.Schedulers.update","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.updatePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.updatePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient":"Microsoft.DurableTask.TaskHubs","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.beginCreateOrUpdate":"Microsoft.DurableTask.TaskHubs.createOrUpdate","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.beginDelete":"Microsoft.DurableTask.TaskHubs.delete","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.createOrUpdate":"Microsoft.DurableTask.TaskHubs.createOrUpdate","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.delete":"Microsoft.DurableTask.TaskHubs.delete","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.get":"Microsoft.DurableTask.TaskHubs.get","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.getWithResponse":"Microsoft.DurableTask.TaskHubs.get","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.listByScheduler":"Microsoft.DurableTask.TaskHubs.listByScheduler","com.azure.resourcemanager.durabletask.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.durabletask.fluent.models.PrivateEndpointConnectionInner":"Microsoft.DurableTask.PrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.models.RetentionPolicyInner":"Microsoft.DurableTask.RetentionPolicy","com.azure.resourcemanager.durabletask.fluent.models.SchedulerInner":"Microsoft.DurableTask.Scheduler","com.azure.resourcemanager.durabletask.fluent.models.SchedulerPrivateLinkResourceInner":"Microsoft.DurableTask.SchedulerPrivateLinkResource","com.azure.resourcemanager.durabletask.fluent.models.TaskHubInner":"Microsoft.DurableTask.TaskHub","com.azure.resourcemanager.durabletask.implementation.DurableTaskManagementClientBuilder":"Microsoft.DurableTask","com.azure.resourcemanager.durabletask.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.durabletask.implementation.models.PrivateEndpointConnectionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.RetentionPolicyListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.SchedulerListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.SchedulerPrivateLinkResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.TaskHubListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.durabletask.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.durabletask.models.OptionalPropertiesUpdateableProperties":"TypeSpec.OptionalProperties","com.azure.resourcemanager.durabletask.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.durabletask.models.PrivateEndpoint":"Azure.ResourceManager.CommonTypes.PrivateEndpoint","com.azure.resourcemanager.durabletask.models.PrivateEndpointConnectionProperties":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties","com.azure.resourcemanager.durabletask.models.PrivateEndpointConnectionProvisioningState":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState","com.azure.resourcemanager.durabletask.models.PrivateEndpointConnectionUpdate":"Azure.ResourceManager.PrivateEndpointConnectionUpdate","com.azure.resourcemanager.durabletask.models.PrivateEndpointServiceConnectionStatus":"Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus","com.azure.resourcemanager.durabletask.models.PrivateLinkResourceProperties":"Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties","com.azure.resourcemanager.durabletask.models.PrivateLinkServiceConnectionState":"Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState","com.azure.resourcemanager.durabletask.models.ProvisioningState":"Microsoft.DurableTask.ProvisioningState","com.azure.resourcemanager.durabletask.models.PublicNetworkAccess":"Microsoft.DurableTask.PublicNetworkAccess","com.azure.resourcemanager.durabletask.models.PurgeableOrchestrationState":"Microsoft.DurableTask.PurgeableOrchestrationState","com.azure.resourcemanager.durabletask.models.RedundancyState":"Microsoft.DurableTask.RedundancyState","com.azure.resourcemanager.durabletask.models.RetentionPolicyDetails":"Microsoft.DurableTask.RetentionPolicyDetails","com.azure.resourcemanager.durabletask.models.RetentionPolicyProperties":"Microsoft.DurableTask.RetentionPolicyProperties","com.azure.resourcemanager.durabletask.models.SchedulerProperties":"Microsoft.DurableTask.SchedulerProperties","com.azure.resourcemanager.durabletask.models.SchedulerPropertiesUpdate":"Microsoft.DurableTask.SchedulerPropertiesUpdate","com.azure.resourcemanager.durabletask.models.SchedulerSku":"Microsoft.DurableTask.SchedulerSku","com.azure.resourcemanager.durabletask.models.SchedulerSkuName":"Microsoft.DurableTask.SchedulerSkuName","com.azure.resourcemanager.durabletask.models.SchedulerSkuUpdate":"Microsoft.DurableTask.SchedulerSkuUpdate","com.azure.resourcemanager.durabletask.models.SchedulerUpdate":"Microsoft.DurableTask.SchedulerUpdate","com.azure.resourcemanager.durabletask.models.TaskHubProperties":"Microsoft.DurableTask.TaskHubProperties"},"generatedFiles":["src/main/java/com/azure/resourcemanager/durabletask/DurableTaskManager.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/DurableTaskManagementClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/RetentionPoliciesClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/SchedulersClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/TaskHubsClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/RetentionPolicyInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerPrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TaskHubInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/package-info.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskManagementClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/PrivateEndpointConnectionImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/RetentionPoliciesClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/RetentionPoliciesImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/RetentionPolicyImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerPrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubsClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubsImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/RetentionPolicyListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/SchedulerListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/SchedulerPrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TaskHubListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/package-info.java","src/main/java/com/azure/resourcemanager/durabletask/models/ActionType.java","src/main/java/com/azure/resourcemanager/durabletask/models/Operation.java","src/main/java/com/azure/resourcemanager/durabletask/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/durabletask/models/Operations.java","src/main/java/com/azure/resourcemanager/durabletask/models/OptionalPropertiesUpdateableProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/Origin.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpointConnectionUpdate.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpointServiceConnectionStatus.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/durabletask/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/durabletask/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/durabletask/models/PurgeableOrchestrationState.java","src/main/java/com/azure/resourcemanager/durabletask/models/RedundancyState.java","src/main/java/com/azure/resourcemanager/durabletask/models/RetentionPolicies.java","src/main/java/com/azure/resourcemanager/durabletask/models/RetentionPolicy.java","src/main/java/com/azure/resourcemanager/durabletask/models/RetentionPolicyDetails.java","src/main/java/com/azure/resourcemanager/durabletask/models/RetentionPolicyProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/Scheduler.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerPrivateLinkResource.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerPropertiesUpdate.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerSku.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerSkuName.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerSkuUpdate.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerUpdate.java","src/main/java/com/azure/resourcemanager/durabletask/models/Schedulers.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskHub.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskHubProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskHubs.java","src/main/java/com/azure/resourcemanager/durabletask/models/package-info.java","src/main/java/com/azure/resourcemanager/durabletask/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"Microsoft.DurableTask":"2026-07-01-preview"},"crossLanguagePackageId":"Microsoft.DurableTask","crossLanguageVersion":"1df18bc0d591","crossLanguageDefinitions":{"com.azure.resourcemanager.durabletask.fluent.DetectorsClient":"Microsoft.DurableTask.Detectors","com.azure.resourcemanager.durabletask.fluent.DetectorsClient.get":"Microsoft.DurableTask.Detectors.get","com.azure.resourcemanager.durabletask.fluent.DetectorsClient.getWithResponse":"Microsoft.DurableTask.Detectors.get","com.azure.resourcemanager.durabletask.fluent.DetectorsClient.listByScheduler":"Microsoft.DurableTask.Detectors.listByScheduler","com.azure.resourcemanager.durabletask.fluent.DurableTaskManagementClient":"Microsoft.DurableTask","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient":"Microsoft.DurableTask.FailoverInstances","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.beginCreateOrReplace":"Microsoft.DurableTask.FailoverInstances.createOrReplace","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.beginDelete":"Microsoft.DurableTask.FailoverInstances.delete","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.beginFailover":"Microsoft.DurableTask.FailoverInstances.failover","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.beginForceFailoverAllowDataLoss":"Microsoft.DurableTask.FailoverInstances.forceFailoverAllowDataLoss","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.createOrReplace":"Microsoft.DurableTask.FailoverInstances.createOrReplace","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.delete":"Microsoft.DurableTask.FailoverInstances.delete","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.failover":"Microsoft.DurableTask.FailoverInstances.failover","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.forceFailoverAllowDataLoss":"Microsoft.DurableTask.FailoverInstances.forceFailoverAllowDataLoss","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.get":"Microsoft.DurableTask.FailoverInstances.get","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.getWithResponse":"Microsoft.DurableTask.FailoverInstances.get","com.azure.resourcemanager.durabletask.fluent.FailoverInstancesClient.listByScheduler":"Microsoft.DurableTask.FailoverInstances.listByScheduler","com.azure.resourcemanager.durabletask.fluent.OperationsClient":"Microsoft.DurableTask.Operations","com.azure.resourcemanager.durabletask.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient":"Microsoft.DurableTask.RetentionPolicies","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.beginCreateOrReplace":"Microsoft.DurableTask.RetentionPolicies.createOrReplace","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.beginDelete":"Microsoft.DurableTask.RetentionPolicies.delete","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.beginUpdate":"Microsoft.DurableTask.RetentionPolicies.update","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.createOrReplace":"Microsoft.DurableTask.RetentionPolicies.createOrReplace","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.delete":"Microsoft.DurableTask.RetentionPolicies.delete","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.get":"Microsoft.DurableTask.RetentionPolicies.get","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.getWithResponse":"Microsoft.DurableTask.RetentionPolicies.get","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.listByScheduler":"Microsoft.DurableTask.RetentionPolicies.listByScheduler","com.azure.resourcemanager.durabletask.fluent.RetentionPoliciesClient.update":"Microsoft.DurableTask.RetentionPolicies.update","com.azure.resourcemanager.durabletask.fluent.SchedulersClient":"Microsoft.DurableTask.Schedulers","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginCreateOrUpdate":"Microsoft.DurableTask.Schedulers.createOrUpdate","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginCreateOrUpdatePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.createOrUpdatePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginDelete":"Microsoft.DurableTask.Schedulers.delete","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginDeletePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.deletePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginUpdate":"Microsoft.DurableTask.Schedulers.update","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.beginUpdatePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.updatePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.createOrUpdate":"Microsoft.DurableTask.Schedulers.createOrUpdate","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.createOrUpdatePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.createOrUpdatePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.delete":"Microsoft.DurableTask.Schedulers.delete","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.deletePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.deletePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getByResourceGroup":"Microsoft.DurableTask.Schedulers.get","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getByResourceGroupWithResponse":"Microsoft.DurableTask.Schedulers.get","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getPrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.getPrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getPrivateEndpointConnectionWithResponse":"Microsoft.DurableTask.Schedulers.getPrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getPrivateLink":"Microsoft.DurableTask.Schedulers.getPrivateLink","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.getPrivateLinkWithResponse":"Microsoft.DurableTask.Schedulers.getPrivateLink","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.list":"Microsoft.DurableTask.Schedulers.listBySubscription","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.listByResourceGroup":"Microsoft.DurableTask.Schedulers.listByResourceGroup","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.listPrivateEndpointConnections":"Microsoft.DurableTask.Schedulers.listPrivateEndpointConnections","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.listPrivateLinks":"Microsoft.DurableTask.Schedulers.listPrivateLinks","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.restart":"Microsoft.DurableTask.Schedulers.restart","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.restartWithResponse":"Microsoft.DurableTask.Schedulers.restart","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.update":"Microsoft.DurableTask.Schedulers.update","com.azure.resourcemanager.durabletask.fluent.SchedulersClient.updatePrivateEndpointConnection":"Microsoft.DurableTask.Schedulers.updatePrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient":"Microsoft.DurableTask.TaskHubs","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.beginCreateOrUpdate":"Microsoft.DurableTask.TaskHubs.createOrUpdate","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.beginDelete":"Microsoft.DurableTask.TaskHubs.delete","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.createOrUpdate":"Microsoft.DurableTask.TaskHubs.createOrUpdate","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.delete":"Microsoft.DurableTask.TaskHubs.delete","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.get":"Microsoft.DurableTask.TaskHubs.get","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.getWithResponse":"Microsoft.DurableTask.TaskHubs.get","com.azure.resourcemanager.durabletask.fluent.TaskHubsClient.listByScheduler":"Microsoft.DurableTask.TaskHubs.listByScheduler","com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient":"Microsoft.DurableTask.TaskQueues","com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient.beginCreateOrUpdate":"Microsoft.DurableTask.TaskQueues.createOrUpdate","com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient.beginDelete":"Microsoft.DurableTask.TaskQueues.delete","com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient.beginUpdate":"Microsoft.DurableTask.TaskQueues.update","com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient.createOrUpdate":"Microsoft.DurableTask.TaskQueues.createOrUpdate","com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient.delete":"Microsoft.DurableTask.TaskQueues.delete","com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient.get":"Microsoft.DurableTask.TaskQueues.get","com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient.getWithResponse":"Microsoft.DurableTask.TaskQueues.get","com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient.listByTaskHub":"Microsoft.DurableTask.TaskQueues.listByTaskHub","com.azure.resourcemanager.durabletask.fluent.TaskQueuesClient.update":"Microsoft.DurableTask.TaskQueues.update","com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient":"Microsoft.DurableTask.TransparentDataEncryptions","com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient.beginCreateOrReplace":"Microsoft.DurableTask.TransparentDataEncryptions.createOrReplace","com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient.beginDelete":"Microsoft.DurableTask.TransparentDataEncryptions.delete","com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient.createOrReplace":"Microsoft.DurableTask.TransparentDataEncryptions.createOrReplace","com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient.delete":"Microsoft.DurableTask.TransparentDataEncryptions.delete","com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient.get":"Microsoft.DurableTask.TransparentDataEncryptions.get","com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient.getWithResponse":"Microsoft.DurableTask.TransparentDataEncryptions.get","com.azure.resourcemanager.durabletask.fluent.TransparentDataEncryptionsClient.listByScheduler":"Microsoft.DurableTask.TransparentDataEncryptions.listByScheduler","com.azure.resourcemanager.durabletask.fluent.models.DetectorInner":"Microsoft.DurableTask.Detector","com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner":"Microsoft.DurableTask.FailoverInstance","com.azure.resourcemanager.durabletask.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.durabletask.fluent.models.PrivateEndpointConnectionInner":"Microsoft.DurableTask.PrivateEndpointConnection","com.azure.resourcemanager.durabletask.fluent.models.RetentionPolicyInner":"Microsoft.DurableTask.RetentionPolicy","com.azure.resourcemanager.durabletask.fluent.models.SchedulerInner":"Microsoft.DurableTask.Scheduler","com.azure.resourcemanager.durabletask.fluent.models.SchedulerPrivateLinkResourceInner":"Microsoft.DurableTask.SchedulerPrivateLinkResource","com.azure.resourcemanager.durabletask.fluent.models.TaskHubInner":"Microsoft.DurableTask.TaskHub","com.azure.resourcemanager.durabletask.fluent.models.TaskQueueInner":"Microsoft.DurableTask.TaskQueue","com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner":"Microsoft.DurableTask.TransparentDataEncryption","com.azure.resourcemanager.durabletask.implementation.DurableTaskManagementClientBuilder":"Microsoft.DurableTask","com.azure.resourcemanager.durabletask.implementation.models.DetectorListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.FailoverInstanceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.durabletask.implementation.models.PrivateEndpointConnectionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.RetentionPolicyListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.SchedulerListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.SchedulerPrivateLinkResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.TaskHubListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.TaskQueueListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.implementation.models.TransparentDataEncryptionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.durabletask.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.durabletask.models.DetectorDataset":"Microsoft.DurableTask.DetectorDataset","com.azure.resourcemanager.durabletask.models.DetectorMetadata":"Microsoft.DurableTask.DetectorMetadata","com.azure.resourcemanager.durabletask.models.DetectorProperties":"Microsoft.DurableTask.DetectorProperties","com.azure.resourcemanager.durabletask.models.DetectorRenderingProperties":"Microsoft.DurableTask.DetectorRenderingProperties","com.azure.resourcemanager.durabletask.models.DetectorRenderingType":"Microsoft.DurableTask.DetectorRenderingType","com.azure.resourcemanager.durabletask.models.DetectorStatus":"Microsoft.DurableTask.DetectorStatus","com.azure.resourcemanager.durabletask.models.DetectorStatusId":"Microsoft.DurableTask.DetectorStatusId","com.azure.resourcemanager.durabletask.models.DetectorTable":"Microsoft.DurableTask.DetectorTable","com.azure.resourcemanager.durabletask.models.DetectorTableColumn":"Microsoft.DurableTask.DetectorTableColumn","com.azure.resourcemanager.durabletask.models.DetectorType":"Microsoft.DurableTask.DetectorType","com.azure.resourcemanager.durabletask.models.FailoverInstanceProperties":"Microsoft.DurableTask.FailoverInstanceProperties","com.azure.resourcemanager.durabletask.models.FailoverState":"Microsoft.DurableTask.FailoverState","com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.durabletask.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.durabletask.models.OptionalPropertiesUpdateableProperties":"TypeSpec.OptionalProperties","com.azure.resourcemanager.durabletask.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.durabletask.models.PrivateEndpoint":"Azure.ResourceManager.CommonTypes.PrivateEndpoint","com.azure.resourcemanager.durabletask.models.PrivateEndpointConnectionProperties":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties","com.azure.resourcemanager.durabletask.models.PrivateEndpointConnectionProvisioningState":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState","com.azure.resourcemanager.durabletask.models.PrivateEndpointConnectionUpdate":"Azure.ResourceManager.PrivateEndpointConnectionUpdate","com.azure.resourcemanager.durabletask.models.PrivateEndpointServiceConnectionStatus":"Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus","com.azure.resourcemanager.durabletask.models.PrivateLinkResourceProperties":"Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties","com.azure.resourcemanager.durabletask.models.PrivateLinkServiceConnectionState":"Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState","com.azure.resourcemanager.durabletask.models.ProvisioningState":"Microsoft.DurableTask.ProvisioningState","com.azure.resourcemanager.durabletask.models.PublicNetworkAccess":"Microsoft.DurableTask.PublicNetworkAccess","com.azure.resourcemanager.durabletask.models.PurgeableOrchestrationState":"Microsoft.DurableTask.PurgeableOrchestrationState","com.azure.resourcemanager.durabletask.models.RedundancyState":"Microsoft.DurableTask.RedundancyState","com.azure.resourcemanager.durabletask.models.ReplicationRole":"Microsoft.DurableTask.ReplicationRole","com.azure.resourcemanager.durabletask.models.RetentionPolicyDetails":"Microsoft.DurableTask.RetentionPolicyDetails","com.azure.resourcemanager.durabletask.models.RetentionPolicyProperties":"Microsoft.DurableTask.RetentionPolicyProperties","com.azure.resourcemanager.durabletask.models.SchedulerProperties":"Microsoft.DurableTask.SchedulerProperties","com.azure.resourcemanager.durabletask.models.SchedulerPropertiesUpdate":"Microsoft.DurableTask.SchedulerPropertiesUpdate","com.azure.resourcemanager.durabletask.models.SchedulerSku":"Microsoft.DurableTask.SchedulerSku","com.azure.resourcemanager.durabletask.models.SchedulerSkuName":"Microsoft.DurableTask.SchedulerSkuName","com.azure.resourcemanager.durabletask.models.SchedulerSkuUpdate":"Microsoft.DurableTask.SchedulerSkuUpdate","com.azure.resourcemanager.durabletask.models.SchedulerUpdate":"Microsoft.DurableTask.SchedulerUpdate","com.azure.resourcemanager.durabletask.models.TaskHubProperties":"Microsoft.DurableTask.TaskHubProperties","com.azure.resourcemanager.durabletask.models.TaskQueueProperties":"Microsoft.DurableTask.TaskQueueProperties","com.azure.resourcemanager.durabletask.models.TaskQueueThroughput":"Microsoft.DurableTask.TaskQueueThroughput","com.azure.resourcemanager.durabletask.models.TaskQueueUpdate":"Microsoft.DurableTask.TaskQueueUpdate","com.azure.resourcemanager.durabletask.models.TransparentDataEncryptionKeySource":"Microsoft.DurableTask.TransparentDataEncryptionKeySource","com.azure.resourcemanager.durabletask.models.TransparentDataEncryptionProperties":"Microsoft.DurableTask.TransparentDataEncryptionProperties","com.azure.resourcemanager.durabletask.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity"},"generatedFiles":["src/main/java/com/azure/resourcemanager/durabletask/DurableTaskManager.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/DetectorsClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/DurableTaskManagementClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/FailoverInstancesClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/RetentionPoliciesClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/SchedulersClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/TaskHubsClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/TaskQueuesClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/TransparentDataEncryptionsClient.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/DetectorInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/FailoverInstanceInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/RetentionPolicyInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerPrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TaskHubInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TaskQueueInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TransparentDataEncryptionInner.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/durabletask/fluent/package-info.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorsClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/DetectorsImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskManagementClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstanceImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstancesClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/FailoverInstancesImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/PrivateEndpointConnectionImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/RetentionPoliciesClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/RetentionPoliciesImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/RetentionPolicyImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerPrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubsClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubsImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueueImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueuesClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskQueuesImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionsClientImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/TransparentDataEncryptionsImpl.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/DetectorListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/FailoverInstanceListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/RetentionPolicyListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/SchedulerListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/SchedulerPrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TaskHubListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TaskQueueListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TransparentDataEncryptionListResult.java","src/main/java/com/azure/resourcemanager/durabletask/implementation/package-info.java","src/main/java/com/azure/resourcemanager/durabletask/models/ActionType.java","src/main/java/com/azure/resourcemanager/durabletask/models/Detector.java","src/main/java/com/azure/resourcemanager/durabletask/models/DetectorDataset.java","src/main/java/com/azure/resourcemanager/durabletask/models/DetectorMetadata.java","src/main/java/com/azure/resourcemanager/durabletask/models/DetectorProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/DetectorRenderingProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/DetectorRenderingType.java","src/main/java/com/azure/resourcemanager/durabletask/models/DetectorStatus.java","src/main/java/com/azure/resourcemanager/durabletask/models/DetectorStatusId.java","src/main/java/com/azure/resourcemanager/durabletask/models/DetectorTable.java","src/main/java/com/azure/resourcemanager/durabletask/models/DetectorTableColumn.java","src/main/java/com/azure/resourcemanager/durabletask/models/DetectorType.java","src/main/java/com/azure/resourcemanager/durabletask/models/Detectors.java","src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstance.java","src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstanceProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/FailoverInstances.java","src/main/java/com/azure/resourcemanager/durabletask/models/FailoverState.java","src/main/java/com/azure/resourcemanager/durabletask/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/durabletask/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/durabletask/models/Operation.java","src/main/java/com/azure/resourcemanager/durabletask/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/durabletask/models/Operations.java","src/main/java/com/azure/resourcemanager/durabletask/models/OptionalPropertiesUpdateableProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/Origin.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpointConnectionUpdate.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateEndpointServiceConnectionStatus.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/durabletask/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/durabletask/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/durabletask/models/PurgeableOrchestrationState.java","src/main/java/com/azure/resourcemanager/durabletask/models/RedundancyState.java","src/main/java/com/azure/resourcemanager/durabletask/models/ReplicationRole.java","src/main/java/com/azure/resourcemanager/durabletask/models/RetentionPolicies.java","src/main/java/com/azure/resourcemanager/durabletask/models/RetentionPolicy.java","src/main/java/com/azure/resourcemanager/durabletask/models/RetentionPolicyDetails.java","src/main/java/com/azure/resourcemanager/durabletask/models/RetentionPolicyProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/Scheduler.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerPrivateLinkResource.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerPropertiesUpdate.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerSku.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerSkuName.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerSkuUpdate.java","src/main/java/com/azure/resourcemanager/durabletask/models/SchedulerUpdate.java","src/main/java/com/azure/resourcemanager/durabletask/models/Schedulers.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskHub.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskHubProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskHubs.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueue.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueThroughput.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueueUpdate.java","src/main/java/com/azure/resourcemanager/durabletask/models/TaskQueues.java","src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryption.java","src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptionKeySource.java","src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptionProperties.java","src/main/java/com/azure/resourcemanager/durabletask/models/TransparentDataEncryptions.java","src/main/java/com/azure/resourcemanager/durabletask/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/durabletask/models/package-info.java","src/main/java/com/azure/resourcemanager/durabletask/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-durabletask/proxy-config.json b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-durabletask/proxy-config.json index 5ff5841f3b3ab..af2d872bab921 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-durabletask/proxy-config.json +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-durabletask/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.durabletask.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.durabletask.implementation.RetentionPoliciesClientImpl$RetentionPoliciesService"],["com.azure.resourcemanager.durabletask.implementation.SchedulersClientImpl$SchedulersService"],["com.azure.resourcemanager.durabletask.implementation.TaskHubsClientImpl$TaskHubsService"]] \ No newline at end of file +[["com.azure.resourcemanager.durabletask.implementation.DetectorsClientImpl$DetectorsService"],["com.azure.resourcemanager.durabletask.implementation.FailoverInstancesClientImpl$FailoverInstancesService"],["com.azure.resourcemanager.durabletask.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.durabletask.implementation.RetentionPoliciesClientImpl$RetentionPoliciesService"],["com.azure.resourcemanager.durabletask.implementation.SchedulersClientImpl$SchedulersService"],["com.azure.resourcemanager.durabletask.implementation.TaskHubsClientImpl$TaskHubsService"],["com.azure.resourcemanager.durabletask.implementation.TaskQueuesClientImpl$TaskQueuesService"],["com.azure.resourcemanager.durabletask.implementation.TransparentDataEncryptionsClientImpl$TransparentDataEncryptionsService"]] \ No newline at end of file diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/DetectorsGetSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/DetectorsGetSamples.java new file mode 100644 index 0000000000000..2490fb71b2c09 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/DetectorsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for Detectors Get. + */ +public final class DetectorsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Detectors_Get.json + */ + /** + * Sample code: Detectors_Get. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void detectorsGet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.detectors() + .getWithResponse("rgopenapi", "testscheduler", "cpuhealth", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/DetectorsListBySchedulerSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/DetectorsListBySchedulerSamples.java new file mode 100644 index 0000000000000..531e54f0c6407 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/DetectorsListBySchedulerSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for Detectors ListByScheduler. + */ +public final class DetectorsListBySchedulerSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Detectors_ListByScheduler.json + */ + /** + * Sample code: Detectors_ListByScheduler. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void detectorsListByScheduler(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.detectors().listByScheduler("rgopenapi", "testscheduler", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesCreateOrReplaceSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesCreateOrReplaceSamples.java new file mode 100644 index 0000000000000..2f6ff07ab79fa --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesCreateOrReplaceSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; +import com.azure.resourcemanager.durabletask.models.FailoverInstanceProperties; + +/** + * Samples for FailoverInstances CreateOrReplace. + */ +public final class FailoverInstancesCreateOrReplaceSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_CreateOrReplace_MaximumSet_Gen.json + */ + /** + * Sample code: FailoverInstances_CreateOrReplace_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + failoverInstancesCreateOrReplaceMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances() + .createOrReplace("rgdurabletask", "testscheduler", new FailoverInstanceInner() + .withProperties(new FailoverInstanceProperties().withPartnerSchedulerResourceId( + "/subscriptions/194D3C1E-462F-4738-9025-092A628C06EB/resourceGroups/rgdurabletask-secondary/providers/Microsoft.DurableTask/schedulers/testscheduler-secondary")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesDeleteSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesDeleteSamples.java new file mode 100644 index 0000000000000..21e494a55aa87 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for FailoverInstances Delete. + */ +public final class FailoverInstancesDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: FailoverInstances_Delete_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + failoverInstancesDeleteMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances().delete("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesFailoverSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesFailoverSamples.java new file mode 100644 index 0000000000000..ac74309e17d3e --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesFailoverSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for FailoverInstances Failover. + */ +public final class FailoverInstancesFailoverSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_Failover.json + */ + /** + * Sample code: FailoverInstances_Failover. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void failoverInstancesFailover(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances().failover("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesForceFailoverAllowDataLossSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesForceFailoverAllowDataLossSamples.java new file mode 100644 index 0000000000000..88fe574e1fffb --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesForceFailoverAllowDataLossSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for FailoverInstances ForceFailoverAllowDataLoss. + */ +public final class FailoverInstancesForceFailoverAllowDataLossSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_ForceFailoverAllowDataLoss.json + */ + /** + * Sample code: FailoverInstances_ForceFailoverAllowDataLoss. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + failoverInstancesForceFailoverAllowDataLoss(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances() + .forceFailoverAllowDataLoss("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesGetSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesGetSamples.java new file mode 100644 index 0000000000000..5004c5012ecef --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for FailoverInstances Get. + */ +public final class FailoverInstancesGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_Get_MaximumSet_Gen.json + */ + /** + * Sample code: FailoverInstances_Get_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + failoverInstancesGetMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances().getWithResponse("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesListBySchedulerSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesListBySchedulerSamples.java new file mode 100644 index 0000000000000..34f0ff55be2c6 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesListBySchedulerSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for FailoverInstances ListByScheduler. + */ +public final class FailoverInstancesListBySchedulerSamples { + /* + * x-ms-original-file: 2026-07-01-preview/FailoverInstances_ListByScheduler_MaximumSet_Gen.json + */ + /** + * Sample code: FailoverInstances_ListByScheduler_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + failoverInstancesListBySchedulerMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.failoverInstances().listByScheduler("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/OperationsListSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/OperationsListSamples.java index b5ca34674de68..13db247725bb2 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/OperationsListSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2026-02-01/Operations_List.json + * x-ms-original-file: 2026-07-01-preview/Operations_List.json */ /** * Sample code: Operations_List. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesCreateOrReplaceSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesCreateOrReplaceSamples.java index 02bde4e7ff150..97dfe50ab1112 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesCreateOrReplaceSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesCreateOrReplaceSamples.java @@ -15,7 +15,7 @@ */ public final class RetentionPoliciesCreateOrReplaceSamples { /* - * x-ms-original-file: 2026-02-01/RetentionPolicies_CreateOrReplace_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/RetentionPolicies_CreateOrReplace_MaximumSet_Gen.json */ /** * Sample code: RetentionPolicies_CreateOrReplace_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesDeleteSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesDeleteSamples.java index 5d0c4250c9521..6019243161dd7 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesDeleteSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class RetentionPoliciesDeleteSamples { /* - * x-ms-original-file: 2026-02-01/RetentionPolicies_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Delete_MaximumSet_Gen.json */ /** * Sample code: RetentionPolicies_Delete_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesGetSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesGetSamples.java index 14e84d15b0fe1..0728af641d3ed 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesGetSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesGetSamples.java @@ -9,7 +9,7 @@ */ public final class RetentionPoliciesGetSamples { /* - * x-ms-original-file: 2026-02-01/RetentionPolicies_Get_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Get_MaximumSet_Gen.json */ /** * Sample code: RetentionPolicies_Get_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesListBySchedulerSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesListBySchedulerSamples.java index 52dc2e7e3aae5..1905ac7a9bfd9 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesListBySchedulerSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesListBySchedulerSamples.java @@ -9,7 +9,7 @@ */ public final class RetentionPoliciesListBySchedulerSamples { /* - * x-ms-original-file: 2026-02-01/RetentionPolicies_ListByScheduler_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/RetentionPolicies_ListByScheduler_MaximumSet_Gen.json */ /** * Sample code: RetentionPolicies_ListByScheduler_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesUpdateSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesUpdateSamples.java index 30bb889cbb6bc..f9873744dbd2f 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesUpdateSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesUpdateSamples.java @@ -15,7 +15,7 @@ */ public final class RetentionPoliciesUpdateSamples { /* - * x-ms-original-file: 2026-02-01/RetentionPolicies_Update_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/RetentionPolicies_Update_MaximumSet_Gen.json */ /** * Sample code: RetentionPolicies_Update_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdatePrivateEndpointConnectionSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdatePrivateEndpointConnectionSamples.java index 0a0db233d2e21..a4d7a2b2bc84b 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdatePrivateEndpointConnectionSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdatePrivateEndpointConnectionSamples.java @@ -14,7 +14,7 @@ */ public final class SchedulersCreateOrUpdatePrivateEndpointConnectionSamples { /* - * x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Create_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Create_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Create_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdateSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdateSamples.java index eef7c57313098..054ade6a3f546 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdateSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdateSamples.java @@ -4,9 +4,12 @@ package com.azure.resourcemanager.durabletask.generated; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.SchedulerProperties; import com.azure.resourcemanager.durabletask.models.SchedulerSku; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; +import com.azure.resourcemanager.durabletask.models.UserAssignedIdentity; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -16,7 +19,7 @@ */ public final class SchedulersCreateOrUpdateSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_CreateOrUpdate.json */ /** * Sample code: Schedulers_CreateOrUpdate. @@ -31,6 +34,10 @@ public static void schedulersCreateOrUpdate(com.azure.resourcemanager.durabletas .withTags(mapOf("department", "research", "development", "true")) .withProperties(new SchedulerProperties().withIpAllowlist(Arrays.asList("10.0.0.0/8")) .withSku(new SchedulerSku().withName(SchedulerSkuName.DEDICATED))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/EE9BD735-67CE-4A90-89C4-439D3F6A4C93/resourceGroups/rgopenapi/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testidentity", + new UserAssignedIdentity()))) .create(); } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersDeletePrivateEndpointConnectionSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersDeletePrivateEndpointConnectionSamples.java index f4f4b650900ab..9d6a05866f8b5 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersDeletePrivateEndpointConnectionSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersDeletePrivateEndpointConnectionSamples.java @@ -9,7 +9,7 @@ */ public final class SchedulersDeletePrivateEndpointConnectionSamples { /* - * x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Delete_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Delete_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersDeleteSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersDeleteSamples.java index 652d0e42f8a1a..0caa708baf793 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersDeleteSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class SchedulersDeleteSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_Delete.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_Delete.json */ /** * Sample code: Schedulers_Delete. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetByResourceGroupSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetByResourceGroupSamples.java index 4a4dd94a65fa3..9876d91be3358 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetByResourceGroupSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class SchedulersGetByResourceGroupSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_Get.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_Get.json */ /** * Sample code: Schedulers_Get. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateEndpointConnectionSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateEndpointConnectionSamples.java index 09115fcc8d8e7..ad524f799efbe 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateEndpointConnectionSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateEndpointConnectionSamples.java @@ -9,7 +9,7 @@ */ public final class SchedulersGetPrivateEndpointConnectionSamples { /* - * x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Get_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Get_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Get_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateLinkSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateLinkSamples.java index 897be91aaaab0..58fe547787793 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateLinkSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateLinkSamples.java @@ -9,7 +9,7 @@ */ public final class SchedulersGetPrivateLinkSamples { /* - * x-ms-original-file: 2026-02-01/PrivateLinkResources_Get_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateLinkResources_Get_MaximumSet_Gen.json */ /** * Sample code: PrivateLinkResources_Get_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListByResourceGroupSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListByResourceGroupSamples.java index 7606de68d980e..6712f62fe6ad8 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListByResourceGroupSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class SchedulersListByResourceGroupSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_ListByResourceGroup.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_ListByResourceGroup.json */ /** * Sample code: Schedulers_ListByResourceGroup. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateEndpointConnectionsSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateEndpointConnectionsSamples.java index 8dfeadea0270b..c0356efcccaf2 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateEndpointConnectionsSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateEndpointConnectionsSamples.java @@ -9,7 +9,7 @@ */ public final class SchedulersListPrivateEndpointConnectionsSamples { /* - * x-ms-original-file: 2026-02-01/PrivateEndpointConnections_List_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_List_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_List_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateLinksSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateLinksSamples.java index cdb21ebb454c9..985d949d9e08a 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateLinksSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateLinksSamples.java @@ -9,7 +9,7 @@ */ public final class SchedulersListPrivateLinksSamples { /* - * x-ms-original-file: 2026-02-01/PrivateLinkResources_List_MaximumSet_Gen.json + * x-ms-original-file: 2026-07-01-preview/PrivateLinkResources_List_MaximumSet_Gen.json */ /** * Sample code: PrivateLinkResources_List_MaximumSet. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListSamples.java index 6620439c73aff..62e8adf075cec 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersListSamples.java @@ -9,7 +9,7 @@ */ public final class SchedulersListSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_ListBySubscription.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_ListBySubscription.json */ /** * Sample code: Schedulers_ListBySubscription. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersRestartSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersRestartSamples.java new file mode 100644 index 0000000000000..dab1401bfd6dd --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersRestartSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for Schedulers Restart. + */ +public final class SchedulersRestartSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Schedulers_Restart.json + */ + /** + * Sample code: Schedulers_Restart. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void schedulersRestart(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.schedulers().restartWithResponse("rgopenapi", "testscheduler", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersUpdatePrivateEndpointConnectionSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersUpdatePrivateEndpointConnectionSamples.java index 4077a858fe450..68bb0f485d98e 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersUpdatePrivateEndpointConnectionSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersUpdatePrivateEndpointConnectionSamples.java @@ -14,7 +14,7 @@ */ public final class SchedulersUpdatePrivateEndpointConnectionSamples { /* - * x-ms-original-file: 2026-02-01/PrivateEndpointConnections_Update.json + * x-ms-original-file: 2026-07-01-preview/PrivateEndpointConnections_Update.json */ /** * Sample code: PrivateEndpointConnections_Update. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersUpdateSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersUpdateSamples.java index 112419d8d9384..3d57da53055aa 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersUpdateSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/SchedulersUpdateSamples.java @@ -4,6 +4,8 @@ package com.azure.resourcemanager.durabletask.generated; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.Scheduler; import com.azure.resourcemanager.durabletask.models.SchedulerPropertiesUpdate; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; @@ -17,7 +19,7 @@ */ public final class SchedulersUpdateSamples { /* - * x-ms-original-file: 2026-02-01/Schedulers_Update.json + * x-ms-original-file: 2026-07-01-preview/Schedulers_Update.json */ /** * Sample code: Schedulers_Update. @@ -32,6 +34,7 @@ public static void schedulersUpdate(com.azure.resourcemanager.durabletask.Durabl .withTags(mapOf("hello", "world")) .withProperties(new SchedulerPropertiesUpdate().withIpAllowlist(Arrays.asList("10.0.0.0/8")) .withSku(new SchedulerSkuUpdate().withName(SchedulerSkuName.DEDICATED).withCapacity(3))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) .apply(); } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsCreateOrUpdateSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsCreateOrUpdateSamples.java index 9cf56f2b27621..9e0684ce7f260 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsCreateOrUpdateSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsCreateOrUpdateSamples.java @@ -5,13 +5,14 @@ package com.azure.resourcemanager.durabletask.generated; import com.azure.resourcemanager.durabletask.models.TaskHubProperties; +import java.util.Arrays; /** * Samples for TaskHubs CreateOrUpdate. */ public final class TaskHubsCreateOrUpdateSamples { /* - * x-ms-original-file: 2026-02-01/TaskHubs_CreateOrUpdate.json + * x-ms-original-file: 2026-07-01-preview/TaskHubs_CreateOrUpdate.json */ /** * Sample code: TaskHubs_CreateOrUpdate. @@ -22,7 +23,7 @@ public static void taskHubsCreateOrUpdate(com.azure.resourcemanager.durabletask. manager.taskHubs() .define("testtaskhub") .withExistingScheduler("rgopenapi", "testscheduler") - .withProperties(new TaskHubProperties()) + .withProperties(new TaskHubProperties().withCapabilities(Arrays.asList("ExampleFutureCapability"))) .create(); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsDeleteSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsDeleteSamples.java index 94856ee69646e..edbf60d1a62e5 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsDeleteSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class TaskHubsDeleteSamples { /* - * x-ms-original-file: 2026-02-01/TaskHubs_Delete.json + * x-ms-original-file: 2026-07-01-preview/TaskHubs_Delete.json */ /** * Sample code: TaskHubs_Delete. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsGetSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsGetSamples.java index 4edbf5b510691..6cdbed7935816 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsGetSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsGetSamples.java @@ -9,7 +9,7 @@ */ public final class TaskHubsGetSamples { /* - * x-ms-original-file: 2026-02-01/TaskHubs_Get.json + * x-ms-original-file: 2026-07-01-preview/TaskHubs_Get.json */ /** * Sample code: TaskHubs_Get. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsListBySchedulerSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsListBySchedulerSamples.java index 2d8ddbc792419..397def03cb2aa 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsListBySchedulerSamples.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskHubsListBySchedulerSamples.java @@ -9,7 +9,7 @@ */ public final class TaskHubsListBySchedulerSamples { /* - * x-ms-original-file: 2026-02-01/TaskHubs_ListByScheduler.json + * x-ms-original-file: 2026-07-01-preview/TaskHubs_ListByScheduler.json */ /** * Sample code: TaskHubs_ListByScheduler. diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesCreateOrUpdateSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d57fca867ea2b --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesCreateOrUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.resourcemanager.durabletask.models.TaskQueueProperties; +import com.azure.resourcemanager.durabletask.models.TaskQueueThroughput; + +/** + * Samples for TaskQueues CreateOrUpdate. + */ +public final class TaskQueuesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_CreateOrUpdate.json + */ + /** + * Sample code: TaskQueues_CreateOrUpdate. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void taskQueuesCreateOrUpdate(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.taskQueues() + .define("QueueA") + .withExistingTaskHub("rgopenapi", "testscheduler", "testtaskhub") + .withProperties( + new TaskQueueProperties().withThroughput(new TaskQueueThroughput().withActionsPerSecond(40))) + .create(); + } + + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_CreateOrUpdate_MinimumSet.json + */ + /** + * Sample code: TaskQueues_CreateOrUpdate_MinimumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + taskQueuesCreateOrUpdateMinimumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.taskQueues() + .define("QueueA") + .withExistingTaskHub("rgopenapi", "testscheduler", "testtaskhub") + .withProperties(new TaskQueueProperties()) + .create(); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesDeleteSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesDeleteSamples.java new file mode 100644 index 0000000000000..d11464bccdbba --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for TaskQueues Delete. + */ +public final class TaskQueuesDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_Delete.json + */ + /** + * Sample code: TaskQueues_Delete. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void taskQueuesDelete(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.taskQueues() + .delete("rgopenapi", "testscheduler", "testtaskhub", "QueueA", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesGetSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesGetSamples.java new file mode 100644 index 0000000000000..016da5cdd2727 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for TaskQueues Get. + */ +public final class TaskQueuesGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_Get.json + */ + /** + * Sample code: TaskQueues_Get. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void taskQueuesGet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.taskQueues() + .getWithResponse("rgopenapi", "testscheduler", "testtaskhub", "QueueA", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesListByTaskHubSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesListByTaskHubSamples.java new file mode 100644 index 0000000000000..e5ea80c12d973 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesListByTaskHubSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for TaskQueues ListByTaskHub. + */ +public final class TaskQueuesListByTaskHubSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_ListByTaskHub.json + */ + /** + * Sample code: TaskQueues_ListByTaskHub. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void taskQueuesListByTaskHub(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.taskQueues() + .listByTaskHub("rgopenapi", "testscheduler", "testtaskhub", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesUpdateSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesUpdateSamples.java new file mode 100644 index 0000000000000..e5e0434142da3 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.resourcemanager.durabletask.models.TaskQueue; +import com.azure.resourcemanager.durabletask.models.TaskQueueProperties; +import com.azure.resourcemanager.durabletask.models.TaskQueueThroughput; + +/** + * Samples for TaskQueues Update. + */ +public final class TaskQueuesUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TaskQueues_Update.json + */ + /** + * Sample code: TaskQueues_Update. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void taskQueuesUpdate(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + TaskQueue resource = manager.taskQueues() + .getWithResponse("rgopenapi", "testscheduler", "testtaskhub", "QueueA", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new TaskQueueProperties().withThroughput(new TaskQueueThroughput().withActionsPerSecond(80))) + .apply(); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsCreateOrReplaceSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsCreateOrReplaceSamples.java new file mode 100644 index 0000000000000..69ec5c5dbd69c --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsCreateOrReplaceSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.resourcemanager.durabletask.fluent.models.TransparentDataEncryptionInner; +import com.azure.resourcemanager.durabletask.models.TransparentDataEncryptionKeySource; +import com.azure.resourcemanager.durabletask.models.TransparentDataEncryptionProperties; + +/** + * Samples for TransparentDataEncryptions CreateOrReplace. + */ +public final class TransparentDataEncryptionsCreateOrReplaceSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_CreateOrReplace_MaximumSet_Gen.json + */ + /** + * Sample code: TransparentDataEncryptions_CreateOrReplace_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void transparentDataEncryptionsCreateOrReplaceMaximumSet( + com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.transparentDataEncryptions() + .createOrReplace("rgdurabletask", "testscheduler", + new TransparentDataEncryptionInner().withProperties(new TransparentDataEncryptionProperties() + .withKeySource(TransparentDataEncryptionKeySource.CUSTOMER_MANAGED) + .withKeyVaultKeyUri("fakeTokenPlaceholder") + .withAutoRotationEnabled(true)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsDeleteSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsDeleteSamples.java new file mode 100644 index 0000000000000..70e1e6d3efa67 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for TransparentDataEncryptions Delete. + */ +public final class TransparentDataEncryptionsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: TransparentDataEncryptions_Delete_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + transparentDataEncryptionsDeleteMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.transparentDataEncryptions().delete("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsGetSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsGetSamples.java new file mode 100644 index 0000000000000..460027dd1ab0f --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for TransparentDataEncryptions Get. + */ +public final class TransparentDataEncryptionsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_Get_MaximumSet_Gen.json + */ + /** + * Sample code: TransparentDataEncryptions_Get_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void + transparentDataEncryptionsGetMaximumSet(com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.transparentDataEncryptions() + .getWithResponse("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsListBySchedulerSamples.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsListBySchedulerSamples.java new file mode 100644 index 0000000000000..7d40b3fc7a4cf --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/samples/java/com/azure/resourcemanager/durabletask/generated/TransparentDataEncryptionsListBySchedulerSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +/** + * Samples for TransparentDataEncryptions ListByScheduler. + */ +public final class TransparentDataEncryptionsListBySchedulerSamples { + /* + * x-ms-original-file: 2026-07-01-preview/TransparentDataEncryptions_ListByScheduler_MaximumSet_Gen.json + */ + /** + * Sample code: TransparentDataEncryptions_ListByScheduler_MaximumSet. + * + * @param manager Entry point to DurableTaskManager. + */ + public static void transparentDataEncryptionsListBySchedulerMaximumSet( + com.azure.resourcemanager.durabletask.DurableTaskManager manager) { + manager.transparentDataEncryptions() + .listByScheduler("rgdurabletask", "testscheduler", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorDatasetTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorDatasetTests.java new file mode 100644 index 0000000000000..59a40d01106de --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorDatasetTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.DetectorDataset; + +public final class DetectorDatasetTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DetectorDataset model = BinaryData.fromString( + "{\"table\":{\"tableName\":\"oifiyipjxsqwpgr\",\"columns\":[{\"columnName\":\"orcjxvsnby\",\"dataType\":\"abnmocpcyshu\",\"columnType\":\"afbljjgpbtoqcjmk\"},{\"columnName\":\"a\",\"dataType\":\"qidtqajzyu\",\"columnType\":\"kudjkrlkhb\"}],\"rows\":[[\"\\\"datapgzgq\\\"\",\"\\\"dataxzlocxscp\\\"\",\"\\\"dataierhhbcsglummaj\\\"\"],[\"\\\"dataaodxo\\\"\"]]},\"renderingProperties\":{\"type\":4,\"title\":\"k\",\"description\":\"xo\"}}") + .toObject(DetectorDataset.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorInnerTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorInnerTests.java new file mode 100644 index 0000000000000..fb8532f7b0c52 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.fluent.models.DetectorInner; + +public final class DetectorInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DetectorInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Succeeded\",\"metadata\":{\"id\":\"zvgnwzs\",\"name\":\"glzufc\",\"description\":\"kohdbiha\",\"author\":\"fhfcb\",\"category\":\"s\",\"supportTopicList\":[\"th\",\"qhabifpikxwcz\",\"yscnpqxu\"],\"analysisTypes\":[\"y\"],\"type\":\"CategoryOverview\",\"score\":6.0032639369011935},\"dataset\":[{\"table\":{\"tableName\":\"vd\",\"columns\":[{},{},{}],\"rows\":[[\"\\\"datafwvuk\\\"\",\"\\\"datagaudcc\\\"\",\"\\\"datanhsjcnyej\\\"\"]]},\"renderingProperties\":{\"type\":7,\"title\":\"tnapczwlokjyemkk\",\"description\":\"ipjoxzjnchgejs\"}},{\"table\":{\"tableName\":\"mailzydehojw\",\"columns\":[{},{},{}],\"rows\":[[\"\\\"datanpmqnjaqwixjspro\\\"\"],[\"\\\"datacputegjvwmfdats\\\"\",\"\\\"datamdvpjhulsu\\\"\"],[\"\\\"datamkjozkrwf\\\"\",\"\\\"datadio\\\"\",\"\\\"datajpslwejd\\\"\",\"\\\"datavwryoqpso\\\"\"]]},\"renderingProperties\":{\"type\":3,\"title\":\"zakljlahbc\",\"description\":\"ffdfdosygexpa\"}}],\"status\":{\"message\":\"khmsbz\",\"statusId\":3}},\"id\":\"zevdphlx\",\"name\":\"olthqtrgqjbp\",\"type\":\"zfsinzgvf\"}") + .toObject(DetectorInner.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorListResultTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorListResultTests.java new file mode 100644 index 0000000000000..2f157fe1d5147 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.implementation.models.DetectorListResult; +import org.junit.jupiter.api.Assertions; + +public final class DetectorListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DetectorListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"metadata\":{\"id\":\"kw\",\"name\":\"eicxmqciwqvhkhi\",\"description\":\"igdtopbob\",\"author\":\"ghmewuam\",\"category\":\"hrzayvvtpgvdf\",\"supportTopicList\":[\"tkftutqxlngx\",\"efgugnxk\",\"xdqmidtthzrvqdra\",\"hjybigehoqfbo\"],\"analysisTypes\":[\"anyktzlcuiywg\",\"ywgndrv\",\"nhzgpphrcgyn\",\"ocpecfvmmco\"],\"type\":\"Analysis\",\"score\":70.36963741674408},\"dataset\":[{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"jqabcypmivkwlzuv\",\"statusId\":0}},\"id\":\"nfnbacfionlebxe\",\"name\":\"qgtz\",\"type\":\"dpnqbq\"},{\"properties\":{\"provisioningState\":\"Failed\",\"metadata\":{\"id\":\"eallnwsubisnj\",\"name\":\"pmng\",\"description\":\"scxaq\",\"author\":\"ochcbonqvpkvl\",\"category\":\"njeaseipheofloke\",\"supportTopicList\":[\"enjbdlwtgrhp\",\"jp\",\"umasxazjpq\"],\"analysisTypes\":[\"ualhbxxhejj\"],\"type\":\"CategoryOverview\",\"score\":61.968004063723214},\"dataset\":[{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}},{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"mcy\",\"statusId\":3}},\"id\":\"bjnpg\",\"name\":\"cftadeh\",\"type\":\"nltyfsoppusuesnz\"},{\"properties\":{\"provisioningState\":\"Provisioning\",\"metadata\":{\"id\":\"vorxzdmohct\",\"name\":\"vudwx\",\"description\":\"dnvowg\",\"author\":\"jugwdkcglhsl\",\"category\":\"jdyggdtji\",\"supportTopicList\":[\"kuofqweykhme\"],\"analysisTypes\":[\"fyexfwhy\",\"cibvyvdcsitynn\"],\"type\":\"Detector\",\"score\":36.160146747587476},\"dataset\":[{\"table\":{},\"renderingProperties\":{}}],\"status\":{\"message\":\"scjeypv\",\"statusId\":1}},\"id\":\"kgqhcjrefovg\",\"name\":\"kqsleyyvxy\",\"type\":\"jpkcattpng\"}],\"nextLink\":\"rcczsqpjhvmd\"}") + .toObject(DetectorListResult.class); + Assertions.assertEquals("rcczsqpjhvmd", model.nextLink()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorMetadataTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorMetadataTests.java new file mode 100644 index 0000000000000..fb72a1ca1211b --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorMetadataTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.DetectorMetadata; + +public final class DetectorMetadataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DetectorMetadata model = BinaryData.fromString( + "{\"id\":\"nteiwaopv\",\"name\":\"ijcmmx\",\"description\":\"ufufsrp\",\"author\":\"zidnsezcxtbzsgfy\",\"category\":\"sne\",\"supportTopicList\":[\"wzjeiach\",\"oosflnr\",\"sfqpteehz\"],\"analysisTypes\":[\"pyqr\",\"mzinpvswjdk\",\"rsoodqxhcrmnoh\"],\"type\":\"Analysis\",\"score\":65.91078195049245}") + .toObject(DetectorMetadata.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorPropertiesTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorPropertiesTests.java new file mode 100644 index 0000000000000..f6a93f89984a5 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.DetectorProperties; + +public final class DetectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DetectorProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Deleting\",\"metadata\":{\"id\":\"oxxjtfelluwf\",\"name\":\"tonpe\",\"description\":\"pjkjlxofpdv\",\"author\":\"fxxypininmayhuy\",\"category\":\"kpode\",\"supportTopicList\":[\"ginuvamih\",\"ognarxzxtheotus\",\"vyevcciqi\",\"nhungbw\"],\"analysisTypes\":[\"nfygxgispemvtz\",\"kufubljo\",\"xqeofjaeqjhqjba\"],\"type\":\"Analysis\",\"score\":53.99528476021299},\"dataset\":[{\"table\":{\"tableName\":\"gsntnbybkzgcwr\",\"columns\":[{\"columnName\":\"xwrljdouskcqvkoc\",\"dataType\":\"jdkwtnhxbnjb\",\"columnType\":\"sqrglssainq\"},{\"columnName\":\"wnzlljfmppeeb\",\"dataType\":\"gxsabkyq\",\"columnType\":\"ujitcjcz\"},{\"columnName\":\"evndh\",\"dataType\":\"wpdappdsbdkv\",\"columnType\":\"wjfeusnhutjel\"},{\"columnName\":\"rl\",\"dataType\":\"ugjzzdatqxhocdge\",\"columnType\":\"lgphu\"}],\"rows\":[[\"\\\"datadvkaozw\\\"\"],[\"\\\"dataftyhxhurokf\\\"\"],[\"\\\"dataxolniwpwcukjfk\\\"\",\"\\\"dataiawxklry\\\"\"],[\"\\\"datawckbasyypnd\\\"\",\"\\\"datahsgcbacphejkot\\\"\",\"\\\"datanqgoulzndli\\\"\",\"\\\"datawyqkgfgibm\\\"\"]]},\"renderingProperties\":{\"type\":2,\"title\":\"eqsrxybzqqedqyt\",\"description\":\"iqfouflmmnkz\"}},{\"table\":{\"tableName\":\"dmgloug\",\"columns\":[{\"columnName\":\"tmut\",\"dataType\":\"qktapspwgcuert\",\"columnType\":\"kdosvqw\"},{\"columnName\":\"mdgbbjfdd\",\"dataType\":\"bmbexppbhtqqro\",\"columnType\":\"p\"},{\"columnName\":\"s\",\"dataType\":\"gbquxigj\",\"columnType\":\"gzjaoyfhrtxilne\"},{\"columnName\":\"ujysvle\",\"dataType\":\"vfqawrlyxwjkcpr\",\"columnType\":\"wbxgjvt\"}],\"rows\":[[\"\\\"datasszdnru\\\"\",\"\\\"dataqguhmuo\\\"\",\"\\\"dataqfprwzwbn\\\"\",\"\\\"datauitnwuiz\\\"\"]]},\"renderingProperties\":{\"type\":3,\"title\":\"fizuckyf\",\"description\":\"rfidfvzwdz\"}}],\"status\":{\"message\":\"ymwisdkft\",\"statusId\":4}}") + .toObject(DetectorProperties.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorRenderingPropertiesTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorRenderingPropertiesTests.java new file mode 100644 index 0000000000000..47f5199cecdfc --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorRenderingPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.DetectorRenderingProperties; + +public final class DetectorRenderingPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DetectorRenderingProperties model + = BinaryData.fromString("{\"type\":1,\"title\":\"ndei\",\"description\":\"twnpzaoqvuhrhcf\"}") + .toObject(DetectorRenderingProperties.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorStatusTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorStatusTests.java new file mode 100644 index 0000000000000..b080307e91468 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorStatusTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.DetectorStatus; + +public final class DetectorStatusTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DetectorStatus model + = BinaryData.fromString("{\"message\":\"yd\",\"statusId\":4}").toObject(DetectorStatus.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorTableColumnTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorTableColumnTests.java new file mode 100644 index 0000000000000..60ae7def9c92d --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorTableColumnTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.DetectorTableColumn; + +public final class DetectorTableColumnTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DetectorTableColumn model = BinaryData + .fromString("{\"columnName\":\"c\",\"dataType\":\"xhvpmoue\",\"columnType\":\"dzxibqeojnxqbzvd\"}") + .toObject(DetectorTableColumn.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorTableTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorTableTests.java new file mode 100644 index 0000000000000..e877dea251932 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorTableTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.DetectorTable; + +public final class DetectorTableTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DetectorTable model = BinaryData.fromString( + "{\"tableName\":\"jionpimexgstxgc\",\"columns\":[{\"columnName\":\"maajrmvdjwzrlo\",\"dataType\":\"clwhijcoejctbz\",\"columnType\":\"s\"}],\"rows\":[[\"\\\"databkbfkgukdkex\\\"\",\"\\\"datappofmxaxcfjpgdd\\\"\"]]}") + .toObject(DetectorTable.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorsGetWithResponseMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorsGetWithResponseMockTests.java new file mode 100644 index 0000000000000..7bc6af2ea664c --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorsGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.Detector; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DetectorsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Deleting\",\"metadata\":{\"id\":\"wuaanoz\",\"name\":\"sphyoulpjrvxa\",\"description\":\"rvimjwosytxitcsk\",\"author\":\"k\",\"category\":\"umiekkezzi\",\"supportTopicList\":[\"yf\"],\"analysisTypes\":[\"gqggebdunygae\",\"idb\",\"fatpxllrxcyjmoa\"],\"type\":\"CategoryOverview\",\"score\":16.66952081875227},\"dataset\":[{\"table\":{\"tableName\":\"mjsjqb\",\"columns\":[{},{},{},{}],\"rows\":[[]]},\"renderingProperties\":{\"type\":3,\"title\":\"yc\",\"description\":\"uhpkxkgymar\"}},{\"table\":{\"tableName\":\"ajxq\",\"columns\":[{},{}],\"rows\":[[]]},\"renderingProperties\":{\"type\":7,\"title\":\"eddgssofw\",\"description\":\"zqalkrmnjijpx\"}},{\"table\":{\"tableName\":\"qudf\",\"columns\":[{},{},{},{}],\"rows\":[[]]},\"renderingProperties\":{\"type\":4,\"title\":\"jyvayffimrzrtuz\",\"description\":\"gsexne\"}}],\"status\":{\"message\":\"nwnwme\",\"statusId\":1}},\"id\":\"yceuzsoib\",\"name\":\"ud\",\"type\":\"frxtrthzvaytdwk\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Detector response = manager.detectors() + .getWithResponse("lpcirelsf", "aenwabf", "tkl", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorsListBySchedulerMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorsListBySchedulerMockTests.java new file mode 100644 index 0000000000000..a49eec94b4a13 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/DetectorsListBySchedulerMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.Detector; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class DetectorsListBySchedulerMockTests { + @Test + public void testListByScheduler() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"metadata\":{\"id\":\"oaxoruzfgsqu\",\"name\":\"xrxxlep\",\"description\":\"amxjezwlw\",\"author\":\"xuqlcvydypat\",\"category\":\"oa\",\"supportTopicList\":[\"niodkooeb\",\"nuj\"],\"analysisTypes\":[\"msbvdkcrodtjinf\",\"jlfltkacjvefkdlf\",\"akggkfpag\",\"owpulpq\"],\"type\":\"CategoryOverview\",\"score\":2.2674584537275333},\"dataset\":[{\"table\":{\"tableName\":\"nsj\",\"columns\":[{}],\"rows\":[[],[],[],[]]},\"renderingProperties\":{\"type\":2,\"title\":\"dszue\",\"description\":\"sbzkf\"}}],\"status\":{\"message\":\"yvpnqicvinvkjj\",\"statusId\":1}},\"id\":\"buukzclewyhml\",\"name\":\"paztzpofncck\",\"type\":\"yfzqwhxxbu\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.detectors().listByScheduler("brqubp", "xhexiilivpdti", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstanceInnerTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstanceInnerTests.java new file mode 100644 index 0000000000000..182931c8cda06 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstanceInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; +import com.azure.resourcemanager.durabletask.models.FailoverInstanceProperties; +import org.junit.jupiter.api.Assertions; + +public final class FailoverInstanceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FailoverInstanceInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Canceled\",\"replicationRole\":\"Primary\",\"failoverState\":\"None\",\"partnerSchedulerResourceId\":\"ntorzihleosjswsr\",\"partnerSchedulerLocation\":\"lyzrpzbchckqqzqi\"},\"id\":\"iysui\",\"name\":\"zynkedya\",\"type\":\"rwyhqmibzyhwitsm\"}") + .toObject(FailoverInstanceInner.class); + Assertions.assertEquals("ntorzihleosjswsr", model.properties().partnerSchedulerResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FailoverInstanceInner model = new FailoverInstanceInner() + .withProperties(new FailoverInstanceProperties().withPartnerSchedulerResourceId("ntorzihleosjswsr")); + model = BinaryData.fromObject(model).toObject(FailoverInstanceInner.class); + Assertions.assertEquals("ntorzihleosjswsr", model.properties().partnerSchedulerResourceId()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstanceListResultTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstanceListResultTests.java new file mode 100644 index 0000000000000..72ac88b088b07 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstanceListResultTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.implementation.models.FailoverInstanceListResult; +import org.junit.jupiter.api.Assertions; + +public final class FailoverInstanceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FailoverInstanceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Provisioning\",\"replicationRole\":\"Secondary\",\"failoverState\":\"Failed\",\"partnerSchedulerResourceId\":\"dmtnc\",\"partnerSchedulerLocation\":\"kotl\"},\"id\":\"d\",\"name\":\"h\",\"type\":\"syocogjltdtbnnha\"},{\"properties\":{\"provisioningState\":\"Updating\",\"replicationRole\":\"Primary\",\"failoverState\":\"InProgress\",\"partnerSchedulerResourceId\":\"ikhnvpamqgxqq\",\"partnerSchedulerLocation\":\"zikywgg\"},\"id\":\"allatmelwuipic\",\"name\":\"jzkzi\",\"type\":\"gvvcnayrhyr\"},{\"properties\":{\"provisioningState\":\"Updating\",\"replicationRole\":\"Secondary\",\"failoverState\":\"Failed\",\"partnerSchedulerResourceId\":\"ndrdvstkwq\",\"partnerSchedulerLocation\":\"chea\"},\"id\":\"fmtdaaygdvwvgp\",\"name\":\"ohgwxrtfudxepxg\",\"type\":\"qagvrvm\"}],\"nextLink\":\"k\"}") + .toObject(FailoverInstanceListResult.class); + Assertions.assertEquals("dmtnc", model.value().get(0).properties().partnerSchedulerResourceId()); + Assertions.assertEquals("k", model.nextLink()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancePropertiesTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancePropertiesTests.java new file mode 100644 index 0000000000000..df7f3c42929c8 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancePropertiesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.FailoverInstanceProperties; +import org.junit.jupiter.api.Assertions; + +public final class FailoverInstancePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FailoverInstanceProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Succeeded\",\"replicationRole\":\"Secondary\",\"failoverState\":\"None\",\"partnerSchedulerResourceId\":\"dpumnzgmw\",\"partnerSchedulerLocation\":\"mabiknsorgjhxb\"}") + .toObject(FailoverInstanceProperties.class); + Assertions.assertEquals("dpumnzgmw", model.partnerSchedulerResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FailoverInstanceProperties model = new FailoverInstanceProperties().withPartnerSchedulerResourceId("dpumnzgmw"); + model = BinaryData.fromObject(model).toObject(FailoverInstanceProperties.class); + Assertions.assertEquals("dpumnzgmw", model.partnerSchedulerResourceId()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesCreateOrReplaceMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesCreateOrReplaceMockTests.java new file mode 100644 index 0000000000000..399df330f9fc4 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesCreateOrReplaceMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.fluent.models.FailoverInstanceInner; +import com.azure.resourcemanager.durabletask.models.FailoverInstance; +import com.azure.resourcemanager.durabletask.models.FailoverInstanceProperties; +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 FailoverInstancesCreateOrReplaceMockTests { + @Test + public void testCreateOrReplace() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"replicationRole\":\"Primary\",\"failoverState\":\"InProgress\",\"partnerSchedulerResourceId\":\"epnylbfu\",\"partnerSchedulerLocation\":\"lyjt\"},\"id\":\"of\",\"name\":\"zhvfcibyfmowuxr\",\"type\":\"jpvd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FailoverInstance response = manager.failoverInstances() + .createOrReplace("g", "ddrihpf", + new FailoverInstanceInner() + .withProperties(new FailoverInstanceProperties().withPartnerSchedulerResourceId("dao")), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("epnylbfu", response.properties().partnerSchedulerResourceId()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesFailoverMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesFailoverMockTests.java new file mode 100644 index 0000000000000..c1dbe5d279773 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesFailoverMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.FailoverInstance; +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 FailoverInstancesFailoverMockTests { + @Test + public void testFailover() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"replicationRole\":\"Primary\",\"failoverState\":\"Succeeded\",\"partnerSchedulerResourceId\":\"vpglydz\",\"partnerSchedulerLocation\":\"rvqeevtoepryutn\"},\"id\":\"tpzdmovzvfvaawzq\",\"name\":\"dflgzuri\",\"type\":\"laecxndticok\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FailoverInstance response + = manager.failoverInstances().failover("ztcktyh", "tqedcgzulwm", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("vpglydz", response.properties().partnerSchedulerResourceId()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesForceFailoverAllowDataLossMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesForceFailoverAllowDataLossMockTests.java new file mode 100644 index 0000000000000..f4205c6109cee --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesForceFailoverAllowDataLossMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.FailoverInstance; +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 FailoverInstancesForceFailoverAllowDataLossMockTests { + @Test + public void testForceFailoverAllowDataLoss() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"replicationRole\":\"Primary\",\"failoverState\":\"None\",\"partnerSchedulerResourceId\":\"kciayzri\",\"partnerSchedulerLocation\":\"hya\"},\"id\":\"vjlboxqvk\",\"name\":\"lmxhomdyn\",\"type\":\"dwdigumb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FailoverInstance response = manager.failoverInstances() + .forceFailoverAllowDataLoss("vzm", "qtmldgxo", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("kciayzri", response.properties().partnerSchedulerResourceId()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesGetWithResponseMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesGetWithResponseMockTests.java new file mode 100644 index 0000000000000..92113e4181eed --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.FailoverInstance; +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 FailoverInstancesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Deleting\",\"replicationRole\":\"Primary\",\"failoverState\":\"Failed\",\"partnerSchedulerResourceId\":\"evwrdnhfuk\",\"partnerSchedulerLocation\":\"sjcswsmystuluqyp\"},\"id\":\"vlerchpqbmfpjba\",\"name\":\"widf\",\"type\":\"xsspuunnoxyhk\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FailoverInstance response = manager.failoverInstances() + .getWithResponse("fnczdwvvbalx", "l", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("evwrdnhfuk", response.properties().partnerSchedulerResourceId()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesListBySchedulerMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesListBySchedulerMockTests.java new file mode 100644 index 0000000000000..1ecbc8bcd3cc3 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/FailoverInstancesListBySchedulerMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.FailoverInstance; +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 FailoverInstancesListBySchedulerMockTests { + @Test + public void testListByScheduler() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"replicationRole\":\"Secondary\",\"failoverState\":\"InProgress\",\"partnerSchedulerResourceId\":\"trnegvmnvuqeqvld\",\"partnerSchedulerLocation\":\"astjbkkdmflvestm\"},\"id\":\"xrrilozapee\",\"name\":\"chpxlktwku\",\"type\":\"iycslevuf\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.failoverInstances().listByScheduler("xfzwi", "vwzjbhyz", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("trnegvmnvuqeqvld", + response.iterator().next().properties().partnerSchedulerResourceId()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/ManagedServiceIdentityTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/ManagedServiceIdentityTests.java new file mode 100644 index 0000000000000..5074482d8f073 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/ManagedServiceIdentityTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.durabletask.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedServiceIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedServiceIdentity model = BinaryData.fromString( + "{\"principalId\":\"bavxbniwdjswzt\",\"tenantId\":\"bpg\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"wtctyqi\":{\"principalId\":\"hpzxbzpfzab\",\"clientId\":\"cuh\"}}}") + .toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("wtctyqi", new UserAssignedIdentity())); + model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/OperationsListMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/OperationsListMockTests.java index dc41a9337ec24..02d82d111c3d3 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/OperationsListMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/OperationsListMockTests.java @@ -21,7 +21,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"qrvkdv\",\"isDataAction\":false,\"display\":{\"provider\":\"mvvd\",\"resource\":\"atkpnp\",\"operation\":\"exxbczwtr\",\"description\":\"iqzbq\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"ghimdblx\",\"isDataAction\":true,\"display\":{\"provider\":\"njhf\",\"resource\":\"wmszkk\",\"operation\":\"qreyfkzi\",\"description\":\"jawneaiv\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/OptionalPropertiesUpdateablePropertiesTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/OptionalPropertiesUpdateablePropertiesTests.java index d7985d459a660..46a83baa522ab 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/OptionalPropertiesUpdateablePropertiesTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/OptionalPropertiesUpdateablePropertiesTests.java @@ -15,12 +15,12 @@ public final class OptionalPropertiesUpdateablePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OptionalPropertiesUpdateableProperties model = BinaryData.fromString( - "{\"privateEndpoint\":{\"id\":\"hjq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"icxm\",\"actionsRequired\":\"iwqvhkh\"}}") + "{\"privateEndpoint\":{\"id\":\"ytjrybnwjewgdr\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"aen\",\"actionsRequired\":\"eh\"}}") .toObject(OptionalPropertiesUpdateableProperties.class); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("icxm", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("iwqvhkh", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("aen", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("eh", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test @@ -29,12 +29,12 @@ public void testSerialize() throws Exception { = new OptionalPropertiesUpdateableProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("icxm") - .withActionsRequired("iwqvhkh")); + .withDescription("aen") + .withActionsRequired("eh")); model = BinaryData.fromObject(model).toObject(OptionalPropertiesUpdateableProperties.class); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("icxm", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("iwqvhkh", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("aen", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("eh", model.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionInnerTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionInnerTests.java index 5cb2b32edb708..d014c9892218f 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionInnerTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionInnerTests.java @@ -16,12 +16,13 @@ public final class PrivateEndpointConnectionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"groupIds\":[\"wclxxwrl\",\"douskcqvkocrcjdk\",\"tnhxbn\"],\"privateEndpoint\":{\"id\":\"ksqrglssai\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"wnzlljfmppeeb\",\"actionsRequired\":\"gxsabkyq\"},\"provisioningState\":\"Creating\"},\"id\":\"itcjczdz\",\"name\":\"vndhkrwpdapp\",\"type\":\"sbdkvwr\"}") + "{\"properties\":{\"groupIds\":[\"pikad\",\"gvtqagnbuynh\",\"jggmebfsiarbu\"],\"privateEndpoint\":{\"id\":\"vpnazzm\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"nmpxttdb\",\"actionsRequired\":\"bnlankxmyskpb\"},\"provisioningState\":\"Failed\"},\"id\":\"tkcxywnytnrsy\",\"name\":\"lqidyby\",\"type\":\"czfc\"}") .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("wnzlljfmppeeb", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("gxsabkyq", model.properties().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("nmpxttdb", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("bnlankxmyskpb", + model.properties().privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test @@ -30,13 +31,14 @@ public void testSerialize() throws Exception { = new PrivateEndpointConnectionInner() .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("wnzlljfmppeeb") - .withActionsRequired("gxsabkyq"))); + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("nmpxttdb") + .withActionsRequired("bnlankxmyskpb"))); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("wnzlljfmppeeb", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("gxsabkyq", model.properties().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("nmpxttdb", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("bnlankxmyskpb", + model.properties().privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionListResultTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionListResultTests.java index bd907b8f05775..24fafddc8e54a 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionListResultTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionListResultTests.java @@ -13,14 +13,14 @@ public final class PrivateEndpointConnectionListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupIds\":[\"dtopbob\",\"og\",\"m\"],\"privateEndpoint\":{\"id\":\"a\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"rzayv\",\"actionsRequired\":\"pgvdf\"},\"provisioningState\":\"Failed\"},\"id\":\"kftutqxlngxlefg\",\"name\":\"gnxkrxdqmidtth\",\"type\":\"rvqdra\"},{\"properties\":{\"groupIds\":[\"big\"],\"privateEndpoint\":{\"id\":\"qfbow\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"yktz\",\"actionsRequired\":\"u\"},\"provisioningState\":\"Creating\"},\"id\":\"qyw\",\"name\":\"ndrvynhzg\",\"type\":\"phrcgyncoc\"},{\"properties\":{\"groupIds\":[\"vmmcoofs\"],\"privateEndpoint\":{\"id\":\"evgbmqjq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"pmivkwlzu\",\"actionsRequired\":\"c\"},\"provisioningState\":\"Failed\"},\"id\":\"nbacfi\",\"name\":\"nlebxetqgtzxd\",\"type\":\"nqbqqwxr\"}],\"nextLink\":\"eallnwsubisnj\"}") + "{\"value\":[{\"properties\":{\"groupIds\":[\"gmifthnzd\"],\"privateEndpoint\":{\"id\":\"l\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"qig\",\"actionsRequired\":\"duhavhqlkt\"},\"provisioningState\":\"Failed\"},\"id\":\"qolbgyc\",\"name\":\"uie\",\"type\":\"tgccymvaolpss\"},{\"properties\":{\"groupIds\":[\"mmdnbbglzps\",\"iydmcwyhzdxs\"],\"privateEndpoint\":{\"id\":\"bzmnvdfznud\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"xzb\",\"actionsRequired\":\"blylpstdbh\"},\"provisioningState\":\"Failed\"},\"id\":\"zdzucerscdntnevf\",\"name\":\"wjmy\",\"type\":\"tdss\"},{\"properties\":{\"groupIds\":[\"mweriofzpy\",\"semwabnet\",\"hhszh\"],\"privateEndpoint\":{\"id\":\"lvwiwubmwmbesl\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"wtppjflcxogaoko\",\"actionsRequired\":\"m\"},\"provisioningState\":\"Deleting\"},\"id\":\"vmkqzeqq\",\"name\":\"dltfz\",\"type\":\"mhhv\"},{\"properties\":{\"groupIds\":[\"eodkwobda\"],\"privateEndpoint\":{\"id\":\"ibqdxbxwakbogqx\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"zgx\",\"actionsRequired\":\"ripl\"},\"provisioningState\":\"Creating\"},\"id\":\"xunkbebxmubyynt\",\"name\":\"lrb\",\"type\":\"tkoievseotgq\"}],\"nextLink\":\"ltmuwlauwzizx\"}") .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("rzayv", + Assertions.assertEquals("qig", model.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("pgvdf", + Assertions.assertEquals("duhavhqlkt", model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("eallnwsubisnj", model.nextLink()); + Assertions.assertEquals("ltmuwlauwzizx", model.nextLink()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionPropertiesTests.java index d87fc2e561ad3..9a5d99940cd47 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionPropertiesTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionPropertiesTests.java @@ -15,12 +15,12 @@ public final class PrivateEndpointConnectionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"groupIds\":[\"eusnhutj\",\"ltmrldh\"],\"privateEndpoint\":{\"id\":\"zzd\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"hocdgeab\",\"actionsRequired\":\"phut\"},\"provisioningState\":\"Succeeded\"}") + "{\"groupIds\":[\"axdbabph\",\"wrqlfktsthsuco\",\"mnyyazt\",\"bt\"],\"privateEndpoint\":{\"id\":\"qpuedckzywbiex\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ue\",\"actionsRequired\":\"ibx\"},\"provisioningState\":\"Creating\"}") .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hocdgeab", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("phut", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("ue", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("ibx", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test @@ -28,13 +28,13 @@ public void testSerialize() throws Exception { PrivateEndpointConnectionProperties model = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("hocdgeab") - .withActionsRequired("phut")); + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("ue") + .withActionsRequired("ibx")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hocdgeab", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("phut", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("ue", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("ibx", model.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionUpdateTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionUpdateTests.java index 78a58625943df..ab7c160e0633d 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionUpdateTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointConnectionUpdateTests.java @@ -16,12 +16,12 @@ public final class PrivateEndpointConnectionUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionUpdate model = BinaryData.fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"eojnxqbzvddn\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"icbtwnpzao\",\"actionsRequired\":\"uhrhcffcyddgl\"}}}") + "{\"properties\":{\"privateEndpoint\":{\"id\":\"pvjzbe\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"nfqqnvwp\",\"actionsRequired\":\"taruoujmkcj\"}}}") .toObject(PrivateEndpointConnectionUpdate.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("icbtwnpzao", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("uhrhcffcyddgl", + Assertions.assertEquals("nfqqnvwp", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("taruoujmkcj", model.properties().privateLinkServiceConnectionState().actionsRequired()); } @@ -31,14 +31,14 @@ public void testSerialize() throws Exception { = new PrivateEndpointConnectionUpdate() .withProperties(new OptionalPropertiesUpdateableProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("icbtwnpzao") - .withActionsRequired("uhrhcffcyddgl"))); + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("nfqqnvwp") + .withActionsRequired("taruoujmkcj"))); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionUpdate.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("icbtwnpzao", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("uhrhcffcyddgl", + Assertions.assertEquals("nfqqnvwp", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("taruoujmkcj", model.properties().privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointTests.java index 523125be7329f..25d864f72b740 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateEndpointTests.java @@ -10,7 +10,7 @@ public final class PrivateEndpointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"vkaozwyiftyhxhur\"}").toObject(PrivateEndpoint.class); + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"hqwa\"}").toObject(PrivateEndpoint.class); } @org.junit.jupiter.api.Test diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateLinkResourcePropertiesTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateLinkResourcePropertiesTests.java index 95cf9e21c8bf7..fedcaa536f5f5 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateLinkResourcePropertiesTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateLinkResourcePropertiesTests.java @@ -12,8 +12,8 @@ public final class PrivateLinkResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"hurzafblj\",\"requiredMembers\":[\"btoqcjmkljavbqid\",\"qajzyulpkudjkr\",\"khbzhfepgzg\"],\"requiredZoneNames\":[\"zloc\",\"scpai\",\"rhhbcs\"]}") + "{\"groupId\":\"xyawj\",\"requiredMembers\":[\"qcslyjpkiid\"],\"requiredZoneNames\":[\"xznelixhnrztf\",\"lhbnxkna\",\"aulppggd\"]}") .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("zloc", model.requiredZoneNames().get(0)); + Assertions.assertEquals("xznelixhnrztf", model.requiredZoneNames().get(0)); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateLinkServiceConnectionStateTests.java index 0ccb488a8ba51..e2ae73c471339 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateLinkServiceConnectionStateTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/PrivateLinkServiceConnectionStateTests.java @@ -13,22 +13,22 @@ public final class PrivateLinkServiceConnectionStateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkServiceConnectionState model = BinaryData - .fromString("{\"status\":\"Rejected\",\"description\":\"yxolniwp\",\"actionsRequired\":\"ukjfkgiawxklr\"}") + .fromString("{\"status\":\"Rejected\",\"description\":\"yoxa\",\"actionsRequired\":\"dkzjancuxrh\"}") .toObject(PrivateLinkServiceConnectionState.class); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("yxolniwp", model.description()); - Assertions.assertEquals("ukjfkgiawxklr", model.actionsRequired()); + Assertions.assertEquals("yoxa", model.description()); + Assertions.assertEquals("dkzjancuxrh", model.actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PrivateLinkServiceConnectionState model = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("yxolniwp") - .withActionsRequired("ukjfkgiawxklr"); + .withDescription("yoxa") + .withActionsRequired("dkzjancuxrh"); model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("yxolniwp", model.description()); - Assertions.assertEquals("ukjfkgiawxklr", model.actionsRequired()); + Assertions.assertEquals("yoxa", model.description()); + Assertions.assertEquals("dkzjancuxrh", model.actionsRequired()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesCreateOrReplaceMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesCreateOrReplaceMockTests.java index 8c4aaf21bcd60..508d5bb1d82a5 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesCreateOrReplaceMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesCreateOrReplaceMockTests.java @@ -26,7 +26,7 @@ public final class RetentionPoliciesCreateOrReplaceMockTests { @Test public void testCreateOrReplace() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"retentionPolicies\":[{\"retentionPeriodInDays\":681452902,\"orchestrationState\":\"Completed\"},{\"retentionPeriodInDays\":181978704,\"orchestrationState\":\"Failed\"},{\"retentionPeriodInDays\":1627840881,\"orchestrationState\":\"Canceled\"},{\"retentionPeriodInDays\":372150678,\"orchestrationState\":\"Completed\"}]},\"id\":\"dslgnayqigynduh\",\"name\":\"vhqlkthumaqo\",\"type\":\"bgycduiertgccym\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"retentionPolicies\":[{\"retentionPeriodInDays\":451636472,\"orchestrationState\":\"Completed\"},{\"retentionPeriodInDays\":42103028,\"orchestrationState\":\"Failed\"}]},\"id\":\"xrxc\",\"name\":\"juisavokqdzf\",\"type\":\"azivjlfrqttbajl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,20 +36,13 @@ public void testCreateOrReplace() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RetentionPolicy response = manager.retentionPolicies() - .createOrReplace("tpvjzbexilzznfqq", "vwpm", - new RetentionPolicyInner() - .withProperties(new RetentionPolicyProperties().withRetentionPolicies(Arrays.asList( - new RetentionPolicyDetails().withRetentionPeriodInDays(477944589) - .withOrchestrationState(PurgeableOrchestrationState.CANCELED), - new RetentionPolicyDetails().withRetentionPeriodInDays(1757000388) - .withOrchestrationState(PurgeableOrchestrationState.TERMINATED), - new RetentionPolicyDetails().withRetentionPeriodInDays(1426920839) - .withOrchestrationState(PurgeableOrchestrationState.CANCELED), - new RetentionPolicyDetails().withRetentionPeriodInDays(1420775781) - .withOrchestrationState(PurgeableOrchestrationState.CANCELED)))), + .createOrReplace("fgcviz", "zdwlvwlyoupfgfb", + new RetentionPolicyInner().withProperties(new RetentionPolicyProperties().withRetentionPolicies( + Arrays.asList(new RetentionPolicyDetails().withRetentionPeriodInDays(1764617188) + .withOrchestrationState(PurgeableOrchestrationState.COMPLETED)))), com.azure.core.util.Context.NONE); - Assertions.assertEquals(681452902, response.properties().retentionPolicies().get(0).retentionPeriodInDays()); + Assertions.assertEquals(451636472, response.properties().retentionPolicies().get(0).retentionPeriodInDays()); Assertions.assertEquals(PurgeableOrchestrationState.COMPLETED, response.properties().retentionPolicies().get(0).orchestrationState()); } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesGetWithResponseMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesGetWithResponseMockTests.java index 2f555960f8720..ee2df48c2af24 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesGetWithResponseMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesGetWithResponseMockTests.java @@ -22,7 +22,7 @@ public final class RetentionPoliciesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Updating\",\"retentionPolicies\":[{\"retentionPeriodInDays\":540005244,\"orchestrationState\":\"Completed\"}]},\"id\":\"xb\",\"name\":\"ybsrfbjfdtwss\",\"type\":\"t\"}"; + = "{\"properties\":{\"provisioningState\":\"Accepted\",\"retentionPolicies\":[{\"retentionPeriodInDays\":427314565,\"orchestrationState\":\"Terminated\"}]},\"id\":\"joxoism\",\"name\":\"ksbpimlqoljx\",\"type\":\"cgxxlxs\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,11 +32,11 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RetentionPolicy response = manager.retentionPolicies() - .getWithResponse("hxcr", "bfovasrruvwbhsq", com.azure.core.util.Context.NONE) + .getWithResponse("rwfscjfnynszquj", "zdvoqytibyowbb", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(540005244, response.properties().retentionPolicies().get(0).retentionPeriodInDays()); - Assertions.assertEquals(PurgeableOrchestrationState.COMPLETED, + Assertions.assertEquals(427314565, response.properties().retentionPolicies().get(0).retentionPeriodInDays()); + Assertions.assertEquals(PurgeableOrchestrationState.TERMINATED, response.properties().retentionPolicies().get(0).orchestrationState()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesListBySchedulerMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesListBySchedulerMockTests.java index 901a80cb2433d..b142e95c9c13e 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesListBySchedulerMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesListBySchedulerMockTests.java @@ -23,7 +23,7 @@ public final class RetentionPoliciesListBySchedulerMockTests { @Test public void testListByScheduler() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"retentionPolicies\":[{\"retentionPeriodInDays\":1057230399,\"orchestrationState\":\"Canceled\"}]},\"id\":\"vwiwubmwmbesld\",\"name\":\"k\",\"type\":\"wtppjflcxogaoko\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"retentionPolicies\":[{\"retentionPeriodInDays\":1232794646,\"orchestrationState\":\"Terminated\"},{\"retentionPeriodInDays\":359778244,\"orchestrationState\":\"Failed\"},{\"retentionPeriodInDays\":2103360732,\"orchestrationState\":\"Terminated\"},{\"retentionPeriodInDays\":810708616,\"orchestrationState\":\"Failed\"}]},\"id\":\"j\",\"name\":\"xccybvpa\",\"type\":\"akkud\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,11 +33,11 @@ public void testListByScheduler() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.retentionPolicies().listByScheduler("tmweriofzpyq", "emwabnet", com.azure.core.util.Context.NONE); + = manager.retentionPolicies().listByScheduler("t", "gkxnyedabg", com.azure.core.util.Context.NONE); - Assertions.assertEquals(1057230399, + Assertions.assertEquals(1232794646, response.iterator().next().properties().retentionPolicies().get(0).retentionPeriodInDays()); - Assertions.assertEquals(PurgeableOrchestrationState.CANCELED, + Assertions.assertEquals(PurgeableOrchestrationState.TERMINATED, response.iterator().next().properties().retentionPolicies().get(0).orchestrationState()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesUpdateMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesUpdateMockTests.java index b1eb734058af0..0cf174fd96cf8 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesUpdateMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPoliciesUpdateMockTests.java @@ -26,7 +26,7 @@ public final class RetentionPoliciesUpdateMockTests { @Test public void testUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"retentionPolicies\":[{\"retentionPeriodInDays\":11756294,\"orchestrationState\":\"Terminated\"},{\"retentionPeriodInDays\":2109510262,\"orchestrationState\":\"Canceled\"},{\"retentionPeriodInDays\":857733914,\"orchestrationState\":\"Terminated\"},{\"retentionPeriodInDays\":677878330,\"orchestrationState\":\"Completed\"}]},\"id\":\"xsrz\",\"name\":\"zucerscdntnev\",\"type\":\"iwjmygtdssls\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"retentionPolicies\":[{\"retentionPeriodInDays\":558614295,\"orchestrationState\":\"Failed\"},{\"retentionPeriodInDays\":725653183,\"orchestrationState\":\"Canceled\"},{\"retentionPeriodInDays\":2142430700,\"orchestrationState\":\"Canceled\"},{\"retentionPeriodInDays\":889333374,\"orchestrationState\":\"Canceled\"}]},\"id\":\"r\",\"name\":\"il\",\"type\":\"yw\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,19 +36,19 @@ public void testUpdate() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RetentionPolicy response = manager.retentionPolicies() - .update("aolps", "lqlfm", + .update("atnwxyiopi", "kqqfk", new RetentionPolicyInner() .withProperties(new RetentionPolicyProperties().withRetentionPolicies(Arrays.asList( - new RetentionPolicyDetails().withRetentionPeriodInDays(220721528) + new RetentionPolicyDetails().withRetentionPeriodInDays(997116324) .withOrchestrationState(PurgeableOrchestrationState.TERMINATED), - new RetentionPolicyDetails().withRetentionPeriodInDays(1340500207) - .withOrchestrationState(PurgeableOrchestrationState.TERMINATED), - new RetentionPolicyDetails().withRetentionPeriodInDays(1295617641) - .withOrchestrationState(PurgeableOrchestrationState.CANCELED)))), + new RetentionPolicyDetails().withRetentionPeriodInDays(1291287111) + .withOrchestrationState(PurgeableOrchestrationState.FAILED), + new RetentionPolicyDetails().withRetentionPeriodInDays(2021052492) + .withOrchestrationState(PurgeableOrchestrationState.COMPLETED)))), com.azure.core.util.Context.NONE); - Assertions.assertEquals(11756294, response.properties().retentionPolicies().get(0).retentionPeriodInDays()); - Assertions.assertEquals(PurgeableOrchestrationState.TERMINATED, + Assertions.assertEquals(558614295, response.properties().retentionPolicies().get(0).retentionPeriodInDays()); + Assertions.assertEquals(PurgeableOrchestrationState.FAILED, response.properties().retentionPolicies().get(0).orchestrationState()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyDetailsTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyDetailsTests.java index 89fb51c2272d2..27158c6783d97 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyDetailsTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyDetailsTests.java @@ -13,18 +13,18 @@ public final class RetentionPolicyDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RetentionPolicyDetails model - = BinaryData.fromString("{\"retentionPeriodInDays\":1022740915,\"orchestrationState\":\"Terminated\"}") + = BinaryData.fromString("{\"retentionPeriodInDays\":1261487431,\"orchestrationState\":\"Canceled\"}") .toObject(RetentionPolicyDetails.class); - Assertions.assertEquals(1022740915, model.retentionPeriodInDays()); - Assertions.assertEquals(PurgeableOrchestrationState.TERMINATED, model.orchestrationState()); + Assertions.assertEquals(1261487431, model.retentionPeriodInDays()); + Assertions.assertEquals(PurgeableOrchestrationState.CANCELED, model.orchestrationState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RetentionPolicyDetails model = new RetentionPolicyDetails().withRetentionPeriodInDays(1022740915) - .withOrchestrationState(PurgeableOrchestrationState.TERMINATED); + RetentionPolicyDetails model = new RetentionPolicyDetails().withRetentionPeriodInDays(1261487431) + .withOrchestrationState(PurgeableOrchestrationState.CANCELED); model = BinaryData.fromObject(model).toObject(RetentionPolicyDetails.class); - Assertions.assertEquals(1022740915, model.retentionPeriodInDays()); - Assertions.assertEquals(PurgeableOrchestrationState.TERMINATED, model.orchestrationState()); + Assertions.assertEquals(1261487431, model.retentionPeriodInDays()); + Assertions.assertEquals(PurgeableOrchestrationState.CANCELED, model.orchestrationState()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyInnerTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyInnerTests.java index e10be394c3c47..a157233f130a9 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyInnerTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyInnerTests.java @@ -16,10 +16,10 @@ public final class RetentionPolicyInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RetentionPolicyInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Deleting\",\"retentionPolicies\":[{\"retentionPeriodInDays\":177141497,\"orchestrationState\":\"Completed\"},{\"retentionPeriodInDays\":1290040732,\"orchestrationState\":\"Failed\"},{\"retentionPeriodInDays\":1843167961,\"orchestrationState\":\"Canceled\"}]},\"id\":\"mkqsleyyv\",\"name\":\"yqjpkcatt\",\"type\":\"ngj\"}") + "{\"properties\":{\"provisioningState\":\"Accepted\",\"retentionPolicies\":[{\"retentionPeriodInDays\":1772158905,\"orchestrationState\":\"Canceled\"},{\"retentionPeriodInDays\":19956965,\"orchestrationState\":\"Completed\"}]},\"id\":\"s\",\"name\":\"dsytgadgvr\",\"type\":\"ea\"}") .toObject(RetentionPolicyInner.class); - Assertions.assertEquals(177141497, model.properties().retentionPolicies().get(0).retentionPeriodInDays()); - Assertions.assertEquals(PurgeableOrchestrationState.COMPLETED, + Assertions.assertEquals(1772158905, model.properties().retentionPolicies().get(0).retentionPeriodInDays()); + Assertions.assertEquals(PurgeableOrchestrationState.CANCELED, model.properties().retentionPolicies().get(0).orchestrationState()); } @@ -27,15 +27,13 @@ public void testDeserialize() throws Exception { public void testSerialize() throws Exception { RetentionPolicyInner model = new RetentionPolicyInner() .withProperties(new RetentionPolicyProperties().withRetentionPolicies(Arrays.asList( - new RetentionPolicyDetails().withRetentionPeriodInDays(177141497) - .withOrchestrationState(PurgeableOrchestrationState.COMPLETED), - new RetentionPolicyDetails().withRetentionPeriodInDays(1290040732) - .withOrchestrationState(PurgeableOrchestrationState.FAILED), - new RetentionPolicyDetails().withRetentionPeriodInDays(1843167961) - .withOrchestrationState(PurgeableOrchestrationState.CANCELED)))); + new RetentionPolicyDetails().withRetentionPeriodInDays(1772158905) + .withOrchestrationState(PurgeableOrchestrationState.CANCELED), + new RetentionPolicyDetails().withRetentionPeriodInDays(19956965) + .withOrchestrationState(PurgeableOrchestrationState.COMPLETED)))); model = BinaryData.fromObject(model).toObject(RetentionPolicyInner.class); - Assertions.assertEquals(177141497, model.properties().retentionPolicies().get(0).retentionPeriodInDays()); - Assertions.assertEquals(PurgeableOrchestrationState.COMPLETED, + Assertions.assertEquals(1772158905, model.properties().retentionPolicies().get(0).retentionPeriodInDays()); + Assertions.assertEquals(PurgeableOrchestrationState.CANCELED, model.properties().retentionPolicies().get(0).orchestrationState()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyListResultTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyListResultTests.java index 4b6d77b761324..1b4a3f14f045e 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyListResultTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyListResultTests.java @@ -13,12 +13,12 @@ public final class RetentionPolicyListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RetentionPolicyListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"retentionPolicies\":[{\"retentionPeriodInDays\":904416760,\"orchestrationState\":\"Completed\"}]},\"id\":\"upfh\",\"name\":\"hltrpmopjmcmatuo\",\"type\":\"thfuiuaodsfcpkvx\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"retentionPolicies\":[{\"retentionPeriodInDays\":1447641859,\"orchestrationState\":\"Canceled\"},{\"retentionPeriodInDays\":466984415,\"orchestrationState\":\"Terminated\"},{\"retentionPeriodInDays\":402102325,\"orchestrationState\":\"Canceled\"}]},\"id\":\"xbezyiuokktwh\",\"name\":\"dxwzywqsmbsurexi\",\"type\":\"o\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"retentionPolicies\":[{\"retentionPeriodInDays\":908271116,\"orchestrationState\":\"Completed\"},{\"retentionPeriodInDays\":1510965337,\"orchestrationState\":\"Canceled\"}]},\"id\":\"ys\",\"name\":\"kiiuxhqyudxor\",\"type\":\"qn\"}],\"nextLink\":\"oczvy\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"retentionPolicies\":[{\"retentionPeriodInDays\":2001921074,\"orchestrationState\":\"Canceled\"}]},\"id\":\"e\",\"name\":\"iipfpubj\",\"type\":\"bwwift\"}],\"nextLink\":\"qkvpuvksgplsakn\"}") .toObject(RetentionPolicyListResult.class); - Assertions.assertEquals(904416760, + Assertions.assertEquals(2001921074, model.value().get(0).properties().retentionPolicies().get(0).retentionPeriodInDays()); - Assertions.assertEquals(PurgeableOrchestrationState.COMPLETED, + Assertions.assertEquals(PurgeableOrchestrationState.CANCELED, model.value().get(0).properties().retentionPolicies().get(0).orchestrationState()); - Assertions.assertEquals("oczvy", model.nextLink()); + Assertions.assertEquals("qkvpuvksgplsakn", model.nextLink()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyPropertiesTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyPropertiesTests.java index ccddfa5075f88..11ff179d07b30 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyPropertiesTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/RetentionPolicyPropertiesTests.java @@ -15,27 +15,21 @@ public final class RetentionPolicyPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RetentionPolicyProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Deleting\",\"retentionPolicies\":[{\"retentionPeriodInDays\":957799467,\"orchestrationState\":\"Terminated\"},{\"retentionPeriodInDays\":445037662,\"orchestrationState\":\"Terminated\"},{\"retentionPeriodInDays\":1112494803,\"orchestrationState\":\"Terminated\"},{\"retentionPeriodInDays\":330627677,\"orchestrationState\":\"Failed\"}]}") + "{\"provisioningState\":\"Succeeded\",\"retentionPolicies\":[{\"retentionPeriodInDays\":596140767,\"orchestrationState\":\"Canceled\"}]}") .toObject(RetentionPolicyProperties.class); - Assertions.assertEquals(957799467, model.retentionPolicies().get(0).retentionPeriodInDays()); - Assertions.assertEquals(PurgeableOrchestrationState.TERMINATED, + Assertions.assertEquals(596140767, model.retentionPolicies().get(0).retentionPeriodInDays()); + Assertions.assertEquals(PurgeableOrchestrationState.CANCELED, model.retentionPolicies().get(0).orchestrationState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RetentionPolicyProperties model = new RetentionPolicyProperties().withRetentionPolicies(Arrays.asList( - new RetentionPolicyDetails().withRetentionPeriodInDays(957799467) - .withOrchestrationState(PurgeableOrchestrationState.TERMINATED), - new RetentionPolicyDetails().withRetentionPeriodInDays(445037662) - .withOrchestrationState(PurgeableOrchestrationState.TERMINATED), - new RetentionPolicyDetails().withRetentionPeriodInDays(1112494803) - .withOrchestrationState(PurgeableOrchestrationState.TERMINATED), - new RetentionPolicyDetails().withRetentionPeriodInDays(330627677) - .withOrchestrationState(PurgeableOrchestrationState.FAILED))); + RetentionPolicyProperties model = new RetentionPolicyProperties() + .withRetentionPolicies(Arrays.asList(new RetentionPolicyDetails().withRetentionPeriodInDays(596140767) + .withOrchestrationState(PurgeableOrchestrationState.CANCELED))); model = BinaryData.fromObject(model).toObject(RetentionPolicyProperties.class); - Assertions.assertEquals(957799467, model.retentionPolicies().get(0).retentionPeriodInDays()); - Assertions.assertEquals(PurgeableOrchestrationState.TERMINATED, + Assertions.assertEquals(596140767, model.retentionPolicies().get(0).retentionPeriodInDays()); + Assertions.assertEquals(PurgeableOrchestrationState.CANCELED, model.retentionPolicies().get(0).orchestrationState()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerInnerTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerInnerTests.java index 29f6044f396f7..5c83af664c1da 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerInnerTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerInnerTests.java @@ -6,10 +6,13 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.durabletask.fluent.models.SchedulerInner; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.PublicNetworkAccess; import com.azure.resourcemanager.durabletask.models.SchedulerProperties; import com.azure.resourcemanager.durabletask.models.SchedulerSku; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; +import com.azure.resourcemanager.durabletask.models.UserAssignedIdentity; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -19,30 +22,38 @@ public final class SchedulerInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SchedulerInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"endpoint\":\"pzvgnwzsymglzufc\",\"ipAllowlist\":[\"kohdbiha\"],\"sku\":{\"name\":\"Consumption\",\"capacity\":1908195338,\"redundancyState\":\"None\"},\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"th\",\"qhabifpikxwcz\",\"yscnpqxu\"],\"privateEndpoint\":{\"id\":\"y\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"b\",\"actionsRequired\":\"rkxvdum\"},\"provisioningState\":\"Succeeded\"},\"id\":\"fwvuk\",\"name\":\"gaudcc\",\"type\":\"nhsjcnyej\"}]},\"location\":\"ryhtnapczwlokjy\",\"tags\":{\"nchgej\":\"kvnipjoxz\",\"huxinpmqnj\":\"podmailzydehojwy\",\"vcputegj\":\"qwixjspro\"},\"id\":\"wmfdatscmdvpjhul\",\"name\":\"uuvmkjozkrwfnd\",\"type\":\"odjpslwejd\"}") + "{\"properties\":{\"provisioningState\":\"Updating\",\"endpoint\":\"sounqecanoaeu\",\"ipAllowlist\":[\"hy\",\"ltrpmopj\",\"cma\",\"u\"],\"sku\":{\"name\":\"Dedicated\",\"capacity\":607140678,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"cpkvxodp\"],\"privateEndpoint\":{\"id\":\"myzydagfuaxbez\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"kktwhrdxw\",\"actionsRequired\":\"wqsmbsur\"},\"provisioningState\":\"Failed\"},\"id\":\"o\",\"name\":\"yocf\",\"type\":\"fksymddystki\"},{\"properties\":{\"groupIds\":[\"qyud\",\"o\",\"rq\",\"b\"],\"privateEndpoint\":{\"id\":\"zvyifqrvkdvj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"mvvd\",\"actionsRequired\":\"atkpnp\"},\"provisioningState\":\"Deleting\"},\"id\":\"xbczwtruwiqz\",\"name\":\"qjvsovmyokacs\",\"type\":\"kwlhzdo\"},{\"properties\":{\"groupIds\":[\"mflbv\",\"nchrkcciww\",\"juqk\"],\"privateEndpoint\":{\"id\":\"ajiwkuo\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ghsauuimjmvxied\",\"actionsRequired\":\"gidyjrrf\"},\"provisioningState\":\"Succeeded\"},\"id\":\"svexcsonpclhoco\",\"name\":\"slkevle\",\"type\":\"gz\"},{\"properties\":{\"groupIds\":[\"fmvfaxkffeiit\",\"lvmezyvshxmzsbbz\",\"ggi\"],\"privateEndpoint\":{\"id\":\"wburvjxxjnspydpt\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"kouknvudwtiu\",\"actionsRequired\":\"ldngkpoci\"},\"provisioningState\":\"Succeeded\"},\"id\":\"xoegukgjnpiucgy\",\"name\":\"evqzntypmrbp\",\"type\":\"zcdrqjsdpydnfyhx\"}]},\"identity\":{\"principalId\":\"ejzicwifsjtt\",\"tenantId\":\"fbishcbkha\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"agalpbuxwgipwhon\":{\"principalId\":\"a\",\"clientId\":\"p\"},\"uzoqft\":{\"principalId\":\"kgshwa\",\"clientId\":\"ixzbinjeputtmryw\"},\"yav\":{\"principalId\":\"qzrnkcqvyxlwhz\",\"clientId\":\"icohoqqnwvl\"},\"yaxuconuqszfkb\":{\"principalId\":\"heun\",\"clientId\":\"qhgyxzkonocukok\"}}},\"location\":\"pewr\",\"tags\":{\"jektcxsenh\":\"wv\",\"rzpwvlqdqgbiq\":\"lrsf\",\"vf\":\"lihkaetcktvfc\",\"xerf\":\"nkymuctqhjfbebrj\"},\"id\":\"wutttxfvjrbi\",\"name\":\"phxepcyvahf\",\"type\":\"ljkyqxjvuuj\"}") .toObject(SchedulerInner.class); - Assertions.assertEquals("ryhtnapczwlokjy", model.location()); - Assertions.assertEquals("kvnipjoxz", model.tags().get("nchgej")); - Assertions.assertEquals("kohdbiha", model.properties().ipAllowlist().get(0)); - Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.properties().sku().name()); - Assertions.assertEquals(1908195338, model.properties().sku().capacity()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.properties().publicNetworkAccess()); + Assertions.assertEquals("pewr", model.location()); + Assertions.assertEquals("wv", model.tags().get("jektcxsenh")); + Assertions.assertEquals("hy", model.properties().ipAllowlist().get(0)); + Assertions.assertEquals(SchedulerSkuName.DEDICATED, model.properties().sku().name()); + Assertions.assertEquals(607140678, model.properties().sku().capacity()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.properties().publicNetworkAccess()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SchedulerInner model = new SchedulerInner().withLocation("ryhtnapczwlokjy") - .withTags(mapOf("nchgej", "kvnipjoxz", "huxinpmqnj", "podmailzydehojwy", "vcputegj", "qwixjspro")) - .withProperties(new SchedulerProperties().withIpAllowlist(Arrays.asList("kohdbiha")) - .withSku(new SchedulerSku().withName(SchedulerSkuName.CONSUMPTION).withCapacity(1908195338)) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)); + SchedulerInner model = new SchedulerInner().withLocation("pewr") + .withTags( + mapOf("jektcxsenh", "wv", "rzpwvlqdqgbiq", "lrsf", "vf", "lihkaetcktvfc", "xerf", "nkymuctqhjfbebrj")) + .withProperties(new SchedulerProperties().withIpAllowlist(Arrays.asList("hy", "ltrpmopj", "cma", "u")) + .withSku(new SchedulerSku().withName(SchedulerSkuName.DEDICATED).withCapacity(607140678)) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) + .withIdentity( + new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("agalpbuxwgipwhon", new UserAssignedIdentity(), "uzoqft", new UserAssignedIdentity(), + "yav", new UserAssignedIdentity(), "yaxuconuqszfkb", new UserAssignedIdentity()))); model = BinaryData.fromObject(model).toObject(SchedulerInner.class); - Assertions.assertEquals("ryhtnapczwlokjy", model.location()); - Assertions.assertEquals("kvnipjoxz", model.tags().get("nchgej")); - Assertions.assertEquals("kohdbiha", model.properties().ipAllowlist().get(0)); - Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.properties().sku().name()); - Assertions.assertEquals(1908195338, model.properties().sku().capacity()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.properties().publicNetworkAccess()); + Assertions.assertEquals("pewr", model.location()); + Assertions.assertEquals("wv", model.tags().get("jektcxsenh")); + Assertions.assertEquals("hy", model.properties().ipAllowlist().get(0)); + Assertions.assertEquals(SchedulerSkuName.DEDICATED, model.properties().sku().name()); + Assertions.assertEquals(607140678, model.properties().sku().capacity()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.properties().publicNetworkAccess()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); } // Use "Map.of" if available diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerListResultTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerListResultTests.java index 1686dd3a0a867..52a6abe3f7443 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerListResultTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerListResultTests.java @@ -6,6 +6,7 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.durabletask.implementation.models.SchedulerListResult; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.PublicNetworkAccess; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; import org.junit.jupiter.api.Assertions; @@ -14,14 +15,15 @@ public final class SchedulerListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SchedulerListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"endpoint\":\"htqqrolfp\",\"ipAllowlist\":[\"s\",\"lgbquxig\",\"yjgzjaoyfhrtxiln\"],\"sku\":{\"name\":\"Dedicated\",\"capacity\":1846063928,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"vfqawrlyxwjkcpr\",\"name\":\"nwbxgjvtbvpyssz\",\"type\":\"nruj\"}]},\"location\":\"uhmuouqfprwzwbn\",\"tags\":{\"zga\":\"tnwu\",\"fizuckyf\":\"x\",\"idf\":\"hr\",\"ymwisdkft\":\"zwdzuh\"},\"id\":\"wxmnteiwao\",\"name\":\"vkmijcmmxdcuf\",\"type\":\"fsrpymzidnse\"}],\"nextLink\":\"xtbzsgfyccsne\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"endpoint\":\"jzwf\",\"ipAllowlist\":[\"q\",\"jidsuyonobglaoc\",\"xtccmg\"],\"sku\":{\"name\":\"Consumption\",\"capacity\":435564330,\"redundancyState\":\"None\"},\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"vwfudwpzntxhd\",\"name\":\"hl\",\"type\":\"qj\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"kfrlhrxsbky\",\"name\":\"pycanuzbpz\",\"type\":\"afkuwb\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"wbme\",\"name\":\"hseyvju\",\"type\":\"rts\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"pkdeemaofmxagkvt\",\"name\":\"elmqk\",\"type\":\"hahvljuahaq\"}]},\"identity\":{\"principalId\":\"dhmdua\",\"tenantId\":\"exq\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"isgwbnbbeldawkz\":{\"principalId\":\"mwsrcrgvxpvgo\",\"clientId\":\"lf\"}}},\"location\":\"liourqhak\",\"tags\":{\"w\":\"ashsfwxos\",\"cjooxdjebwpucwwf\":\"xcug\",\"hzceuojgjrwjue\":\"ovbvmeueciv\"},\"id\":\"otwmcdyt\",\"name\":\"x\",\"type\":\"it\"},{\"properties\":{\"provisioningState\":\"Provisioning\",\"endpoint\":\"wgqwgxhn\",\"ipAllowlist\":[\"kxfbkpycgklwndn\",\"jdauwhvy\"],\"sku\":{\"name\":\"Dedicated\",\"capacity\":725778535,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"bm\",\"name\":\"ow\",\"type\":\"wpr\"}]},\"identity\":{\"principalId\":\"veual\",\"tenantId\":\"j\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"tjrip\":{\"principalId\":\"obbc\",\"clientId\":\"s\"},\"zvlvqhjkbegib\":{\"principalId\":\"bpbewtghfgb\",\"clientId\":\"gw\"},\"tzjuzgwyzmhtxo\":{\"principalId\":\"mxiebw\",\"clientId\":\"loayqcgw\"}}},\"location\":\"mtsavjcbpwxqp\",\"tags\":{\"mdyvxqtayriw\":\"nftguvriuhpr\",\"qbex\":\"ro\",\"nmefqsgzvahapj\":\"mcqibycnojv\"},\"id\":\"zhpvgqzcjrvxd\",\"name\":\"zlmwlxkvugfhz\",\"type\":\"vawjvzunlu\"}],\"nextLink\":\"nnprn\"}") .toObject(SchedulerListResult.class); - Assertions.assertEquals("uhmuouqfprwzwbn", model.value().get(0).location()); - Assertions.assertEquals("tnwu", model.value().get(0).tags().get("zga")); - Assertions.assertEquals("s", model.value().get(0).properties().ipAllowlist().get(0)); - Assertions.assertEquals(SchedulerSkuName.DEDICATED, model.value().get(0).properties().sku().name()); - Assertions.assertEquals(1846063928, model.value().get(0).properties().sku().capacity()); + Assertions.assertEquals("liourqhak", model.value().get(0).location()); + Assertions.assertEquals("ashsfwxos", model.value().get(0).tags().get("w")); + Assertions.assertEquals("q", model.value().get(0).properties().ipAllowlist().get(0)); + Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.value().get(0).properties().sku().name()); + Assertions.assertEquals(435564330, model.value().get(0).properties().sku().capacity()); Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("xtbzsgfyccsne", model.nextLink()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + Assertions.assertEquals("nnprn", model.nextLink()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPrivateLinkResourceInnerTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPrivateLinkResourceInnerTests.java index ae2e9daa5d11b..79107a5ab799c 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPrivateLinkResourceInnerTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPrivateLinkResourceInnerTests.java @@ -12,8 +12,8 @@ public final class SchedulerPrivateLinkResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SchedulerPrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"wzjeiach\",\"requiredMembers\":[\"sflnrosfqp\",\"eeh\"],\"requiredZoneNames\":[\"ypyqrimzinp\",\"swjdkirso\",\"dqxhcrmnohjtckwh\",\"soifiyipjxsqw\"]},\"id\":\"rjb\",\"name\":\"norcjxvsnbyxqab\",\"type\":\"mocpc\"}") + "{\"properties\":{\"groupId\":\"eilpjzuaejxdu\",\"requiredMembers\":[\"kzbbtd\",\"umveekgpwozuhkf\"],\"requiredZoneNames\":[\"jyofdxluusdtto\",\"waboe\"]},\"id\":\"v\",\"name\":\"elnsmvbxw\",\"type\":\"jsflhhcaalnjix\"}") .toObject(SchedulerPrivateLinkResourceInner.class); - Assertions.assertEquals("ypyqrimzinp", model.properties().requiredZoneNames().get(0)); + Assertions.assertEquals("jyofdxluusdtto", model.properties().requiredZoneNames().get(0)); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPrivateLinkResourceListResultTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPrivateLinkResourceListResultTests.java index 33a91c54eaad6..0e79b5f3edbb6 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPrivateLinkResourceListResultTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPrivateLinkResourceListResultTests.java @@ -12,9 +12,9 @@ public final class SchedulerPrivateLinkResourceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SchedulerPrivateLinkResourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"majtjaod\",\"requiredMembers\":[\"nbdxk\",\"pxokajionp\",\"mexgstxgcp\",\"dg\"],\"requiredZoneNames\":[\"jrmvdjwzrlo\",\"mcl\",\"hijco\",\"jctbza\"]},\"id\":\"qsycbkbfkgu\",\"name\":\"dkexxppofm\",\"type\":\"axcfjpgddtocjjx\"}],\"nextLink\":\"pmouexhdz\"}") + "{\"value\":[{\"properties\":{\"groupId\":\"pnyiropuhp\",\"requiredMembers\":[\"pgylg\",\"git\",\"medjvcslynqwwncw\",\"zhxgktrmgucn\"],\"requiredZoneNames\":[\"t\"]},\"id\":\"ellwptfdy\",\"name\":\"pfqbuaceopzf\",\"type\":\"rhhuaopppcqeqx\"},{\"properties\":{\"groupId\":\"dahzxctobg\",\"requiredMembers\":[\"moizpos\",\"mgrcfbu\",\"rmfqjhhkxbpvj\"],\"requiredZoneNames\":[\"hx\",\"j\"]},\"id\":\"gudivkrtswbxqz\",\"name\":\"szjfauvjfdxxivet\",\"type\":\"t\"},{\"properties\":{\"groupId\":\"qtdo\",\"requiredMembers\":[\"bxvwv\",\"yslqbhsfx\",\"blytk\",\"lmpewwwfbkr\"],\"requiredZoneNames\":[\"svshqjohx\"]},\"id\":\"sbfov\",\"name\":\"srruvwbhsqfsubcg\",\"type\":\"birx\"}],\"nextLink\":\"ybsrfbjfdtwss\"}") .toObject(SchedulerPrivateLinkResourceListResult.class); - Assertions.assertEquals("jrmvdjwzrlo", model.value().get(0).properties().requiredZoneNames().get(0)); - Assertions.assertEquals("pmouexhdz", model.nextLink()); + Assertions.assertEquals("t", model.value().get(0).properties().requiredZoneNames().get(0)); + Assertions.assertEquals("ybsrfbjfdtwss", model.nextLink()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPropertiesTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPropertiesTests.java index 89c6feda9e39c..dc3fd574fb624 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPropertiesTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPropertiesTests.java @@ -16,23 +16,24 @@ public final class SchedulerPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SchedulerProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Canceled\",\"endpoint\":\"yoqpsoaccta\",\"ipAllowlist\":[\"kljla\"],\"sku\":{\"name\":\"Consumption\",\"capacity\":381528868,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"gexpaojakhmsbz\",\"hcrzevd\",\"hlxaolthqtr\",\"qjbpfzfsin\"],\"privateEndpoint\":{\"id\":\"f\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"zoxxjtf\",\"actionsRequired\":\"luwfzitonpeqfpjk\"},\"provisioningState\":\"Failed\"},\"id\":\"fpdvhpfxxypi\",\"name\":\"i\",\"type\":\"mayhuybbkpodepoo\"},{\"properties\":{\"groupIds\":[\"vamih\",\"ognarxzxtheotus\",\"vyevcciqi\",\"nhungbw\"],\"privateEndpoint\":{\"id\":\"nfygxgispemvtz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ubljofxqe\",\"actionsRequired\":\"jaeq\"},\"provisioningState\":\"Creating\"},\"id\":\"b\",\"name\":\"s\",\"type\":\"msmjqulngsntn\"}]}") + "{\"provisioningState\":\"Provisioning\",\"endpoint\":\"ok\",\"ipAllowlist\":[\"ljyoxgvcltb\",\"sncghkjeszz\"],\"sku\":{\"name\":\"Consumption\",\"capacity\":1755265349,\"redundancyState\":\"None\"},\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"smx\"],\"privateEndpoint\":{\"id\":\"mpvecxgodebfqk\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"pukgriwflzlfb\",\"actionsRequired\":\"puz\"},\"provisioningState\":\"Failed\"},\"id\":\"pnq\",\"name\":\"ahmgkbrp\",\"type\":\"y\"}]}") .toObject(SchedulerProperties.class); - Assertions.assertEquals("kljla", model.ipAllowlist().get(0)); + Assertions.assertEquals("ljyoxgvcltb", model.ipAllowlist().get(0)); Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.sku().name()); - Assertions.assertEquals(381528868, model.sku().capacity()); + Assertions.assertEquals(1755265349, model.sku().capacity()); Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SchedulerProperties model = new SchedulerProperties().withIpAllowlist(Arrays.asList("kljla")) - .withSku(new SchedulerSku().withName(SchedulerSkuName.CONSUMPTION).withCapacity(381528868)) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED); + SchedulerProperties model + = new SchedulerProperties().withIpAllowlist(Arrays.asList("ljyoxgvcltb", "sncghkjeszz")) + .withSku(new SchedulerSku().withName(SchedulerSkuName.CONSUMPTION).withCapacity(1755265349)) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED); model = BinaryData.fromObject(model).toObject(SchedulerProperties.class); - Assertions.assertEquals("kljla", model.ipAllowlist().get(0)); + Assertions.assertEquals("ljyoxgvcltb", model.ipAllowlist().get(0)); Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.sku().name()); - Assertions.assertEquals(381528868, model.sku().capacity()); + Assertions.assertEquals(1755265349, model.sku().capacity()); Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPropertiesUpdateTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPropertiesUpdateTests.java index a96759d367651..951be82ff6c3a 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPropertiesUpdateTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerPropertiesUpdateTests.java @@ -16,23 +16,24 @@ public final class SchedulerPropertiesUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SchedulerPropertiesUpdate model = BinaryData.fromString( - "{\"provisioningState\":\"Succeeded\",\"endpoint\":\"tduqktapspwgcuer\",\"ipAllowlist\":[\"kdosvqw\"],\"sku\":{\"name\":\"Dedicated\",\"capacity\":1497620633,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Enabled\"}") + "{\"provisioningState\":\"Accepted\",\"endpoint\":\"nermcl\",\"ipAllowlist\":[\"phoxus\",\"rpabg\"],\"sku\":{\"name\":\"Dedicated\",\"capacity\":593857578,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Disabled\"}") .toObject(SchedulerPropertiesUpdate.class); - Assertions.assertEquals("kdosvqw", model.ipAllowlist().get(0)); + Assertions.assertEquals("phoxus", model.ipAllowlist().get(0)); Assertions.assertEquals(SchedulerSkuName.DEDICATED, model.sku().name()); - Assertions.assertEquals(1497620633, model.sku().capacity()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); + Assertions.assertEquals(593857578, model.sku().capacity()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SchedulerPropertiesUpdate model = new SchedulerPropertiesUpdate().withIpAllowlist(Arrays.asList("kdosvqw")) - .withSku(new SchedulerSkuUpdate().withName(SchedulerSkuName.DEDICATED).withCapacity(1497620633)) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED); + SchedulerPropertiesUpdate model + = new SchedulerPropertiesUpdate().withIpAllowlist(Arrays.asList("phoxus", "rpabg")) + .withSku(new SchedulerSkuUpdate().withName(SchedulerSkuName.DEDICATED).withCapacity(593857578)) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED); model = BinaryData.fromObject(model).toObject(SchedulerPropertiesUpdate.class); - Assertions.assertEquals("kdosvqw", model.ipAllowlist().get(0)); + Assertions.assertEquals("phoxus", model.ipAllowlist().get(0)); Assertions.assertEquals(SchedulerSkuName.DEDICATED, model.sku().name()); - Assertions.assertEquals(1497620633, model.sku().capacity()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); + Assertions.assertEquals(593857578, model.sku().capacity()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerSkuTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerSkuTests.java index eb9d79ac9f19f..a470dbf36c358 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerSkuTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerSkuTests.java @@ -13,17 +13,17 @@ public final class SchedulerSkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SchedulerSku model - = BinaryData.fromString("{\"name\":\"Dedicated\",\"capacity\":105854038,\"redundancyState\":\"None\"}") + = BinaryData.fromString("{\"name\":\"Consumption\",\"capacity\":177621177,\"redundancyState\":\"None\"}") .toObject(SchedulerSku.class); - Assertions.assertEquals(SchedulerSkuName.DEDICATED, model.name()); - Assertions.assertEquals(105854038, model.capacity()); + Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.name()); + Assertions.assertEquals(177621177, model.capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SchedulerSku model = new SchedulerSku().withName(SchedulerSkuName.DEDICATED).withCapacity(105854038); + SchedulerSku model = new SchedulerSku().withName(SchedulerSkuName.CONSUMPTION).withCapacity(177621177); model = BinaryData.fromObject(model).toObject(SchedulerSku.class); - Assertions.assertEquals(SchedulerSkuName.DEDICATED, model.name()); - Assertions.assertEquals(105854038, model.capacity()); + Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.name()); + Assertions.assertEquals(177621177, model.capacity()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerSkuUpdateTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerSkuUpdateTests.java index aab4ee10923b8..64e974ac94fdb 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerSkuUpdateTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerSkuUpdateTests.java @@ -13,18 +13,18 @@ public final class SchedulerSkuUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SchedulerSkuUpdate model - = BinaryData.fromString("{\"name\":\"Consumption\",\"capacity\":1359237516,\"redundancyState\":\"None\"}") + = BinaryData.fromString("{\"name\":\"Dedicated\",\"capacity\":1647814243,\"redundancyState\":\"Zone\"}") .toObject(SchedulerSkuUpdate.class); - Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.name()); - Assertions.assertEquals(1359237516, model.capacity()); + Assertions.assertEquals(SchedulerSkuName.DEDICATED, model.name()); + Assertions.assertEquals(1647814243, model.capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SchedulerSkuUpdate model - = new SchedulerSkuUpdate().withName(SchedulerSkuName.CONSUMPTION).withCapacity(1359237516); + = new SchedulerSkuUpdate().withName(SchedulerSkuName.DEDICATED).withCapacity(1647814243); model = BinaryData.fromObject(model).toObject(SchedulerSkuUpdate.class); - Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.name()); - Assertions.assertEquals(1359237516, model.capacity()); + Assertions.assertEquals(SchedulerSkuName.DEDICATED, model.name()); + Assertions.assertEquals(1647814243, model.capacity()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerUpdateTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerUpdateTests.java index 26daf1a17392c..d46f52c877508 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerUpdateTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulerUpdateTests.java @@ -5,11 +5,14 @@ package com.azure.resourcemanager.durabletask.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.PublicNetworkAccess; import com.azure.resourcemanager.durabletask.models.SchedulerPropertiesUpdate; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; import com.azure.resourcemanager.durabletask.models.SchedulerSkuUpdate; import com.azure.resourcemanager.durabletask.models.SchedulerUpdate; +import com.azure.resourcemanager.durabletask.models.UserAssignedIdentity; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -19,29 +22,33 @@ public final class SchedulerUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SchedulerUpdate model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"endpoint\":\"kbasyypn\",\"ipAllowlist\":[\"sgcbac\",\"hejkotynqgou\",\"zndlikwy\",\"kgfg\"],\"sku\":{\"name\":\"Consumption\",\"capacity\":1793250583,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Disabled\"},\"tags\":{\"qedqytbciqfoufl\":\"xybz\",\"glougpbk\":\"mnkzsmod\"}}") + "{\"properties\":{\"provisioningState\":\"Provisioning\",\"endpoint\":\"gmgsxnkjzkde\",\"ipAllowlist\":[\"vlopwiyighx\",\"kdwzbaiuebbaumny\",\"upedeojnabckhs\",\"txp\"],\"sku\":{\"name\":\"Consumption\",\"capacity\":74737899,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Enabled\"},\"tags\":{\"jdhtldwkyzxu\":\"pskrdqmh\",\"svlxotogtwrup\":\"tkncwsc\"},\"identity\":{\"principalId\":\"vnm\",\"tenantId\":\"ykvceoveil\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"nv\":{\"principalId\":\"yfjfcnjbkcn\",\"clientId\":\"hbttkphyw\"}}}}") .toObject(SchedulerUpdate.class); - Assertions.assertEquals("sgcbac", model.properties().ipAllowlist().get(0)); + Assertions.assertEquals("vlopwiyighx", model.properties().ipAllowlist().get(0)); Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.properties().sku().name()); - Assertions.assertEquals(1793250583, model.properties().sku().capacity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.properties().publicNetworkAccess()); - Assertions.assertEquals("xybz", model.tags().get("qedqytbciqfoufl")); + Assertions.assertEquals(74737899, model.properties().sku().capacity()); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.properties().publicNetworkAccess()); + Assertions.assertEquals("pskrdqmh", model.tags().get("jdhtldwkyzxu")); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SchedulerUpdate model = new SchedulerUpdate() .withProperties(new SchedulerPropertiesUpdate() - .withIpAllowlist(Arrays.asList("sgcbac", "hejkotynqgou", "zndlikwy", "kgfg")) - .withSku(new SchedulerSkuUpdate().withName(SchedulerSkuName.CONSUMPTION).withCapacity(1793250583)) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) - .withTags(mapOf("qedqytbciqfoufl", "xybz", "glougpbk", "mnkzsmod")); + .withIpAllowlist(Arrays.asList("vlopwiyighx", "kdwzbaiuebbaumny", "upedeojnabckhs", "txp")) + .withSku(new SchedulerSkuUpdate().withName(SchedulerSkuName.CONSUMPTION).withCapacity(74737899)) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)) + .withTags(mapOf("jdhtldwkyzxu", "pskrdqmh", "svlxotogtwrup", "tkncwsc")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("nv", new UserAssignedIdentity()))); model = BinaryData.fromObject(model).toObject(SchedulerUpdate.class); - Assertions.assertEquals("sgcbac", model.properties().ipAllowlist().get(0)); + Assertions.assertEquals("vlopwiyighx", model.properties().ipAllowlist().get(0)); Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, model.properties().sku().name()); - Assertions.assertEquals(1793250583, model.properties().sku().capacity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.properties().publicNetworkAccess()); - Assertions.assertEquals("xybz", model.tags().get("qedqytbciqfoufl")); + Assertions.assertEquals(74737899, model.properties().sku().capacity()); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.properties().publicNetworkAccess()); + Assertions.assertEquals("pskrdqmh", model.tags().get("jdhtldwkyzxu")); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); } // Use "Map.of" if available diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdateMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdateMockTests.java index d1d66bc07bb77..2ba29b285f08d 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdateMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdateMockTests.java @@ -10,11 +10,14 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentity; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.PublicNetworkAccess; import com.azure.resourcemanager.durabletask.models.Scheduler; import com.azure.resourcemanager.durabletask.models.SchedulerProperties; import com.azure.resourcemanager.durabletask.models.SchedulerSku; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; +import com.azure.resourcemanager.durabletask.models.UserAssignedIdentity; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -28,7 +31,7 @@ public final class SchedulersCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"endpoint\":\"wgqwgxhn\",\"ipAllowlist\":[\"kxfbkpycgklwndn\",\"jdauwhvy\"],\"sku\":{\"name\":\"Dedicated\",\"capacity\":725778535,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"mpowuwpr\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"ualupjmkh\",\"name\":\"xobbcswsrt\",\"type\":\"riplrbpbewtg\"}]},\"location\":\"gblcgwxzvlvq\",\"tags\":{\"oayqc\":\"begibtnmxiebwwa\",\"uzgwyzmhtx\":\"wrtz\"},\"id\":\"ngmtsavjcb\",\"name\":\"wxqpsrknftguvri\",\"type\":\"hprwmdyv\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"endpoint\":\"qknp\",\"ipAllowlist\":[\"gnepttwqmsni\",\"fcdmqnrojlpijn\",\"rxfrddhc\",\"atiz\"],\"sku\":{\"name\":\"Consumption\",\"capacity\":852301245,\"redundancyState\":\"None\"},\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"yzhftwesgogczh\",\"nnxk\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Failed\"},\"id\":\"hmossxkkgth\",\"name\":\"rghxjb\",\"type\":\"hqxvcxgfrpdsofbs\"},{\"properties\":{\"groupIds\":[\"vbuswd\",\"z\",\"ybycnunvj\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Failed\"},\"id\":\"awnopqgikyzirtxd\",\"name\":\"uxzejntpsew\",\"type\":\"ioilqukrydxtq\"},{\"properties\":{\"groupIds\":[\"xorgg\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"omtbghhavgrvkff\",\"name\":\"vjzhpjbib\",\"type\":\"jmfxumvf\"},{\"properties\":{\"groupIds\":[\"ovwxnbkfezzxsc\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"g\",\"name\":\"rujbzbomvzzbtdc\",\"type\":\"vp\"}]},\"identity\":{\"principalId\":\"ujviylwdshfs\",\"tenantId\":\"rbgyefry\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"rfh\":{\"principalId\":\"j\",\"clientId\":\"wncot\"},\"a\":{\"principalId\":\"ctymoxoftp\",\"clientId\":\"iwyczuh\"}}},\"location\":\"qjlihhyuspska\",\"tags\":{\"lucvpam\":\"lmfwdgzx\",\"ytxifqjzgxmrh\":\"sreuzvxurisjnh\",\"pauutpw\":\"blwpcesutrgj\",\"jqgwzp\":\"qhih\"},\"id\":\"fqntcyp\",\"name\":\"xjvfoimwksl\",\"type\":\"rcizjxvyd\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -38,21 +41,25 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Scheduler response = manager.schedulers() - .define("bkyvp") - .withRegion("liourqhak") - .withExistingResourceGroup("hckfrlhrx") - .withTags(mapOf("w", "ashsfwxos", "cjooxdjebwpucwwf", "xcug", "hzceuojgjrwjue", "ovbvmeueciv")) - .withProperties(new SchedulerProperties().withIpAllowlist(Arrays.asList("zka")) - .withSku(new SchedulerSku().withName(SchedulerSkuName.CONSUMPTION).withCapacity(1834539320)) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)) + .define("ixexcc") + .withRegion("lbfpncurd") + .withExistingResourceGroup("ijejvegrhbpn") + .withTags(mapOf("xcbihw", "iithtywu", "twjchrdg", "knfd", "uu", "ihxumwctondzj")) + .withProperties(new SchedulerProperties().withIpAllowlist(Arrays.asList("htpwij", "hyjsvfycx")) + .withSku(new SchedulerSku().withName(SchedulerSkuName.CONSUMPTION).withCapacity(1391683758)) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("ozphvwauyqncygu", new UserAssignedIdentity(), "pelmcuvhixbjxyf", + new UserAssignedIdentity(), "ttpkiwkkbnujrywv", new UserAssignedIdentity()))) .create(); - Assertions.assertEquals("gblcgwxzvlvq", response.location()); - Assertions.assertEquals("begibtnmxiebwwa", response.tags().get("oayqc")); - Assertions.assertEquals("kxfbkpycgklwndn", response.properties().ipAllowlist().get(0)); - Assertions.assertEquals(SchedulerSkuName.DEDICATED, response.properties().sku().name()); - Assertions.assertEquals(725778535, response.properties().sku().capacity()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.properties().publicNetworkAccess()); + Assertions.assertEquals("qjlihhyuspska", response.location()); + Assertions.assertEquals("lmfwdgzx", response.tags().get("lucvpam")); + Assertions.assertEquals("gnepttwqmsni", response.properties().ipAllowlist().get(0)); + Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, response.properties().sku().name()); + Assertions.assertEquals(852301245, response.properties().sku().capacity()); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.properties().publicNetworkAccess()); + Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); } // Use "Map.of" if available diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdatePrivateEndpointConnectionMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdatePrivateEndpointConnectionMockTests.java index c7fca71d88e7e..0bf07c5caa18e 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdatePrivateEndpointConnectionMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersCreateOrUpdatePrivateEndpointConnectionMockTests.java @@ -25,7 +25,7 @@ public final class SchedulersCreateOrUpdatePrivateEndpointConnectionMockTests { @Test public void testCreateOrUpdatePrivateEndpointConnection() throws Exception { String responseStr - = "{\"properties\":{\"groupIds\":[\"yofd\",\"luu\",\"dttouwaboekqvkel\",\"smv\"],\"privateEndpoint\":{\"id\":\"yjsflhhcaalnji\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"yaw\",\"actionsRequired\":\"yaqcslyjpkiidz\"},\"provisioningState\":\"Succeeded\"},\"id\":\"nelixhnrztfo\",\"name\":\"hb\",\"type\":\"xknalaulppg\"}"; + = "{\"properties\":{\"groupIds\":[\"novqfzge\",\"jdftuljltd\",\"ceamtm\",\"zuo\"],\"privateEndpoint\":{\"id\":\"wcw\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"knssxmojm\",\"actionsRequired\":\"p\"},\"provisioningState\":\"Succeeded\"},\"id\":\"vk\",\"name\":\"cfzq\",\"type\":\"jyxgtczh\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,19 +36,18 @@ public void testCreateOrUpdatePrivateEndpointConnection() throws Exception { PrivateEndpointConnection response = manager.schedulers() - .definePrivateEndpointConnection("bycnojvkn") - .withExistingScheduler("qtayri", "wroyqbexrmcq") + .definePrivateEndpointConnection("mrtwna") + .withExistingScheduler("ceacvlhvygdy", "t") .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("peilpjzuaejxdu") - .withActionsRequired("skzbb"))) + .withDescription("qphchqnrnrpxehuw") + .withActionsRequired("k"))) .create(); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("yaw", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("yaqcslyjpkiidz", - response.properties().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("knssxmojm", response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("p", response.properties().privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetByResourceGroupWithResponseMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetByResourceGroupWithResponseMockTests.java index efc0b98bfeb85..bd39c00c253a5 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetByResourceGroupWithResponseMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetByResourceGroupWithResponseMockTests.java @@ -10,6 +10,7 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.PublicNetworkAccess; import com.azure.resourcemanager.durabletask.models.Scheduler; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; @@ -23,7 +24,7 @@ public final class SchedulersGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"endpoint\":\"ciwwzjuqkhr\",\"ipAllowlist\":[\"jiwkuofoskghsau\",\"imjm\"],\"sku\":{\"name\":\"Consumption\",\"capacity\":1584034364,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"rfbyaosvexcso\",\"pclhocohslk\",\"vleggzfbuhfmvfax\",\"ffeii\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"ez\",\"name\":\"v\",\"type\":\"hxmzsbbzoggig\"},{\"properties\":{\"groupIds\":[\"ur\",\"jx\",\"jnspydp\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"kouknvudwtiu\",\"name\":\"bldngkpoc\",\"type\":\"pazyxoegukg\"},{\"properties\":{\"groupIds\":[\"ucgygevqz\",\"typmrbpizcdrqjsd\",\"ydnfyhxdeoejz\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Failed\"},\"id\":\"sjttgzfbish\",\"name\":\"bkh\",\"type\":\"jdeyeamdpha\"}]},\"location\":\"lpbuxwgipwhonowk\",\"tags\":{\"jeputtmrywn\":\"wankixzbi\",\"lwh\":\"zoqftiyqzrnkcqvy\",\"ryavwhheunmmqh\":\"lsicohoqqnwv\",\"noc\":\"yxzk\"},\"id\":\"koklya\",\"name\":\"uconuqszfkbey\",\"type\":\"ewrmjmwvvjektc\"}"; + = "{\"properties\":{\"provisioningState\":\"Deleting\",\"endpoint\":\"jaltolmnc\",\"ipAllowlist\":[\"obqwcsdbnwdcfh\",\"cqdpfuv\"],\"sku\":{\"name\":\"Consumption\",\"capacity\":793590133,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"t\",\"udutnco\",\"mr\",\"xqtvcofu\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Succeeded\"},\"id\":\"gj\",\"name\":\"bgdknnqv\",\"type\":\"aznqntoru\"}]},\"identity\":{\"principalId\":\"sahmky\",\"tenantId\":\"rauwjuetaebu\",\"type\":\"None\",\"userAssignedIdentities\":{\"kif\":{\"principalId\":\"ovsm\",\"clientId\":\"xwabmqoe\"},\"tujitcjedft\":{\"principalId\":\"tpuqujmq\",\"clientId\":\"kfbtndoaongbjc\"}}},\"location\":\"ae\",\"tags\":{\"bxarzgszufoxci\":\"jvdcpzfoqouic\",\"haz\":\"opidoamciodh\",\"toego\":\"khnzbonlw\"},\"id\":\"dwbwhkszzcmrvexz\",\"name\":\"vbtqgsfraoyzk\",\"type\":\"owtlmnguxawqald\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,14 +34,15 @@ public void testGetByResourceGroupWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Scheduler response = manager.schedulers() - .getByResourceGroupWithResponse("myokacspkwlh", "dobpxjmflbvvn", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("qa", "zfeqztppri", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("lpbuxwgipwhonowk", response.location()); - Assertions.assertEquals("wankixzbi", response.tags().get("jeputtmrywn")); - Assertions.assertEquals("jiwkuofoskghsau", response.properties().ipAllowlist().get(0)); + Assertions.assertEquals("ae", response.location()); + Assertions.assertEquals("jvdcpzfoqouic", response.tags().get("bxarzgszufoxci")); + Assertions.assertEquals("obqwcsdbnwdcfh", response.properties().ipAllowlist().get(0)); Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, response.properties().sku().name()); - Assertions.assertEquals(1584034364, response.properties().sku().capacity()); + Assertions.assertEquals(793590133, response.properties().sku().capacity()); Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.properties().publicNetworkAccess()); + Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateEndpointConnectionWithResponseMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateEndpointConnectionWithResponseMockTests.java index b3845a33242fb..212630ab1c6b0 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateEndpointConnectionWithResponseMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateEndpointConnectionWithResponseMockTests.java @@ -22,7 +22,7 @@ public final class SchedulersGetPrivateEndpointConnectionWithResponseMockTests { @Test public void testGetPrivateEndpointConnectionWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"groupIds\":[\"kn\",\"ws\"],\"privateEndpoint\":{\"id\":\"vlxotogtwrupqsx\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"cykvceo\",\"actionsRequired\":\"ilovnot\"},\"provisioningState\":\"Succeeded\"},\"id\":\"cnjbkcnxdhbt\",\"name\":\"kphywpnvjto\",\"type\":\"nermcl\"}"; + = "{\"properties\":{\"groupIds\":[\"okerqwkyhkobop\",\"xedk\",\"wep\",\"qpcrf\"],\"privateEndpoint\":{\"id\":\"ccsnjvcdwxlpq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"nkhtjsyingw\",\"actionsRequired\":\"atmtdhtmdvy\"},\"provisioningState\":\"Deleting\"},\"id\":\"dgszywkbirryuzh\",\"name\":\"hkjoqr\",\"type\":\"qqaatjinrvgou\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,13 +32,14 @@ public void testGetPrivateEndpointConnectionWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnection response = manager.schedulers() - .getPrivateEndpointConnectionWithResponse("ckhsmtxpsieb", "fhvpesaps", "rdqmhjjdhtldwkyz", + .getPrivateEndpointConnectionWithResponse("pfcqdp", "qxqvpsvuoymgc", "elvezrypq", com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("cykvceo", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ilovnot", response.properties().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("nkhtjsyingw", response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("atmtdhtmdvy", + response.properties().privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateLinkWithResponseMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateLinkWithResponseMockTests.java index 1239cf88db8f3..c659d572b1a6f 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateLinkWithResponseMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersGetPrivateLinkWithResponseMockTests.java @@ -21,7 +21,7 @@ public final class SchedulersGetPrivateLinkWithResponseMockTests { @Test public void testGetPrivateLinkWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"groupId\":\"bxu\",\"requiredMembers\":[\"hqwa\",\"muzyoxaepdk\",\"jancu\",\"rhdwbavxbniw\"],\"requiredZoneNames\":[\"wz\",\"s\"]},\"id\":\"pgn\",\"name\":\"ytxhp\",\"type\":\"xbzpfzab\"}"; + = "{\"properties\":{\"groupId\":\"lsj\",\"requiredMembers\":[\"szfjvfbgofelja\",\"rqmq\"],\"requiredZoneNames\":[\"vriiio\",\"nalghfkvtvsexso\",\"ueluqhhahhxvrhmz\"]},\"id\":\"pjgwwspug\",\"name\":\"ftqsxhqxujxuk\",\"type\":\"dxdigr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,10 +31,9 @@ public void testGetPrivateLinkWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SchedulerPrivateLinkResource response = manager.schedulers() - .getPrivateLinkWithResponse("hsucoc", "nyyazttbtwwrqpue", "ckzywbiexzfeyue", - com.azure.core.util.Context.NONE) + .getPrivateLinkWithResponse("szrnwo", "indfpwpjyl", "bt", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("wz", response.properties().requiredZoneNames().get(0)); + Assertions.assertEquals("vriiio", response.properties().requiredZoneNames().get(0)); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListByResourceGroupMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListByResourceGroupMockTests.java index 85d8841284a63..fb64bbb992bd1 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListByResourceGroupMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListByResourceGroupMockTests.java @@ -11,6 +11,7 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.PublicNetworkAccess; import com.azure.resourcemanager.durabletask.models.Scheduler; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; @@ -24,7 +25,7 @@ public final class SchedulersListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"endpoint\":\"wvlqdqgb\",\"ipAllowlist\":[\"ylihkaetckt\",\"fcivfsnkym\",\"ctq\"],\"sku\":{\"name\":\"Dedicated\",\"capacity\":1887113058,\"redundancyState\":\"None\"},\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"uwutttxfvjrbi\",\"phxepcyvahf\",\"ljkyqxjvuuj\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"kgj\",\"name\":\"jyoxgvclt\",\"type\":\"gsncghkjeszz\"}]},\"location\":\"ijhtxf\",\"tags\":{\"xnehmpvec\":\"bfs\"},\"id\":\"godebfqkkrbmpu\",\"name\":\"gr\",\"type\":\"wflzlfbxzpuzy\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"endpoint\":\"t\",\"ipAllowlist\":[\"fhpagmhrskdsnf\",\"sd\",\"akgtdlmkkzevdlh\",\"wpusdsttwvogv\"],\"sku\":{\"name\":\"Dedicated\",\"capacity\":2086607804,\"redundancyState\":\"Zone\"},\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"kufgmj\",\"rwr\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"aenuuz\",\"name\":\"opbminrfdw\",\"type\":\"yuhhziu\"}]},\"identity\":{\"principalId\":\"ozbhdmsmlmzq\",\"tenantId\":\"ft\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"iyylhalnswhccsp\":{\"principalId\":\"u\",\"clientId\":\"hxicslfaoqz\"}}},\"location\":\"aivwitqscywu\",\"tags\":{\"i\":\"oluhczbwemh\",\"wmsweypqwd\":\"sbrgz\",\"mkttlstvlzywem\":\"ggicccnxqhue\",\"lusiy\":\"zrncsdt\"},\"id\":\"bsfgytguslfea\",\"name\":\"cy\",\"type\":\"qukyhejhzi\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,14 +35,16 @@ public void testListByResourceGroup() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.schedulers().listByResourceGroup("senhwlrs", com.azure.core.util.Context.NONE); + = manager.schedulers().listByResourceGroup("yuuximerqfobwyzn", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ijhtxf", response.iterator().next().location()); - Assertions.assertEquals("bfs", response.iterator().next().tags().get("xnehmpvec")); - Assertions.assertEquals("ylihkaetckt", response.iterator().next().properties().ipAllowlist().get(0)); + Assertions.assertEquals("aivwitqscywu", response.iterator().next().location()); + Assertions.assertEquals("oluhczbwemh", response.iterator().next().tags().get("i")); + Assertions.assertEquals("fhpagmhrskdsnf", response.iterator().next().properties().ipAllowlist().get(0)); Assertions.assertEquals(SchedulerSkuName.DEDICATED, response.iterator().next().properties().sku().name()); - Assertions.assertEquals(1887113058, response.iterator().next().properties().sku().capacity()); + Assertions.assertEquals(2086607804, response.iterator().next().properties().sku().capacity()); Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.iterator().next().properties().publicNetworkAccess()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, + response.iterator().next().identity().type()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListMockTests.java index 1d862d5e1e028..710c5110044c6 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListMockTests.java @@ -11,6 +11,7 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.ManagedServiceIdentityType; import com.azure.resourcemanager.durabletask.models.PublicNetworkAccess; import com.azure.resourcemanager.durabletask.models.Scheduler; import com.azure.resourcemanager.durabletask.models.SchedulerSkuName; @@ -24,7 +25,7 @@ public final class SchedulersListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"endpoint\":\"qzahmgkbrp\",\"ipAllowlist\":[\"dhibnuq\"],\"sku\":{\"name\":\"Consumption\",\"capacity\":500953055,\"redundancyState\":\"None\"},\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"gnbuy\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Failed\"},\"id\":\"gmebfsiarbutrcv\",\"name\":\"na\",\"type\":\"zmhjrunmp\"}]},\"location\":\"tdbhrbnla\",\"tags\":{\"ny\":\"myskpbhenbtkcxy\",\"nlqidybyxczf\":\"nrs\"},\"id\":\"lhaaxdbabp\",\"name\":\"lwrq\",\"type\":\"fkts\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Provisioning\",\"endpoint\":\"elolppvksrpqvuj\",\"ipAllowlist\":[\"aehtwd\",\"r\",\"tswiby\"],\"sku\":{\"name\":\"Dedicated\",\"capacity\":66676019,\"redundancyState\":\"None\"},\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"cstwity\",\"hevxcced\",\"pnmdyodnwzxltjcv\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"ugcxnavvwxq\",\"name\":\"byqunyow\",\"type\":\"wlmdjrkv\"},{\"properties\":{\"groupIds\":[\"fvpdbo\",\"acizsjqlhkrr\",\"bdeibqipqk\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"dzwmkrefajpj\",\"name\":\"rwkq\",\"type\":\"yhgbijtjivfx\"},{\"properties\":{\"groupIds\":[\"bibsystawfsdjpvk\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"bkzbzkd\",\"name\":\"ncj\",\"type\":\"budurgkakmo\"},{\"properties\":{\"groupIds\":[\"jk\",\"ffhmouwqlgzr\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Failed\"},\"id\":\"ebizikayuh\",\"name\":\"lbjbsyb\",\"type\":\"qwrvtldgmfp\"}]},\"identity\":{\"principalId\":\"pip\",\"tenantId\":\"ltha\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"kdw\":{\"principalId\":\"mwutwbdsre\",\"clientId\":\"drhneuyow\"}}},\"location\":\"i\",\"tags\":{\"mejzanlfzxia\":\"ircgpikpz\"},\"id\":\"rmbzo\",\"name\":\"okixrjqcir\",\"type\":\"zpfrla\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -35,12 +36,14 @@ public void testList() throws Exception { PagedIterable response = manager.schedulers().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("tdbhrbnla", response.iterator().next().location()); - Assertions.assertEquals("myskpbhenbtkcxy", response.iterator().next().tags().get("ny")); - Assertions.assertEquals("dhibnuq", response.iterator().next().properties().ipAllowlist().get(0)); - Assertions.assertEquals(SchedulerSkuName.CONSUMPTION, response.iterator().next().properties().sku().name()); - Assertions.assertEquals(500953055, response.iterator().next().properties().sku().capacity()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, + Assertions.assertEquals("i", response.iterator().next().location()); + Assertions.assertEquals("ircgpikpz", response.iterator().next().tags().get("mejzanlfzxia")); + Assertions.assertEquals("aehtwd", response.iterator().next().properties().ipAllowlist().get(0)); + Assertions.assertEquals(SchedulerSkuName.DEDICATED, response.iterator().next().properties().sku().name()); + Assertions.assertEquals(66676019, response.iterator().next().properties().sku().capacity()); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.iterator().next().properties().publicNetworkAccess()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, + response.iterator().next().identity().type()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateEndpointConnectionsMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateEndpointConnectionsMockTests.java index 46a267eb340b4..752d36153512d 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateEndpointConnectionsMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateEndpointConnectionsMockTests.java @@ -23,7 +23,7 @@ public final class SchedulersListPrivateEndpointConnectionsMockTests { @Test public void testListPrivateEndpointConnections() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"groupIds\":[\"qugxywpmueefjzwf\"],\"privateEndpoint\":{\"id\":\"ujidsuyono\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ocqxtccmg\",\"actionsRequired\":\"dxyt\"},\"provisioningState\":\"Failed\"},\"id\":\"rxv\",\"name\":\"fudwpznt\",\"type\":\"hdzhlrqj\"}]}"; + = "{\"value\":[{\"properties\":{\"groupIds\":[\"kvtkkg\"],\"privateEndpoint\":{\"id\":\"wjygvjayvblmhvk\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"xvvy\",\"actionsRequired\":\"s\"},\"provisioningState\":\"Creating\"},\"id\":\"rqufegxuvwz\",\"name\":\"bnhlmc\",\"type\":\"l\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,14 +32,14 @@ public void testListPrivateEndpointConnections() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.schedulers() - .listPrivateEndpointConnections("plpho", "uscrpabgyepsb", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.schedulers().listPrivateEndpointConnections("mfiibfggj", "ool", com.azure.core.util.Context.NONE); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, response.iterator().next().properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ocqxtccmg", + Assertions.assertEquals("xvvy", response.iterator().next().properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("dxyt", + Assertions.assertEquals("s", response.iterator().next().properties().privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateLinksMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateLinksMockTests.java index 19bad9edab078..155ec793b8951 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateLinksMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersListPrivateLinksMockTests.java @@ -22,7 +22,7 @@ public final class SchedulersListPrivateLinksMockTests { @Test public void testListPrivateLinks() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"vgyuguos\",\"requiredMembers\":[\"fssxqukkfplg\",\"gsxnkjzkdeslpv\",\"opwi\"],\"requiredZoneNames\":[\"hxpkd\",\"zb\"]},\"id\":\"uebbaumnyqup\",\"name\":\"deoj\",\"type\":\"a\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"botzingamvppho\",\"requiredMembers\":[\"zudphqamvdkfw\",\"nwcvtbvkayhmtnv\"],\"requiredZoneNames\":[\"atkzwpcnpw\",\"cjaesgvvs\",\"cyajguqf\"]},\"id\":\"ygz\",\"name\":\"vdnkfxusem\",\"type\":\"wzrmuh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,8 +32,8 @@ public void testListPrivateLinks() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.schedulers().listPrivateLinks("lcuhxwtctyqiklb", "ovplw", com.azure.core.util.Context.NONE); + = manager.schedulers().listPrivateLinks("guufzd", "syqtfi", com.azure.core.util.Context.NONE); - Assertions.assertEquals("hxpkd", response.iterator().next().properties().requiredZoneNames().get(0)); + Assertions.assertEquals("atkzwpcnpw", response.iterator().next().properties().requiredZoneNames().get(0)); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersRestartWithResponseMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersRestartWithResponseMockTests.java new file mode 100644 index 0000000000000..e5e36c53f797d --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/SchedulersRestartWithResponseMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SchedulersRestartWithResponseMockTests { + @Test + public void testRestartWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.schedulers().restartWithResponse("dn", "itvgbmhrixkwm", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubInnerTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubInnerTests.java index 0c8b4ff0edf4b..e67b4cdcc5d1d 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubInnerTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubInnerTests.java @@ -7,18 +7,23 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.durabletask.fluent.models.TaskHubInner; import com.azure.resourcemanager.durabletask.models.TaskHubProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; public final class TaskHubInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TaskHubInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Deleting\",\"dashboardUrl\":\"gnzscxaqwo\"},\"id\":\"hcbonqvpkvlr\",\"name\":\"njeaseipheofloke\",\"type\":\"y\"}") + "{\"properties\":{\"provisioningState\":\"Accepted\",\"dashboardUrl\":\"jefuzmuvpbttdumo\",\"capabilities\":[\"xe\",\"mnzb\",\"bhjpglkfgohdne\"]},\"id\":\"lfphsdyhtozfikd\",\"name\":\"wwquuvxzxclvithh\",\"type\":\"zonosgg\"}") .toObject(TaskHubInner.class); + Assertions.assertEquals("xe", model.properties().capabilities().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TaskHubInner model = new TaskHubInner().withProperties(new TaskHubProperties()); + TaskHubInner model = new TaskHubInner() + .withProperties(new TaskHubProperties().withCapabilities(Arrays.asList("xe", "mnzb", "bhjpglkfgohdne"))); model = BinaryData.fromObject(model).toObject(TaskHubInner.class); + Assertions.assertEquals("xe", model.properties().capabilities().get(0)); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubListResultTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubListResultTests.java index e24a4074317ff..9c6336174690c 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubListResultTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubListResultTests.java @@ -12,8 +12,9 @@ public final class TaskHubListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TaskHubListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"dashboardUrl\":\"zj\"},\"id\":\"yegu\",\"name\":\"lhbxxhejjzzvdud\",\"type\":\"wdslfhotwmcy\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"dashboardUrl\":\"jnpg\"},\"id\":\"ftadehxnltyfs\",\"name\":\"ppusuesnzwdejba\",\"type\":\"orxzdmohctbqvud\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"dashboardUrl\":\"nvowgujju\"},\"id\":\"dkcglhsl\",\"name\":\"zj\",\"type\":\"yggdtjixh\"},{\"properties\":{\"provisioningState\":\"Provisioning\",\"dashboardUrl\":\"qweykhmenev\"},\"id\":\"exfwhy\",\"name\":\"cibvyvdcsitynn\",\"type\":\"amdecte\"}],\"nextLink\":\"iqscjeypv\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"dashboardUrl\":\"dmhdlxyjr\",\"capabilities\":[\"gafcnihgwqapnedg\",\"bcvkcvqvpkeq\",\"cvdrhvoodsot\",\"obzdopcjwvnhdl\"]},\"id\":\"mgxcxrslpm\",\"name\":\"twuoegrpkhjwni\",\"type\":\"qsluicp\"},{\"properties\":{\"provisioningState\":\"Failed\",\"dashboardUrl\":\"zl\",\"capabilities\":[\"mpaxmodfvuefywsb\",\"fvmwy\",\"rfouyftaakcpw\"]},\"id\":\"zvqtmnubexkp\",\"name\":\"ksmond\",\"type\":\"mquxvypo\"}],\"nextLink\":\"kopkwhojvpajqgx\"}") .toObject(TaskHubListResult.class); - Assertions.assertEquals("iqscjeypv", model.nextLink()); + Assertions.assertEquals("gafcnihgwqapnedg", model.value().get(0).properties().capabilities().get(0)); + Assertions.assertEquals("kopkwhojvpajqgx", model.nextLink()); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubPropertiesTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubPropertiesTests.java index 0ceb5849ea525..f3bade76763ad 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubPropertiesTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubPropertiesTests.java @@ -6,18 +6,23 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.durabletask.models.TaskHubProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; public final class TaskHubPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TaskHubProperties model - = BinaryData.fromString("{\"provisioningState\":\"Canceled\",\"dashboardUrl\":\"bdlwtgrhpdjpj\"}") - .toObject(TaskHubProperties.class); + TaskHubProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Canceled\",\"dashboardUrl\":\"hfwdsjnkaljutiis\",\"capabilities\":[\"ffgdkz\",\"ewkfvhqcrai\",\"vpnpp\"]}") + .toObject(TaskHubProperties.class); + Assertions.assertEquals("ffgdkz", model.capabilities().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TaskHubProperties model = new TaskHubProperties(); + TaskHubProperties model + = new TaskHubProperties().withCapabilities(Arrays.asList("ffgdkz", "ewkfvhqcrai", "vpnpp")); model = BinaryData.fromObject(model).toObject(TaskHubProperties.class); + Assertions.assertEquals("ffgdkz", model.capabilities().get(0)); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsCreateOrUpdateMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsCreateOrUpdateMockTests.java index dd13c3424dce5..b95c0f1eb7b8f 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsCreateOrUpdateMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsCreateOrUpdateMockTests.java @@ -14,6 +14,8 @@ import com.azure.resourcemanager.durabletask.models.TaskHubProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -21,7 +23,7 @@ public final class TaskHubsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"dashboardUrl\":\"vwvxyslqbhsfx\"},\"id\":\"lyt\",\"name\":\"blmpewww\",\"type\":\"bkrvrnsvshqj\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"dashboardUrl\":\"wr\",\"capabilities\":[\"wagohbuffk\",\"rqemvvhmxt\",\"rjfut\",\"coebjvewzcj\"]},\"id\":\"m\",\"name\":\"cpmguaadraufact\",\"type\":\"ahzovajjziuxxp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,10 +33,11 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); TaskHub response = manager.taskHubs() - .define("tswb") - .withExistingScheduler("mjh", "xjyngudivk") - .withProperties(new TaskHubProperties()) + .define("fqjbvleo") + .withExistingScheduler("dyg", "ookk") + .withProperties(new TaskHubProperties().withCapabilities(Arrays.asList("aryeu"))) .create(); + Assertions.assertEquals("wagohbuffk", response.properties().capabilities().get(0)); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsGetWithResponseMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsGetWithResponseMockTests.java index d8cd71c22647e..9bead65aa77fc 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsGetWithResponseMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsGetWithResponseMockTests.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.durabletask.models.TaskHub; 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; @@ -20,7 +21,7 @@ public final class TaskHubsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"dashboardUrl\":\"ncw\"},\"id\":\"hxg\",\"name\":\"trmgucnapkte\",\"type\":\"ellwptfdy\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"dashboardUrl\":\"wrck\",\"capabilities\":[\"lyhpluodpvruud\"]},\"id\":\"zibt\",\"name\":\"ostgkts\",\"type\":\"vdxec\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,8 +31,9 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); TaskHub response = manager.taskHubs() - .getWithResponse("dtpnapnyiropuhp", "gvpgy", "gqgitxmedjvcsl", com.azure.core.util.Context.NONE) + .getWithResponse("ydbsd", "hmkxmaehvbb", "uripltfnhtba", com.azure.core.util.Context.NONE) .getValue(); + Assertions.assertEquals("lyhpluodpvruud", response.properties().capabilities().get(0)); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsListBySchedulerMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsListBySchedulerMockTests.java index 64c5fe9a7cf3c..f13f0a76fac61 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsListBySchedulerMockTests.java +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskHubsListBySchedulerMockTests.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.durabletask.models.TaskHub; 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; @@ -21,7 +22,7 @@ public final class TaskHubsListBySchedulerMockTests { @Test public void testListByScheduler() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"dashboardUrl\":\"hzxct\"},\"id\":\"gbkdmoizpos\",\"name\":\"mgrcfbu\",\"type\":\"rmfqjhhkxbpvj\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"dashboardUrl\":\"mlkxtrqjfs\",\"capabilities\":[\"btx\",\"w\"]},\"id\":\"wsrt\",\"name\":\"wcoezbrhub\",\"type\":\"kh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,7 +32,8 @@ public void testListByScheduler() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.taskHubs().listByScheduler("pfqbuaceopzf", "rhhuaopppcqeqx", com.azure.core.util.Context.NONE); + = manager.taskHubs().listByScheduler("zedqbcvhzlhplo", "qkdlw", com.azure.core.util.Context.NONE); + Assertions.assertEquals("btx", response.iterator().next().properties().capabilities().get(0)); } } diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueInnerTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueInnerTests.java new file mode 100644 index 0000000000000..f05045bda2b45 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueInnerTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.fluent.models.TaskQueueInner; +import com.azure.resourcemanager.durabletask.models.TaskQueueProperties; +import com.azure.resourcemanager.durabletask.models.TaskQueueThroughput; +import org.junit.jupiter.api.Assertions; + +public final class TaskQueueInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TaskQueueInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Updating\",\"throughput\":{\"actionsPerSecond\":478734436}},\"id\":\"fqvm\",\"name\":\"cxozapvhelxp\",\"type\":\"glyatddckcbcuej\"}") + .toObject(TaskQueueInner.class); + Assertions.assertEquals(478734436, model.properties().throughput().actionsPerSecond()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TaskQueueInner model = new TaskQueueInner().withProperties( + new TaskQueueProperties().withThroughput(new TaskQueueThroughput().withActionsPerSecond(478734436))); + model = BinaryData.fromObject(model).toObject(TaskQueueInner.class); + Assertions.assertEquals(478734436, model.properties().throughput().actionsPerSecond()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueListResultTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueListResultTests.java new file mode 100644 index 0000000000000..40d8625b4a2b7 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueListResultTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.implementation.models.TaskQueueListResult; +import org.junit.jupiter.api.Assertions; + +public final class TaskQueueListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TaskQueueListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"throughput\":{\"actionsPerSecond\":218775906}},\"id\":\"m\",\"name\":\"bmrqyibahwfl\",\"type\":\"szdtmhrkwof\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"throughput\":{\"actionsPerSecond\":728388129}},\"id\":\"iexpbtgiwbwo\",\"name\":\"nwashrtd\",\"type\":\"kcnqxwbpo\"},{\"properties\":{\"provisioningState\":\"Accepted\",\"throughput\":{\"actionsPerSecond\":991090920}},\"id\":\"aasipqi\",\"name\":\"obyu\",\"type\":\"erpqlpqwcciuqg\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"throughput\":{\"actionsPerSecond\":204480929}},\"id\":\"fbtkuwhhmhyk\",\"name\":\"joxafnndlpi\",\"type\":\"hkoymkcdyhbp\"}],\"nextLink\":\"pwdreqnovvqf\"}") + .toObject(TaskQueueListResult.class); + Assertions.assertEquals(218775906, model.value().get(0).properties().throughput().actionsPerSecond()); + Assertions.assertEquals("pwdreqnovvqf", model.nextLink()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuePropertiesTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuePropertiesTests.java new file mode 100644 index 0000000000000..71bbda5702095 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuePropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.TaskQueueProperties; +import com.azure.resourcemanager.durabletask.models.TaskQueueThroughput; +import org.junit.jupiter.api.Assertions; + +public final class TaskQueuePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TaskQueueProperties model = BinaryData + .fromString("{\"provisioningState\":\"Failed\",\"throughput\":{\"actionsPerSecond\":612337028}}") + .toObject(TaskQueueProperties.class); + Assertions.assertEquals(612337028, model.throughput().actionsPerSecond()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TaskQueueProperties model + = new TaskQueueProperties().withThroughput(new TaskQueueThroughput().withActionsPerSecond(612337028)); + model = BinaryData.fromObject(model).toObject(TaskQueueProperties.class); + Assertions.assertEquals(612337028, model.throughput().actionsPerSecond()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueThroughputTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueThroughputTests.java new file mode 100644 index 0000000000000..a104c248a8d84 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueThroughputTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.TaskQueueThroughput; +import org.junit.jupiter.api.Assertions; + +public final class TaskQueueThroughputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TaskQueueThroughput model + = BinaryData.fromString("{\"actionsPerSecond\":785036468}").toObject(TaskQueueThroughput.class); + Assertions.assertEquals(785036468, model.actionsPerSecond()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TaskQueueThroughput model = new TaskQueueThroughput().withActionsPerSecond(785036468); + model = BinaryData.fromObject(model).toObject(TaskQueueThroughput.class); + Assertions.assertEquals(785036468, model.actionsPerSecond()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueUpdateTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueUpdateTests.java new file mode 100644 index 0000000000000..dd454630c70da --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueueUpdateTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.TaskQueueProperties; +import com.azure.resourcemanager.durabletask.models.TaskQueueThroughput; +import com.azure.resourcemanager.durabletask.models.TaskQueueUpdate; +import org.junit.jupiter.api.Assertions; + +public final class TaskQueueUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TaskQueueUpdate model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Canceled\",\"throughput\":{\"actionsPerSecond\":1882166065}}}") + .toObject(TaskQueueUpdate.class); + Assertions.assertEquals(1882166065, model.properties().throughput().actionsPerSecond()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TaskQueueUpdate model = new TaskQueueUpdate().withProperties( + new TaskQueueProperties().withThroughput(new TaskQueueThroughput().withActionsPerSecond(1882166065))); + model = BinaryData.fromObject(model).toObject(TaskQueueUpdate.class); + Assertions.assertEquals(1882166065, model.properties().throughput().actionsPerSecond()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesCreateOrUpdateMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesCreateOrUpdateMockTests.java new file mode 100644 index 0000000000000..78315282af5dc --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesCreateOrUpdateMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.TaskQueue; +import com.azure.resourcemanager.durabletask.models.TaskQueueProperties; +import com.azure.resourcemanager.durabletask.models.TaskQueueThroughput; +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 TaskQueuesCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"throughput\":{\"actionsPerSecond\":1720447469}},\"id\":\"vcimpev\",\"name\":\"gmblrri\",\"type\":\"bywdxsmicc\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + TaskQueue response = manager.taskQueues() + .define("iqndieuzaofj") + .withExistingTaskHub("nnrwrbiork", "alywjhhgdn", "xmsivfomiloxggdu") + .withProperties( + new TaskQueueProperties().withThroughput(new TaskQueueThroughput().withActionsPerSecond(315622888))) + .create(); + + Assertions.assertEquals(1720447469, response.properties().throughput().actionsPerSecond()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesGetWithResponseMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesGetWithResponseMockTests.java new file mode 100644 index 0000000000000..b15fd68e2556c --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.TaskQueue; +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 TaskQueuesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Failed\",\"throughput\":{\"actionsPerSecond\":168697362}},\"id\":\"pjuohminyfl\",\"name\":\"orwmduvwpklv\",\"type\":\"w\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + TaskQueue response = manager.taskQueues() + .getWithResponse("hneekul", "gs", "qubkw", "lenrd", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(168697362, response.properties().throughput().actionsPerSecond()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesListByTaskHubMockTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesListByTaskHubMockTests.java new file mode 100644 index 0000000000000..537c1107e8eef --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/TaskQueuesListByTaskHubMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.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.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.durabletask.DurableTaskManager; +import com.azure.resourcemanager.durabletask.models.TaskQueue; +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 TaskQueuesListByTaskHubMockTests { + @Test + public void testListByTaskHub() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Provisioning\",\"throughput\":{\"actionsPerSecond\":549450060}},\"id\":\"sukokwbqplhl\",\"name\":\"nuuepzlrp\",\"type\":\"wzsoldweyuqdunv\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + DurableTaskManager manager = DurableTaskManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.taskQueues() + .listByTaskHub("ygdxpgpqchis", "epn", "bjcrxgibbdaxco", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(549450060, response.iterator().next().properties().throughput().actionsPerSecond()); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/UserAssignedIdentityTests.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/UserAssignedIdentityTests.java new file mode 100644 index 0000000000000..7c0de6735e860 --- /dev/null +++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/test/java/com/azure/resourcemanager/durabletask/generated/UserAssignedIdentityTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.durabletask.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.durabletask.models.UserAssignedIdentity; + +public final class UserAssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserAssignedIdentity model + = BinaryData.fromString("{\"principalId\":\"bbovplwzbhvgyugu\",\"clientId\":\"vmkfssxqu\"}") + .toObject(UserAssignedIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserAssignedIdentity model = new UserAssignedIdentity(); + model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); + } +} diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/tsp-location.yaml b/sdk/durabletask/azure-resourcemanager-durabletask/tsp-location.yaml index 88b0416152cb7..83acb22e0796d 100644 --- a/sdk/durabletask/azure-resourcemanager-durabletask/tsp-location.yaml +++ b/sdk/durabletask/azure-resourcemanager-durabletask/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/durabletask/DurableTask.Management -commit: a86317f00c71ef51aab7f78e6f4a2be3cf58f2cd +directory: specification/durabletask/resource-manager/Microsoft.DurableTask/DurableTask +commit: f1f796502a81c1cf4d44fe97109e8a71fe8ba485 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/edgeoperator/azure-resourcemanager-edgeoperator/pom.xml b/sdk/edgeoperator/azure-resourcemanager-edgeoperator/pom.xml index 07a940781539f..42fc38a57ebb4 100644 --- a/sdk/edgeoperator/azure-resourcemanager-edgeoperator/pom.xml +++ b/sdk/edgeoperator/azure-resourcemanager-edgeoperator/pom.xml @@ -67,7 +67,7 @@ com.azure azure-identity - 1.18.6 + 1.18.7 test