diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md index 066adad9504a..3ffc7767d227 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2023-08-31) + +- Azure Resource Manager ContainerServiceFleet client library for Java. This package contains Microsoft Azure SDK for ContainerServiceFleet Management SDK. Azure Kubernetes Fleet Manager Client. Package tag package-preview-2023-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/README.md b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/README.md index dec1589e1ecb..763c5fc830b0 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/README.md +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ContainerServiceFleet client library for Java. -This package contains Microsoft Azure SDK for ContainerServiceFleet Management SDK. Azure Kubernetes Fleet Manager Client. Package tag package-2023-03-preview. 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 ContainerServiceFleet Management SDK. Azure Kubernetes Fleet Manager Client. Package tag package-preview-2023-08. 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-containerservicefleet - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fcontainerservicefleet%2Fazure-resourcemanager-containerservicefleet%2FREADME.png) diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/SAMPLE.md b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/SAMPLE.md index eb8bbe4c012b..f2cc493e9067 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/SAMPLE.md +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/SAMPLE.md @@ -9,6 +9,13 @@ - [ListByFleet](#fleetmembers_listbyfleet) - [Update](#fleetmembers_update) +## FleetUpdateStrategies + +- [CreateOrUpdate](#fleetupdatestrategies_createorupdate) +- [Delete](#fleetupdatestrategies_delete) +- [Get](#fleetupdatestrategies_get) +- [ListByFleet](#fleetupdatestrategies_listbyfleet) + ## Fleets - [CreateOrUpdate](#fleets_createorupdate) @@ -37,7 +44,7 @@ /** Samples for FleetMembers Create. */ public final class FleetMembersCreateSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/FleetMembers_Create.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Create.json */ /** * Sample code: Creates a FleetMember resource with a long running operation. @@ -63,7 +70,7 @@ public final class FleetMembersCreateSamples { /** Samples for FleetMembers Delete. */ public final class FleetMembersDeleteSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/FleetMembers_Delete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Delete.json */ /** * Sample code: Deletes a FleetMember resource asynchronously with a long running operation. @@ -83,7 +90,7 @@ public final class FleetMembersDeleteSamples { /** Samples for FleetMembers Get. */ public final class FleetMembersGetSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/FleetMembers_Get.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Get.json */ /** * Sample code: Gets a FleetMember resource. @@ -103,7 +110,7 @@ public final class FleetMembersGetSamples { /** Samples for FleetMembers ListByFleet. */ public final class FleetMembersListByFleetSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/FleetMembers_ListByFleet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_ListByFleet.json */ /** * Sample code: Lists the members of a Fleet. @@ -125,7 +132,7 @@ import com.azure.resourcemanager.containerservicefleet.models.FleetMember; /** Samples for FleetMembers Update. */ public final class FleetMembersUpdateSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/FleetMembers_Update.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Update.json */ /** * Sample code: Updates a FleetMember resource synchronously. @@ -144,6 +151,104 @@ public final class FleetMembersUpdateSamples { } ``` +### FleetUpdateStrategies_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservicefleet.models.UpdateGroup; +import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; +import com.azure.resourcemanager.containerservicefleet.models.UpdateStage; +import java.util.Arrays; + +/** Samples for FleetUpdateStrategies CreateOrUpdate. */ +public final class FleetUpdateStrategiesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_CreateOrUpdate.json + */ + /** + * Sample code: Create a FleetUpdateStrategy. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void createAFleetUpdateStrategy( + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager + .fleetUpdateStrategies() + .define("strartegy1") + .withExistingFleet("rg1", "fleet1") + .withStrategy( + new UpdateRunStrategy() + .withStages( + Arrays + .asList( + new UpdateStage() + .withName("stage1") + .withGroups(Arrays.asList(new UpdateGroup().withName("group-a"))) + .withAfterStageWaitInSeconds(3600)))) + .create(); + } +} +``` + +### FleetUpdateStrategies_Delete + +```java +/** Samples for FleetUpdateStrategies Delete. */ +public final class FleetUpdateStrategiesDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_Delete.json + */ + /** + * Sample code: Delete a FleetUpdateStrategy resource. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void deleteAFleetUpdateStrategyResource( + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.fleetUpdateStrategies().delete("rg1", "fleet1", "strategy1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### FleetUpdateStrategies_Get + +```java +/** Samples for FleetUpdateStrategies Get. */ +public final class FleetUpdateStrategiesGetSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_Get.json + */ + /** + * Sample code: Get a FleetUpdateStrategy resource. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void getAFleetUpdateStrategyResource( + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.fleetUpdateStrategies().getWithResponse("rg1", "fleet1", "strategy1", com.azure.core.util.Context.NONE); + } +} +``` + +### FleetUpdateStrategies_ListByFleet + +```java +/** Samples for FleetUpdateStrategies ListByFleet. */ +public final class FleetUpdateStrategiesListByFleetSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_ListByFleet.json + */ + /** + * Sample code: List the FleetUpdateStrategy resources by fleet. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void listTheFleetUpdateStrategyResourcesByFleet( + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.fleetUpdateStrategies().listByFleet("rg1", "fleet1", com.azure.core.util.Context.NONE); + } +} +``` + ### Fleets_CreateOrUpdate ```java @@ -154,7 +259,7 @@ import java.util.Map; /** Samples for Fleets CreateOrUpdate. */ public final class FleetsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_CreateOrUpdate.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_CreateOrUpdate.json */ /** * Sample code: Creates a Fleet resource with a long running operation. @@ -173,6 +278,7 @@ public final class FleetsCreateOrUpdateSamples { .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -192,7 +298,7 @@ public final class FleetsCreateOrUpdateSamples { /** Samples for Fleets Delete. */ public final class FleetsDeleteSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_Delete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_Delete.json */ /** * Sample code: Deletes a Fleet resource asynchronously with a long running operation. @@ -212,7 +318,7 @@ public final class FleetsDeleteSamples { /** Samples for Fleets GetByResourceGroup. */ public final class FleetsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_Get.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_Get.json */ /** * Sample code: Gets a Fleet resource. @@ -232,7 +338,7 @@ public final class FleetsGetByResourceGroupSamples { /** Samples for Fleets List. */ public final class FleetsListSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_ListBySub.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_ListBySub.json */ /** * Sample code: Lists the Fleet resources in a subscription. @@ -252,7 +358,7 @@ public final class FleetsListSamples { /** Samples for Fleets ListByResourceGroup. */ public final class FleetsListByResourceGroupSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_ListByResourceGroup.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_ListByResourceGroup.json */ /** * Sample code: Lists the Fleet resources in a resource group. @@ -272,7 +378,7 @@ public final class FleetsListByResourceGroupSamples { /** Samples for Fleets ListCredentials. */ public final class FleetsListCredentialsSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_ListCredentialsResult.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_ListCredentialsResult.json */ /** * Sample code: Lists the user credentials of a Fleet. @@ -296,7 +402,7 @@ import java.util.Map; /** Samples for Fleets Update. */ public final class FleetsUpdateSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_PatchTags.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_PatchTags.json */ /** * Sample code: Update a Fleet. @@ -313,6 +419,7 @@ public final class FleetsUpdateSamples { resource.update().withTags(mapOf("env", "prod", "tier", "secure")).withIfMatch("dfjkwelr7384").apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -332,7 +439,7 @@ public final class FleetsUpdateSamples { /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Operations_List.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Operations_List.json */ /** * Sample code: List the operations for the provider. @@ -352,6 +459,8 @@ public final class OperationsListSamples { import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpdate; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeSpec; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeType; +import com.azure.resourcemanager.containerservicefleet.models.NodeImageSelection; +import com.azure.resourcemanager.containerservicefleet.models.NodeImageSelectionType; import com.azure.resourcemanager.containerservicefleet.models.UpdateGroup; import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; import com.azure.resourcemanager.containerservicefleet.models.UpdateStage; @@ -360,7 +469,7 @@ import java.util.Arrays; /** Samples for UpdateRuns CreateOrUpdate. */ public final class UpdateRunsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_CreateOrUpdate.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_CreateOrUpdate.json */ /** * Sample code: Create an UpdateRun. @@ -373,6 +482,8 @@ public final class UpdateRunsCreateOrUpdateSamples { .updateRuns() .define("run1") .withExistingFleet("rg1", "fleet1") + .withUpdateStrategyId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1") .withStrategy( new UpdateRunStrategy() .withStages( @@ -387,7 +498,8 @@ public final class UpdateRunsCreateOrUpdateSamples { .withUpgrade( new ManagedClusterUpgradeSpec() .withType(ManagedClusterUpgradeType.FULL) - .withKubernetesVersion("1.26.1"))) + .withKubernetesVersion("1.26.1")) + .withNodeImageSelection(new NodeImageSelection().withType(NodeImageSelectionType.LATEST))) .create(); } } @@ -399,7 +511,7 @@ public final class UpdateRunsCreateOrUpdateSamples { /** Samples for UpdateRuns Delete. */ public final class UpdateRunsDeleteSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_Delete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Delete.json */ /** * Sample code: Delete an updateRun resource. @@ -419,7 +531,7 @@ public final class UpdateRunsDeleteSamples { /** Samples for UpdateRuns Get. */ public final class UpdateRunsGetSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_Get.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Get.json */ /** * Sample code: Gets an UpdateRun resource. @@ -439,7 +551,7 @@ public final class UpdateRunsGetSamples { /** Samples for UpdateRuns ListByFleet. */ public final class UpdateRunsListByFleetSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_ListByFleet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_ListByFleet.json */ /** * Sample code: Lists the UpdateRun resources by fleet. @@ -459,7 +571,7 @@ public final class UpdateRunsListByFleetSamples { /** Samples for UpdateRuns Start. */ public final class UpdateRunsStartSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_Start.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Start.json */ /** * Sample code: Starts an UpdateRun. @@ -479,7 +591,7 @@ public final class UpdateRunsStartSamples { /** Samples for UpdateRuns Stop. */ public final class UpdateRunsStopSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_Stop.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Stop.json */ /** * Sample code: Stops an UpdateRun. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml index 3f03a86fa222..a8410c501242 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for ContainerServiceFleet Management - This package contains Microsoft Azure SDK for ContainerServiceFleet Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Kubernetes Fleet Manager Client. Package tag package-2023-03-preview. + This package contains Microsoft Azure SDK for ContainerServiceFleet Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Kubernetes Fleet Manager Client. Package tag package-preview-2023-08. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/ContainerServiceFleetManager.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/ContainerServiceFleetManager.java index c830f572a53b..a3055c98060c 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/ContainerServiceFleetManager.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/ContainerServiceFleetManager.java @@ -26,10 +26,12 @@ import com.azure.resourcemanager.containerservicefleet.fluent.ContainerServiceFleetManagementClient; import com.azure.resourcemanager.containerservicefleet.implementation.ContainerServiceFleetManagementClientBuilder; import com.azure.resourcemanager.containerservicefleet.implementation.FleetMembersImpl; +import com.azure.resourcemanager.containerservicefleet.implementation.FleetUpdateStrategiesImpl; import com.azure.resourcemanager.containerservicefleet.implementation.FleetsImpl; import com.azure.resourcemanager.containerservicefleet.implementation.OperationsImpl; import com.azure.resourcemanager.containerservicefleet.implementation.UpdateRunsImpl; import com.azure.resourcemanager.containerservicefleet.models.FleetMembers; +import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategies; import com.azure.resourcemanager.containerservicefleet.models.Fleets; import com.azure.resourcemanager.containerservicefleet.models.Operations; import com.azure.resourcemanager.containerservicefleet.models.UpdateRuns; @@ -50,6 +52,8 @@ public final class ContainerServiceFleetManager { private UpdateRuns updateRuns; + private FleetUpdateStrategies fleetUpdateStrategies; + private final ContainerServiceFleetManagementClient clientObject; private ContainerServiceFleetManager( @@ -322,8 +326,22 @@ public UpdateRuns updateRuns() { } /** - * @return Wrapped service client ContainerServiceFleetManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets the resource collection API of FleetUpdateStrategies. It manages FleetUpdateStrategy. + * + * @return Resource collection API of FleetUpdateStrategies. + */ + public FleetUpdateStrategies fleetUpdateStrategies() { + if (this.fleetUpdateStrategies == null) { + this.fleetUpdateStrategies = new FleetUpdateStrategiesImpl(clientObject.getFleetUpdateStrategies(), this); + } + return fleetUpdateStrategies; + } + + /** + * Gets wrapped service client ContainerServiceFleetManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client ContainerServiceFleetManagementClient. */ public ContainerServiceFleetManagementClient serviceClient() { return this.clientObject; diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/ContainerServiceFleetManagementClient.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/ContainerServiceFleetManagementClient.java index 969e4dda852e..d078a056ec21 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/ContainerServiceFleetManagementClient.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/ContainerServiceFleetManagementClient.java @@ -71,4 +71,11 @@ public interface ContainerServiceFleetManagementClient { * @return the UpdateRunsClient object. */ UpdateRunsClient getUpdateRuns(); + + /** + * Gets the FleetUpdateStrategiesClient object to access its operations. + * + * @return the FleetUpdateStrategiesClient object. + */ + FleetUpdateStrategiesClient getFleetUpdateStrategies(); } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetMembersClient.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetMembersClient.java index 0471f5c8a45b..f63d744b178d 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetMembersClient.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetMembersClient.java @@ -155,6 +155,22 @@ FleetMemberInner create( String ifNoneMatch, Context context); + /** + * Update a FleetMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param fleetMemberName The name of the Fleet member resource. + * @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 member of the Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FleetMemberInner> beginUpdate( + String resourceGroupName, String fleetName, String fleetMemberName, FleetMemberUpdate properties); + /** * Update a FleetMember. * @@ -167,10 +183,10 @@ FleetMemberInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 member of the Fleet along with {@link Response}. + * @return the {@link SyncPoller} for polling of a member of the Fleet. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FleetMemberInner> beginUpdate( String resourceGroupName, String fleetName, String fleetMemberName, @@ -194,6 +210,29 @@ Response updateWithResponse( FleetMemberInner update( String resourceGroupName, String fleetName, String fleetMemberName, FleetMemberUpdate properties); + /** + * Update a FleetMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param fleetMemberName The name of the Fleet member resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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 member of the Fleet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetMemberInner update( + String resourceGroupName, + String fleetName, + String fleetMemberName, + FleetMemberUpdate properties, + String ifMatch, + Context context); + /** * Delete a FleetMember. * diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetUpdateStrategiesClient.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetUpdateStrategiesClient.java new file mode 100644 index 000000000000..b300330e42c0 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetUpdateStrategiesClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.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.containerservicefleet.fluent.models.FleetUpdateStrategyInner; + +/** An instance of this class provides access to all the operations defined in FleetUpdateStrategiesClient. */ +public interface FleetUpdateStrategiesClient { + /** + * List FleetUpdateStrategy resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFleet(String resourceGroupName, String fleetName); + + /** + * List FleetUpdateStrategy resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFleet(String resourceGroupName, String fleetName, Context context); + + /** + * Get a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FleetUpdateStrategy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String fleetName, String updateStrategyName, Context context); + + /** + * Get a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FleetUpdateStrategy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetUpdateStrategyInner get(String resourceGroupName, String fleetName, String updateStrategyName); + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @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 defines a multi-stage process to perform update operations across + * members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FleetUpdateStrategyInner> beginCreateOrUpdate( + String resourceGroupName, String fleetName, String updateStrategyName, FleetUpdateStrategyInner resource); + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @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 defines a multi-stage process to perform update operations across + * members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FleetUpdateStrategyInner> beginCreateOrUpdate( + String resourceGroupName, + String fleetName, + String updateStrategyName, + FleetUpdateStrategyInner resource, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @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 defines a multi-stage process to perform update operations across members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetUpdateStrategyInner createOrUpdate( + String resourceGroupName, String fleetName, String updateStrategyName, FleetUpdateStrategyInner resource); + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @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 defines a multi-stage process to perform update operations across members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetUpdateStrategyInner createOrUpdate( + String resourceGroupName, + String fleetName, + String updateStrategyName, + FleetUpdateStrategyInner resource, + String ifMatch, + String ifNoneMatch, + Context context); + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String fleetName, String updateStrategyName); + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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 fleetName, String updateStrategyName, String ifMatch, Context context); + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String fleetName, String updateStrategyName); + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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 fleetName, String updateStrategyName, String ifMatch, Context context); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetsClient.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetsClient.java index 8e13481a37f9..1a8a5cc3e72b 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetsClient.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/FleetsClient.java @@ -166,6 +166,21 @@ FleetInner createOrUpdate( String ifNoneMatch, Context context); + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @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 the Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FleetInner> beginUpdate( + String resourceGroupName, String fleetName, FleetPatch properties); + /** * Update a Fleet. * @@ -177,10 +192,10 @@ FleetInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Fleet resource along with {@link Response}. + * @return the {@link SyncPoller} for polling of the Fleet resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FleetInner> beginUpdate( String resourceGroupName, String fleetName, FleetPatch properties, String ifMatch, Context context); /** @@ -197,6 +212,23 @@ Response updateWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) FleetInner update(String resourceGroupName, String fleetName, FleetPatch properties); + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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 Fleet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetInner update( + String resourceGroupName, String fleetName, FleetPatch properties, String ifMatch, Context context); + /** * Delete a Fleet. * diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/UpdateRunsClient.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/UpdateRunsClient.java index 4600c323c647..014b760e35b8 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/UpdateRunsClient.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/UpdateRunsClient.java @@ -82,8 +82,8 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UpdateRunInner> beginCreateOrUpdate( @@ -102,8 +102,8 @@ SyncPoller, UpdateRunInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UpdateRunInner> beginCreateOrUpdate( @@ -125,7 +125,7 @@ SyncPoller, UpdateRunInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) UpdateRunInner createOrUpdate( @@ -144,7 +144,7 @@ UpdateRunInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) UpdateRunInner createOrUpdate( @@ -224,8 +224,8 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UpdateRunInner> beginStart( @@ -242,8 +242,8 @@ SyncPoller, UpdateRunInner> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UpdateRunInner> beginStart( @@ -258,7 +258,7 @@ SyncPoller, UpdateRunInner> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) UpdateRunInner start(String resourceGroupName, String fleetName, String updateRunName); @@ -274,7 +274,7 @@ SyncPoller, UpdateRunInner> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) UpdateRunInner start( @@ -289,8 +289,8 @@ UpdateRunInner start( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UpdateRunInner> beginStop( @@ -307,8 +307,8 @@ SyncPoller, UpdateRunInner> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, UpdateRunInner> beginStop( @@ -323,7 +323,7 @@ SyncPoller, UpdateRunInner> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) UpdateRunInner stop(String resourceGroupName, String fleetName, String updateRunName); @@ -339,7 +339,7 @@ SyncPoller, UpdateRunInner> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) UpdateRunInner stop( diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetInner.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetInner.java index eb33abb3b654..9ae7c731c534 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetInner.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetInner.java @@ -9,6 +9,7 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.containerservicefleet.models.FleetHubProfile; import com.azure.resourcemanager.containerservicefleet.models.FleetProvisioningState; +import com.azure.resourcemanager.containerservicefleet.models.ManagedServiceIdentity; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -30,6 +31,12 @@ public final class FleetInner extends Resource { @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /* + * Managed identity. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -61,6 +68,26 @@ public String etag() { return this.etag; } + /** + * Get the identity property: Managed identity. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed identity. + * + * @param identity the identity value to set. + * @return the FleetInner object itself. + */ + public FleetInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -125,5 +152,8 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetUpdateStrategyInner.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetUpdateStrategyInner.java new file mode 100644 index 000000000000..1735c187bbe1 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetUpdateStrategyInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategyProvisioningState; +import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines a multi-stage process to perform update operations across members of a Fleet. */ +@Fluent +public final class FleetUpdateStrategyInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties") + private FleetUpdateStrategyProperties innerProperties; + + /* + * If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. + * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity + * tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section + * 14.27) header fields. + */ + @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** Creates an instance of FleetUpdateStrategyInner class. */ + public FleetUpdateStrategyInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private FleetUpdateStrategyProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: If eTag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the provisioningState property: The provisioning state of the UpdateStrategy resource. + * + * @return the provisioningState value. + */ + public FleetUpdateStrategyProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the strategy property: Defines the update sequence of the clusters. + * + * @return the strategy value. + */ + public UpdateRunStrategy strategy() { + return this.innerProperties() == null ? null : this.innerProperties().strategy(); + } + + /** + * Set the strategy property: Defines the update sequence of the clusters. + * + * @param strategy the strategy value to set. + * @return the FleetUpdateStrategyInner object itself. + */ + public FleetUpdateStrategyInner withStrategy(UpdateRunStrategy strategy) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetUpdateStrategyProperties(); + } + this.innerProperties().withStrategy(strategy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetUpdateStrategyProperties.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetUpdateStrategyProperties.java new file mode 100644 index 000000000000..d96273b33975 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetUpdateStrategyProperties.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategyProvisioningState; +import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the UpdateStrategy. */ +@Fluent +public final class FleetUpdateStrategyProperties { + /* + * The provisioning state of the UpdateStrategy resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private FleetUpdateStrategyProvisioningState provisioningState; + + /* + * Defines the update sequence of the clusters. + */ + @JsonProperty(value = "strategy", required = true) + private UpdateRunStrategy strategy; + + /** Creates an instance of FleetUpdateStrategyProperties class. */ + public FleetUpdateStrategyProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the UpdateStrategy resource. + * + * @return the provisioningState value. + */ + public FleetUpdateStrategyProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the strategy property: Defines the update sequence of the clusters. + * + * @return the strategy value. + */ + public UpdateRunStrategy strategy() { + return this.strategy; + } + + /** + * Set the strategy property: Defines the update sequence of the clusters. + * + * @param strategy the strategy value to set. + * @return the FleetUpdateStrategyProperties object itself. + */ + public FleetUpdateStrategyProperties withStrategy(UpdateRunStrategy strategy) { + this.strategy = strategy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (strategy() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property strategy in model FleetUpdateStrategyProperties")); + } else { + strategy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FleetUpdateStrategyProperties.class); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/UpdateRunInner.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/UpdateRunInner.java index d38284fb3d31..a8f8052fabb9 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/UpdateRunInner.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/UpdateRunInner.java @@ -6,14 +6,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpdate; import com.azure.resourcemanager.containerservicefleet.models.UpdateRunProvisioningState; import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStatus; import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; import com.fasterxml.jackson.annotation.JsonProperty; -/** An UpdateRun is a multi-stage process to perform update operations across members of a Fleet. */ +/** A multi-stage process to perform update operations across members of a Fleet. */ @Fluent public final class UpdateRunInner extends ProxyResource { /* @@ -31,12 +30,6 @@ public final class UpdateRunInner extends ProxyResource { @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) private String etag; - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - /** Creates an instance of UpdateRunInner class. */ public UpdateRunInner() { } @@ -63,21 +56,57 @@ public String etag() { } /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Get the provisioningState property: The provisioning state of the UpdateRun resource. * - * @return the systemData value. + * @return the provisioningState value. */ - public SystemData systemData() { - return this.systemData; + public UpdateRunProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** - * Get the provisioningState property: The provisioning state of the UpdateRun resource. + * Get the updateStrategyId property: The resource id of the FleetUpdateStrategy resource to reference. * - * @return the provisioningState value. + *

When creating a new run, there are three ways to define a strategy for the run: 1. Define a new strategy in + * place: Set the "strategy" field. 2. Use an existing strategy: Set the "updateStrategyId" field. (since + * 2023-08-15-preview) 3. Use the default strategy to update all the members one by one: Leave both + * "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + * + *

Setting both "updateStrategyId" and "strategy" is invalid. + * + *

UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and + * store it in the "strategy" field. Subsequent changes to the referenced FleetUpdateStrategy resource do not + * propagate. UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + * + * @return the updateStrategyId value. */ - public UpdateRunProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public String updateStrategyId() { + return this.innerProperties() == null ? null : this.innerProperties().updateStrategyId(); + } + + /** + * Set the updateStrategyId property: The resource id of the FleetUpdateStrategy resource to reference. + * + *

When creating a new run, there are three ways to define a strategy for the run: 1. Define a new strategy in + * place: Set the "strategy" field. 2. Use an existing strategy: Set the "updateStrategyId" field. (since + * 2023-08-15-preview) 3. Use the default strategy to update all the members one by one: Leave both + * "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + * + *

Setting both "updateStrategyId" and "strategy" is invalid. + * + *

UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and + * store it in the "strategy" field. Subsequent changes to the referenced FleetUpdateStrategy resource do not + * propagate. UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + * + * @param updateStrategyId the updateStrategyId value to set. + * @return the UpdateRunInner object itself. + */ + public UpdateRunInner withUpdateStrategyId(String updateStrategyId) { + if (this.innerProperties() == null) { + this.innerProperties = new UpdateRunProperties(); + } + this.innerProperties().withUpdateStrategyId(updateStrategyId); + return this; } /** diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/UpdateRunProperties.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/UpdateRunProperties.java index 4bf52c56a42f..bdafc6dc98b6 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/UpdateRunProperties.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/UpdateRunProperties.java @@ -21,6 +21,25 @@ public final class UpdateRunProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private UpdateRunProvisioningState provisioningState; + /* + * The resource id of the FleetUpdateStrategy resource to reference. + * + * When creating a new run, there are three ways to define a strategy for the run: + * 1. Define a new strategy in place: Set the "strategy" field. + * 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + * 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" + * unset. (since 2023-08-15-preview) + * + * Setting both "updateStrategyId" and "strategy" is invalid. + * + * UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and + * store it in the "strategy" field. + * Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + * UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + */ + @JsonProperty(value = "updateStrategyId") + private String updateStrategyId; + /* * The strategy defines the order in which the clusters will be updated. * If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a @@ -56,6 +75,48 @@ public UpdateRunProvisioningState provisioningState() { return this.provisioningState; } + /** + * Get the updateStrategyId property: The resource id of the FleetUpdateStrategy resource to reference. + * + *

When creating a new run, there are three ways to define a strategy for the run: 1. Define a new strategy in + * place: Set the "strategy" field. 2. Use an existing strategy: Set the "updateStrategyId" field. (since + * 2023-08-15-preview) 3. Use the default strategy to update all the members one by one: Leave both + * "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + * + *

Setting both "updateStrategyId" and "strategy" is invalid. + * + *

UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and + * store it in the "strategy" field. Subsequent changes to the referenced FleetUpdateStrategy resource do not + * propagate. UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + * + * @return the updateStrategyId value. + */ + public String updateStrategyId() { + return this.updateStrategyId; + } + + /** + * Set the updateStrategyId property: The resource id of the FleetUpdateStrategy resource to reference. + * + *

When creating a new run, there are three ways to define a strategy for the run: 1. Define a new strategy in + * place: Set the "strategy" field. 2. Use an existing strategy: Set the "updateStrategyId" field. (since + * 2023-08-15-preview) 3. Use the default strategy to update all the members one by one: Leave both + * "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + * + *

Setting both "updateStrategyId" and "strategy" is invalid. + * + *

UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and + * store it in the "strategy" field. Subsequent changes to the referenced FleetUpdateStrategy resource do not + * propagate. UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + * + * @param updateStrategyId the updateStrategyId value to set. + * @return the UpdateRunProperties object itself. + */ + public UpdateRunProperties withUpdateStrategyId(String updateStrategyId) { + this.updateStrategyId = updateStrategyId; + return this; + } + /** * Get the strategy property: The strategy defines the order in which the clusters will be updated. If not set, all * members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/ContainerServiceFleetManagementClientBuilder.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/ContainerServiceFleetManagementClientBuilder.java index acfe1c1ad16f..c6c133263ee1 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/ContainerServiceFleetManagementClientBuilder.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/ContainerServiceFleetManagementClientBuilder.java @@ -137,7 +137,7 @@ public ContainerServiceFleetManagementClientImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/ContainerServiceFleetManagementClientImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/ContainerServiceFleetManagementClientImpl.java index c935723c3379..4b034c6d669b 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/ContainerServiceFleetManagementClientImpl.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/ContainerServiceFleetManagementClientImpl.java @@ -24,6 +24,7 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.containerservicefleet.fluent.ContainerServiceFleetManagementClient; import com.azure.resourcemanager.containerservicefleet.fluent.FleetMembersClient; +import com.azure.resourcemanager.containerservicefleet.fluent.FleetUpdateStrategiesClient; import com.azure.resourcemanager.containerservicefleet.fluent.FleetsClient; import com.azure.resourcemanager.containerservicefleet.fluent.OperationsClient; import com.azure.resourcemanager.containerservicefleet.fluent.UpdateRunsClient; @@ -159,6 +160,18 @@ public UpdateRunsClient getUpdateRuns() { return this.updateRuns; } + /** The FleetUpdateStrategiesClient object to access its operations. */ + private final FleetUpdateStrategiesClient fleetUpdateStrategies; + + /** + * Gets the FleetUpdateStrategiesClient object to access its operations. + * + * @return the FleetUpdateStrategiesClient object. + */ + public FleetUpdateStrategiesClient getFleetUpdateStrategies() { + return this.fleetUpdateStrategies; + } + /** * Initializes an instance of ContainerServiceFleetManagementClient client. * @@ -181,11 +194,12 @@ public UpdateRunsClient getUpdateRuns() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-03-15-preview"; + this.apiVersion = "2023-08-15-preview"; this.operations = new OperationsClientImpl(this); this.fleets = new FleetsClientImpl(this); this.fleetMembers = new FleetMembersClientImpl(this); this.updateRuns = new UpdateRunsClientImpl(this); + this.fleetUpdateStrategies = new FleetUpdateStrategiesClientImpl(this); } /** diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetImpl.java index faec43979470..ec42ed7e9ad0 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetImpl.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetImpl.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.containerservicefleet.models.FleetHubProfile; import com.azure.resourcemanager.containerservicefleet.models.FleetPatch; import com.azure.resourcemanager.containerservicefleet.models.FleetProvisioningState; +import com.azure.resourcemanager.containerservicefleet.models.ManagedServiceIdentity; import java.util.Collections; import java.util.Map; @@ -51,6 +52,10 @@ public String etag() { return this.innerModel().etag(); } + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -140,8 +145,7 @@ public Fleet apply() { serviceManager .serviceClient() .getFleets() - .updateWithResponse(resourceGroupName, fleetName, updateProperties, updateIfMatch, Context.NONE) - .getValue(); + .update(resourceGroupName, fleetName, updateProperties, updateIfMatch, Context.NONE); return this; } @@ -150,8 +154,7 @@ public Fleet apply(Context context) { serviceManager .serviceClient() .getFleets() - .updateWithResponse(resourceGroupName, fleetName, updateProperties, updateIfMatch, context) - .getValue(); + .update(resourceGroupName, fleetName, updateProperties, updateIfMatch, context); return this; } @@ -212,6 +215,16 @@ public FleetImpl withTags(Map tags) { } } + public FleetImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProperties.withIdentity(identity); + return this; + } + } + public FleetImpl withHubProfile(FleetHubProfile hubProfile) { this.innerModel().withHubProfile(hubProfile); return this; diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetMemberImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetMemberImpl.java index 56c962e867b9..e0af292a07ba 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetMemberImpl.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetMemberImpl.java @@ -132,9 +132,7 @@ public FleetMember apply() { serviceManager .serviceClient() .getFleetMembers() - .updateWithResponse( - resourceGroupName, fleetName, fleetMemberName, updateProperties, updateIfMatch, Context.NONE) - .getValue(); + .update(resourceGroupName, fleetName, fleetMemberName, updateProperties, updateIfMatch, Context.NONE); return this; } @@ -143,9 +141,7 @@ public FleetMember apply(Context context) { serviceManager .serviceClient() .getFleetMembers() - .updateWithResponse( - resourceGroupName, fleetName, fleetMemberName, updateProperties, updateIfMatch, context) - .getValue(); + .update(resourceGroupName, fleetName, fleetMemberName, updateProperties, updateIfMatch, context); return this; } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetMembersClientImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetMembersClientImpl.java index 90c28879b844..6761e079572c 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetMembersClientImpl.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetMembersClientImpl.java @@ -116,9 +116,9 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}") - @ExpectedResponses({200}) + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> update( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -921,7 +921,7 @@ public FleetMemberInner create( * @return a member of the Fleet along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, String fleetName, String fleetMemberName, @@ -989,7 +989,7 @@ private Mono> updateWithResponseAsync( * @return a member of the Fleet along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, String fleetName, String fleetMemberName, @@ -1040,6 +1040,170 @@ private Mono> updateWithResponseAsync( context); } + /** + * Update a FleetMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param fleetMemberName The name of the Fleet member resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 member of the Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetMemberInner> beginUpdateAsync( + String resourceGroupName, + String fleetName, + String fleetMemberName, + FleetMemberUpdate properties, + String ifMatch) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FleetMemberInner.class, + FleetMemberInner.class, + this.client.getContext()); + } + + /** + * Update a FleetMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param fleetMemberName The name of the Fleet member resource. + * @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 member of the Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetMemberInner> beginUpdateAsync( + String resourceGroupName, String fleetName, String fleetMemberName, FleetMemberUpdate properties) { + final String ifMatch = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FleetMemberInner.class, + FleetMemberInner.class, + this.client.getContext()); + } + + /** + * Update a FleetMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param fleetMemberName The name of the Fleet member resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a member of the Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetMemberInner> beginUpdateAsync( + String resourceGroupName, + String fleetName, + String fleetMemberName, + FleetMemberUpdate properties, + String ifMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FleetMemberInner.class, FleetMemberInner.class, context); + } + + /** + * Update a FleetMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param fleetMemberName The name of the Fleet member resource. + * @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 member of the Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FleetMemberInner> beginUpdate( + String resourceGroupName, String fleetName, String fleetMemberName, FleetMemberUpdate properties) { + final String ifMatch = null; + return this + .beginUpdateAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch) + .getSyncPoller(); + } + + /** + * Update a FleetMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param fleetMemberName The name of the Fleet member resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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 member of the Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FleetMemberInner> beginUpdate( + String resourceGroupName, + String fleetName, + String fleetMemberName, + FleetMemberUpdate properties, + String ifMatch, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch, context) + .getSyncPoller(); + } + + /** + * Update a FleetMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param fleetMemberName The name of the Fleet member resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 member of the Fleet on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String fleetName, + String fleetMemberName, + FleetMemberUpdate properties, + String ifMatch) { + return beginUpdateAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + /** * Update a FleetMember. * @@ -1056,8 +1220,9 @@ private Mono> updateWithResponseAsync( private Mono updateAsync( String resourceGroupName, String fleetName, String fleetMemberName, FleetMemberUpdate properties) { final String ifMatch = null; - return updateWithResponseAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return beginUpdateAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1072,18 +1237,19 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 member of the Fleet along with {@link Response}. + * @return a member of the Fleet on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( + private Mono updateAsync( String resourceGroupName, String fleetName, String fleetMemberName, FleetMemberUpdate properties, String ifMatch, Context context) { - return updateWithResponseAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch, context) - .block(); + return beginUpdateAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1102,8 +1268,32 @@ public Response updateWithResponse( public FleetMemberInner update( String resourceGroupName, String fleetName, String fleetMemberName, FleetMemberUpdate properties) { final String ifMatch = null; - return updateWithResponse(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch, Context.NONE) - .getValue(); + return updateAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch).block(); + } + + /** + * Update a FleetMember. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param fleetMemberName The name of the Fleet member resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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 member of the Fleet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetMemberInner update( + String resourceGroupName, + String fleetName, + String fleetMemberName, + FleetMemberUpdate properties, + String ifMatch, + Context context) { + return updateAsync(resourceGroupName, fleetName, fleetMemberName, properties, ifMatch, context).block(); } /** diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetUpdateStrategiesClientImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetUpdateStrategiesClientImpl.java new file mode 100644 index 000000000000..6fa960d9abfc --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetUpdateStrategiesClientImpl.java @@ -0,0 +1,1305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservicefleet.fluent.FleetUpdateStrategiesClient; +import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetUpdateStrategyInner; +import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategyListResult; +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 FleetUpdateStrategiesClient. */ +public final class FleetUpdateStrategiesClientImpl implements FleetUpdateStrategiesClient { + /** The proxy service used to perform REST calls. */ + private final FleetUpdateStrategiesService service; + + /** The service client containing this operation class. */ + private final ContainerServiceFleetManagementClientImpl client; + + /** + * Initializes an instance of FleetUpdateStrategiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FleetUpdateStrategiesClientImpl(ContainerServiceFleetManagementClientImpl client) { + this.service = + RestProxy + .create(FleetUpdateStrategiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceFleetManagementClientFleetUpdateStrategies to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceFlee") + public interface FleetUpdateStrategiesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFleet( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fleetName") String fleetName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("fleetName") String fleetName, + @PathParam("updateStrategyName") String updateStrategyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, + @PathParam("fleetName") String fleetName, + @PathParam("updateStrategyName") String updateStrategyName, + @BodyParam("application/json") FleetUpdateStrategyInner resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("If-Match") String ifMatch, + @PathParam("fleetName") String fleetName, + @PathParam("updateStrategyName") String updateStrategyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFleetNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List FleetUpdateStrategy resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFleetSinglePageAsync( + String resourceGroupName, String fleetName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByFleet( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + fleetName, + 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 FleetUpdateStrategy resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFleetSinglePageAsync( + String resourceGroupName, String fleetName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByFleet( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + fleetName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List FleetUpdateStrategy resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFleetAsync(String resourceGroupName, String fleetName) { + return new PagedFlux<>( + () -> listByFleetSinglePageAsync(resourceGroupName, fleetName), + nextLink -> listByFleetNextSinglePageAsync(nextLink)); + } + + /** + * List FleetUpdateStrategy resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFleetAsync( + String resourceGroupName, String fleetName, Context context) { + return new PagedFlux<>( + () -> listByFleetSinglePageAsync(resourceGroupName, fleetName, context), + nextLink -> listByFleetNextSinglePageAsync(nextLink, context)); + } + + /** + * List FleetUpdateStrategy resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFleet(String resourceGroupName, String fleetName) { + return new PagedIterable<>(listByFleetAsync(resourceGroupName, fleetName)); + } + + /** + * List FleetUpdateStrategy resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFleet( + String resourceGroupName, String fleetName, Context context) { + return new PagedIterable<>(listByFleetAsync(resourceGroupName, fleetName, context)); + } + + /** + * Get a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FleetUpdateStrategy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String fleetName, String updateStrategyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (updateStrategyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateStrategyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + fleetName, + updateStrategyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FleetUpdateStrategy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String fleetName, String updateStrategyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (updateStrategyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateStrategyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + fleetName, + updateStrategyName, + accept, + context); + } + + /** + * Get a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FleetUpdateStrategy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String fleetName, String updateStrategyName) { + return getWithResponseAsync(resourceGroupName, fleetName, updateStrategyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FleetUpdateStrategy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String fleetName, String updateStrategyName, Context context) { + return getWithResponseAsync(resourceGroupName, fleetName, updateStrategyName, context).block(); + } + + /** + * Get a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FleetUpdateStrategy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetUpdateStrategyInner get(String resourceGroupName, String fleetName, String updateStrategyName) { + return getWithResponse(resourceGroupName, fleetName, updateStrategyName, Context.NONE).getValue(); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a multi-stage process to perform update operations across members of a Fleet along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String fleetName, + String updateStrategyName, + FleetUpdateStrategyInner resource, + String ifMatch, + String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (updateStrategyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateStrategyName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + ifMatch, + ifNoneMatch, + fleetName, + updateStrategyName, + resource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @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 defines a multi-stage process to perform update operations across members of a Fleet along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String fleetName, + String updateStrategyName, + FleetUpdateStrategyInner resource, + String ifMatch, + String ifNoneMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (updateStrategyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateStrategyName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + ifMatch, + ifNoneMatch, + fleetName, + updateStrategyName, + resource, + accept, + context); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 defines a multi-stage process to perform update operations across + * members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetUpdateStrategyInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String fleetName, + String updateStrategyName, + FleetUpdateStrategyInner resource, + String ifMatch, + String ifNoneMatch) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, fleetName, updateStrategyName, resource, ifMatch, ifNoneMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FleetUpdateStrategyInner.class, + FleetUpdateStrategyInner.class, + this.client.getContext()); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @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 defines a multi-stage process to perform update operations across + * members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetUpdateStrategyInner> beginCreateOrUpdateAsync( + String resourceGroupName, String fleetName, String updateStrategyName, FleetUpdateStrategyInner resource) { + final String ifMatch = null; + final String ifNoneMatch = null; + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, fleetName, updateStrategyName, resource, ifMatch, ifNoneMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FleetUpdateStrategyInner.class, + FleetUpdateStrategyInner.class, + this.client.getContext()); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of defines a multi-stage process to perform update operations across + * members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetUpdateStrategyInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String fleetName, + String updateStrategyName, + FleetUpdateStrategyInner resource, + String ifMatch, + String ifNoneMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, fleetName, updateStrategyName, resource, ifMatch, ifNoneMatch, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + FleetUpdateStrategyInner.class, + FleetUpdateStrategyInner.class, + context); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @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 defines a multi-stage process to perform update operations across + * members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FleetUpdateStrategyInner> beginCreateOrUpdate( + String resourceGroupName, String fleetName, String updateStrategyName, FleetUpdateStrategyInner resource) { + final String ifMatch = null; + final String ifNoneMatch = null; + return this + .beginCreateOrUpdateAsync(resourceGroupName, fleetName, updateStrategyName, resource, ifMatch, ifNoneMatch) + .getSyncPoller(); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @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 defines a multi-stage process to perform update operations across + * members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FleetUpdateStrategyInner> beginCreateOrUpdate( + String resourceGroupName, + String fleetName, + String updateStrategyName, + FleetUpdateStrategyInner resource, + String ifMatch, + String ifNoneMatch, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, fleetName, updateStrategyName, resource, ifMatch, ifNoneMatch, context) + .getSyncPoller(); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines a multi-stage process to perform update operations across members of a Fleet on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String fleetName, + String updateStrategyName, + FleetUpdateStrategyInner resource, + String ifMatch, + String ifNoneMatch) { + return beginCreateOrUpdateAsync( + resourceGroupName, fleetName, updateStrategyName, resource, ifMatch, ifNoneMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @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 defines a multi-stage process to perform update operations across members of a Fleet on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String fleetName, String updateStrategyName, FleetUpdateStrategyInner resource) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginCreateOrUpdateAsync( + resourceGroupName, fleetName, updateStrategyName, resource, ifMatch, ifNoneMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @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 defines a multi-stage process to perform update operations across members of a Fleet on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String fleetName, + String updateStrategyName, + FleetUpdateStrategyInner resource, + String ifMatch, + String ifNoneMatch, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, fleetName, updateStrategyName, resource, ifMatch, ifNoneMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @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 defines a multi-stage process to perform update operations across members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetUpdateStrategyInner createOrUpdate( + String resourceGroupName, String fleetName, String updateStrategyName, FleetUpdateStrategyInner resource) { + final String ifMatch = null; + final String ifNoneMatch = null; + return createOrUpdateAsync(resourceGroupName, fleetName, updateStrategyName, resource, ifMatch, ifNoneMatch) + .block(); + } + + /** + * Create a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @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 defines a multi-stage process to perform update operations across members of a Fleet. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetUpdateStrategyInner createOrUpdate( + String resourceGroupName, + String fleetName, + String updateStrategyName, + FleetUpdateStrategyInner resource, + String ifMatch, + String ifNoneMatch, + Context context) { + return createOrUpdateAsync( + resourceGroupName, fleetName, updateStrategyName, resource, ifMatch, ifNoneMatch, context) + .block(); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 fleetName, String updateStrategyName, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (updateStrategyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateStrategyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + ifMatch, + fleetName, + updateStrategyName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String fleetName, String updateStrategyName, String ifMatch, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (updateStrategyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateStrategyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + ifMatch, + fleetName, + updateStrategyName, + accept, + context); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 fleetName, String updateStrategyName, String ifMatch) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, fleetName, updateStrategyName, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String fleetName, String updateStrategyName) { + final String ifMatch = null; + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, fleetName, updateStrategyName, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String fleetName, String updateStrategyName, String ifMatch, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, fleetName, updateStrategyName, ifMatch, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String fleetName, String updateStrategyName) { + final String ifMatch = null; + return this.beginDeleteAsync(resourceGroupName, fleetName, updateStrategyName, ifMatch).getSyncPoller(); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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 fleetName, String updateStrategyName, String ifMatch, Context context) { + return this + .beginDeleteAsync(resourceGroupName, fleetName, updateStrategyName, ifMatch, context) + .getSyncPoller(); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 fleetName, String updateStrategyName, String ifMatch) { + return beginDeleteAsync(resourceGroupName, fleetName, updateStrategyName, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String fleetName, String updateStrategyName) { + final String ifMatch = null; + return beginDeleteAsync(resourceGroupName, fleetName, updateStrategyName, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String fleetName, String updateStrategyName, String ifMatch, Context context) { + return beginDeleteAsync(resourceGroupName, fleetName, updateStrategyName, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String fleetName, String updateStrategyName) { + final String ifMatch = null; + deleteAsync(resourceGroupName, fleetName, updateStrategyName, ifMatch).block(); + } + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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 fleetName, String updateStrategyName, String ifMatch, Context context) { + deleteAsync(resourceGroupName, fleetName, updateStrategyName, ifMatch, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFleetNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByFleetNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetUpdateStrategiesImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetUpdateStrategiesImpl.java new file mode 100644 index 000000000000..6d04b6b9e826 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetUpdateStrategiesImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.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.containerservicefleet.fluent.FleetUpdateStrategiesClient; +import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetUpdateStrategyInner; +import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategies; +import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategy; + +public final class FleetUpdateStrategiesImpl implements FleetUpdateStrategies { + private static final ClientLogger LOGGER = new ClientLogger(FleetUpdateStrategiesImpl.class); + + private final FleetUpdateStrategiesClient innerClient; + + private final com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager serviceManager; + + public FleetUpdateStrategiesImpl( + FleetUpdateStrategiesClient innerClient, + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByFleet(String resourceGroupName, String fleetName) { + PagedIterable inner = this.serviceClient().listByFleet(resourceGroupName, fleetName); + return Utils.mapPage(inner, inner1 -> new FleetUpdateStrategyImpl(inner1, this.manager())); + } + + public PagedIterable listByFleet(String resourceGroupName, String fleetName, Context context) { + PagedIterable inner = + this.serviceClient().listByFleet(resourceGroupName, fleetName, context); + return Utils.mapPage(inner, inner1 -> new FleetUpdateStrategyImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String fleetName, String updateStrategyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, fleetName, updateStrategyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new FleetUpdateStrategyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FleetUpdateStrategy get(String resourceGroupName, String fleetName, String updateStrategyName) { + FleetUpdateStrategyInner inner = this.serviceClient().get(resourceGroupName, fleetName, updateStrategyName); + if (inner != null) { + return new FleetUpdateStrategyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String fleetName, String updateStrategyName) { + this.serviceClient().delete(resourceGroupName, fleetName, updateStrategyName); + } + + public void delete( + String resourceGroupName, String fleetName, String updateStrategyName, String ifMatch, Context context) { + this.serviceClient().delete(resourceGroupName, fleetName, updateStrategyName, ifMatch, context); + } + + public FleetUpdateStrategy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String fleetName = Utils.getValueFromIdByName(id, "fleets"); + if (fleetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id))); + } + String updateStrategyName = Utils.getValueFromIdByName(id, "updateStrategies"); + if (updateStrategyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'updateStrategies'.", id))); + } + return this.getWithResponse(resourceGroupName, fleetName, updateStrategyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String fleetName = Utils.getValueFromIdByName(id, "fleets"); + if (fleetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id))); + } + String updateStrategyName = Utils.getValueFromIdByName(id, "updateStrategies"); + if (updateStrategyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'updateStrategies'.", id))); + } + return this.getWithResponse(resourceGroupName, fleetName, updateStrategyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String fleetName = Utils.getValueFromIdByName(id, "fleets"); + if (fleetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id))); + } + String updateStrategyName = Utils.getValueFromIdByName(id, "updateStrategies"); + if (updateStrategyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'updateStrategies'.", id))); + } + String localIfMatch = null; + this.delete(resourceGroupName, fleetName, updateStrategyName, localIfMatch, Context.NONE); + } + + public void deleteByIdWithResponse(String id, String ifMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String fleetName = Utils.getValueFromIdByName(id, "fleets"); + if (fleetName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fleets'.", id))); + } + String updateStrategyName = Utils.getValueFromIdByName(id, "updateStrategies"); + if (updateStrategyName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'updateStrategies'.", id))); + } + this.delete(resourceGroupName, fleetName, updateStrategyName, ifMatch, context); + } + + private FleetUpdateStrategiesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager() { + return this.serviceManager; + } + + public FleetUpdateStrategyImpl define(String name) { + return new FleetUpdateStrategyImpl(name, this.manager()); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetUpdateStrategyImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetUpdateStrategyImpl.java new file mode 100644 index 000000000000..dafc58d28c51 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetUpdateStrategyImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetUpdateStrategyInner; +import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategy; +import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategyProvisioningState; +import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; + +public final class FleetUpdateStrategyImpl + implements FleetUpdateStrategy, FleetUpdateStrategy.Definition, FleetUpdateStrategy.Update { + private FleetUpdateStrategyInner innerObject; + + private final com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public FleetUpdateStrategyProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public UpdateRunStrategy strategy() { + return this.innerModel().strategy(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FleetUpdateStrategyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String fleetName; + + private String updateStrategyName; + + private String createIfMatch; + + private String createIfNoneMatch; + + private String updateIfMatch; + + private String updateIfNoneMatch; + + public FleetUpdateStrategyImpl withExistingFleet(String resourceGroupName, String fleetName) { + this.resourceGroupName = resourceGroupName; + this.fleetName = fleetName; + return this; + } + + public FleetUpdateStrategy create() { + this.innerObject = + serviceManager + .serviceClient() + .getFleetUpdateStrategies() + .createOrUpdate( + resourceGroupName, + fleetName, + updateStrategyName, + this.innerModel(), + createIfMatch, + createIfNoneMatch, + Context.NONE); + return this; + } + + public FleetUpdateStrategy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFleetUpdateStrategies() + .createOrUpdate( + resourceGroupName, + fleetName, + updateStrategyName, + this.innerModel(), + createIfMatch, + createIfNoneMatch, + context); + return this; + } + + FleetUpdateStrategyImpl( + String name, com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager serviceManager) { + this.innerObject = new FleetUpdateStrategyInner(); + this.serviceManager = serviceManager; + this.updateStrategyName = name; + this.createIfMatch = null; + this.createIfNoneMatch = null; + } + + public FleetUpdateStrategyImpl update() { + this.updateIfMatch = null; + this.updateIfNoneMatch = null; + return this; + } + + public FleetUpdateStrategy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getFleetUpdateStrategies() + .createOrUpdate( + resourceGroupName, + fleetName, + updateStrategyName, + this.innerModel(), + updateIfMatch, + updateIfNoneMatch, + Context.NONE); + return this; + } + + public FleetUpdateStrategy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFleetUpdateStrategies() + .createOrUpdate( + resourceGroupName, + fleetName, + updateStrategyName, + this.innerModel(), + updateIfMatch, + updateIfNoneMatch, + context); + return this; + } + + FleetUpdateStrategyImpl( + FleetUpdateStrategyInner innerObject, + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.fleetName = Utils.getValueFromIdByName(innerObject.id(), "fleets"); + this.updateStrategyName = Utils.getValueFromIdByName(innerObject.id(), "updateStrategies"); + } + + public FleetUpdateStrategy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getFleetUpdateStrategies() + .getWithResponse(resourceGroupName, fleetName, updateStrategyName, Context.NONE) + .getValue(); + return this; + } + + public FleetUpdateStrategy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getFleetUpdateStrategies() + .getWithResponse(resourceGroupName, fleetName, updateStrategyName, context) + .getValue(); + return this; + } + + public FleetUpdateStrategyImpl withStrategy(UpdateRunStrategy strategy) { + this.innerModel().withStrategy(strategy); + return this; + } + + public FleetUpdateStrategyImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + return this; + } + } + + public FleetUpdateStrategyImpl withIfNoneMatch(String ifNoneMatch) { + if (isInCreateMode()) { + this.createIfNoneMatch = ifNoneMatch; + return this; + } else { + this.updateIfNoneMatch = ifNoneMatch; + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetsClientImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetsClientImpl.java index 4f4b74c66b7f..f2cf5e21992c 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetsClientImpl.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/FleetsClientImpl.java @@ -125,9 +125,9 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}") - @ExpectedResponses({200}) + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> update( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -1009,7 +1009,7 @@ public FleetInner createOrUpdate( * @return the Fleet resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, String fleetName, FleetPatch properties, String ifMatch) { if (this.client.getEndpoint() == null) { return Mono @@ -1067,7 +1067,7 @@ private Mono> updateWithResponseAsync( * @return the Fleet resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, String fleetName, FleetPatch properties, String ifMatch, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -1108,6 +1108,134 @@ private Mono> updateWithResponseAsync( context); } + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetInner> beginUpdateAsync( + String resourceGroupName, String fleetName, FleetPatch properties, String ifMatch) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, fleetName, properties, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FleetInner.class, FleetInner.class, this.client.getContext()); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @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 the Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetInner> beginUpdateAsync( + String resourceGroupName, String fleetName, FleetPatch properties) { + final String ifMatch = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, fleetName, properties, ifMatch); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FleetInner.class, FleetInner.class, this.client.getContext()); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FleetInner> beginUpdateAsync( + String resourceGroupName, String fleetName, FleetPatch properties, String ifMatch, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, fleetName, properties, ifMatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), FleetInner.class, FleetInner.class, context); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @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 the Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FleetInner> beginUpdate( + String resourceGroupName, String fleetName, FleetPatch properties) { + final String ifMatch = null; + return this.beginUpdateAsync(resourceGroupName, fleetName, properties, ifMatch).getSyncPoller(); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Fleet resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FleetInner> beginUpdate( + String resourceGroupName, String fleetName, FleetPatch properties, String ifMatch, Context context) { + return this.beginUpdateAsync(resourceGroupName, fleetName, properties, ifMatch, context).getSyncPoller(); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Fleet resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String fleetName, FleetPatch properties, String ifMatch) { + return beginUpdateAsync(resourceGroupName, fleetName, properties, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + /** * Update a Fleet. * @@ -1122,8 +1250,9 @@ private Mono> updateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String fleetName, FleetPatch properties) { final String ifMatch = null; - return updateWithResponseAsync(resourceGroupName, fleetName, properties, ifMatch) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return beginUpdateAsync(resourceGroupName, fleetName, properties, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1137,12 +1266,14 @@ private Mono updateAsync(String resourceGroupName, String fleetName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Fleet resource along with {@link Response}. + * @return the Fleet resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( + private Mono updateAsync( String resourceGroupName, String fleetName, FleetPatch properties, String ifMatch, Context context) { - return updateWithResponseAsync(resourceGroupName, fleetName, properties, ifMatch, context).block(); + return beginUpdateAsync(resourceGroupName, fleetName, properties, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1159,7 +1290,26 @@ public Response updateWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public FleetInner update(String resourceGroupName, String fleetName, FleetPatch properties) { final String ifMatch = null; - return updateWithResponse(resourceGroupName, fleetName, properties, ifMatch, Context.NONE).getValue(); + return updateAsync(resourceGroupName, fleetName, properties, ifMatch).block(); + } + + /** + * Update a Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param properties The resource properties to be updated. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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 Fleet resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetInner update( + String resourceGroupName, String fleetName, FleetPatch properties, String ifMatch, Context context) { + return updateAsync(resourceGroupName, fleetName, properties, ifMatch, context).block(); } /** diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/UpdateRunImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/UpdateRunImpl.java index 881a14875ab3..3abbfce778ad 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/UpdateRunImpl.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/UpdateRunImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.containerservicefleet.implementation; -import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.containerservicefleet.fluent.models.UpdateRunInner; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpdate; @@ -34,14 +33,14 @@ public String etag() { return this.innerModel().etag(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - public UpdateRunProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public String updateStrategyId() { + return this.innerModel().updateStrategyId(); + } + public UpdateRunStrategy strategy() { return this.innerModel().strategy(); } @@ -211,6 +210,11 @@ public UpdateRun stop(String ifMatch, Context context) { return serviceManager.updateRuns().stop(resourceGroupName, fleetName, updateRunName, ifMatch, context); } + public UpdateRunImpl withUpdateStrategyId(String updateStrategyId) { + this.innerModel().withUpdateStrategyId(updateStrategyId); + return this; + } + public UpdateRunImpl withStrategy(UpdateRunStrategy strategy) { this.innerModel().withStrategy(strategy); return this; diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/UpdateRunsClientImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/UpdateRunsClientImpl.java index 8aaaa8dc520e..4bcf8f12d0da 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/UpdateRunsClientImpl.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/UpdateRunsClientImpl.java @@ -517,8 +517,8 @@ public UpdateRunInner get(String resourceGroupName, String fleetName, String upd * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet along with - * {@link Response} on successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -588,8 +588,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet along with - * {@link Response} on successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -656,8 +656,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link PollerFlux} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UpdateRunInner> beginCreateOrUpdateAsync( @@ -690,8 +690,8 @@ private PollerFlux, UpdateRunInner> beginCreateOrUpda * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link PollerFlux} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UpdateRunInner> beginCreateOrUpdateAsync( @@ -724,8 +724,8 @@ private PollerFlux, UpdateRunInner> beginCreateOrUpda * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link PollerFlux} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UpdateRunInner> beginCreateOrUpdateAsync( @@ -756,8 +756,8 @@ private PollerFlux, UpdateRunInner> beginCreateOrUpda * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UpdateRunInner> beginCreateOrUpdate( @@ -782,8 +782,8 @@ public SyncPoller, UpdateRunInner> beginCreateOrUpdat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UpdateRunInner> beginCreateOrUpdate( @@ -812,8 +812,8 @@ public SyncPoller, UpdateRunInner> beginCreateOrUpdat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet on - * successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -838,8 +838,8 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet on - * successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -864,8 +864,8 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet on - * successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -892,7 +892,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) public UpdateRunInner createOrUpdate( @@ -915,7 +915,7 @@ public UpdateRunInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) public UpdateRunInner createOrUpdate( @@ -1248,8 +1248,8 @@ public void delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet along with - * {@link Response} on successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync( @@ -1305,8 +1305,8 @@ private Mono>> startWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet along with - * {@link Response} on successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> startWithResponseAsync( @@ -1358,8 +1358,8 @@ private Mono>> startWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link PollerFlux} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UpdateRunInner> beginStartAsync( @@ -1385,8 +1385,8 @@ private PollerFlux, UpdateRunInner> beginStartAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link PollerFlux} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UpdateRunInner> beginStartAsync( @@ -1415,8 +1415,8 @@ private PollerFlux, UpdateRunInner> beginStartAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link PollerFlux} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UpdateRunInner> beginStartAsync( @@ -1439,8 +1439,8 @@ private PollerFlux, UpdateRunInner> beginStartAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UpdateRunInner> beginStart( @@ -1460,8 +1460,8 @@ public SyncPoller, UpdateRunInner> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UpdateRunInner> beginStart( @@ -1479,8 +1479,8 @@ public SyncPoller, UpdateRunInner> beginStart( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet on - * successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync( @@ -1499,8 +1499,8 @@ private Mono startAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet on - * successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync(String resourceGroupName, String fleetName, String updateRunName) { @@ -1521,8 +1521,8 @@ private Mono startAsync(String resourceGroupName, String fleetNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet on - * successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono startAsync( @@ -1541,7 +1541,7 @@ private Mono startAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) public UpdateRunInner start(String resourceGroupName, String fleetName, String updateRunName) { @@ -1560,7 +1560,7 @@ public UpdateRunInner start(String resourceGroupName, String fleetName, String u * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) public UpdateRunInner start( @@ -1578,8 +1578,8 @@ public UpdateRunInner start( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet along with - * {@link Response} on successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync( @@ -1635,8 +1635,8 @@ private Mono>> stopWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet along with - * {@link Response} on successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> stopWithResponseAsync( @@ -1688,8 +1688,8 @@ private Mono>> stopWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link PollerFlux} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UpdateRunInner> beginStopAsync( @@ -1715,8 +1715,8 @@ private PollerFlux, UpdateRunInner> beginStopAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link PollerFlux} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UpdateRunInner> beginStopAsync( @@ -1745,8 +1745,8 @@ private PollerFlux, UpdateRunInner> beginStopAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link PollerFlux} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, UpdateRunInner> beginStopAsync( @@ -1769,8 +1769,8 @@ private PollerFlux, UpdateRunInner> beginStopAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UpdateRunInner> beginStop( @@ -1790,8 +1790,8 @@ public SyncPoller, UpdateRunInner> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 an UpdateRun is a multi-stage process to perform update operations - * across members of a Fleet. + * @return the {@link SyncPoller} for polling of a multi-stage process to perform update operations across members + * of a Fleet. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, UpdateRunInner> beginStop( @@ -1809,8 +1809,8 @@ public SyncPoller, UpdateRunInner> beginStop( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet on - * successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync( @@ -1829,8 +1829,8 @@ private Mono stopAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet on - * successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync(String resourceGroupName, String fleetName, String updateRunName) { @@ -1851,8 +1851,8 @@ private Mono stopAsync(String resourceGroupName, String fleetNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet on - * successful completion of {@link Mono}. + * @return a multi-stage process to perform update operations across members of a Fleet on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono stopAsync( @@ -1871,7 +1871,7 @@ private Mono stopAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) public UpdateRunInner stop(String resourceGroupName, String fleetName, String updateRunName) { @@ -1890,7 +1890,7 @@ public UpdateRunInner stop(String resourceGroupName, String fleetName, String up * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ @ServiceMethod(returns = ReturnType.SINGLE) public UpdateRunInner stop( diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/AgentProfile.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/AgentProfile.java new file mode 100644 index 000000000000..43397ae41c43 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/AgentProfile.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Agent profile for the Fleet hub. */ +@Fluent +public final class AgentProfile { + /* + * The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet + * will be generated and used. + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /** Creates an instance of AgentProfile class. */ + public AgentProfile() { + } + + /** + * Get the subnetId property: The ID of the subnet which the Fleet hub node will join on startup. If this is not + * specified, a vnet and subnet will be generated and used. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The ID of the subnet which the Fleet hub node will join on startup. If this is not + * specified, a vnet and subnet will be generated and used. + * + * @param subnetId the subnetId value to set. + * @return the AgentProfile object itself. + */ + public AgentProfile withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ApiServerAccessProfile.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ApiServerAccessProfile.java new file mode 100644 index 000000000000..3f2b6771dd07 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ApiServerAccessProfile.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Access profile for the Fleet hub API server. */ +@Fluent +public final class ApiServerAccessProfile { + /* + * Whether to create the Fleet hub as a private cluster or not. + */ + @JsonProperty(value = "enablePrivateCluster") + private Boolean enablePrivateCluster; + + /* + * Whether to enable apiserver vnet integration for the Fleet hub or not. + */ + @JsonProperty(value = "enableVnetIntegration") + private Boolean enableVnetIntegration; + + /* + * The subnet to be used when apiserver vnet integration is enabled. It is required when creating a new Fleet with + * BYO vnet. + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /** Creates an instance of ApiServerAccessProfile class. */ + public ApiServerAccessProfile() { + } + + /** + * Get the enablePrivateCluster property: Whether to create the Fleet hub as a private cluster or not. + * + * @return the enablePrivateCluster value. + */ + public Boolean enablePrivateCluster() { + return this.enablePrivateCluster; + } + + /** + * Set the enablePrivateCluster property: Whether to create the Fleet hub as a private cluster or not. + * + * @param enablePrivateCluster the enablePrivateCluster value to set. + * @return the ApiServerAccessProfile object itself. + */ + public ApiServerAccessProfile withEnablePrivateCluster(Boolean enablePrivateCluster) { + this.enablePrivateCluster = enablePrivateCluster; + return this; + } + + /** + * Get the enableVnetIntegration property: Whether to enable apiserver vnet integration for the Fleet hub or not. + * + * @return the enableVnetIntegration value. + */ + public Boolean enableVnetIntegration() { + return this.enableVnetIntegration; + } + + /** + * Set the enableVnetIntegration property: Whether to enable apiserver vnet integration for the Fleet hub or not. + * + * @param enableVnetIntegration the enableVnetIntegration value to set. + * @return the ApiServerAccessProfile object itself. + */ + public ApiServerAccessProfile withEnableVnetIntegration(Boolean enableVnetIntegration) { + this.enableVnetIntegration = enableVnetIntegration; + return this; + } + + /** + * Get the subnetId property: The subnet to be used when apiserver vnet integration is enabled. It is required when + * creating a new Fleet with BYO vnet. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet to be used when apiserver vnet integration is enabled. It is required when + * creating a new Fleet with BYO vnet. + * + * @param subnetId the subnetId value to set. + * @return the ApiServerAccessProfile object itself. + */ + public ApiServerAccessProfile withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Fleet.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Fleet.java index 5992bbf9d6c4..063c11164564 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Fleet.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Fleet.java @@ -58,6 +58,13 @@ public interface Fleet { */ String etag(); + /** + * Gets the identity property: Managed identity. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -114,11 +121,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The Fleet definition stages. */ interface DefinitionStages { /** The first stage of the Fleet definition. */ interface Blank extends WithLocation { } + /** The stage of the Fleet definition allowing to specify location. */ interface WithLocation { /** @@ -137,6 +146,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the Fleet definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -147,12 +157,14 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the Fleet definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, DefinitionStages.WithHubProfile, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch { @@ -171,6 +183,7 @@ interface WithCreate */ Fleet create(Context context); } + /** The stage of the Fleet definition allowing to specify tags. */ interface WithTags { /** @@ -181,6 +194,18 @@ interface WithTags { */ WithCreate withTags(Map tags); } + + /** The stage of the Fleet definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed identity.. + * + * @param identity Managed identity. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the Fleet definition allowing to specify hubProfile. */ interface WithHubProfile { /** @@ -191,6 +216,7 @@ interface WithHubProfile { */ WithCreate withHubProfile(FleetHubProfile hubProfile); } + /** The stage of the Fleet definition allowing to specify ifMatch. */ interface WithIfMatch { /** @@ -201,6 +227,7 @@ interface WithIfMatch { */ WithCreate withIfMatch(String ifMatch); } + /** The stage of the Fleet definition allowing to specify ifNoneMatch. */ interface WithIfNoneMatch { /** @@ -212,6 +239,7 @@ interface WithIfNoneMatch { WithCreate withIfNoneMatch(String ifNoneMatch); } } + /** * Begins update for the Fleet resource. * @@ -220,7 +248,7 @@ interface WithIfNoneMatch { Fleet.Update update(); /** The template for Fleet update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIfMatch { + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithIfMatch { /** * Executes the update request. * @@ -236,6 +264,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithIfMatch { */ Fleet apply(Context context); } + /** The Fleet update stages. */ interface UpdateStages { /** The stage of the Fleet update allowing to specify tags. */ @@ -248,6 +277,18 @@ interface WithTags { */ Update withTags(Map tags); } + + /** The stage of the Fleet update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed identity.. + * + * @param identity Managed identity. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the Fleet update allowing to specify ifMatch. */ interface WithIfMatch { /** @@ -259,6 +300,7 @@ interface WithIfMatch { Update withIfMatch(String ifMatch); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetHubProfile.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetHubProfile.java index 9c9d80bdfba5..ad871aca8ba8 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetHubProfile.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetHubProfile.java @@ -16,6 +16,18 @@ public final class FleetHubProfile { @JsonProperty(value = "dnsPrefix") private String dnsPrefix; + /* + * The access profile for the Fleet hub API server. + */ + @JsonProperty(value = "apiServerAccessProfile") + private ApiServerAccessProfile apiServerAccessProfile; + + /* + * The agent profile for the Fleet hub. + */ + @JsonProperty(value = "agentProfile") + private AgentProfile agentProfile; + /* * The FQDN of the Fleet hub. */ @@ -52,6 +64,46 @@ public FleetHubProfile withDnsPrefix(String dnsPrefix) { return this; } + /** + * Get the apiServerAccessProfile property: The access profile for the Fleet hub API server. + * + * @return the apiServerAccessProfile value. + */ + public ApiServerAccessProfile apiServerAccessProfile() { + return this.apiServerAccessProfile; + } + + /** + * Set the apiServerAccessProfile property: The access profile for the Fleet hub API server. + * + * @param apiServerAccessProfile the apiServerAccessProfile value to set. + * @return the FleetHubProfile object itself. + */ + public FleetHubProfile withApiServerAccessProfile(ApiServerAccessProfile apiServerAccessProfile) { + this.apiServerAccessProfile = apiServerAccessProfile; + return this; + } + + /** + * Get the agentProfile property: The agent profile for the Fleet hub. + * + * @return the agentProfile value. + */ + public AgentProfile agentProfile() { + return this.agentProfile; + } + + /** + * Set the agentProfile property: The agent profile for the Fleet hub. + * + * @param agentProfile the agentProfile value to set. + * @return the FleetHubProfile object itself. + */ + public FleetHubProfile withAgentProfile(AgentProfile agentProfile) { + this.agentProfile = agentProfile; + return this; + } + /** * Get the fqdn property: The FQDN of the Fleet hub. * @@ -76,5 +128,11 @@ public String kubernetesVersion() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (apiServerAccessProfile() != null) { + apiServerAccessProfile().validate(); + } + if (agentProfile() != null) { + agentProfile().validate(); + } } } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetMember.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetMember.java index c8c2be0c107c..fcd78346cce8 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetMember.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetMember.java @@ -89,11 +89,13 @@ public interface FleetMember { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The FleetMember definition stages. */ interface DefinitionStages { /** The first stage of the FleetMember definition. */ interface Blank extends WithParentResource { } + /** The stage of the FleetMember definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -105,6 +107,7 @@ interface WithParentResource { */ WithCreate withExistingFleet(String resourceGroupName, String fleetName); } + /** * The stage of the FleetMember 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. @@ -129,6 +132,7 @@ interface WithCreate */ FleetMember create(Context context); } + /** The stage of the FleetMember definition allowing to specify clusterResourceId. */ interface WithClusterResourceId { /** @@ -143,6 +147,7 @@ interface WithClusterResourceId { */ WithCreate withClusterResourceId(String clusterResourceId); } + /** The stage of the FleetMember definition allowing to specify group. */ interface WithGroup { /** @@ -153,6 +158,7 @@ interface WithGroup { */ WithCreate withGroup(String group); } + /** The stage of the FleetMember definition allowing to specify ifMatch. */ interface WithIfMatch { /** @@ -163,6 +169,7 @@ interface WithIfMatch { */ WithCreate withIfMatch(String ifMatch); } + /** The stage of the FleetMember definition allowing to specify ifNoneMatch. */ interface WithIfNoneMatch { /** @@ -174,6 +181,7 @@ interface WithIfNoneMatch { WithCreate withIfNoneMatch(String ifNoneMatch); } } + /** * Begins update for the FleetMember resource. * @@ -198,6 +206,7 @@ interface Update extends UpdateStages.WithGroup, UpdateStages.WithIfMatch { */ FleetMember apply(Context context); } + /** The FleetMember update stages. */ interface UpdateStages { /** The stage of the FleetMember update allowing to specify group. */ @@ -210,6 +219,7 @@ interface WithGroup { */ Update withGroup(String group); } + /** The stage of the FleetMember update allowing to specify ifMatch. */ interface WithIfMatch { /** @@ -221,6 +231,7 @@ interface WithIfMatch { Update withIfMatch(String ifMatch); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetPatch.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetPatch.java index b30127962ba6..f91f23d30594 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetPatch.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetPatch.java @@ -19,6 +19,12 @@ public final class FleetPatch { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /* + * Managed identity. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + /** Creates an instance of FleetPatch class. */ public FleetPatch() { } @@ -43,11 +49,34 @@ public FleetPatch withTags(Map tags) { return this; } + /** + * Get the identity property: Managed identity. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed identity. + * + * @param identity the identity value to set. + * @return the FleetPatch object itself. + */ + public FleetPatch withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } } } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategies.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategies.java new file mode 100644 index 000000000000..c2cdb4982af0 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategies.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.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 FleetUpdateStrategies. */ +public interface FleetUpdateStrategies { + /** + * List FleetUpdateStrategy resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFleet(String resourceGroupName, String fleetName); + + /** + * List FleetUpdateStrategy resources by Fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FleetUpdateStrategy list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFleet(String resourceGroupName, String fleetName, Context context); + + /** + * Get a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FleetUpdateStrategy along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String fleetName, String updateStrategyName, Context context); + + /** + * Get a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a FleetUpdateStrategy. + */ + FleetUpdateStrategy get(String resourceGroupName, String fleetName, String updateStrategyName); + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String fleetName, String updateStrategyName); + + /** + * Delete a FleetUpdateStrategy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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 fleetName, String updateStrategyName, String ifMatch, Context context); + + /** + * Get a FleetUpdateStrategy. + * + * @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 FleetUpdateStrategy along with {@link Response}. + */ + FleetUpdateStrategy getById(String id); + + /** + * Get a FleetUpdateStrategy. + * + * @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 FleetUpdateStrategy along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a FleetUpdateStrategy. + * + * @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 FleetUpdateStrategy. + * + * @param id the resource ID. + * @param ifMatch The request should only proceed if an entity matches this string. + * @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, String ifMatch, Context context); + + /** + * Begins definition for a new FleetUpdateStrategy resource. + * + * @param name resource name. + * @return the first stage of the new FleetUpdateStrategy definition. + */ + FleetUpdateStrategy.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategy.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategy.java new file mode 100644 index 000000000000..59a6897f62ae --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategy.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetUpdateStrategyInner; + +/** An immutable client-side representation of FleetUpdateStrategy. */ +public interface FleetUpdateStrategy { + /** + * 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 etag property: If eTag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the provisioningState property: The provisioning state of the UpdateStrategy resource. + * + * @return the provisioningState value. + */ + FleetUpdateStrategyProvisioningState provisioningState(); + + /** + * Gets the strategy property: Defines the update sequence of the clusters. + * + * @return the strategy value. + */ + UpdateRunStrategy strategy(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.containerservicefleet.fluent.models.FleetUpdateStrategyInner object. + * + * @return the inner object. + */ + FleetUpdateStrategyInner innerModel(); + + /** The entirety of the FleetUpdateStrategy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The FleetUpdateStrategy definition stages. */ + interface DefinitionStages { + /** The first stage of the FleetUpdateStrategy definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the FleetUpdateStrategy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, fleetName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @return the next definition stage. + */ + WithCreate withExistingFleet(String resourceGroupName, String fleetName); + } + + /** + * The stage of the FleetUpdateStrategy 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.WithStrategy, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + FleetUpdateStrategy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FleetUpdateStrategy create(Context context); + } + + /** The stage of the FleetUpdateStrategy definition allowing to specify strategy. */ + interface WithStrategy { + /** + * Specifies the strategy property: Defines the update sequence of the clusters.. + * + * @param strategy Defines the update sequence of the clusters. + * @return the next definition stage. + */ + WithCreate withStrategy(UpdateRunStrategy strategy); + } + + /** The stage of the FleetUpdateStrategy definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The request should only proceed if an entity matches this string.. + * + * @param ifMatch The request should only proceed if an entity matches this string. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + + /** The stage of the FleetUpdateStrategy definition allowing to specify ifNoneMatch. */ + interface WithIfNoneMatch { + /** + * Specifies the ifNoneMatch property: The request should only proceed if no entity matches this string.. + * + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @return the next definition stage. + */ + WithCreate withIfNoneMatch(String ifNoneMatch); + } + } + + /** + * Begins update for the FleetUpdateStrategy resource. + * + * @return the stage of resource update. + */ + FleetUpdateStrategy.Update update(); + + /** The template for FleetUpdateStrategy update. */ + interface Update extends UpdateStages.WithStrategy, UpdateStages.WithIfMatch, UpdateStages.WithIfNoneMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FleetUpdateStrategy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FleetUpdateStrategy apply(Context context); + } + + /** The FleetUpdateStrategy update stages. */ + interface UpdateStages { + /** The stage of the FleetUpdateStrategy update allowing to specify strategy. */ + interface WithStrategy { + /** + * Specifies the strategy property: Defines the update sequence of the clusters.. + * + * @param strategy Defines the update sequence of the clusters. + * @return the next definition stage. + */ + Update withStrategy(UpdateRunStrategy strategy); + } + + /** The stage of the FleetUpdateStrategy update allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The request should only proceed if an entity matches this string.. + * + * @param ifMatch The request should only proceed if an entity matches this string. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + + /** The stage of the FleetUpdateStrategy update allowing to specify ifNoneMatch. */ + interface WithIfNoneMatch { + /** + * Specifies the ifNoneMatch property: The request should only proceed if no entity matches this string.. + * + * @param ifNoneMatch The request should only proceed if no entity matches this string. + * @return the next definition stage. + */ + Update withIfNoneMatch(String ifNoneMatch); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FleetUpdateStrategy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FleetUpdateStrategy refresh(Context context); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategyListResult.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategyListResult.java new file mode 100644 index 000000000000..4d98a9102439 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategyListResult.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetUpdateStrategyInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response of a FleetUpdateStrategy list operation. */ +@Fluent +public final class FleetUpdateStrategyListResult { + /* + * The FleetUpdateStrategy items on this page + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of items + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of FleetUpdateStrategyListResult class. */ + public FleetUpdateStrategyListResult() { + } + + /** + * Get the value property: The FleetUpdateStrategy items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The FleetUpdateStrategy items on this page. + * + * @param value the value value to set. + * @return the FleetUpdateStrategyListResult object itself. + */ + public FleetUpdateStrategyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the FleetUpdateStrategyListResult object itself. + */ + public FleetUpdateStrategyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model FleetUpdateStrategyListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FleetUpdateStrategyListResult.class); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategyProvisioningState.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategyProvisioningState.java new file mode 100644 index 000000000000..160854df88e7 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetUpdateStrategyProvisioningState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of the UpdateStrategy resource. */ +public final class FleetUpdateStrategyProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for FleetUpdateStrategyProvisioningState. */ + public static final FleetUpdateStrategyProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for FleetUpdateStrategyProvisioningState. */ + public static final FleetUpdateStrategyProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for FleetUpdateStrategyProvisioningState. */ + public static final FleetUpdateStrategyProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of FleetUpdateStrategyProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FleetUpdateStrategyProvisioningState() { + } + + /** + * Creates or finds a FleetUpdateStrategyProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FleetUpdateStrategyProvisioningState. + */ + @JsonCreator + public static FleetUpdateStrategyProvisioningState fromString(String name) { + return fromString(name, FleetUpdateStrategyProvisioningState.class); + } + + /** + * Gets known FleetUpdateStrategyProvisioningState values. + * + * @return known FleetUpdateStrategyProvisioningState values. + */ + public static Collection values() { + return values(FleetUpdateStrategyProvisioningState.class); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ManagedClusterUpdate.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ManagedClusterUpdate.java index 50aeaa31f228..c720623b9d7a 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ManagedClusterUpdate.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ManagedClusterUpdate.java @@ -17,6 +17,12 @@ public final class ManagedClusterUpdate { @JsonProperty(value = "upgrade", required = true) private ManagedClusterUpgradeSpec upgrade; + /* + * The node image upgrade to be applied to the target nodes in update run. + */ + @JsonProperty(value = "nodeImageSelection") + private NodeImageSelection nodeImageSelection; + /** Creates an instance of ManagedClusterUpdate class. */ public ManagedClusterUpdate() { } @@ -41,6 +47,26 @@ public ManagedClusterUpdate withUpgrade(ManagedClusterUpgradeSpec upgrade) { return this; } + /** + * Get the nodeImageSelection property: The node image upgrade to be applied to the target nodes in update run. + * + * @return the nodeImageSelection value. + */ + public NodeImageSelection nodeImageSelection() { + return this.nodeImageSelection; + } + + /** + * Set the nodeImageSelection property: The node image upgrade to be applied to the target nodes in update run. + * + * @param nodeImageSelection the nodeImageSelection value to set. + * @return the ManagedClusterUpdate object itself. + */ + public ManagedClusterUpdate withNodeImageSelection(NodeImageSelection nodeImageSelection) { + this.nodeImageSelection = nodeImageSelection; + return this; + } + /** * Validates the instance. * @@ -54,6 +80,9 @@ public void validate() { } else { upgrade().validate(); } + if (nodeImageSelection() != null) { + nodeImageSelection().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterUpdate.class); diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ManagedServiceIdentity.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..ea8e5411345b --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ManagedServiceIdentity.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public final class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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 UUID 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 UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @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 set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ManagedServiceIdentityType.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..6c8b5c0ececf --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/ManagedServiceIdentityType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. */ + 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. + */ + @JsonCreator + 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/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/MemberUpdateStatus.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/MemberUpdateStatus.java index ac39d6959039..14dcfc32be3c 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/MemberUpdateStatus.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/MemberUpdateStatus.java @@ -34,6 +34,12 @@ public final class MemberUpdateStatus { @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) private String operationId; + /* + * The status message after processing the member update operation. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + /** Creates an instance of MemberUpdateStatus class. */ public MemberUpdateStatus() { } @@ -74,6 +80,15 @@ public String operationId() { return this.operationId; } + /** + * Get the message property: The status message after processing the member update operation. + * + * @return the message value. + */ + public String message() { + return this.message; + } + /** * Validates the instance. * diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageSelection.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageSelection.java new file mode 100644 index 000000000000..1bd5f5b43521 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageSelection.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The node image upgrade to be applied to the target nodes in update run. */ +@Fluent +public final class NodeImageSelection { + /* + * The node image upgrade type. + */ + @JsonProperty(value = "type", required = true) + private NodeImageSelectionType type; + + /** Creates an instance of NodeImageSelection class. */ + public NodeImageSelection() { + } + + /** + * Get the type property: The node image upgrade type. + * + * @return the type value. + */ + public NodeImageSelectionType type() { + return this.type; + } + + /** + * Set the type property: The node image upgrade type. + * + * @param type the type value to set. + * @return the NodeImageSelection object itself. + */ + public NodeImageSelection withType(NodeImageSelectionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model NodeImageSelection")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NodeImageSelection.class); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageSelectionStatus.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageSelectionStatus.java new file mode 100644 index 000000000000..99be24967dff --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageSelectionStatus.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The node image upgrade specs for the update run. */ +@Immutable +public final class NodeImageSelectionStatus { + /* + * The image versions to upgrade the nodes to. + */ + @JsonProperty(value = "selectedNodeImageVersions", access = JsonProperty.Access.WRITE_ONLY) + private List selectedNodeImageVersions; + + /** Creates an instance of NodeImageSelectionStatus class. */ + public NodeImageSelectionStatus() { + } + + /** + * Get the selectedNodeImageVersions property: The image versions to upgrade the nodes to. + * + * @return the selectedNodeImageVersions value. + */ + public List selectedNodeImageVersions() { + return this.selectedNodeImageVersions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (selectedNodeImageVersions() != null) { + selectedNodeImageVersions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageSelectionType.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageSelectionType.java new file mode 100644 index 000000000000..36b051843e7d --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageSelectionType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The node image upgrade type. */ +public final class NodeImageSelectionType extends ExpandableStringEnum { + /** Static value Latest for NodeImageSelectionType. */ + public static final NodeImageSelectionType LATEST = fromString("Latest"); + + /** Static value Consistent for NodeImageSelectionType. */ + public static final NodeImageSelectionType CONSISTENT = fromString("Consistent"); + + /** + * Creates a new instance of NodeImageSelectionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NodeImageSelectionType() { + } + + /** + * Creates or finds a NodeImageSelectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeImageSelectionType. + */ + @JsonCreator + public static NodeImageSelectionType fromString(String name) { + return fromString(name, NodeImageSelectionType.class); + } + + /** + * Gets known NodeImageSelectionType values. + * + * @return known NodeImageSelectionType values. + */ + public static Collection values() { + return values(NodeImageSelectionType.class); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageVersion.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageVersion.java new file mode 100644 index 000000000000..ba7d55c932b3 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/NodeImageVersion.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The node upgrade image version. */ +@Immutable +public final class NodeImageVersion { + /* + * The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13'). + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** Creates an instance of NodeImageVersion class. */ + public NodeImageVersion() { + } + + /** + * Get the version property: The image version to upgrade the nodes to (e.g., + * 'AKSUbuntu-1804gen2containerd-2022.12.13'). + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateGroup.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateGroup.java index 7e4d18ad9b3f..2e8d4a747970 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateGroup.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateGroup.java @@ -12,9 +12,8 @@ @Fluent public final class UpdateGroup { /* - * The name of the Fleet member group to update. - * It should match the name of an existing FleetMember group. - * A group can only appear once across all UpdateStages in the UpdateRun. + * Name of the group. + * It must match a group name of an existing fleet member. */ @JsonProperty(value = "name", required = true) private String name; @@ -24,8 +23,7 @@ public UpdateGroup() { } /** - * Get the name property: The name of the Fleet member group to update. It should match the name of an existing - * FleetMember group. A group can only appear once across all UpdateStages in the UpdateRun. + * Get the name property: Name of the group. It must match a group name of an existing fleet member. * * @return the name value. */ @@ -34,8 +32,7 @@ public String name() { } /** - * Set the name property: The name of the Fleet member group to update. It should match the name of an existing - * FleetMember group. A group can only appear once across all UpdateStages in the UpdateRun. + * Set the name property: Name of the group. It must match a group name of an existing fleet member. * * @param name the name value to set. * @return the UpdateGroup object itself. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRun.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRun.java index 98b10bf2d212..f884d5a1d9e9 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRun.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRun.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.containerservicefleet.models; -import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.containerservicefleet.fluent.models.UpdateRunInner; @@ -42,18 +41,29 @@ public interface UpdateRun { String etag(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the provisioningState property: The provisioning state of the UpdateRun resource. * - * @return the systemData value. + * @return the provisioningState value. */ - SystemData systemData(); + UpdateRunProvisioningState provisioningState(); /** - * Gets the provisioningState property: The provisioning state of the UpdateRun resource. + * Gets the updateStrategyId property: The resource id of the FleetUpdateStrategy resource to reference. * - * @return the provisioningState value. + *

When creating a new run, there are three ways to define a strategy for the run: 1. Define a new strategy in + * place: Set the "strategy" field. 2. Use an existing strategy: Set the "updateStrategyId" field. (since + * 2023-08-15-preview) 3. Use the default strategy to update all the members one by one: Leave both + * "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + * + *

Setting both "updateStrategyId" and "strategy" is invalid. + * + *

UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and + * store it in the "strategy" field. Subsequent changes to the referenced FleetUpdateStrategy resource do not + * propagate. UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + * + * @return the updateStrategyId value. */ - UpdateRunProvisioningState provisioningState(); + String updateStrategyId(); /** * Gets the strategy property: The strategy defines the order in which the clusters will be updated. If not set, all @@ -97,11 +107,13 @@ public interface UpdateRun { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The UpdateRun definition stages. */ interface DefinitionStages { /** The first stage of the UpdateRun definition. */ interface Blank extends WithParentResource { } + /** The stage of the UpdateRun definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -113,12 +125,14 @@ interface WithParentResource { */ WithCreate withExistingFleet(String resourceGroupName, String fleetName); } + /** * The stage of the UpdateRun 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.WithStrategy, + extends DefinitionStages.WithUpdateStrategyId, + DefinitionStages.WithStrategy, DefinitionStages.WithManagedClusterUpdate, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch { @@ -137,6 +151,40 @@ interface WithCreate */ UpdateRun create(Context context); } + + /** The stage of the UpdateRun definition allowing to specify updateStrategyId. */ + interface WithUpdateStrategyId { + /** + * Specifies the updateStrategyId property: The resource id of the FleetUpdateStrategy resource to + * reference. + * + *

When creating a new run, there are three ways to define a strategy for the run: 1. Define a new + * strategy in place: Set the "strategy" field. 2. Use an existing strategy: Set the "updateStrategyId" + * field. (since 2023-08-15-preview) 3. Use the default strategy to update all the members one by one: Leave + * both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + * + *

Setting both "updateStrategyId" and "strategy" is invalid. + * + *

UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of + * creation and store it in the "strategy" field. Subsequent changes to the referenced FleetUpdateStrategy + * resource do not propagate. UpdateRunStrategy changes can be made directly on the "strategy" field before + * launching the UpdateRun.. + * + * @param updateStrategyId The resource id of the FleetUpdateStrategy resource to reference. + *

When creating a new run, there are three ways to define a strategy for the run: 1. Define a new + * strategy in place: Set the "strategy" field. 2. Use an existing strategy: Set the "updateStrategyId" + * field. (since 2023-08-15-preview) 3. Use the default strategy to update all the members one by one: + * Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + *

Setting both "updateStrategyId" and "strategy" is invalid. + *

UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of + * creation and store it in the "strategy" field. Subsequent changes to the referenced + * FleetUpdateStrategy resource do not propagate. UpdateRunStrategy changes can be made directly on the + * "strategy" field before launching the UpdateRun. + * @return the next definition stage. + */ + WithCreate withUpdateStrategyId(String updateStrategyId); + } + /** The stage of the UpdateRun definition allowing to specify strategy. */ interface WithStrategy { /** @@ -153,6 +201,7 @@ interface WithStrategy { */ WithCreate withStrategy(UpdateRunStrategy strategy); } + /** The stage of the UpdateRun definition allowing to specify managedClusterUpdate. */ interface WithManagedClusterUpdate { /** @@ -165,6 +214,7 @@ interface WithManagedClusterUpdate { */ WithCreate withManagedClusterUpdate(ManagedClusterUpdate managedClusterUpdate); } + /** The stage of the UpdateRun definition allowing to specify ifMatch. */ interface WithIfMatch { /** @@ -175,6 +225,7 @@ interface WithIfMatch { */ WithCreate withIfMatch(String ifMatch); } + /** The stage of the UpdateRun definition allowing to specify ifNoneMatch. */ interface WithIfNoneMatch { /** @@ -186,6 +237,7 @@ interface WithIfNoneMatch { WithCreate withIfNoneMatch(String ifNoneMatch); } } + /** * Begins update for the UpdateRun resource. * @@ -195,7 +247,8 @@ interface WithIfNoneMatch { /** The template for UpdateRun update. */ interface Update - extends UpdateStages.WithStrategy, + extends UpdateStages.WithUpdateStrategyId, + UpdateStages.WithStrategy, UpdateStages.WithManagedClusterUpdate, UpdateStages.WithIfMatch, UpdateStages.WithIfNoneMatch { @@ -214,8 +267,42 @@ interface Update */ UpdateRun apply(Context context); } + /** The UpdateRun update stages. */ interface UpdateStages { + /** The stage of the UpdateRun update allowing to specify updateStrategyId. */ + interface WithUpdateStrategyId { + /** + * Specifies the updateStrategyId property: The resource id of the FleetUpdateStrategy resource to + * reference. + * + *

When creating a new run, there are three ways to define a strategy for the run: 1. Define a new + * strategy in place: Set the "strategy" field. 2. Use an existing strategy: Set the "updateStrategyId" + * field. (since 2023-08-15-preview) 3. Use the default strategy to update all the members one by one: Leave + * both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + * + *

Setting both "updateStrategyId" and "strategy" is invalid. + * + *

UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of + * creation and store it in the "strategy" field. Subsequent changes to the referenced FleetUpdateStrategy + * resource do not propagate. UpdateRunStrategy changes can be made directly on the "strategy" field before + * launching the UpdateRun.. + * + * @param updateStrategyId The resource id of the FleetUpdateStrategy resource to reference. + *

When creating a new run, there are three ways to define a strategy for the run: 1. Define a new + * strategy in place: Set the "strategy" field. 2. Use an existing strategy: Set the "updateStrategyId" + * field. (since 2023-08-15-preview) 3. Use the default strategy to update all the members one by one: + * Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + *

Setting both "updateStrategyId" and "strategy" is invalid. + *

UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of + * creation and store it in the "strategy" field. Subsequent changes to the referenced + * FleetUpdateStrategy resource do not propagate. UpdateRunStrategy changes can be made directly on the + * "strategy" field before launching the UpdateRun. + * @return the next definition stage. + */ + Update withUpdateStrategyId(String updateStrategyId); + } + /** The stage of the UpdateRun update allowing to specify strategy. */ interface WithStrategy { /** @@ -232,6 +319,7 @@ interface WithStrategy { */ Update withStrategy(UpdateRunStrategy strategy); } + /** The stage of the UpdateRun update allowing to specify managedClusterUpdate. */ interface WithManagedClusterUpdate { /** @@ -244,6 +332,7 @@ interface WithManagedClusterUpdate { */ Update withManagedClusterUpdate(ManagedClusterUpdate managedClusterUpdate); } + /** The stage of the UpdateRun update allowing to specify ifMatch. */ interface WithIfMatch { /** @@ -254,6 +343,7 @@ interface WithIfMatch { */ Update withIfMatch(String ifMatch); } + /** The stage of the UpdateRun update allowing to specify ifNoneMatch. */ interface WithIfNoneMatch { /** @@ -265,6 +355,7 @@ interface WithIfNoneMatch { Update withIfNoneMatch(String ifNoneMatch); } } + /** * Refreshes the resource to sync with Azure. * @@ -285,7 +376,7 @@ interface WithIfNoneMatch { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ UpdateRun start(); @@ -297,7 +388,7 @@ interface WithIfNoneMatch { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ UpdateRun start(String ifMatch, Context context); @@ -306,7 +397,7 @@ interface WithIfNoneMatch { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ UpdateRun stop(); @@ -318,7 +409,7 @@ interface WithIfNoneMatch { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ UpdateRun stop(String ifMatch, Context context); } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunStatus.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunStatus.java index 4a27c8860ebb..cee4a783e7b8 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunStatus.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunStatus.java @@ -23,6 +23,13 @@ public final class UpdateRunStatus { @JsonProperty(value = "stages", access = JsonProperty.Access.WRITE_ONLY) private List stages; + /* + * The node image upgrade specs for the update run. It is only set in update run when `NodeImageSelection.type` is + * `Consistent`. + */ + @JsonProperty(value = "nodeImageSelection", access = JsonProperty.Access.WRITE_ONLY) + private NodeImageSelectionStatus nodeImageSelection; + /** Creates an instance of UpdateRunStatus class. */ public UpdateRunStatus() { } @@ -45,6 +52,16 @@ public List stages() { return this.stages; } + /** + * Get the nodeImageSelection property: The node image upgrade specs for the update run. It is only set in update + * run when `NodeImageSelection.type` is `Consistent`. + * + * @return the nodeImageSelection value. + */ + public NodeImageSelectionStatus nodeImageSelection() { + return this.nodeImageSelection; + } + /** * Validates the instance. * @@ -57,5 +74,8 @@ public void validate() { if (stages() != null) { stages().forEach(e -> e.validate()); } + if (nodeImageSelection() != null) { + nodeImageSelection().validate(); + } } } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunStrategy.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunStrategy.java index e421d43301af..1ef2c287bf34 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunStrategy.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunStrategy.java @@ -9,11 +9,18 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The UpdateRunStrategy configures the sequence of Stages and Groups in which the clusters will be updated. */ +/** + * Defines the update sequence of the clusters via stages and groups. + * + *

Stages within a run are executed sequentially one after another. Groups within a stage are executed in parallel. + * Member clusters within a group are updated sequentially one after another. + * + *

A valid strategy contains no duplicate groups within or across stages. + */ @Fluent public final class UpdateRunStrategy { /* - * The list of stages that compose this update run. + * The list of stages that compose this update run. Min size: 1. */ @JsonProperty(value = "stages", required = true) private List stages; @@ -23,7 +30,7 @@ public UpdateRunStrategy() { } /** - * Get the stages property: The list of stages that compose this update run. + * Get the stages property: The list of stages that compose this update run. Min size: 1. * * @return the stages value. */ @@ -32,7 +39,7 @@ public List stages() { } /** - * Set the stages property: The list of stages that compose this update run. + * Set the stages property: The list of stages that compose this update run. Min size: 1. * * @param stages the stages value to set. * @return the UpdateRunStrategy object itself. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRuns.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRuns.java index 7e20b85918aa..5b2a8ce71315 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRuns.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRuns.java @@ -98,7 +98,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ UpdateRun start(String resourceGroupName, String fleetName, String updateRunName); @@ -113,7 +113,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ UpdateRun start(String resourceGroupName, String fleetName, String updateRunName, String ifMatch, Context context); @@ -126,7 +126,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ UpdateRun stop(String resourceGroupName, String fleetName, String updateRunName); @@ -141,7 +141,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an UpdateRun is a multi-stage process to perform update operations across members of a Fleet. + * @return a multi-stage process to perform update operations across members of a Fleet. */ UpdateRun stop(String resourceGroupName, String fleetName, String updateRunName, String ifMatch, Context context); diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateStage.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateStage.java index 0f40baa100a6..33c74cd98287 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateStage.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateStage.java @@ -10,9 +10,8 @@ import java.util.List; /** - * Contains the groups to be updated by an UpdateRun. Update order: - Sequential between stages: Stages run - * sequentially. The previous stage must complete before the next one starts. - Parallel within a stage: Groups within a - * stage run in parallel. - Sequential within a group: Clusters within a group are updated sequentially. + * Defines a stage which contains the groups to update and the steps to take (e.g., wait for a time period) before + * starting the next stage. */ @Fluent public final class UpdateStage { @@ -23,8 +22,7 @@ public final class UpdateStage { private String name; /* - * A list of group names that compose the stage. - * The groups will be updated in parallel. Each group name can only appear once in the UpdateRun. + * Defines the groups to be executed in parallel in this stage. Duplicate groups are not allowed. Min size: 1. */ @JsonProperty(value = "groups") private List groups; @@ -61,8 +59,8 @@ public UpdateStage withName(String name) { } /** - * Get the groups property: A list of group names that compose the stage. The groups will be updated in parallel. - * Each group name can only appear once in the UpdateRun. + * Get the groups property: Defines the groups to be executed in parallel in this stage. Duplicate groups are not + * allowed. Min size: 1. * * @return the groups value. */ @@ -71,8 +69,8 @@ public List groups() { } /** - * Set the groups property: A list of group names that compose the stage. The groups will be updated in parallel. - * Each group name can only appear once in the UpdateRun. + * Set the groups property: Defines the groups to be executed in parallel in this stage. Duplicate groups are not + * allowed. Min size: 1. * * @param groups the groups value to set. * @return the UpdateStage object itself. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateState.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateState.java index 36e514a8a3c5..b5ad2b403422 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateState.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateState.java @@ -22,6 +22,9 @@ public final class UpdateState extends ExpandableStringEnum { /** Static value Stopped for UpdateState. */ public static final UpdateState STOPPED = fromString("Stopped"); + /** Static value Skipped for UpdateState. */ + public static final UpdateState SKIPPED = fromString("Skipped"); + /** Static value Failed for UpdateState. */ public static final UpdateState FAILED = fromString("Failed"); diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UserAssignedIdentity.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..a85b9c11535f --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public final class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID 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 UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersCreateSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersCreateSamples.java index 4cd1dd9dd177..355ff392a4f7 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersCreateSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersCreateSamples.java @@ -7,7 +7,7 @@ /** Samples for FleetMembers Create. */ public final class FleetMembersCreateSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/FleetMembers_Create.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Create.json */ /** * Sample code: Creates a FleetMember resource with a long running operation. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersDeleteSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersDeleteSamples.java index 06b3c7d148d1..d678e1403348 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersDeleteSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for FleetMembers Delete. */ public final class FleetMembersDeleteSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/FleetMembers_Delete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Delete.json */ /** * Sample code: Deletes a FleetMember resource asynchronously with a long running operation. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersGetSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersGetSamples.java index 78368062b879..9ccf9eea319d 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersGetSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersGetSamples.java @@ -7,7 +7,7 @@ /** Samples for FleetMembers Get. */ public final class FleetMembersGetSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/FleetMembers_Get.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Get.json */ /** * Sample code: Gets a FleetMember resource. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersListByFleetSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersListByFleetSamples.java index 31e8867aa21c..8337aee6af02 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersListByFleetSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersListByFleetSamples.java @@ -7,7 +7,7 @@ /** Samples for FleetMembers ListByFleet. */ public final class FleetMembersListByFleetSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/FleetMembers_ListByFleet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_ListByFleet.json */ /** * Sample code: Lists the members of a Fleet. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersUpdateSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersUpdateSamples.java index f5aacfc5fa00..708134055f8c 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersUpdateSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersUpdateSamples.java @@ -9,7 +9,7 @@ /** Samples for FleetMembers Update. */ public final class FleetMembersUpdateSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/FleetMembers_Update.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/FleetMembers_Update.json */ /** * Sample code: Updates a FleetMember resource synchronously. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesCreateOrUpdateSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..73b55d7e636e --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesCreateOrUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.generated; + +import com.azure.resourcemanager.containerservicefleet.models.UpdateGroup; +import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; +import com.azure.resourcemanager.containerservicefleet.models.UpdateStage; +import java.util.Arrays; + +/** Samples for FleetUpdateStrategies CreateOrUpdate. */ +public final class FleetUpdateStrategiesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_CreateOrUpdate.json + */ + /** + * Sample code: Create a FleetUpdateStrategy. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void createAFleetUpdateStrategy( + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager + .fleetUpdateStrategies() + .define("strartegy1") + .withExistingFleet("rg1", "fleet1") + .withStrategy( + new UpdateRunStrategy() + .withStages( + Arrays + .asList( + new UpdateStage() + .withName("stage1") + .withGroups(Arrays.asList(new UpdateGroup().withName("group-a"))) + .withAfterStageWaitInSeconds(3600)))) + .create(); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesDeleteSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesDeleteSamples.java new file mode 100644 index 000000000000..d6f6ba13d3f7 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.generated; + +/** Samples for FleetUpdateStrategies Delete. */ +public final class FleetUpdateStrategiesDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_Delete.json + */ + /** + * Sample code: Delete a FleetUpdateStrategy resource. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void deleteAFleetUpdateStrategyResource( + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.fleetUpdateStrategies().delete("rg1", "fleet1", "strategy1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesGetSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesGetSamples.java new file mode 100644 index 000000000000..a15f915fa02d --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesGetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.generated; + +/** Samples for FleetUpdateStrategies Get. */ +public final class FleetUpdateStrategiesGetSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_Get.json + */ + /** + * Sample code: Get a FleetUpdateStrategy resource. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void getAFleetUpdateStrategyResource( + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.fleetUpdateStrategies().getWithResponse("rg1", "fleet1", "strategy1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesListByFleetSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesListByFleetSamples.java new file mode 100644 index 000000000000..c88d18956150 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesListByFleetSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservicefleet.generated; + +/** Samples for FleetUpdateStrategies ListByFleet. */ +public final class FleetUpdateStrategiesListByFleetSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateStrategies_ListByFleet.json + */ + /** + * Sample code: List the FleetUpdateStrategy resources by fleet. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void listTheFleetUpdateStrategyResourcesByFleet( + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.fleetUpdateStrategies().listByFleet("rg1", "fleet1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateOrUpdateSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateOrUpdateSamples.java index e7c6cf562b6b..220bbf535b75 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateOrUpdateSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateOrUpdateSamples.java @@ -11,7 +11,7 @@ /** Samples for Fleets CreateOrUpdate. */ public final class FleetsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_CreateOrUpdate.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_CreateOrUpdate.json */ /** * Sample code: Creates a Fleet resource with a long running operation. @@ -30,6 +30,7 @@ public static void createsAFleetResourceWithALongRunningOperation( .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsDeleteSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsDeleteSamples.java index f239aa84d589..52aeb1855f2b 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsDeleteSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Fleets Delete. */ public final class FleetsDeleteSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_Delete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_Delete.json */ /** * Sample code: Deletes a Fleet resource asynchronously with a long running operation. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsGetByResourceGroupSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsGetByResourceGroupSamples.java index b5c13a06033a..e666acd3f869 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsGetByResourceGroupSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Fleets GetByResourceGroup. */ public final class FleetsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_Get.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_Get.json */ /** * Sample code: Gets a Fleet resource. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListByResourceGroupSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListByResourceGroupSamples.java index a189cc22b9f0..704ea45c8f3d 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListByResourceGroupSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Fleets ListByResourceGroup. */ public final class FleetsListByResourceGroupSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_ListByResourceGroup.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_ListByResourceGroup.json */ /** * Sample code: Lists the Fleet resources in a resource group. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListCredentialsSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListCredentialsSamples.java index 451da254b650..0f5b966f71d5 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListCredentialsSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListCredentialsSamples.java @@ -7,7 +7,7 @@ /** Samples for Fleets ListCredentials. */ public final class FleetsListCredentialsSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_ListCredentialsResult.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_ListCredentialsResult.json */ /** * Sample code: Lists the user credentials of a Fleet. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListSamples.java index f823b805c039..521a862565d8 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Fleets List. */ public final class FleetsListSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_ListBySub.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_ListBySub.json */ /** * Sample code: Lists the Fleet resources in a subscription. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsUpdateSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsUpdateSamples.java index 34e247053b16..7ee152bc232d 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsUpdateSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsUpdateSamples.java @@ -11,7 +11,7 @@ /** Samples for Fleets Update. */ public final class FleetsUpdateSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Fleets_PatchTags.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Fleets_PatchTags.json */ /** * Sample code: Update a Fleet. @@ -28,6 +28,7 @@ public static void updateAFleet( resource.update().withTags(mapOf("env", "prod", "tier", "secure")).withIfMatch("dfjkwelr7384").apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/OperationsListSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/OperationsListSamples.java index 5548ab35f880..5542bb8d4b7f 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/OperationsListSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/OperationsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/Operations_List.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/Operations_List.json */ /** * Sample code: List the operations for the provider. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsCreateOrUpdateSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsCreateOrUpdateSamples.java index 50e504a4b1f7..eb2d52cb2cf6 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsCreateOrUpdateSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsCreateOrUpdateSamples.java @@ -7,6 +7,8 @@ import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpdate; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeSpec; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeType; +import com.azure.resourcemanager.containerservicefleet.models.NodeImageSelection; +import com.azure.resourcemanager.containerservicefleet.models.NodeImageSelectionType; import com.azure.resourcemanager.containerservicefleet.models.UpdateGroup; import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; import com.azure.resourcemanager.containerservicefleet.models.UpdateStage; @@ -15,7 +17,7 @@ /** Samples for UpdateRuns CreateOrUpdate. */ public final class UpdateRunsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_CreateOrUpdate.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_CreateOrUpdate.json */ /** * Sample code: Create an UpdateRun. @@ -28,6 +30,8 @@ public static void createAnUpdateRun( .updateRuns() .define("run1") .withExistingFleet("rg1", "fleet1") + .withUpdateStrategyId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1") .withStrategy( new UpdateRunStrategy() .withStages( @@ -42,7 +46,8 @@ public static void createAnUpdateRun( .withUpgrade( new ManagedClusterUpgradeSpec() .withType(ManagedClusterUpgradeType.FULL) - .withKubernetesVersion("1.26.1"))) + .withKubernetesVersion("1.26.1")) + .withNodeImageSelection(new NodeImageSelection().withType(NodeImageSelectionType.LATEST))) .create(); } } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsDeleteSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsDeleteSamples.java index a5d1abe6dc12..33a6429331e4 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsDeleteSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for UpdateRuns Delete. */ public final class UpdateRunsDeleteSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_Delete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Delete.json */ /** * Sample code: Delete an updateRun resource. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsGetSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsGetSamples.java index fbe61893e0d9..33ca02231590 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsGetSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for UpdateRuns Get. */ public final class UpdateRunsGetSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_Get.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Get.json */ /** * Sample code: Gets an UpdateRun resource. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsListByFleetSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsListByFleetSamples.java index d57a4f7e89ab..af1e8f632f62 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsListByFleetSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsListByFleetSamples.java @@ -7,7 +7,7 @@ /** Samples for UpdateRuns ListByFleet. */ public final class UpdateRunsListByFleetSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_ListByFleet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_ListByFleet.json */ /** * Sample code: Lists the UpdateRun resources by fleet. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStartSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStartSamples.java index 77cc2c265375..b1077cc9010a 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStartSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStartSamples.java @@ -7,7 +7,7 @@ /** Samples for UpdateRuns Start. */ public final class UpdateRunsStartSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_Start.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Start.json */ /** * Sample code: Starts an UpdateRun. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStopSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStopSamples.java index 4667b8585207..19ea137f7dae 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStopSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStopSamples.java @@ -7,7 +7,7 @@ /** Samples for UpdateRuns Stop. */ public final class UpdateRunsStopSamples { /* - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-03-15-preview/examples/UpdateRuns_Stop.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2023-08-15-preview/examples/UpdateRuns_Stop.json */ /** * Sample code: Stops an UpdateRun. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetCredentialResultTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetCredentialResultTests.java deleted file mode 100644 index d3ae5016cf91..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetCredentialResultTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.FleetCredentialResult; - -public final class FleetCredentialResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetCredentialResult model = - BinaryData.fromString("{\"name\":\"bbkpodep\"}").toObject(FleetCredentialResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetCredentialResult model = new FleetCredentialResult(); - model = BinaryData.fromObject(model).toObject(FleetCredentialResult.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetCredentialResultsInnerTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetCredentialResultsInnerTests.java deleted file mode 100644 index b8c7c4e994f2..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetCredentialResultsInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetCredentialResultsInner; - -public final class FleetCredentialResultsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetCredentialResultsInner model = - BinaryData - .fromString( - "{\"kubeconfigs\":[{\"name\":\"zoxxjtf\"},{\"name\":\"uwfzitonpe\"},{\"name\":\"jkjlxofpdvhpfx\"},{\"name\":\"ininmay\"}]}") - .toObject(FleetCredentialResultsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetCredentialResultsInner model = new FleetCredentialResultsInner(); - model = BinaryData.fromObject(model).toObject(FleetCredentialResultsInner.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetHubProfileTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetHubProfileTests.java deleted file mode 100644 index 789ecc349997..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetHubProfileTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.FleetHubProfile; -import org.junit.jupiter.api.Assertions; - -public final class FleetHubProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetHubProfile model = - BinaryData - .fromString( - "{\"dnsPrefix\":\"fdfdosygexpa\",\"fqdn\":\"akhmsbzjhcrz\",\"kubernetesVersion\":\"dphlxaolt\"}") - .toObject(FleetHubProfile.class); - Assertions.assertEquals("fdfdosygexpa", model.dnsPrefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetHubProfile model = new FleetHubProfile().withDnsPrefix("fdfdosygexpa"); - model = BinaryData.fromObject(model).toObject(FleetHubProfile.class); - Assertions.assertEquals("fdfdosygexpa", model.dnsPrefix()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetInnerTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetInnerTests.java deleted file mode 100644 index 7087a900cce8..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetInnerTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetInner; -import com.azure.resourcemanager.containerservicefleet.models.FleetHubProfile; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class FleetInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"hubProfile\":{\"dnsPrefix\":\"emkkvnipjox\",\"fqdn\":\"nchgej\",\"kubernetesVersion\":\"odmailzyd\"}},\"eTag\":\"o\",\"location\":\"yahux\",\"tags\":{\"xj\":\"mqnjaqw\",\"atscmd\":\"prozvcputegjvwmf\"},\"id\":\"pjhulsuuvmkj\",\"name\":\"zkrwfn\",\"type\":\"iodjp\"}") - .toObject(FleetInner.class); - Assertions.assertEquals("yahux", model.location()); - Assertions.assertEquals("mqnjaqw", model.tags().get("xj")); - Assertions.assertEquals("emkkvnipjox", model.hubProfile().dnsPrefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetInner model = - new FleetInner() - .withLocation("yahux") - .withTags(mapOf("xj", "mqnjaqw", "atscmd", "prozvcputegjvwmf")) - .withHubProfile(new FleetHubProfile().withDnsPrefix("emkkvnipjox")); - model = BinaryData.fromObject(model).toObject(FleetInner.class); - Assertions.assertEquals("yahux", model.location()); - Assertions.assertEquals("mqnjaqw", model.tags().get("xj")); - Assertions.assertEquals("emkkvnipjox", model.hubProfile().dnsPrefix()); - } - - @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/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetListResultTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetListResultTests.java deleted file mode 100644 index 1f2fa25d6a17..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetListResultTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetInner; -import com.azure.resourcemanager.containerservicefleet.models.FleetListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class FleetListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"eTag\":\"xqhabi\",\"location\":\"ikxwc\",\"tags\":{\"n\":\"scnpqxuhivy\",\"rkxvdum\":\"wby\"},\"id\":\"grtfwvu\",\"name\":\"xgaudccs\",\"type\":\"h\"}],\"nextLink\":\"cnyejhkryhtnapcz\"}") - .toObject(FleetListResult.class); - Assertions.assertEquals("ikxwc", model.value().get(0).location()); - Assertions.assertEquals("scnpqxuhivy", model.value().get(0).tags().get("n")); - Assertions.assertEquals("cnyejhkryhtnapcz", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetListResult model = - new FleetListResult() - .withValue( - Arrays - .asList( - new FleetInner() - .withLocation("ikxwc") - .withTags(mapOf("n", "scnpqxuhivy", "rkxvdum", "wby")))) - .withNextLink("cnyejhkryhtnapcz"); - model = BinaryData.fromObject(model).toObject(FleetListResult.class); - Assertions.assertEquals("ikxwc", model.value().get(0).location()); - Assertions.assertEquals("scnpqxuhivy", model.value().get(0).tags().get("n")); - Assertions.assertEquals("cnyejhkryhtnapcz", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberInnerTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberInnerTests.java deleted file mode 100644 index 59efcbca0c35..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetMemberInner; -import org.junit.jupiter.api.Assertions; - -public final class FleetMemberInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetMemberInner model = - BinaryData - .fromString( - "{\"properties\":{\"clusterResourceId\":\"wjfeusnhutjel\",\"group\":\"rl\",\"provisioningState\":\"Failed\"},\"eTag\":\"jzzd\",\"id\":\"qxhocdgeablgphut\",\"name\":\"cndvkaozwyiftyhx\",\"type\":\"urokft\"}") - .toObject(FleetMemberInner.class); - Assertions.assertEquals("wjfeusnhutjel", model.clusterResourceId()); - Assertions.assertEquals("rl", model.group()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetMemberInner model = new FleetMemberInner().withClusterResourceId("wjfeusnhutjel").withGroup("rl"); - model = BinaryData.fromObject(model).toObject(FleetMemberInner.class); - Assertions.assertEquals("wjfeusnhutjel", model.clusterResourceId()); - Assertions.assertEquals("rl", model.group()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberListResultTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberListResultTests.java deleted file mode 100644 index 048ba3ca007d..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberListResultTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetMemberInner; -import com.azure.resourcemanager.containerservicefleet.models.FleetMemberListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class FleetMemberListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetMemberListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"clusterResourceId\":\"nuvamiheogna\",\"group\":\"zxtheotusivyevcc\",\"provisioningState\":\"Succeeded\"},\"eTag\":\"nhungbw\",\"id\":\"rnfygxgispem\",\"name\":\"tzfkufubl\",\"type\":\"ofx\"},{\"properties\":{\"clusterResourceId\":\"ofjaeqjhqjb\",\"group\":\"v\",\"provisioningState\":\"Succeeded\"},\"eTag\":\"qulngsntnbybkzgc\",\"id\":\"wclxxwrl\",\"name\":\"douskcqvkocrcjdk\",\"type\":\"tnhxbn\"},{\"properties\":{\"clusterResourceId\":\"iksqr\",\"group\":\"ssainqpjwnzll\",\"provisioningState\":\"Failed\"},\"eTag\":\"pee\",\"id\":\"mgxsab\",\"name\":\"yqduujit\",\"type\":\"jczdzevndh\"}],\"nextLink\":\"wpdappdsbdkv\"}") - .toObject(FleetMemberListResult.class); - Assertions.assertEquals("nuvamiheogna", model.value().get(0).clusterResourceId()); - Assertions.assertEquals("zxtheotusivyevcc", model.value().get(0).group()); - Assertions.assertEquals("wpdappdsbdkv", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetMemberListResult model = - new FleetMemberListResult() - .withValue( - Arrays - .asList( - new FleetMemberInner().withClusterResourceId("nuvamiheogna").withGroup("zxtheotusivyevcc"), - new FleetMemberInner().withClusterResourceId("ofjaeqjhqjb").withGroup("v"), - new FleetMemberInner().withClusterResourceId("iksqr").withGroup("ssainqpjwnzll"))) - .withNextLink("wpdappdsbdkv"); - model = BinaryData.fromObject(model).toObject(FleetMemberListResult.class); - Assertions.assertEquals("nuvamiheogna", model.value().get(0).clusterResourceId()); - Assertions.assertEquals("zxtheotusivyevcc", model.value().get(0).group()); - Assertions.assertEquals("wpdappdsbdkv", model.nextLink()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberPropertiesTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberPropertiesTests.java deleted file mode 100644 index 0cd7cf97d5e4..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetMemberProperties; -import org.junit.jupiter.api.Assertions; - -public final class FleetMemberPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetMemberProperties model = - BinaryData - .fromString( - "{\"clusterResourceId\":\"xolniwpwcukjfk\",\"group\":\"awxklr\",\"provisioningState\":\"Failed\"}") - .toObject(FleetMemberProperties.class); - Assertions.assertEquals("xolniwpwcukjfk", model.clusterResourceId()); - Assertions.assertEquals("awxklr", model.group()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetMemberProperties model = - new FleetMemberProperties().withClusterResourceId("xolniwpwcukjfk").withGroup("awxklr"); - model = BinaryData.fromObject(model).toObject(FleetMemberProperties.class); - Assertions.assertEquals("xolniwpwcukjfk", model.clusterResourceId()); - Assertions.assertEquals("awxklr", model.group()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberUpdatePropertiesTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberUpdatePropertiesTests.java deleted file mode 100644 index 3015d501c82c..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberUpdatePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetMemberUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class FleetMemberUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetMemberUpdateProperties model = - BinaryData.fromString("{\"group\":\"hsgcbacphejkot\"}").toObject(FleetMemberUpdateProperties.class); - Assertions.assertEquals("hsgcbacphejkot", model.group()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetMemberUpdateProperties model = new FleetMemberUpdateProperties().withGroup("hsgcbacphejkot"); - model = BinaryData.fromObject(model).toObject(FleetMemberUpdateProperties.class); - Assertions.assertEquals("hsgcbacphejkot", model.group()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberUpdateTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberUpdateTests.java deleted file mode 100644 index 8d02145b3992..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMemberUpdateTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.FleetMemberUpdate; -import org.junit.jupiter.api.Assertions; - -public final class FleetMemberUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetMemberUpdate model = - BinaryData.fromString("{\"properties\":{\"group\":\"kbasyypn\"}}").toObject(FleetMemberUpdate.class); - Assertions.assertEquals("kbasyypn", model.group()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetMemberUpdate model = new FleetMemberUpdate().withGroup("kbasyypn"); - model = BinaryData.fromObject(model).toObject(FleetMemberUpdate.class); - Assertions.assertEquals("kbasyypn", model.group()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersCreateMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersCreateMockTests.java deleted file mode 100644 index e76d6e01e0a8..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersCreateMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.FleetMember; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FleetMembersCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"clusterResourceId\":\"hagalpbuxwgipwh\",\"group\":\"ow\",\"provisioningState\":\"Succeeded\"},\"eTag\":\"wankixzbi\",\"id\":\"eputtmrywnuzoqf\",\"name\":\"iyqzrnk\",\"type\":\"qvyxlwhzlsicoho\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FleetMember response = - manager - .fleetMembers() - .define("azyxoegukg") - .withExistingFleet("enkouknvudw", "iukbldngkpoci") - .withClusterResourceId("piu") - .withGroup("ygevqzntypmrbpiz") - .withIfMatch("zfbishcbkhaj") - .withIfNoneMatch("eyeam") - .create(); - - Assertions.assertEquals("hagalpbuxwgipwh", response.clusterResourceId()); - Assertions.assertEquals("ow", response.group()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersDeleteMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersDeleteMockTests.java deleted file mode 100644 index f8f6407bf60b..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FleetMembersDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .fleetMembers() - .delete("lvmezyvshxmzsbbz", "ggi", "rxwburv", "xxjnspydptk", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersGetWithResponseMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersGetWithResponseMockTests.java deleted file mode 100644 index 936a23fd42e0..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.FleetMember; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FleetMembersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"clusterResourceId\":\"skghsauuimj\",\"group\":\"xieduugidyjrr\",\"provisioningState\":\"Joining\"},\"eTag\":\"osvexcsonpclhoc\",\"id\":\"slkevle\",\"name\":\"gz\",\"type\":\"buhfmvfaxkffeiit\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FleetMember response = - manager - .fleetMembers() - .getWithResponse("zdobpxjmflbvvnch", "kcciwwzjuqkhr", "ajiwkuo", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("skghsauuimj", response.clusterResourceId()); - Assertions.assertEquals("xieduugidyjrr", response.group()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersListByFleetMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersListByFleetMockTests.java deleted file mode 100644 index 6c189e52ed40..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersListByFleetMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.FleetMember; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FleetMembersListByFleetMockTests { - @Test - public void testListByFleet() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"clusterResourceId\":\"zvyifqrvkdvj\",\"group\":\"lrmv\",\"provisioningState\":\"Updating\"},\"eTag\":\"atkpnp\",\"id\":\"exxbczwtr\",\"name\":\"wiqzbqjvsovmyo\",\"type\":\"acspkwl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.fleetMembers().listByFleet("uxh", "yudxorrqnbp", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zvyifqrvkdvj", response.iterator().next().clusterResourceId()); - Assertions.assertEquals("lrmv", response.iterator().next().group()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetPatchTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetPatchTests.java deleted file mode 100644 index 6cb17dee757c..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetPatchTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.FleetPatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class FleetPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetPatch model = BinaryData.fromString("{\"tags\":{\"f\":\"rgqjbpfzfsinzg\"}}").toObject(FleetPatch.class); - Assertions.assertEquals("rgqjbpfzfsinzg", model.tags().get("f")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetPatch model = new FleetPatch().withTags(mapOf("f", "rgqjbpfzfsinzg")); - model = BinaryData.fromObject(model).toObject(FleetPatch.class); - Assertions.assertEquals("rgqjbpfzfsinzg", model.tags().get("f")); - } - - @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/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetPropertiesTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetPropertiesTests.java deleted file mode 100644 index afa3139b2ea3..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetProperties; -import com.azure.resourcemanager.containerservicefleet.models.FleetHubProfile; -import org.junit.jupiter.api.Assertions; - -public final class FleetPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Creating\",\"hubProfile\":{\"dnsPrefix\":\"dpvwryoqpsoaccta\",\"fqdn\":\"kljla\",\"kubernetesVersion\":\"cr\"}}") - .toObject(FleetProperties.class); - Assertions.assertEquals("dpvwryoqpsoaccta", model.hubProfile().dnsPrefix()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetProperties model = - new FleetProperties().withHubProfile(new FleetHubProfile().withDnsPrefix("dpvwryoqpsoaccta")); - model = BinaryData.fromObject(model).toObject(FleetProperties.class); - Assertions.assertEquals("dpvwryoqpsoaccta", model.hubProfile().dnsPrefix()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateOrUpdateMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateOrUpdateMockTests.java deleted file mode 100644 index d63544a7f0b1..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.Fleet; -import com.azure.resourcemanager.containerservicefleet.models.FleetHubProfile; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FleetsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"hubProfile\":{\"dnsPrefix\":\"q\",\"fqdn\":\"a\",\"kubernetesVersion\":\"ae\"}},\"eTag\":\"fhyhltrpmopjmcma\",\"location\":\"okth\",\"tags\":{\"xodpuozmyzydagfu\":\"uaodsfcpk\",\"dxwzywqsmbsurexi\":\"xbezyiuokktwh\"},\"id\":\"o\",\"name\":\"yocf\",\"type\":\"fksymddystki\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Fleet response = - manager - .fleets() - .define("ndnvo") - .withRegion("whybcib") - .withExistingResourceGroup("vudwx") - .withTags(mapOf("ynnaam", "dcsi", "qsc", "ectehf", "hcjrefovgmk", "eypvhezrkg")) - .withHubProfile(new FleetHubProfile().withDnsPrefix("gwdkcglhsl")) - .withIfMatch("jh") - .withIfNoneMatch("mdajv") - .create(); - - Assertions.assertEquals("okth", response.location()); - Assertions.assertEquals("uaodsfcpk", response.tags().get("xodpuozmyzydagfu")); - Assertions.assertEquals("q", response.hubProfile().dnsPrefix()); - } - - @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/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsDeleteMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsDeleteMockTests.java deleted file mode 100644 index 7ae131e1e905..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FleetsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.fleets().delete("ualhbxxhejj", "zvdudgwdslfhotwm", "ynpwlbj", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsGetByResourceGroupWithResponseMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 20dc569b1caf..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.Fleet; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FleetsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Canceled\",\"hubProfile\":{\"dnsPrefix\":\"fnba\",\"fqdn\":\"ionle\",\"kubernetesVersion\":\"etqgtzxdpnq\"}},\"eTag\":\"qwxrjfeallnw\",\"location\":\"bisnja\",\"tags\":{\"onq\":\"ngnzscxaqwoochc\",\"ea\":\"pkvlrxn\",\"enjbdlwtgrhp\":\"eipheoflokeyy\"},\"id\":\"jp\",\"name\":\"umasxazjpq\",\"type\":\"e\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Fleet response = - manager - .fleets() - .getByResourceGroupWithResponse("c", "pmivkwlzu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bisnja", response.location()); - Assertions.assertEquals("ngnzscxaqwoochc", response.tags().get("onq")); - Assertions.assertEquals("fnba", response.hubProfile().dnsPrefix()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListByResourceGroupMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListByResourceGroupMockTests.java deleted file mode 100644 index 08eb251c71d3..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListByResourceGroupMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.Fleet; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FleetsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"hubProfile\":{\"dnsPrefix\":\"gug\",\"fqdn\":\"krxd\",\"kubernetesVersion\":\"i\"}},\"eTag\":\"thz\",\"location\":\"qdrabhjybigehoqf\",\"tags\":{\"zlcuiywgqywgndrv\":\"skanyk\"},\"id\":\"nhzgpphrcgyn\",\"name\":\"ocpecfvmmco\",\"type\":\"fsxlzevgbmqjqa\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.fleets().listByResourceGroup("iotkftutqxl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qdrabhjybigehoqf", response.iterator().next().location()); - Assertions.assertEquals("skanyk", response.iterator().next().tags().get("zlcuiywgqywgndrv")); - Assertions.assertEquals("gug", response.iterator().next().hubProfile().dnsPrefix()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListCredentialsWithResponseMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListCredentialsWithResponseMockTests.java deleted file mode 100644 index 6c608ad59158..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListCredentialsWithResponseMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.FleetCredentialResults; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FleetsListCredentialsWithResponseMockTests { - @Test - public void testListCredentialsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"kubeconfigs\":[{\"name\":\"esnzwde\"},{\"name\":\"vorxzdmohct\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FleetCredentialResults response = - manager - .fleets() - .listCredentialsWithResponse("pgacftadehxnlty", "sop", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListMockTests.java deleted file mode 100644 index f3e916a3d713..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.Fleet; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class FleetsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"hubProfile\":{\"dnsPrefix\":\"pzaoqvuhr\",\"fqdn\":\"f\",\"kubernetesVersion\":\"yd\"}},\"eTag\":\"lmjthjq\",\"location\":\"pyeicxm\",\"tags\":{\"pbobjo\":\"wqvhkhixuigdt\",\"w\":\"hm\"},\"id\":\"a\",\"name\":\"a\",\"type\":\"hrzayvvtpgvdf\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.fleets().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pyeicxm", response.iterator().next().location()); - Assertions.assertEquals("wqvhkhixuigdt", response.iterator().next().tags().get("pbobjo")); - Assertions.assertEquals("pzaoqvuhr", response.iterator().next().hubProfile().dnsPrefix()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedClusterUpdateTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedClusterUpdateTests.java deleted file mode 100644 index 9c0b796a75ce..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedClusterUpdateTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpdate; -import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeSpec; -import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeType; -import org.junit.jupiter.api.Assertions; - -public final class ManagedClusterUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedClusterUpdate model = - BinaryData - .fromString("{\"upgrade\":{\"type\":\"Full\",\"kubernetesVersion\":\"mdwzjeiachboo\"}}") - .toObject(ManagedClusterUpdate.class); - Assertions.assertEquals(ManagedClusterUpgradeType.FULL, model.upgrade().type()); - Assertions.assertEquals("mdwzjeiachboo", model.upgrade().kubernetesVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedClusterUpdate model = - new ManagedClusterUpdate() - .withUpgrade( - new ManagedClusterUpgradeSpec() - .withType(ManagedClusterUpgradeType.FULL) - .withKubernetesVersion("mdwzjeiachboo")); - model = BinaryData.fromObject(model).toObject(ManagedClusterUpdate.class); - Assertions.assertEquals(ManagedClusterUpgradeType.FULL, model.upgrade().type()); - Assertions.assertEquals("mdwzjeiachboo", model.upgrade().kubernetesVersion()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedClusterUpgradeSpecTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedClusterUpgradeSpecTests.java deleted file mode 100644 index 2a2c39902ae5..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedClusterUpgradeSpecTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeSpec; -import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeType; -import org.junit.jupiter.api.Assertions; - -public final class ManagedClusterUpgradeSpecTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedClusterUpgradeSpec model = - BinaryData - .fromString("{\"type\":\"NodeImageOnly\",\"kubernetesVersion\":\"nrosfqpte\"}") - .toObject(ManagedClusterUpgradeSpec.class); - Assertions.assertEquals(ManagedClusterUpgradeType.NODE_IMAGE_ONLY, model.type()); - Assertions.assertEquals("nrosfqpte", model.kubernetesVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedClusterUpgradeSpec model = - new ManagedClusterUpgradeSpec() - .withType(ManagedClusterUpgradeType.NODE_IMAGE_ONLY) - .withKubernetesVersion("nrosfqpte"); - model = BinaryData.fromObject(model).toObject(ManagedClusterUpgradeSpec.class); - Assertions.assertEquals(ManagedClusterUpgradeType.NODE_IMAGE_ONLY, model.type()); - Assertions.assertEquals("nrosfqpte", model.kubernetesVersion()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/MemberUpdateStatusTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/MemberUpdateStatusTests.java deleted file mode 100644 index c964ef05c07a..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/MemberUpdateStatusTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.MemberUpdateStatus; - -public final class MemberUpdateStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MemberUpdateStatus model = - BinaryData - .fromString( - "{\"status\":{\"startTime\":\"2021-09-06T05:45:20Z\",\"completedTime\":\"2021-02-14T15:50:10Z\",\"state\":\"Completed\"},\"name\":\"djwzrlov\",\"clusterResourceId\":\"lwhijcoejctbzaq\",\"operationId\":\"sycbkbfk\"}") - .toObject(MemberUpdateStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MemberUpdateStatus model = new MemberUpdateStatus(); - model = BinaryData.fromObject(model).toObject(MemberUpdateStatus.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationDisplayTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationDisplayTests.java deleted file mode 100644 index cc1ab10f373b..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationInnerTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationInnerTests.java deleted file mode 100644 index 2d40cb2bb10b..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.OperationInner; -import com.azure.resourcemanager.containerservicefleet.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationListResultTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationListResultTests.java deleted file mode 100644 index 594e5268f00f..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationsListMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationsListMockTests.java deleted file mode 100644 index 7dccbf3fb624..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"mxaxc\",\"isDataAction\":false,\"display\":{\"provider\":\"dtocj\",\"resource\":\"hvpmoue\",\"operation\":\"dzxibqeojnxqbzvd\",\"description\":\"t\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateGroupStatusTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateGroupStatusTests.java deleted file mode 100644 index 969d9bc63c9c..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateGroupStatusTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.UpdateGroupStatus; - -public final class UpdateGroupStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateGroupStatus model = - BinaryData - .fromString( - "{\"status\":{\"startTime\":\"2021-08-17T01:01:15Z\",\"completedTime\":\"2021-05-08T18:49:34Z\",\"state\":\"Completed\"},\"name\":\"aierhhb\",\"members\":[{\"status\":{\"startTime\":\"2021-07-20T05:11Z\",\"completedTime\":\"2021-01-08T14:04:30Z\",\"state\":\"Stopped\"},\"name\":\"odxobnbdxkqpxok\",\"clusterResourceId\":\"ionpimexg\",\"operationId\":\"xgcp\"}]}") - .toObject(UpdateGroupStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateGroupStatus model = new UpdateGroupStatus(); - model = BinaryData.fromObject(model).toObject(UpdateGroupStatus.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateGroupTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateGroupTests.java deleted file mode 100644 index 85ca4ff55aee..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateGroupTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.UpdateGroup; -import org.junit.jupiter.api.Assertions; - -public final class UpdateGroupTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateGroup model = BinaryData.fromString("{\"name\":\"cs\"}").toObject(UpdateGroup.class); - Assertions.assertEquals("cs", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateGroup model = new UpdateGroup().withName("cs"); - model = BinaryData.fromObject(model).toObject(UpdateGroup.class); - Assertions.assertEquals("cs", model.name()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunInnerTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunInnerTests.java deleted file mode 100644 index 947e609ce9a9..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.UpdateRunInner; -import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpdate; -import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; -import java.util.Arrays; - -public final class UpdateRunInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateRunInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"strategy\":{\"stages\":[]},\"managedClusterUpdate\":{},\"status\":{\"stages\":[]}},\"eTag\":\"uxig\",\"id\":\"jgzjaoyfhrtx\",\"name\":\"lnerkujysvleju\",\"type\":\"fqawrlyxw\"}") - .toObject(UpdateRunInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateRunInner model = - new UpdateRunInner() - .withStrategy(new UpdateRunStrategy().withStages(Arrays.asList())) - .withManagedClusterUpdate(new ManagedClusterUpdate()); - model = BinaryData.fromObject(model).toObject(UpdateRunInner.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunListResultTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunListResultTests.java deleted file mode 100644 index 52a6f6d2bf06..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunListResultTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.UpdateRunInner; -import com.azure.resourcemanager.containerservicefleet.models.UpdateRunListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateRunListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateRunListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\"},\"eTag\":\"ndlik\",\"id\":\"qkgfgibma\",\"name\":\"gakeqsr\",\"type\":\"yb\"},{\"properties\":{\"provisioningState\":\"Canceled\"},\"eTag\":\"tbciqfouflmm\",\"id\":\"zsm\",\"name\":\"dmgloug\",\"type\":\"b\"},{\"properties\":{\"provisioningState\":\"Failed\"},\"eTag\":\"uqktap\",\"id\":\"wgcu\",\"name\":\"rtumkdosvq\",\"type\":\"hbmdgbbjfdd\"}],\"nextLink\":\"bmbexppbhtqqro\"}") - .toObject(UpdateRunListResult.class); - Assertions.assertEquals("bmbexppbhtqqro", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateRunListResult model = - new UpdateRunListResult() - .withValue(Arrays.asList(new UpdateRunInner(), new UpdateRunInner(), new UpdateRunInner())) - .withNextLink("bmbexppbhtqqro"); - model = BinaryData.fromObject(model).toObject(UpdateRunListResult.class); - Assertions.assertEquals("bmbexppbhtqqro", model.nextLink()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunPropertiesTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunPropertiesTests.java deleted file mode 100644 index fa8afb100945..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunPropertiesTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.UpdateRunProperties; -import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpdate; -import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeSpec; -import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeType; -import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; -import com.azure.resourcemanager.containerservicefleet.models.UpdateStage; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateRunPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateRunProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Canceled\",\"strategy\":{\"stages\":[{\"name\":\"bnwbxgjvtbvpyssz\",\"groups\":[],\"afterStageWaitInSeconds\":315783866},{\"name\":\"jq\",\"groups\":[],\"afterStageWaitInSeconds\":1745806154},{\"name\":\"uouq\",\"groups\":[],\"afterStageWaitInSeconds\":326786210},{\"name\":\"zw\",\"groups\":[],\"afterStageWaitInSeconds\":2100303933}]},\"managedClusterUpdate\":{\"upgrade\":{\"type\":\"NodeImageOnly\",\"kubernetesVersion\":\"nwui\"}},\"status\":{\"status\":{\"startTime\":\"2021-08-08T04:29:53Z\",\"completedTime\":\"2021-11-07T16:18:10Z\",\"state\":\"Failed\"},\"stages\":[{\"name\":\"i\",\"groups\":[]}]}}") - .toObject(UpdateRunProperties.class); - Assertions.assertEquals("bnwbxgjvtbvpyssz", model.strategy().stages().get(0).name()); - Assertions.assertEquals(315783866, model.strategy().stages().get(0).afterStageWaitInSeconds()); - Assertions - .assertEquals(ManagedClusterUpgradeType.NODE_IMAGE_ONLY, model.managedClusterUpdate().upgrade().type()); - Assertions.assertEquals("nwui", model.managedClusterUpdate().upgrade().kubernetesVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateRunProperties model = - new UpdateRunProperties() - .withStrategy( - new UpdateRunStrategy() - .withStages( - Arrays - .asList( - new UpdateStage() - .withName("bnwbxgjvtbvpyssz") - .withGroups(Arrays.asList()) - .withAfterStageWaitInSeconds(315783866), - new UpdateStage() - .withName("jq") - .withGroups(Arrays.asList()) - .withAfterStageWaitInSeconds(1745806154), - new UpdateStage() - .withName("uouq") - .withGroups(Arrays.asList()) - .withAfterStageWaitInSeconds(326786210), - new UpdateStage() - .withName("zw") - .withGroups(Arrays.asList()) - .withAfterStageWaitInSeconds(2100303933)))) - .withManagedClusterUpdate( - new ManagedClusterUpdate() - .withUpgrade( - new ManagedClusterUpgradeSpec() - .withType(ManagedClusterUpgradeType.NODE_IMAGE_ONLY) - .withKubernetesVersion("nwui"))); - model = BinaryData.fromObject(model).toObject(UpdateRunProperties.class); - Assertions.assertEquals("bnwbxgjvtbvpyssz", model.strategy().stages().get(0).name()); - Assertions.assertEquals(315783866, model.strategy().stages().get(0).afterStageWaitInSeconds()); - Assertions - .assertEquals(ManagedClusterUpgradeType.NODE_IMAGE_ONLY, model.managedClusterUpdate().upgrade().type()); - Assertions.assertEquals("nwui", model.managedClusterUpdate().upgrade().kubernetesVersion()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunStatusTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunStatusTests.java deleted file mode 100644 index 188cfb1be883..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunStatusTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStatus; - -public final class UpdateRunStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateRunStatus model = - BinaryData - .fromString( - "{\"status\":{\"startTime\":\"2021-01-29T18:51:03Z\",\"completedTime\":\"2021-10-06T17:45:29Z\",\"state\":\"Stopped\"},\"stages\":[{\"status\":{\"startTime\":\"2021-03-07T01:43:41Z\",\"completedTime\":\"2021-03-18T16:28:01Z\",\"state\":\"Stopped\"},\"name\":\"dkirsoodqxhcr\",\"groups\":[],\"afterStageWaitStatus\":{\"waitDurationInSeconds\":1543175438}}]}") - .toObject(UpdateRunStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateRunStatus model = new UpdateRunStatus(); - model = BinaryData.fromObject(model).toObject(UpdateRunStatus.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunStrategyTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunStrategyTests.java deleted file mode 100644 index 77da1406fa52..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunStrategyTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; -import com.azure.resourcemanager.containerservicefleet.models.UpdateStage; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateRunStrategyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateRunStrategy model = - BinaryData - .fromString( - "{\"stages\":[{\"name\":\"dfvzwdzuhty\",\"groups\":[],\"afterStageWaitInSeconds\":396497881}]}") - .toObject(UpdateRunStrategy.class); - Assertions.assertEquals("dfvzwdzuhty", model.stages().get(0).name()); - Assertions.assertEquals(396497881, model.stages().get(0).afterStageWaitInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateRunStrategy model = - new UpdateRunStrategy() - .withStages( - Arrays - .asList( - new UpdateStage() - .withName("dfvzwdzuhty") - .withGroups(Arrays.asList()) - .withAfterStageWaitInSeconds(396497881))); - model = BinaryData.fromObject(model).toObject(UpdateRunStrategy.class); - Assertions.assertEquals("dfvzwdzuhty", model.stages().get(0).name()); - Assertions.assertEquals(396497881, model.stages().get(0).afterStageWaitInSeconds()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsDeleteMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsDeleteMockTests.java deleted file mode 100644 index a9c591142ce2..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class UpdateRunsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .updateRuns() - .delete("jky", "xjvuujqgidokg", "ljyoxgvcltb", "sncghkjeszz", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsGetWithResponseMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsGetWithResponseMockTests.java deleted file mode 100644 index 5bd05a25bc98..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.UpdateRun; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class UpdateRunsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Failed\",\"strategy\":{\"stages\":[]},\"managedClusterUpdate\":{},\"status\":{\"stages\":[]}},\"eTag\":\"ymuctqhjfbebrj\",\"id\":\"erfuwuttt\",\"name\":\"fvjrbirphxepcy\",\"type\":\"ahfn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UpdateRun response = - manager - .updateRuns() - .getWithResponse("senhwlrs", "frzpwvlqdqgb", "qylihkaetckt", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsListByFleetMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsListByFleetMockTests.java deleted file mode 100644 index 6a7b67000058..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsListByFleetMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.UpdateRun; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class UpdateRunsListByFleetMockTests { - @Test - public void testListByFleet() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"strategy\":{\"stages\":[]},\"managedClusterUpdate\":{},\"status\":{\"stages\":[]}},\"eTag\":\"gyxzk\",\"id\":\"ocukoklyax\",\"name\":\"conuqszfkbeype\",\"type\":\"rmjmwvvjektc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.updateRuns().listByFleet("qnwvlrya", "w", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStartMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStartMockTests.java deleted file mode 100644 index 2c509c85f6d0..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStartMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.UpdateRun; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class UpdateRunsStartMockTests { - @Test - public void testStart() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"strategy\":{\"stages\":[]},\"managedClusterUpdate\":{},\"status\":{\"stages\":[]}},\"eTag\":\"fbxzpuzycisp\",\"id\":\"zahmgkbrpyydhibn\",\"name\":\"qqkpikadrg\",\"type\":\"tqagnbuynh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UpdateRun response = - manager - .updateRuns() - .start("bijhtxfvgxbf", "mxnehmp", "ec", "godebfqkkrbmpu", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStopMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStopMockTests.java deleted file mode 100644 index 989907a296b1..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsStopMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; -import com.azure.resourcemanager.containerservicefleet.models.UpdateRun; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class UpdateRunsStopMockTests { - @Test - public void testStop() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"strategy\":{\"stages\":[]},\"managedClusterUpdate\":{},\"status\":{\"stages\":[]}},\"eTag\":\"synlqidybyxczfc\",\"id\":\"aaxdbabphlwrq\",\"name\":\"fkts\",\"type\":\"hsucoc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerServiceFleetManager manager = - ContainerServiceFleetManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - UpdateRun response = - manager - .updateRuns() - .stop( - "jggmebfsiarbu", - "rcvpnazzmhjrunmp", - "ttdbhrbnl", - "nkxmyskpbhenbtk", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateStageStatusTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateStageStatusTests.java deleted file mode 100644 index d87c5cd07e5c..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateStageStatusTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.UpdateStageStatus; - -public final class UpdateStageStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateStageStatus model = - BinaryData - .fromString( - "{\"status\":{\"startTime\":\"2021-12-04T15:56:22Z\",\"completedTime\":\"2020-12-23T01:19:24Z\",\"state\":\"Stopped\"},\"name\":\"wpgrjbzno\",\"groups\":[{\"status\":{\"startTime\":\"2021-01-31T18:34:57Z\",\"completedTime\":\"2021-11-14T01:20:47Z\",\"state\":\"Stopping\"},\"name\":\"bnmo\",\"members\":[]},{\"status\":{\"startTime\":\"2021-08-24T13:39:32Z\",\"completedTime\":\"2021-08-24T18:20:56Z\",\"state\":\"Stopped\"},\"name\":\"ljjgpbtoqcjmkl\",\"members\":[]},{\"status\":{\"startTime\":\"2021-11-17T00:12:24Z\",\"completedTime\":\"2021-04-20T08:45:23Z\",\"state\":\"Stopping\"},\"name\":\"yulpkudjkr\",\"members\":[]}],\"afterStageWaitStatus\":{\"status\":{\"startTime\":\"2021-09-13T05:12:15Z\",\"completedTime\":\"2021-02-23T09:32:58Z\",\"state\":\"Failed\"},\"waitDurationInSeconds\":210488856}}") - .toObject(UpdateStageStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateStageStatus model = new UpdateStageStatus(); - model = BinaryData.fromObject(model).toObject(UpdateStageStatus.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateStageTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateStageTests.java deleted file mode 100644 index 12f255a7fa12..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateStageTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.UpdateGroup; -import com.azure.resourcemanager.containerservicefleet.models.UpdateStage; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateStageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateStage model = - BinaryData - .fromString( - "{\"name\":\"kfthwxmntei\",\"groups\":[{\"name\":\"pvkmijcmmxdcuf\"},{\"name\":\"fsrpymzidnse\"},{\"name\":\"cxtbzsg\"}],\"afterStageWaitInSeconds\":121296393}") - .toObject(UpdateStage.class); - Assertions.assertEquals("kfthwxmntei", model.name()); - Assertions.assertEquals("pvkmijcmmxdcuf", model.groups().get(0).name()); - Assertions.assertEquals(121296393, model.afterStageWaitInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateStage model = - new UpdateStage() - .withName("kfthwxmntei") - .withGroups( - Arrays - .asList( - new UpdateGroup().withName("pvkmijcmmxdcuf"), - new UpdateGroup().withName("fsrpymzidnse"), - new UpdateGroup().withName("cxtbzsg"))) - .withAfterStageWaitInSeconds(121296393); - model = BinaryData.fromObject(model).toObject(UpdateStage.class); - Assertions.assertEquals("kfthwxmntei", model.name()); - Assertions.assertEquals("pvkmijcmmxdcuf", model.groups().get(0).name()); - Assertions.assertEquals(121296393, model.afterStageWaitInSeconds()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateStatusTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateStatusTests.java deleted file mode 100644 index 4716012cd2cc..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateStatusTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.UpdateStatus; - -public final class UpdateStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateStatus model = - BinaryData - .fromString( - "{\"startTime\":\"2020-12-26T05:08:12Z\",\"completedTime\":\"2021-01-23T02:14:07Z\",\"state\":\"Stopping\"}") - .toObject(UpdateStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateStatus model = new UpdateStatus(); - model = BinaryData.fromObject(model).toObject(UpdateStatus.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/WaitStatusTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/WaitStatusTests.java deleted file mode 100644 index 15506705ac0a..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/WaitStatusTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.WaitStatus; - -public final class WaitStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WaitStatus model = - BinaryData - .fromString( - "{\"status\":{\"startTime\":\"2021-04-20T10:26:18Z\",\"completedTime\":\"2021-10-12T01:56:34Z\",\"state\":\"Stopped\"},\"waitDurationInSeconds\":1046063438}") - .toObject(WaitStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WaitStatus model = new WaitStatus(); - model = BinaryData.fromObject(model).toObject(WaitStatus.class); - } -}