diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md index 7dc143ac59b3..60503d35ebf6 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md @@ -1,22 +1,11 @@ # Release History -## 1.2.0 (2025-04-10) +## 1.2.0 (2025-05-13) - Azure Resource Manager Container Service Fleet client library for Java. This package contains Microsoft Azure SDK for Container Service Fleet Management SDK. Azure Kubernetes Fleet Manager api client. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -#### Serialization/Deserialization change - -- `Jackson` is removed from dependency and no longer supported. - -##### Migration Guide - -If you are using `Jackson`/`ObjectMapper` for manual serialization/deserialization, configure your `ObjectMapper` for backward compatibility: -```java -objectMapper.registerModule(com.azure.core.serializer.json.jackson.JacksonJsonProvider.getJsonSerializableDatabindModule()); -``` - #### `models.FleetMemberListResult` was removed #### `models.UpdateRunListResult` was removed @@ -39,67 +28,248 @@ objectMapper.registerModule(com.azure.core.serializer.json.jackson.JacksonJsonPr ### Features Added +* `models.GateConfiguration` was added + * `models.UpgradeChannel` was added +* `implementation.models.OperationListResult` was added + * `models.AutoUpgradeProfile$Update` was added * `models.AutoUpgradeProfile$Definition` was added * `models.FleetStatus` was added +* `models.UpdateRunGateStatus` was added + * `models.AutoUpgradeProfileProvisioningState` was added * `models.FleetMemberStatus` was added +* `models.GatePatch` was added + +* `models.Timing` was added + * `models.AutoUpgradeNodeImageSelectionType` was added +* `models.Gates` was added + +* `implementation.models.FleetMemberListResult` was added + +* `implementation.models.GateListResult` was added + +* `models.GateType` was added + * `models.AutoUpgradeProfile$UpdateStages` was added * `models.AutoUpgradeProfiles` was added * `models.AutoUpgradeProfile` was added +* `implementation.models.UpdateRunListResult` was added + * `models.AutoUpgradeNodeImageSelection` was added +* `models.GatePatchProperties` was added + +* `implementation.models.FleetListResult` was added + +* `models.GateProvisioningState` was added + * `models.AutoUpgradeProfile$DefinitionStages` was added +* `models.UpdateRunGateTargetProperties` was added + +* `models.GateTarget` was added + * `models.AutoUpgradeProfileOperations` was added +* `implementation.models.AutoUpgradeProfileListResult` was added + +* `models.Gate` was added + * `models.AutoUpgradeLastTriggerStatus` was added +* `models.GateState` was added + +* `implementation.models.FleetUpdateStrategyListResult` was added + * `models.GenerateResponse` was added * `models.AutoUpgradeProfileStatus` was added #### `models.ApiServerAccessProfile` was modified -* `withSubnetId(java.lang.String)` was added -* `withEnableVnetIntegration(java.lang.Boolean)` was added * `enableVnetIntegration()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added * `subnetId()` was added +* `withEnableVnetIntegration(java.lang.Boolean)` was added +* `withSubnetId(java.lang.String)` was added + +#### `models.UserAssignedIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.WaitStatus` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added #### `ContainerServiceFleetManager` was modified -* `autoUpgradeProfiles()` was added * `autoUpgradeProfileOperations()` was added +* `gates()` was added +* `autoUpgradeProfiles()` was added + +#### `models.AgentProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added #### `models.FleetMember` was modified +* `labels()` was added * `status()` was added +#### `models.UpdateStageStatus` was modified + +* `beforeGates()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `afterGates()` was added +* `toJson(com.azure.json.JsonWriter)` was added + #### `models.Fleet` was modified * `status()` was added +#### `models.ManagedServiceIdentity` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UpdateGroupStatus` was modified + +* `beforeGates()` was added +* `afterGates()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.FleetHubProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UpdateRunStrategy` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + #### `models.NodeImageSelection` was modified +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added * `withCustomNodeImageVersions(java.util.List)` was added * `customNodeImageVersions()` was added +#### `models.NodeImageSelectionStatus` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FleetMember$Definition` was modified + +* `withLabels(java.util.Map)` was added + +#### `models.FleetMemberUpdate` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withLabels(java.util.Map)` was added +* `labels()` was added + +#### `models.UpdateStatus` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FleetPatch` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.UpdateGroup` was modified + +* `afterGates()` was added +* `beforeGates()` was added +* `withAfterGates(java.util.List)` was added +* `withBeforeGates(java.util.List)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ManagedClusterUpgradeSpec` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UpdateStage` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `beforeGates()` was added +* `withAfterGates(java.util.List)` was added +* `afterGates()` was added +* `withBeforeGates(java.util.List)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.SkipProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.MemberUpdateStatus` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FleetCredentialResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationDisplay` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ManagedClusterUpdate` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + #### `models.UpdateRun` was modified * `autoUpgradeProfileId()` was added +#### `models.SkipTarget` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NodeImageVersion` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.FleetMember$Update` was modified + +* `withLabels(java.util.Map)` was added + +#### `models.UpdateRunStatus` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + ## 1.2.0-beta.1 (2024-10-17) - 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-2024-05-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/SAMPLE.md b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/SAMPLE.md index 3cc4c06f7a60..3a4be40b76b6 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/SAMPLE.md +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/SAMPLE.md @@ -37,6 +37,12 @@ - [ListCredentials](#fleets_listcredentials) - [UpdateAsync](#fleets_updateasync) +## Gates + +- [Get](#gates_get) +- [ListByFleet](#gates_listbyfleet) +- [Update](#gates_update) + ## Operations - [List](#operations_list) @@ -58,7 +64,7 @@ */ public final class FleetUpdateStrategiesDeleteSamples { /* - * x-ms-original-file: 2025-03-01/UpdateStrategies_Delete.json + * x-ms-original-file: 2025-04-01-preview/UpdateStrategies_Delete.json */ /** * Sample code: Delete a FleetUpdateStrategy resource. @@ -71,7 +77,7 @@ public final class FleetUpdateStrategiesDeleteSamples { } /* - * x-ms-original-file: 2025-03-01/FleetUpdateStrategies_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetUpdateStrategies_Delete_MaximumSet_Gen.json */ /** * Sample code: Delete a FleetUpdateStrategy resource. - generated by [MaximumSet] rule. @@ -94,7 +100,7 @@ public final class FleetUpdateStrategiesDeleteSamples { */ public final class UpdateRunsStopSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Stop_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Stop_MaximumSet_Gen.json */ /** * Sample code: Stops an UpdateRun. - generated by [MaximumSet] rule. @@ -107,7 +113,7 @@ public final class UpdateRunsStopSamples { } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Stop.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Stop.json */ /** * Sample code: Stops an UpdateRun. @@ -129,7 +135,7 @@ public final class UpdateRunsStopSamples { */ public final class FleetUpdateStrategiesListByFleetSamples { /* - * x-ms-original-file: 2025-03-01/UpdateStrategies_ListByFleet.json + * x-ms-original-file: 2025-04-01-preview/UpdateStrategies_ListByFleet.json */ /** * Sample code: List the FleetUpdateStrategy resources by fleet. @@ -142,7 +148,7 @@ public final class FleetUpdateStrategiesListByFleetSamples { } /* - * x-ms-original-file: 2025-03-01/FleetUpdateStrategies_ListByFleet_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetUpdateStrategies_ListByFleet_MaximumSet_Gen.json */ /** * Sample code: List the FleetUpdateStrategy resources by fleet. - generated by [MaximumSet] rule. @@ -166,7 +172,7 @@ import com.azure.resourcemanager.containerservicefleet.models.FleetMember; */ public final class FleetMembersUpdateAsyncSamples { /* - * x-ms-original-file: 2025-03-01/FleetMembers_Update_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Update_MaximumSet_Gen.json */ /** * Sample code: Updates a FleetMember resource synchronously. - generated by [MaximumSet] rule. @@ -182,7 +188,7 @@ public final class FleetMembersUpdateAsyncSamples { } /* - * x-ms-original-file: 2025-03-01/FleetMembers_Update.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Update.json */ /** * Sample code: Updates a FleetMember resource synchronously. @@ -207,7 +213,7 @@ public final class FleetMembersUpdateAsyncSamples { */ public final class FleetMembersListByFleetSamples { /* - * x-ms-original-file: 2025-03-01/FleetMembers_ListByFleet_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_ListByFleet_MaximumSet_Gen.json */ /** * Sample code: Lists the members of a Fleet. - generated by [MaximumSet] rule. @@ -220,7 +226,7 @@ public final class FleetMembersListByFleetSamples { } /* - * x-ms-original-file: 2025-03-01/FleetMembers_ListByFleet.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_ListByFleet.json */ /** * Sample code: Lists the members of a Fleet. @@ -242,7 +248,7 @@ public final class FleetMembersListByFleetSamples { */ public final class FleetsGetByResourceGroupSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_Get_MaximumSet_Gen.json */ /** * Sample code: Gets a Fleet resource. - generated by [MaximumSet] rule. @@ -255,7 +261,7 @@ public final class FleetsGetByResourceGroupSamples { } /* - * x-ms-original-file: 2025-03-01/Fleets_Get.json + * x-ms-original-file: 2025-04-01-preview/Fleets_Get.json */ /** * Sample code: Gets a Fleet resource. @@ -271,13 +277,58 @@ public final class FleetsGetByResourceGroupSamples { ### FleetMembers_Delete +```java +/** + * Samples for Gates Get. + */ +public final class GatesGetSamples { + /* + * x-ms-original-file: 2025-04-01-preview/Gates_Get.json + */ + /** + * Sample code: Gets a Gate resource. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void + getsAGateResource(com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.gates() + .getWithResponse("rg1", "fleet1", "12345678-910a-bcde-f000-000000000000", com.azure.core.util.Context.NONE); + } +} +``` + +### FleetMembers_Get + +```java +/** + * Samples for Gates ListByFleet. + */ +public final class GatesListByFleetSamples { + /* + * x-ms-original-file: 2025-04-01-preview/Gates_ListByFleet.json + */ + /** + * Sample code: Lists the Gates of a Fleet. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void + listsTheGatesOfAFleet(com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.gates().listByFleet("rg1", "fleet1", com.azure.core.util.Context.NONE); + } +} +``` + +### FleetMembers_ListByFleet + ```java /** * Samples for AutoUpgradeProfiles ListByFleet. */ public final class AutoUpgradeProfilesListByFleetSamples { /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_ListByFleet.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_ListByFleet.json */ /** * Sample code: Lists the AutoUpgradeProfile resources by fleet. @@ -290,7 +341,7 @@ public final class AutoUpgradeProfilesListByFleetSamples { } /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_ListByFleet_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_ListByFleet_MaximumSet_Gen.json */ /** * Sample code: Lists the AutoUpgradeProfile resources by fleet. - generated by [MaximumSet] rule. @@ -304,7 +355,7 @@ public final class AutoUpgradeProfilesListByFleetSamples { } ``` -### FleetMembers_Get +### FleetMembers_UpdateAsync ```java /** @@ -312,7 +363,7 @@ public final class AutoUpgradeProfilesListByFleetSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-03-01/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Operations_List_MinimumSet_Gen.json */ /** * Sample code: List the operations for the provider. - generated by [MinimumSet] rule. @@ -325,7 +376,7 @@ public final class OperationsListSamples { } /* - * x-ms-original-file: 2025-03-01/Operations_List.json + * x-ms-original-file: 2025-04-01-preview/Operations_List.json */ /** * Sample code: List the operations for the provider. @@ -338,7 +389,7 @@ public final class OperationsListSamples { } /* - * x-ms-original-file: 2025-03-01/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Operations_List_MaximumSet_Gen.json */ /** * Sample code: List the operations for the provider. - generated by [MaximumSet] rule. @@ -352,7 +403,7 @@ public final class OperationsListSamples { } ``` -### FleetMembers_ListByFleet +### FleetUpdateStrategies_CreateOrUpdate ```java import com.azure.resourcemanager.containerservicefleet.models.Fleet; @@ -367,7 +418,7 @@ import java.util.Map; */ public final class FleetsUpdateAsyncSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_PatchTags.json + * x-ms-original-file: 2025-04-01-preview/Fleets_PatchTags.json */ /** * Sample code: Update a Fleet. @@ -383,7 +434,7 @@ public final class FleetsUpdateAsyncSamples { } /* - * x-ms-original-file: 2025-03-01/Fleets_Update_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_Update_MaximumSet_Gen.json */ /** * Sample code: Update a Fleet. - generated by [MaximumSet] rule. @@ -417,7 +468,7 @@ public final class FleetsUpdateAsyncSamples { } ``` -### FleetMembers_UpdateAsync +### FleetUpdateStrategies_Delete ```java /** @@ -425,7 +476,7 @@ public final class FleetsUpdateAsyncSamples { */ public final class FleetsDeleteSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_Delete.json + * x-ms-original-file: 2025-04-01-preview/Fleets_Delete.json */ /** * Sample code: Deletes a Fleet resource asynchronously with a long running operation. @@ -438,7 +489,7 @@ public final class FleetsDeleteSamples { } /* - * x-ms-original-file: 2025-03-01/Fleets_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_Delete_MaximumSet_Gen.json */ /** * Sample code: Deletes a Fleet resource asynchronously with a long running operation. - generated by [MaximumSet] @@ -454,7 +505,7 @@ public final class FleetsDeleteSamples { } ``` -### FleetUpdateStrategies_CreateOrUpdate +### FleetUpdateStrategies_Get ```java /** @@ -462,7 +513,7 @@ public final class FleetsDeleteSamples { */ public final class UpdateRunsListByFleetSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_ListByFleet.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_ListByFleet.json */ /** * Sample code: Lists the UpdateRun resources by fleet. @@ -475,7 +526,7 @@ public final class UpdateRunsListByFleetSamples { } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_ListByFleet_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_ListByFleet_MaximumSet_Gen.json */ /** * Sample code: Lists the UpdateRun resources by fleet. - generated by [MaximumSet] rule. @@ -489,7 +540,7 @@ public final class UpdateRunsListByFleetSamples { } ``` -### FleetUpdateStrategies_Delete +### FleetUpdateStrategies_ListByFleet ```java /** @@ -497,7 +548,7 @@ public final class UpdateRunsListByFleetSamples { */ public final class FleetsListCredentialsSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_ListCredentials_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_ListCredentials_MaximumSet_Gen.json */ /** * Sample code: Lists the user credentials of a Fleet. - generated by [MaximumSet] rule. @@ -510,7 +561,7 @@ public final class FleetsListCredentialsSamples { } /* - * x-ms-original-file: 2025-03-01/Fleets_ListCredentialsResult.json + * x-ms-original-file: 2025-04-01-preview/Fleets_ListCredentialsResult.json */ /** * Sample code: Lists the user credentials of a Fleet. @@ -524,7 +575,7 @@ public final class FleetsListCredentialsSamples { } ``` -### FleetUpdateStrategies_Get +### Fleets_Create ```java /** @@ -532,7 +583,7 @@ public final class FleetsListCredentialsSamples { */ public final class FleetMembersDeleteSamples { /* - * x-ms-original-file: 2025-03-01/FleetMembers_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Delete_MaximumSet_Gen.json */ /** * Sample code: Deletes a FleetMember resource asynchronously with a long running operation. - generated by @@ -546,7 +597,7 @@ public final class FleetMembersDeleteSamples { } /* - * x-ms-original-file: 2025-03-01/FleetMembers_Delete.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Delete.json */ /** * Sample code: Deletes a FleetMember resource asynchronously with a long running operation. @@ -560,7 +611,7 @@ public final class FleetMembersDeleteSamples { } ``` -### FleetUpdateStrategies_ListByFleet +### Fleets_Delete ```java /** @@ -568,7 +619,7 @@ public final class FleetMembersDeleteSamples { */ public final class UpdateRunsStartSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Start_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Start_MaximumSet_Gen.json */ /** * Sample code: Starts an UpdateRun. - generated by [MaximumSet] rule. @@ -582,7 +633,7 @@ public final class UpdateRunsStartSamples { } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Start.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Start.json */ /** * Sample code: Starts an UpdateRun. @@ -596,7 +647,7 @@ public final class UpdateRunsStartSamples { } ``` -### Fleets_Create +### Fleets_GetByResourceGroup ```java /** @@ -604,7 +655,7 @@ public final class UpdateRunsStartSamples { */ public final class FleetsListByResourceGroupSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_ListByResourceGroup.json + * x-ms-original-file: 2025-04-01-preview/Fleets_ListByResourceGroup.json */ /** * Sample code: Lists the Fleet resources in a resource group. @@ -617,7 +668,7 @@ public final class FleetsListByResourceGroupSamples { } /* - * x-ms-original-file: 2025-03-01/Fleets_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: Lists the Fleet resources in a resource group. - generated by [MaximumSet] rule. @@ -631,7 +682,36 @@ public final class FleetsListByResourceGroupSamples { } ``` -### Fleets_Delete +### Fleets_List + +```java +import com.azure.resourcemanager.containerservicefleet.models.GatePatch; +import com.azure.resourcemanager.containerservicefleet.models.GatePatchProperties; +import com.azure.resourcemanager.containerservicefleet.models.GateState; + +/** + * Samples for Gates Update. + */ +public final class GatesUpdateSamples { + /* + * x-ms-original-file: 2025-04-01-preview/Gates_Update.json + */ + /** + * Sample code: Updates a Gate resource. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void + updatesAGateResource(com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.gates() + .update("rg1", "fleet1", "12345678-910a-bcde-f000-000000000000", + new GatePatch().withProperties(new GatePatchProperties().withState(GateState.COMPLETED)), null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### Fleets_ListByResourceGroup ```java /** @@ -639,7 +719,7 @@ public final class FleetsListByResourceGroupSamples { */ public final class UpdateRunsDeleteSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Delete_MaximumSet_Gen.json */ /** * Sample code: Delete an updateRun resource. - generated by [MaximumSet] rule. @@ -653,7 +733,7 @@ public final class UpdateRunsDeleteSamples { } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Delete.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Delete.json */ /** * Sample code: Delete an updateRun resource. @@ -667,7 +747,7 @@ public final class UpdateRunsDeleteSamples { } ``` -### Fleets_GetByResourceGroup +### Fleets_ListCredentials ```java /** @@ -675,7 +755,7 @@ public final class UpdateRunsDeleteSamples { */ public final class AutoUpgradeProfilesDeleteSamples { /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_Delete_MaximumSet_Gen.json */ /** * Sample code: Delete an AutoUpgradeProfile resource. - generated by [MaximumSet] rule. @@ -685,11 +765,11 @@ public final class AutoUpgradeProfilesDeleteSamples { public static void deleteAnAutoUpgradeProfileResourceGeneratedByMaximumSetRule( com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { manager.autoUpgradeProfiles() - .delete("rgfleets", "fleet1", "autoupgradeprofile1", "qmdsmmawj", com.azure.core.util.Context.NONE); + .delete("rgfleets", "fleet1", "autoupgradeprofile1", "tmlfhgsu", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_Delete.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_Delete.json */ /** * Sample code: Delete an AutoUpgradeProfile resource. @@ -704,7 +784,7 @@ public final class AutoUpgradeProfilesDeleteSamples { } ``` -### Fleets_List +### Fleets_UpdateAsync ```java /** @@ -712,7 +792,7 @@ public final class AutoUpgradeProfilesDeleteSamples { */ public final class FleetMembersCreateSamples { /* - * x-ms-original-file: 2025-03-01/FleetMembers_Create.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Create.json */ /** * Sample code: Creates a FleetMember resource with a long running operation. @@ -730,7 +810,7 @@ public final class FleetMembersCreateSamples { } /* - * x-ms-original-file: 2025-03-01/FleetMembers_Create_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Create_MaximumSet_Gen.json */ /** * Sample code: Creates a FleetMember resource with a long running operation. - generated by [MaximumSet] rule. @@ -752,7 +832,7 @@ public final class FleetMembersCreateSamples { } ``` -### Fleets_ListByResourceGroup +### Gates_Get ```java /** @@ -760,7 +840,7 @@ public final class FleetMembersCreateSamples { */ public final class FleetUpdateStrategiesGetSamples { /* - * x-ms-original-file: 2025-03-01/FleetUpdateStrategies_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetUpdateStrategies_Get_MaximumSet_Gen.json */ /** * Sample code: Get a FleetUpdateStrategy resource. - generated by [MaximumSet] rule. @@ -774,7 +854,7 @@ public final class FleetUpdateStrategiesGetSamples { } /* - * x-ms-original-file: 2025-03-01/UpdateStrategies_Get.json + * x-ms-original-file: 2025-04-01-preview/UpdateStrategies_Get.json */ /** * Sample code: Get a FleetUpdateStrategy resource. @@ -788,7 +868,7 @@ public final class FleetUpdateStrategiesGetSamples { } ``` -### Fleets_ListCredentials +### Gates_ListByFleet ```java import com.azure.resourcemanager.containerservicefleet.models.AgentProfile; @@ -805,7 +885,7 @@ import java.util.Map; */ public final class FleetsCreateSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Creates a Fleet resource with a long running operation. - generated by [MaximumSet] rule. @@ -835,7 +915,7 @@ public final class FleetsCreateSamples { } /* - * x-ms-original-file: 2025-03-01/Fleets_CreateOrUpdate.json + * x-ms-original-file: 2025-04-01-preview/Fleets_CreateOrUpdate.json */ /** * Sample code: Creates a Fleet resource with a long running operation. @@ -868,7 +948,7 @@ public final class FleetsCreateSamples { } ``` -### Fleets_UpdateAsync +### Gates_Update ```java /** @@ -876,7 +956,7 @@ public final class FleetsCreateSamples { */ public final class FleetsListSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: Lists the Fleet resources in a subscription. - generated by [MaximumSet] rule. @@ -889,7 +969,7 @@ public final class FleetsListSamples { } /* - * x-ms-original-file: 2025-03-01/Fleets_ListBySub.json + * x-ms-original-file: 2025-04-01-preview/Fleets_ListBySub.json */ /** * Sample code: Lists the Fleet resources in a subscription. @@ -916,7 +996,7 @@ import java.util.Arrays; */ public final class UpdateRunsSkipSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Skip_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Skip_MaximumSet_Gen.json */ /** * Sample code: Skips one or more member/group/stage/afterStageWait(s) of an UpdateRun. - generated by [MaximumSet] @@ -935,7 +1015,7 @@ public final class UpdateRunsSkipSamples { } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Skip.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Skip.json */ /** * Sample code: Skips one or more member/group/stage/afterStageWait(s) of an UpdateRun. @@ -962,7 +1042,7 @@ public final class UpdateRunsSkipSamples { */ public final class FleetMembersGetSamples { /* - * x-ms-original-file: 2025-03-01/FleetMembers_Get.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Get.json */ /** * Sample code: Gets a FleetMember resource. @@ -975,7 +1055,7 @@ public final class FleetMembersGetSamples { } /* - * x-ms-original-file: 2025-03-01/FleetMembers_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Get_MaximumSet_Gen.json */ /** * Sample code: Gets a FleetMember resource. - generated by [MaximumSet] rule. @@ -994,7 +1074,6 @@ public final class FleetMembersGetSamples { ```java import com.azure.resourcemanager.containerservicefleet.models.AutoUpgradeNodeImageSelection; import com.azure.resourcemanager.containerservicefleet.models.AutoUpgradeNodeImageSelectionType; -import com.azure.resourcemanager.containerservicefleet.models.AutoUpgradeProfileStatus; import com.azure.resourcemanager.containerservicefleet.models.UpgradeChannel; /** @@ -1002,7 +1081,7 @@ import com.azure.resourcemanager.containerservicefleet.models.UpgradeChannel; */ public final class AutoUpgradeProfilesCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_CreateOrUpdate.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_CreateOrUpdate.json */ /** * Sample code: Create an AutoUpgradeProfile. @@ -1019,7 +1098,7 @@ public final class AutoUpgradeProfilesCreateOrUpdateSamples { } /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Create an AutoUpgradeProfile. - generated by [MaximumSet] rule. @@ -1037,9 +1116,8 @@ public final class AutoUpgradeProfilesCreateOrUpdateSamples { .withNodeImageSelection( new AutoUpgradeNodeImageSelection().withType(AutoUpgradeNodeImageSelectionType.LATEST)) .withDisabled(true) - .withAutoUpgradeProfileStatus(new AutoUpgradeProfileStatus()) - .withIfMatch("teikqmg") - .withIfNoneMatch("ghfmmyrekxincsxklbldnvhqd") + .withIfMatch("uktvayathbu") + .withIfNoneMatch("vdjolwxnefqamimybcvxxva") .create(); } } @@ -1053,7 +1131,7 @@ public final class AutoUpgradeProfilesCreateOrUpdateSamples { */ public final class AutoUpgradeProfilesGetSamples { /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_Get_MaximumSet_Gen.json */ /** * Sample code: Gets an AutoUpgradeProfile resource. - generated by [MaximumSet] rule. @@ -1067,7 +1145,7 @@ public final class AutoUpgradeProfilesGetSamples { } /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_Get.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_Get.json */ /** * Sample code: Gets an AutoUpgradeProfile resource. @@ -1085,6 +1163,8 @@ public final class AutoUpgradeProfilesGetSamples { ### UpdateRuns_ListByFleet ```java +import com.azure.resourcemanager.containerservicefleet.models.GateConfiguration; +import com.azure.resourcemanager.containerservicefleet.models.GateType; import com.azure.resourcemanager.containerservicefleet.models.UpdateGroup; import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; import com.azure.resourcemanager.containerservicefleet.models.UpdateStage; @@ -1095,7 +1175,7 @@ import java.util.Arrays; */ public final class FleetUpdateStrategiesCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-03-01/FleetUpdateStrategies_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetUpdateStrategies_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Create a FleetUpdateStrategy. - generated by [MaximumSet] rule. @@ -1116,7 +1196,7 @@ public final class FleetUpdateStrategiesCreateOrUpdateSamples { } /* - * x-ms-original-file: 2025-03-01/UpdateStrategies_CreateOrUpdate.json + * x-ms-original-file: 2025-04-01-preview/UpdateStrategies_CreateOrUpdate.json */ /** * Sample code: Create a FleetUpdateStrategy. @@ -1126,11 +1206,19 @@ public final class FleetUpdateStrategiesCreateOrUpdateSamples { public static void createAFleetUpdateStrategy( com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { manager.fleetUpdateStrategies() - .define("strartegy1") + .define("strategy1") .withExistingFleet("rg1", "fleet1") .withStrategy(new UpdateRunStrategy().withStages(Arrays.asList(new UpdateStage().withName("stage1") - .withGroups(Arrays.asList(new UpdateGroup().withName("group-a"))) - .withAfterStageWaitInSeconds(3600)))) + .withGroups(Arrays.asList(new UpdateGroup().withName("group-a") + .withBeforeGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate before group-a").withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate after group-a").withType(GateType.APPROVAL))))) + .withAfterStageWaitInSeconds(3600) + .withBeforeGates(Arrays + .asList(new GateConfiguration().withDisplayName("gate before stage1").withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate after stage1").withType(GateType.APPROVAL)))))) .create(); } } @@ -1144,7 +1232,7 @@ public final class FleetUpdateStrategiesCreateOrUpdateSamples { */ public final class AutoUpgradeProfileOperationsGenerateUpdateRunSamples { /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfileOperations_GenerateUpdateRun_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfileOperations_GenerateUpdateRun_MaximumSet_Gen.json */ /** * Sample code: AutoUpgradeProfileOperations_GenerateUpdateRun_MaximumSet. @@ -1167,7 +1255,7 @@ public final class AutoUpgradeProfileOperationsGenerateUpdateRunSamples { */ public final class UpdateRunsGetSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Get_MaximumSet_Gen.json */ /** * Sample code: Gets an UpdateRun resource. - generated by [MaximumSet] rule. @@ -1180,7 +1268,7 @@ public final class UpdateRunsGetSamples { } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Get.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Get.json */ /** * Sample code: Gets an UpdateRun resource. @@ -1197,6 +1285,8 @@ public final class UpdateRunsGetSamples { ### UpdateRuns_Stop ```java +import com.azure.resourcemanager.containerservicefleet.models.GateConfiguration; +import com.azure.resourcemanager.containerservicefleet.models.GateType; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpdate; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeSpec; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeType; @@ -1213,7 +1303,7 @@ import java.util.Arrays; */ public final class UpdateRunsCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Create an UpdateRun. - generated by [MaximumSet] rule. @@ -1241,7 +1331,7 @@ public final class UpdateRunsCreateOrUpdateSamples { } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_CreateOrUpdate.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_CreateOrUpdate.json */ /** * Sample code: Create an UpdateRun. @@ -1256,8 +1346,16 @@ public final class UpdateRunsCreateOrUpdateSamples { .withUpdateStrategyId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1") .withStrategy(new UpdateRunStrategy().withStages(Arrays.asList(new UpdateStage().withName("stage1") - .withGroups(Arrays.asList(new UpdateGroup().withName("group-a"))) - .withAfterStageWaitInSeconds(3600)))) + .withGroups(Arrays.asList(new UpdateGroup().withName("group-a") + .withBeforeGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate before group-a").withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate after group-a").withType(GateType.APPROVAL))))) + .withAfterStageWaitInSeconds(3600) + .withBeforeGates(Arrays + .asList(new GateConfiguration().withDisplayName("gate before stage1").withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate after stage1").withType(GateType.APPROVAL)))))) .withManagedClusterUpdate(new ManagedClusterUpdate() .withUpgrade(new ManagedClusterUpgradeSpec().withType(ManagedClusterUpgradeType.FULL) .withKubernetesVersion("1.26.1")) diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml index 6685c9c13739..500e20018145 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml @@ -45,7 +45,6 @@ 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 c03377aab7fc..8183bce6af98 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 @@ -31,6 +31,7 @@ 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.GatesImpl; import com.azure.resourcemanager.containerservicefleet.implementation.OperationsImpl; import com.azure.resourcemanager.containerservicefleet.implementation.UpdateRunsImpl; import com.azure.resourcemanager.containerservicefleet.models.AutoUpgradeProfileOperations; @@ -38,6 +39,7 @@ 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.Gates; import com.azure.resourcemanager.containerservicefleet.models.Operations; import com.azure.resourcemanager.containerservicefleet.models.UpdateRuns; import java.time.Duration; @@ -59,6 +61,8 @@ public final class ContainerServiceFleetManager { private FleetMembers fleetMembers; + private Gates gates; + private UpdateRuns updateRuns; private FleetUpdateStrategies fleetUpdateStrategies; @@ -319,6 +323,18 @@ public FleetMembers fleetMembers() { return fleetMembers; } + /** + * Gets the resource collection API of Gates. + * + * @return Resource collection API of Gates. + */ + public Gates gates() { + if (this.gates == null) { + this.gates = new GatesImpl(clientObject.getGates(), this); + } + return gates; + } + /** * Gets the resource collection API of UpdateRuns. It manages UpdateRun. * 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 50f7a523f52b..60b4a9256b76 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 @@ -67,6 +67,13 @@ public interface ContainerServiceFleetManagementClient { */ FleetMembersClient getFleetMembers(); + /** + * Gets the GatesClient object to access its operations. + * + * @return the GatesClient object. + */ + GatesClient getGates(); + /** * Gets the UpdateRunsClient object to access its operations. * diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/GatesClient.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/GatesClient.java new file mode 100644 index 000000000000..404919700934 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/GatesClient.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.GateInner; +import com.azure.resourcemanager.containerservicefleet.models.GatePatch; + +/** + * An instance of this class provides access to all the operations defined in GatesClient. + */ +public interface GatesClient { + /** + * Get a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @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 Gate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String fleetName, String gateName, Context context); + + /** + * Get a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @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 Gate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GateInner get(String resourceGroupName, String fleetName, String gateName); + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @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 Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GateInner> beginUpdate(String resourceGroupName, String fleetName, + String gateName, GatePatch properties); + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 a Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GateInner> beginUpdate(String resourceGroupName, String fleetName, + String gateName, GatePatch properties, String ifMatch, String ifNoneMatch, Context context); + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GateInner update(String resourceGroupName, String fleetName, String gateName, GatePatch properties); + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 a Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GateInner update(String resourceGroupName, String fleetName, String gateName, GatePatch properties, String ifMatch, + String ifNoneMatch, Context context); + + /** + * List Gate 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 Gate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFleet(String resourceGroupName, String fleetName); + + /** + * List Gate 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 Gate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFleet(String resourceGroupName, String fleetName, Context context); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberInner.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberInner.java index 3bc78ca77e60..660f86770ad9 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberInner.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberInner.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.containerservicefleet.models.FleetMemberProvisioningState; import com.azure.resourcemanager.containerservicefleet.models.FleetMemberStatus; import java.io.IOException; +import java.util.Map; /** * A member of the Fleet. It contains a reference to an existing Kubernetes cluster on Azure. @@ -177,6 +178,29 @@ public FleetMemberProvisioningState provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } + /** + * Get the labels property: The labels for the fleet member. + * + * @return the labels value. + */ + public Map labels() { + return this.innerProperties() == null ? null : this.innerProperties().labels(); + } + + /** + * Set the labels property: The labels for the fleet member. + * + * @param labels the labels value to set. + * @return the FleetMemberInner object itself. + */ + public FleetMemberInner withLabels(Map labels) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetMemberProperties(); + } + this.innerProperties().withLabels(labels); + return this; + } + /** * Get the status property: Status information of the last operation for fleet member. * diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberProperties.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberProperties.java index 5b2e0a0a656f..827b910b17db 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberProperties.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberProperties.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.containerservicefleet.models.FleetMemberProvisioningState; import com.azure.resourcemanager.containerservicefleet.models.FleetMemberStatus; import java.io.IOException; +import java.util.Map; /** * A member of the Fleet. It contains a reference to an existing Kubernetes cluster on Azure. @@ -36,6 +37,11 @@ public final class FleetMemberProperties implements JsonSerializable labels; + /* * Status information of the last operation for fleet member. */ @@ -100,6 +106,26 @@ public FleetMemberProvisioningState provisioningState() { return this.provisioningState; } + /** + * Get the labels property: The labels for the fleet member. + * + * @return the labels value. + */ + public Map labels() { + return this.labels; + } + + /** + * Set the labels property: The labels for the fleet member. + * + * @param labels the labels value to set. + * @return the FleetMemberProperties object itself. + */ + public FleetMemberProperties withLabels(Map labels) { + this.labels = labels; + return this; + } + /** * Get the status property: Status information of the last operation for fleet member. * @@ -135,6 +161,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("clusterResourceId", this.clusterResourceId); jsonWriter.writeStringField("group", this.group); + jsonWriter.writeMapField("labels", this.labels, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -161,6 +188,9 @@ public static FleetMemberProperties fromJson(JsonReader jsonReader) throws IOExc } else if ("provisioningState".equals(fieldName)) { deserializedFleetMemberProperties.provisioningState = FleetMemberProvisioningState.fromString(reader.getString()); + } else if ("labels".equals(fieldName)) { + Map labels = reader.readMap(reader1 -> reader1.getString()); + deserializedFleetMemberProperties.labels = labels; } else if ("status".equals(fieldName)) { deserializedFleetMemberProperties.status = FleetMemberStatus.fromJson(reader); } else { diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberUpdateProperties.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberUpdateProperties.java index 7b8b59253369..0d4e7398d09a 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberUpdateProperties.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/FleetMemberUpdateProperties.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * The updatable properties of the FleetMember. @@ -21,6 +22,11 @@ public final class FleetMemberUpdateProperties implements JsonSerializable labels; + /** * Creates an instance of FleetMemberUpdateProperties class. */ @@ -47,6 +53,26 @@ public FleetMemberUpdateProperties withGroup(String group) { return this; } + /** + * Get the labels property: The labels for the fleet member. + * + * @return the labels value. + */ + public Map labels() { + return this.labels; + } + + /** + * Set the labels property: The labels for the fleet member. + * + * @param labels the labels value to set. + * @return the FleetMemberUpdateProperties object itself. + */ + public FleetMemberUpdateProperties withLabels(Map labels) { + this.labels = labels; + return this; + } + /** * Validates the instance. * @@ -62,6 +88,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("group", this.group); + jsonWriter.writeMapField("labels", this.labels, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -82,6 +109,9 @@ public static FleetMemberUpdateProperties fromJson(JsonReader jsonReader) throws if ("group".equals(fieldName)) { deserializedFleetMemberUpdateProperties.group = reader.getString(); + } else if ("labels".equals(fieldName)) { + Map labels = reader.readMap(reader1 -> reader1.getString()); + deserializedFleetMemberUpdateProperties.labels = labels; } else { reader.skipChildren(); } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/GateInner.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/GateInner.java new file mode 100644 index 000000000000..686beaebbfd2 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/GateInner.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservicefleet.models.GateProvisioningState; +import com.azure.resourcemanager.containerservicefleet.models.GateState; +import com.azure.resourcemanager.containerservicefleet.models.GateTarget; +import com.azure.resourcemanager.containerservicefleet.models.GateType; +import java.io.IOException; +import java.util.Map; + +/** + * A Gate controls the progression during a staged rollout, e.g. in an Update Run. + */ +@Immutable +public final class GateInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private GateProperties 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. + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GateInner class. + */ + private GateInner() { + } + + /** + * Get the innerProperties property: The resource-specific properties for this resource. + * + * @return the innerProperties value. + */ + private GateProperties 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: The provisioning state of the Gate resource. + * + * @return the provisioningState value. + */ + public GateProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the displayName property: The human-readable display name of the Gate. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the gateType property: The type of the Gate determines how it is completed. + * + * @return the gateType value. + */ + public GateType gateType() { + return this.innerProperties() == null ? null : this.innerProperties().gateType(); + } + + /** + * Get the target property: The target that the Gate is controlling, e.g. an Update Run. + * + * @return the target value. + */ + public GateTarget target() { + return this.innerProperties() == null ? null : this.innerProperties().target(); + } + + /** + * Get the state property: The state of the Gate. + * + * @return the state value. + */ + public GateState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GateInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GateInner. + */ + public static GateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GateInner deserializedGateInner = new GateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGateInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGateInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGateInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedGateInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGateInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedGateInner.innerProperties = GateProperties.fromJson(reader); + } else if ("eTag".equals(fieldName)) { + deserializedGateInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedGateInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGateInner; + }); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/GateProperties.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/GateProperties.java new file mode 100644 index 000000000000..bf9f63922969 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/fluent/models/GateProperties.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservicefleet.models.GateProvisioningState; +import com.azure.resourcemanager.containerservicefleet.models.GateState; +import com.azure.resourcemanager.containerservicefleet.models.GateTarget; +import com.azure.resourcemanager.containerservicefleet.models.GateType; +import java.io.IOException; + +/** + * A Gate controls the progression during a staged rollout, e.g. in an Update Run. + */ +@Immutable +public final class GateProperties implements JsonSerializable { + /* + * The provisioning state of the Gate resource. + */ + private GateProvisioningState provisioningState; + + /* + * The human-readable display name of the Gate. + */ + private String displayName; + + /* + * The type of the Gate determines how it is completed. + */ + private GateType gateType; + + /* + * The target that the Gate is controlling, e.g. an Update Run. + */ + private GateTarget target; + + /* + * The state of the Gate. + */ + private GateState state; + + /** + * Creates an instance of GateProperties class. + */ + private GateProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the Gate resource. + * + * @return the provisioningState value. + */ + public GateProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the displayName property: The human-readable display name of the Gate. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the gateType property: The type of the Gate determines how it is completed. + * + * @return the gateType value. + */ + public GateType gateType() { + return this.gateType; + } + + /** + * Get the target property: The target that the Gate is controlling, e.g. an Update Run. + * + * @return the target value. + */ + public GateTarget target() { + return this.target; + } + + /** + * Get the state property: The state of the Gate. + * + * @return the state value. + */ + public GateState state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gateType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property gateType in model GateProperties")); + } + if (target() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property target in model GateProperties")); + } else { + target().validate(); + } + if (state() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property state in model GateProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GateProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("gateType", this.gateType == null ? null : this.gateType.toString()); + jsonWriter.writeJsonField("target", this.target); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GateProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GateProperties. + */ + public static GateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GateProperties deserializedGateProperties = new GateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("gateType".equals(fieldName)) { + deserializedGateProperties.gateType = GateType.fromString(reader.getString()); + } else if ("target".equals(fieldName)) { + deserializedGateProperties.target = GateTarget.fromJson(reader); + } else if ("state".equals(fieldName)) { + deserializedGateProperties.state = GateState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedGateProperties.provisioningState = GateProvisioningState.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedGateProperties.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGateProperties; + }); + } +} 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 b07f18f1e646..8780a37a5b32 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 @@ -32,6 +32,7 @@ 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.GatesClient; import com.azure.resourcemanager.containerservicefleet.fluent.OperationsClient; import com.azure.resourcemanager.containerservicefleet.fluent.UpdateRunsClient; import java.io.IOException; @@ -174,6 +175,20 @@ public FleetMembersClient getFleetMembers() { return this.fleetMembers; } + /** + * The GatesClient object to access its operations. + */ + private final GatesClient gates; + + /** + * Gets the GatesClient object to access its operations. + * + * @return the GatesClient object. + */ + public GatesClient getGates() { + return this.gates; + } + /** * The UpdateRunsClient object to access its operations. */ @@ -247,10 +262,11 @@ public AutoUpgradeProfileOperationsClient getAutoUpgradeProfileOperations() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2025-03-01"; + this.apiVersion = "2025-04-01-preview"; this.operations = new OperationsClientImpl(this); this.fleets = new FleetsClientImpl(this); this.fleetMembers = new FleetMembersClientImpl(this); + this.gates = new GatesClientImpl(this); this.updateRuns = new UpdateRunsClientImpl(this); this.fleetUpdateStrategies = new FleetUpdateStrategiesClientImpl(this); this.autoUpgradeProfiles = new AutoUpgradeProfilesClientImpl(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 ddaf6cfbfa56..8d0836917df7 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 @@ -11,6 +11,8 @@ import com.azure.resourcemanager.containerservicefleet.models.FleetMemberProvisioningState; import com.azure.resourcemanager.containerservicefleet.models.FleetMemberStatus; import com.azure.resourcemanager.containerservicefleet.models.FleetMemberUpdate; +import java.util.Collections; +import java.util.Map; public final class FleetMemberImpl implements FleetMember, FleetMember.Definition, FleetMember.Update { private FleetMemberInner innerObject; @@ -49,6 +51,15 @@ public FleetMemberProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public Map labels() { + Map inner = this.innerModel().labels(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public FleetMemberStatus status() { return this.innerModel().status(); } @@ -170,6 +181,16 @@ public FleetMemberImpl withGroup(String group) { } } + public FleetMemberImpl withLabels(Map labels) { + if (isInCreateMode()) { + this.innerModel().withLabels(labels); + return this; + } else { + this.updateProperties.withLabels(labels); + return this; + } + } + public FleetMemberImpl withIfMatch(String ifMatch) { if (isInCreateMode()) { this.createIfMatch = ifMatch; diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/GateImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/GateImpl.java new file mode 100644 index 000000000000..a0787739af32 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/GateImpl.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservicefleet.fluent.models.GateInner; +import com.azure.resourcemanager.containerservicefleet.models.Gate; +import com.azure.resourcemanager.containerservicefleet.models.GateProvisioningState; +import com.azure.resourcemanager.containerservicefleet.models.GateState; +import com.azure.resourcemanager.containerservicefleet.models.GateTarget; +import com.azure.resourcemanager.containerservicefleet.models.GateType; +import java.util.Collections; +import java.util.Map; + +public final class GateImpl implements Gate { + private GateInner innerObject; + + private final com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager serviceManager; + + GateImpl(GateInner innerObject, + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public GateProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public GateType gateType() { + return this.innerModel().gateType(); + } + + public GateTarget target() { + return this.innerModel().target(); + } + + public GateState state() { + return this.innerModel().state(); + } + + public GateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/GatesClientImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/GatesClientImpl.java new file mode 100644 index 000000000000..a9a90f38c05e --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/GatesClientImpl.java @@ -0,0 +1,855 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerservicefleet.fluent.GatesClient; +import com.azure.resourcemanager.containerservicefleet.fluent.models.GateInner; +import com.azure.resourcemanager.containerservicefleet.implementation.models.GateListResult; +import com.azure.resourcemanager.containerservicefleet.models.GatePatch; +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 GatesClient. + */ +public final class GatesClientImpl implements GatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final GatesService service; + + /** + * The service client containing this operation class. + */ + private final ContainerServiceFleetManagementClientImpl client; + + /** + * Initializes an instance of GatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GatesClientImpl(ContainerServiceFleetManagementClientImpl client) { + this.service = RestProxy.create(GatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceFleetManagementClientGates to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "ContainerServiceFlee") + public interface GatesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/gates/{gateName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @PathParam("gateName") String gateName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/gates/{gateName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @PathParam("gateName") String gateName, @HeaderParam("Accept") String accept, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/gates/{gateName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, @PathParam("fleetName") String fleetName, + @PathParam("gateName") String gateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GatePatch properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/gates/{gateName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, @PathParam("fleetName") String fleetName, + @PathParam("gateName") String gateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GatePatch properties, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/gates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFleet(@HostParam("endpoint") 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}/gates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByFleetSync(@HostParam("endpoint") 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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFleetNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByFleetNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Gate along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String fleetName, + String gateName) { + 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 (gateName == null) { + return Mono.error(new IllegalArgumentException("Parameter gateName 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, gateName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Gate on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String fleetName, String gateName) { + return getWithResponseAsync(resourceGroupName, fleetName, gateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @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 Gate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String fleetName, String gateName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (gateName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter gateName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, gateName, accept, context); + } + + /** + * Get a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Gate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GateInner get(String resourceGroupName, String fleetName, String gateName) { + return getWithResponse(resourceGroupName, fleetName, gateName, Context.NONE).getValue(); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 a Gate controls the progression during a staged rollout, e.g along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String fleetName, + String gateName, GatePatch properties, 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 (gateName == null) { + return Mono.error(new IllegalArgumentException("Parameter gateName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, fleetName, gateName, + contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 a Gate controls the progression during a staged rollout, e.g along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String fleetName, String gateName, + GatePatch properties, String ifMatch, String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (gateName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter gateName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, fleetName, gateName, contentType, + accept, properties, Context.NONE); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 a Gate controls the progression during a staged rollout, e.g along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String fleetName, String gateName, + GatePatch properties, String ifMatch, String ifNoneMatch, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (gateName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter gateName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, ifMatch, ifNoneMatch, fleetName, gateName, contentType, + accept, properties, context); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 a Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GateInner> beginUpdateAsync(String resourceGroupName, String fleetName, + String gateName, GatePatch properties, String ifMatch, String ifNoneMatch) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, fleetName, gateName, properties, ifMatch, ifNoneMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), GateInner.class, + GateInner.class, this.client.getContext()); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @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 Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GateInner> beginUpdateAsync(String resourceGroupName, String fleetName, + String gateName, GatePatch properties) { + final String ifMatch = null; + final String ifNoneMatch = null; + Mono>> mono + = updateWithResponseAsync(resourceGroupName, fleetName, gateName, properties, ifMatch, ifNoneMatch); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), GateInner.class, + GateInner.class, this.client.getContext()); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 SyncPoller} for polling of a Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GateInner> beginUpdate(String resourceGroupName, String fleetName, + String gateName, GatePatch properties, String ifMatch, String ifNoneMatch) { + Response response + = updateWithResponse(resourceGroupName, fleetName, gateName, properties, ifMatch, ifNoneMatch); + return this.client.getLroResult(response, GateInner.class, GateInner.class, Context.NONE); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @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 Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GateInner> beginUpdate(String resourceGroupName, String fleetName, + String gateName, GatePatch properties) { + final String ifMatch = null; + final String ifNoneMatch = null; + Response response + = updateWithResponse(resourceGroupName, fleetName, gateName, properties, ifMatch, ifNoneMatch); + return this.client.getLroResult(response, GateInner.class, GateInner.class, Context.NONE); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 a Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GateInner> beginUpdate(String resourceGroupName, String fleetName, + String gateName, GatePatch properties, String ifMatch, String ifNoneMatch, Context context) { + Response response + = updateWithResponse(resourceGroupName, fleetName, gateName, properties, ifMatch, ifNoneMatch, context); + return this.client.getLroResult(response, GateInner.class, GateInner.class, context); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 a Gate controls the progression during a staged rollout, e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String fleetName, String gateName, + GatePatch properties, String ifMatch, String ifNoneMatch) { + return beginUpdateAsync(resourceGroupName, fleetName, gateName, properties, ifMatch, ifNoneMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Gate controls the progression during a staged rollout, e.g on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String fleetName, String gateName, + GatePatch properties) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginUpdateAsync(resourceGroupName, fleetName, gateName, properties, ifMatch, ifNoneMatch).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GateInner update(String resourceGroupName, String fleetName, String gateName, GatePatch properties) { + final String ifMatch = null; + final String ifNoneMatch = null; + return beginUpdate(resourceGroupName, fleetName, gateName, properties, ifMatch, ifNoneMatch).getFinalResult(); + } + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 a Gate controls the progression during a staged rollout, e.g. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GateInner update(String resourceGroupName, String fleetName, String gateName, GatePatch properties, + String ifMatch, String ifNoneMatch, Context context) { + return beginUpdate(resourceGroupName, fleetName, gateName, properties, ifMatch, ifNoneMatch, context) + .getFinalResult(); + } + + /** + * List Gate 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 Gate 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 Gate 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 Gate 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 Gate 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 Gate list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFleetSinglePage(String resourceGroupName, String fleetName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByFleetSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Gate 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 Gate list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFleetSinglePage(String resourceGroupName, String fleetName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (fleetName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByFleetSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Gate 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 Gate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFleet(String resourceGroupName, String fleetName) { + return new PagedIterable<>(() -> listByFleetSinglePage(resourceGroupName, fleetName), + nextLink -> listByFleetNextSinglePage(nextLink)); + } + + /** + * List Gate 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 Gate list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFleet(String resourceGroupName, String fleetName, Context context) { + return new PagedIterable<>(() -> listByFleetSinglePage(resourceGroupName, fleetName, context), + nextLink -> listByFleetNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Gate 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Gate list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFleetNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByFleetNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Gate list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFleetNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByFleetNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(GatesClientImpl.class); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/GatesImpl.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/GatesImpl.java new file mode 100644 index 000000000000..3cdfd83388e0 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/GatesImpl.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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.GatesClient; +import com.azure.resourcemanager.containerservicefleet.fluent.models.GateInner; +import com.azure.resourcemanager.containerservicefleet.models.Gate; +import com.azure.resourcemanager.containerservicefleet.models.GatePatch; +import com.azure.resourcemanager.containerservicefleet.models.Gates; + +public final class GatesImpl implements Gates { + private static final ClientLogger LOGGER = new ClientLogger(GatesImpl.class); + + private final GatesClient innerClient; + + private final com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager serviceManager; + + public GatesImpl(GatesClient innerClient, + com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String fleetName, String gateName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, fleetName, gateName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Gate get(String resourceGroupName, String fleetName, String gateName) { + GateInner inner = this.serviceClient().get(resourceGroupName, fleetName, gateName); + if (inner != null) { + return new GateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Gate update(String resourceGroupName, String fleetName, String gateName, GatePatch properties) { + GateInner inner = this.serviceClient().update(resourceGroupName, fleetName, gateName, properties); + if (inner != null) { + return new GateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Gate update(String resourceGroupName, String fleetName, String gateName, GatePatch properties, + String ifMatch, String ifNoneMatch, Context context) { + GateInner inner = this.serviceClient() + .update(resourceGroupName, fleetName, gateName, properties, ifMatch, ifNoneMatch, context); + if (inner != null) { + return new GateImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByFleet(String resourceGroupName, String fleetName) { + PagedIterable inner = this.serviceClient().listByFleet(resourceGroupName, fleetName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GateImpl(inner1, this.manager())); + } + + public PagedIterable listByFleet(String resourceGroupName, String fleetName, Context context) { + PagedIterable inner = this.serviceClient().listByFleet(resourceGroupName, fleetName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GateImpl(inner1, this.manager())); + } + + private GatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/models/GateListResult.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/models/GateListResult.java new file mode 100644 index 000000000000..c45ef7bf9951 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/implementation/models/GateListResult.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.containerservicefleet.fluent.models.GateInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Gate list operation. + */ +@Immutable +public final class GateListResult implements JsonSerializable { + /* + * The Gate items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of GateListResult class. + */ + private GateListResult() { + } + + /** + * Get the value property: The Gate items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model GateListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GateListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GateListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GateListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GateListResult. + */ + public static GateListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GateListResult deserializedGateListResult = new GateListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> GateInner.fromJson(reader1)); + deserializedGateListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGateListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGateListResult; + }); + } +} 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 3c8d4e0a67f7..d024b1e3a7f9 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 @@ -7,6 +7,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetMemberInner; +import java.util.Map; /** * An immutable client-side representation of FleetMember. @@ -73,6 +74,13 @@ public interface FleetMember { */ FleetMemberProvisioningState provisioningState(); + /** + * Gets the labels property: The labels for the fleet member. + * + * @return the labels value. + */ + Map labels(); + /** * Gets the status property: Status information of the last operation for fleet member. * @@ -130,7 +138,7 @@ interface WithParentResource { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithClusterResourceId, DefinitionStages.WithGroup, - DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch { + DefinitionStages.WithLabels, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch { /** * Executes the create request. * @@ -177,6 +185,19 @@ interface WithGroup { WithCreate withGroup(String group); } + /** + * The stage of the FleetMember definition allowing to specify labels. + */ + interface WithLabels { + /** + * Specifies the labels property: The labels for the fleet member.. + * + * @param labels The labels for the fleet member. + * @return the next definition stage. + */ + WithCreate withLabels(Map labels); + } + /** * The stage of the FleetMember definition allowing to specify ifMatch. */ @@ -214,7 +235,7 @@ interface WithIfNoneMatch { /** * The template for FleetMember update. */ - interface Update extends UpdateStages.WithGroup, UpdateStages.WithIfMatch { + interface Update extends UpdateStages.WithGroup, UpdateStages.WithLabels, UpdateStages.WithIfMatch { /** * Executes the update request. * @@ -248,6 +269,19 @@ interface WithGroup { Update withGroup(String group); } + /** + * The stage of the FleetMember update allowing to specify labels. + */ + interface WithLabels { + /** + * Specifies the labels property: The labels for the fleet member.. + * + * @param labels The labels for the fleet member. + * @return the next definition stage. + */ + Update withLabels(Map labels); + } + /** * The stage of the FleetMember update allowing to specify ifMatch. */ diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetMemberUpdate.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetMemberUpdate.java index 52e380b23988..5fbe81072d5b 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetMemberUpdate.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/FleetMemberUpdate.java @@ -11,6 +11,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetMemberUpdateProperties; import java.io.IOException; +import java.util.Map; /** * The type used for update operations of the FleetMember. @@ -60,6 +61,29 @@ public FleetMemberUpdate withGroup(String group) { return this; } + /** + * Get the labels property: The labels for the fleet member. + * + * @return the labels value. + */ + public Map labels() { + return this.innerProperties() == null ? null : this.innerProperties().labels(); + } + + /** + * Set the labels property: The labels for the fleet member. + * + * @param labels the labels value to set. + * @return the FleetMemberUpdate object itself. + */ + public FleetMemberUpdate withLabels(Map labels) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetMemberUpdateProperties(); + } + this.innerProperties().withLabels(labels); + return this; + } + /** * Validates the instance. * diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Gate.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Gate.java new file mode 100644 index 000000000000..f0f92f490d58 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Gate.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservicefleet.fluent.models.GateInner; +import java.util.Map; + +/** + * An immutable client-side representation of Gate. + */ +public interface Gate { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the Gate resource. + * + * @return the provisioningState value. + */ + GateProvisioningState provisioningState(); + + /** + * Gets the displayName property: The human-readable display name of the Gate. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the gateType property: The type of the Gate determines how it is completed. + * + * @return the gateType value. + */ + GateType gateType(); + + /** + * Gets the target property: The target that the Gate is controlling, e.g. an Update Run. + * + * @return the target value. + */ + GateTarget target(); + + /** + * Gets the state property: The state of the Gate. + * + * @return the state value. + */ + GateState state(); + + /** + * Gets the inner com.azure.resourcemanager.containerservicefleet.fluent.models.GateInner object. + * + * @return the inner object. + */ + GateInner innerModel(); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateConfiguration.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateConfiguration.java new file mode 100644 index 000000000000..2c0c8696b031 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateConfiguration.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * GateConfiguration is used to define where Gates should be placed within the Update Run. + */ +@Fluent +public final class GateConfiguration implements JsonSerializable { + /* + * The human-readable display name of the Gate. + */ + private String displayName; + + /* + * The type of the Gate determines how it is completed. + */ + private GateType type; + + /** + * Creates an instance of GateConfiguration class. + */ + public GateConfiguration() { + } + + /** + * Get the displayName property: The human-readable display name of the Gate. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The human-readable display name of the Gate. + * + * @param displayName the displayName value to set. + * @return the GateConfiguration object itself. + */ + public GateConfiguration withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the type property: The type of the Gate determines how it is completed. + * + * @return the type value. + */ + public GateType type() { + return this.type; + } + + /** + * Set the type property: The type of the Gate determines how it is completed. + * + * @param type the type value to set. + * @return the GateConfiguration object itself. + */ + public GateConfiguration withType(GateType 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.atError() + .log(new IllegalArgumentException("Missing required property type in model GateConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GateConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GateConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GateConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GateConfiguration. + */ + public static GateConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GateConfiguration deserializedGateConfiguration = new GateConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedGateConfiguration.type = GateType.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedGateConfiguration.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGateConfiguration; + }); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GatePatch.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GatePatch.java new file mode 100644 index 000000000000..569f6c8f6b61 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GatePatch.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Patch a Gate resource. + */ +@Fluent +public final class GatePatch implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * Properties of a Gate that can be patched. + */ + private GatePatchProperties properties; + + /** + * Creates an instance of GatePatch class. + */ + public GatePatch() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the GatePatch object itself. + */ + public GatePatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: Properties of a Gate that can be patched. + * + * @return the properties value. + */ + public GatePatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of a Gate that can be patched. + * + * @param properties the properties value to set. + * @return the GatePatch object itself. + */ + public GatePatch withProperties(GatePatchProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model GatePatch")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GatePatch.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GatePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GatePatch if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GatePatch. + */ + public static GatePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GatePatch deserializedGatePatch = new GatePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedGatePatch.properties = GatePatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGatePatch.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedGatePatch; + }); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GatePatchProperties.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GatePatchProperties.java new file mode 100644 index 000000000000..1a391e08382a --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GatePatchProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of a Gate that can be patched. + */ +@Fluent +public final class GatePatchProperties implements JsonSerializable { + /* + * The state of the Gate. + */ + private GateState state; + + /** + * Creates an instance of GatePatchProperties class. + */ + public GatePatchProperties() { + } + + /** + * Get the state property: The state of the Gate. + * + * @return the state value. + */ + public GateState state() { + return this.state; + } + + /** + * Set the state property: The state of the Gate. + * + * @param state the state value to set. + * @return the GatePatchProperties object itself. + */ + public GatePatchProperties withState(GateState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (state() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property state in model GatePatchProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GatePatchProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GatePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GatePatchProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GatePatchProperties. + */ + public static GatePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GatePatchProperties deserializedGatePatchProperties = new GatePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedGatePatchProperties.state = GateState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGatePatchProperties; + }); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateProvisioningState.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateProvisioningState.java new file mode 100644 index 000000000000..09df08767acd --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the Gate resource. + */ +public final class GateProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final GateProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final GateProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final GateProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of GateProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GateProvisioningState() { + } + + /** + * Creates or finds a GateProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GateProvisioningState. + */ + public static GateProvisioningState fromString(String name) { + return fromString(name, GateProvisioningState.class); + } + + /** + * Gets known GateProvisioningState values. + * + * @return known GateProvisioningState values. + */ + public static Collection values() { + return values(GateProvisioningState.class); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateState.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateState.java new file mode 100644 index 000000000000..4508fc9901da --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of the Gate. + */ +public final class GateState extends ExpandableStringEnum { + /** + * A Pending Gate will continue to block the staged rollout process it is controlling. + */ + public static final GateState PENDING = fromString("Pending"); + + /** + * A Skipped Gate means that the staged rollout process it is controlling was skipped. + */ + public static final GateState SKIPPED = fromString("Skipped"); + + /** + * An Completed Gate allows the staged rollout process to continue. + */ + public static final GateState COMPLETED = fromString("Completed"); + + /** + * Creates a new instance of GateState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GateState() { + } + + /** + * Creates or finds a GateState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GateState. + */ + public static GateState fromString(String name) { + return fromString(name, GateState.class); + } + + /** + * Gets known GateState values. + * + * @return known GateState values. + */ + public static Collection values() { + return values(GateState.class); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateTarget.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateTarget.java new file mode 100644 index 000000000000..20260ac10fca --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateTarget.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The target that the Gate is controlling, e.g. an Update Run. Exactly one of the properties objects will be set. + */ +@Immutable +public final class GateTarget implements JsonSerializable { + /* + * The resource id that the Gate is controlling the rollout of. + */ + private BinaryData id; + + /* + * The properties of the Update Run that the Gate is targeting. + */ + private UpdateRunGateTargetProperties updateRunProperties; + + /** + * Creates an instance of GateTarget class. + */ + private GateTarget() { + } + + /** + * Get the id property: The resource id that the Gate is controlling the rollout of. + * + * @return the id value. + */ + public BinaryData id() { + return this.id; + } + + /** + * Get the updateRunProperties property: The properties of the Update Run that the Gate is targeting. + * + * @return the updateRunProperties value. + */ + public UpdateRunGateTargetProperties updateRunProperties() { + return this.updateRunProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model GateTarget")); + } + if (updateRunProperties() != null) { + updateRunProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GateTarget.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeFieldName("id"); + this.id.writeTo(jsonWriter); + jsonWriter.writeJsonField("updateRunProperties", this.updateRunProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GateTarget from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GateTarget if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GateTarget. + */ + public static GateTarget fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GateTarget deserializedGateTarget = new GateTarget(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGateTarget.id + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("updateRunProperties".equals(fieldName)) { + deserializedGateTarget.updateRunProperties = UpdateRunGateTargetProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGateTarget; + }); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateType.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateType.java new file mode 100644 index 000000000000..1d37fa8bc8c2 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/GateType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the Gate determines how it is completed. + */ +public final class GateType extends ExpandableStringEnum { + /** + * An approval gate is completed by setting its state to be Completed. + */ + public static final GateType APPROVAL = fromString("Approval"); + + /** + * Creates a new instance of GateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GateType() { + } + + /** + * Creates or finds a GateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GateType. + */ + public static GateType fromString(String name) { + return fromString(name, GateType.class); + } + + /** + * Gets known GateType values. + * + * @return known GateType values. + */ + public static Collection values() { + return values(GateType.class); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Gates.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Gates.java new file mode 100644 index 000000000000..df4e3102cd22 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Gates.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.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 Gates. + */ +public interface Gates { + /** + * Get a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @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 Gate along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String fleetName, String gateName, Context context); + + /** + * Get a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @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 Gate. + */ + Gate get(String resourceGroupName, String fleetName, String gateName); + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Gate controls the progression during a staged rollout, e.g. + */ + Gate update(String resourceGroupName, String fleetName, String gateName, GatePatch properties); + + /** + * Update a Gate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param gateName The name of the Gate resource, a GUID. + * @param properties The resource properties to be updated. + * @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 a Gate controls the progression during a staged rollout, e.g. + */ + Gate update(String resourceGroupName, String fleetName, String gateName, GatePatch properties, String ifMatch, + String ifNoneMatch, Context context); + + /** + * List Gate 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 Gate list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFleet(String resourceGroupName, String fleetName); + + /** + * List Gate 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 Gate list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFleet(String resourceGroupName, String fleetName, Context context); +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Timing.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Timing.java new file mode 100644 index 000000000000..553bdd3030ad --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/Timing.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether the Gate is placed before or after the target. + */ +public final class Timing extends ExpandableStringEnum { + /** + * The Gate is before the target. + */ + public static final Timing BEFORE = fromString("Before"); + + /** + * The Gate is after the target. + */ + public static final Timing AFTER = fromString("After"); + + /** + * Creates a new instance of Timing value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Timing() { + } + + /** + * Creates or finds a Timing from its string representation. + * + * @param name a name to look for. + * @return the corresponding Timing. + */ + public static Timing fromString(String name) { + return fromString(name, Timing.class); + } + + /** + * Gets known Timing values. + * + * @return known Timing values. + */ + public static Collection values() { + return values(Timing.class); + } +} 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 b98b8db11c63..f96a398e3c1c 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 @@ -11,6 +11,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * A group to be updated. @@ -23,6 +24,16 @@ public final class UpdateGroup implements JsonSerializable { */ private String name; + /* + * A list of Gates that will be created before this Group is executed. + */ + private List beforeGates; + + /* + * A list of Gates that will be created after this Group is executed. + */ + private List afterGates; + /** * Creates an instance of UpdateGroup class. */ @@ -51,6 +62,46 @@ public UpdateGroup withName(String name) { return this; } + /** + * Get the beforeGates property: A list of Gates that will be created before this Group is executed. + * + * @return the beforeGates value. + */ + public List beforeGates() { + return this.beforeGates; + } + + /** + * Set the beforeGates property: A list of Gates that will be created before this Group is executed. + * + * @param beforeGates the beforeGates value to set. + * @return the UpdateGroup object itself. + */ + public UpdateGroup withBeforeGates(List beforeGates) { + this.beforeGates = beforeGates; + return this; + } + + /** + * Get the afterGates property: A list of Gates that will be created after this Group is executed. + * + * @return the afterGates value. + */ + public List afterGates() { + return this.afterGates; + } + + /** + * Set the afterGates property: A list of Gates that will be created after this Group is executed. + * + * @param afterGates the afterGates value to set. + * @return the UpdateGroup object itself. + */ + public UpdateGroup withAfterGates(List afterGates) { + this.afterGates = afterGates; + return this; + } + /** * Validates the instance. * @@ -61,6 +112,12 @@ public void validate() { throw LOGGER.atError() .log(new IllegalArgumentException("Missing required property name in model UpdateGroup")); } + if (beforeGates() != null) { + beforeGates().forEach(e -> e.validate()); + } + if (afterGates() != null) { + afterGates().forEach(e -> e.validate()); + } } private static final ClientLogger LOGGER = new ClientLogger(UpdateGroup.class); @@ -72,6 +129,8 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("beforeGates", this.beforeGates, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("afterGates", this.afterGates, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -93,6 +152,14 @@ public static UpdateGroup fromJson(JsonReader jsonReader) throws IOException { if ("name".equals(fieldName)) { deserializedUpdateGroup.name = reader.getString(); + } else if ("beforeGates".equals(fieldName)) { + List beforeGates + = reader.readArray(reader1 -> GateConfiguration.fromJson(reader1)); + deserializedUpdateGroup.beforeGates = beforeGates; + } else if ("afterGates".equals(fieldName)) { + List afterGates + = reader.readArray(reader1 -> GateConfiguration.fromJson(reader1)); + deserializedUpdateGroup.afterGates = afterGates; } else { reader.skipChildren(); } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateGroupStatus.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateGroupStatus.java index 619fdacd1506..3fc702708e32 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateGroupStatus.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateGroupStatus.java @@ -32,6 +32,16 @@ public final class UpdateGroupStatus implements JsonSerializable members; + /* + * The list of Gates that will run before this UpdateGroup. + */ + private List beforeGates; + + /* + * The list of Gates that will run after this UpdateGroup. + */ + private List afterGates; + /** * Creates an instance of UpdateGroupStatus class. */ @@ -65,6 +75,24 @@ public List members() { return this.members; } + /** + * Get the beforeGates property: The list of Gates that will run before this UpdateGroup. + * + * @return the beforeGates value. + */ + public List beforeGates() { + return this.beforeGates; + } + + /** + * Get the afterGates property: The list of Gates that will run after this UpdateGroup. + * + * @return the afterGates value. + */ + public List afterGates() { + return this.afterGates; + } + /** * Validates the instance. * @@ -77,6 +105,12 @@ public void validate() { if (members() != null) { members().forEach(e -> e.validate()); } + if (beforeGates() != null) { + beforeGates().forEach(e -> e.validate()); + } + if (afterGates() != null) { + afterGates().forEach(e -> e.validate()); + } } /** @@ -111,6 +145,14 @@ public static UpdateGroupStatus fromJson(JsonReader jsonReader) throws IOExcepti List members = reader.readArray(reader1 -> MemberUpdateStatus.fromJson(reader1)); deserializedUpdateGroupStatus.members = members; + } else if ("beforeGates".equals(fieldName)) { + List beforeGates + = reader.readArray(reader1 -> UpdateRunGateStatus.fromJson(reader1)); + deserializedUpdateGroupStatus.beforeGates = beforeGates; + } else if ("afterGates".equals(fieldName)) { + List afterGates + = reader.readArray(reader1 -> UpdateRunGateStatus.fromJson(reader1)); + deserializedUpdateGroupStatus.afterGates = afterGates; } else { reader.skipChildren(); } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunGateStatus.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunGateStatus.java new file mode 100644 index 000000000000..675bd78423c8 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunGateStatus.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The status of the Gate, as represented in the Update Run. + */ +@Immutable +public final class UpdateRunGateStatus implements JsonSerializable { + /* + * The human-readable display name of the Gate. + */ + private String displayName; + + /* + * The resource id of the Gate. + */ + private String gateId; + + /* + * The status of the Gate. + */ + private UpdateStatus status; + + /** + * Creates an instance of UpdateRunGateStatus class. + */ + private UpdateRunGateStatus() { + } + + /** + * Get the displayName property: The human-readable display name of the Gate. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the gateId property: The resource id of the Gate. + * + * @return the gateId value. + */ + public String gateId() { + return this.gateId; + } + + /** + * Get the status property: The status of the Gate. + * + * @return the status value. + */ + public UpdateStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateRunGateStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateRunGateStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UpdateRunGateStatus. + */ + public static UpdateRunGateStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateRunGateStatus deserializedUpdateRunGateStatus = new UpdateRunGateStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedUpdateRunGateStatus.displayName = reader.getString(); + } else if ("gateId".equals(fieldName)) { + deserializedUpdateRunGateStatus.gateId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedUpdateRunGateStatus.status = UpdateStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateRunGateStatus; + }); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunGateTargetProperties.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunGateTargetProperties.java new file mode 100644 index 000000000000..5d0d4cda1dcd --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateRunGateTargetProperties.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of the Update Run that the Gate is targeting. + */ +@Immutable +public final class UpdateRunGateTargetProperties implements JsonSerializable { + /* + * The name of the Update Run. + */ + private String name; + + /* + * The Update Stage of the Update Run. + */ + private String stage; + + /* + * The Update Group of the Update Run. + */ + private String group; + + /* + * Whether the Gate is placed before or after the update itself. + */ + private Timing timing; + + /** + * Creates an instance of UpdateRunGateTargetProperties class. + */ + private UpdateRunGateTargetProperties() { + } + + /** + * Get the name property: The name of the Update Run. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the stage property: The Update Stage of the Update Run. + * + * @return the stage value. + */ + public String stage() { + return this.stage; + } + + /** + * Get the group property: The Update Group of the Update Run. + * + * @return the group value. + */ + public String group() { + return this.group; + } + + /** + * Get the timing property: Whether the Gate is placed before or after the update itself. + * + * @return the timing value. + */ + public Timing timing() { + return this.timing; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timing() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property timing in model UpdateRunGateTargetProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateRunGateTargetProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timing", this.timing == null ? null : this.timing.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateRunGateTargetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateRunGateTargetProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateRunGateTargetProperties. + */ + public static UpdateRunGateTargetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateRunGateTargetProperties deserializedUpdateRunGateTargetProperties + = new UpdateRunGateTargetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedUpdateRunGateTargetProperties.name = reader.getString(); + } else if ("timing".equals(fieldName)) { + deserializedUpdateRunGateTargetProperties.timing = Timing.fromString(reader.getString()); + } else if ("stage".equals(fieldName)) { + deserializedUpdateRunGateTargetProperties.stage = reader.getString(); + } else if ("group".equals(fieldName)) { + deserializedUpdateRunGateTargetProperties.group = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateRunGateTargetProperties; + }); + } +} 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 d4f25fd5960e..793c35c04b1e 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 @@ -35,6 +35,16 @@ public final class UpdateStage implements JsonSerializable { */ private Integer afterStageWaitInSeconds; + /* + * A list of Gates that will be created before this Stage is executed. + */ + private List beforeGates; + + /* + * A list of Gates that will be created after this Stage is executed. + */ + private List afterGates; + /** * Creates an instance of UpdateStage class. */ @@ -105,6 +115,46 @@ public UpdateStage withAfterStageWaitInSeconds(Integer afterStageWaitInSeconds) return this; } + /** + * Get the beforeGates property: A list of Gates that will be created before this Stage is executed. + * + * @return the beforeGates value. + */ + public List beforeGates() { + return this.beforeGates; + } + + /** + * Set the beforeGates property: A list of Gates that will be created before this Stage is executed. + * + * @param beforeGates the beforeGates value to set. + * @return the UpdateStage object itself. + */ + public UpdateStage withBeforeGates(List beforeGates) { + this.beforeGates = beforeGates; + return this; + } + + /** + * Get the afterGates property: A list of Gates that will be created after this Stage is executed. + * + * @return the afterGates value. + */ + public List afterGates() { + return this.afterGates; + } + + /** + * Set the afterGates property: A list of Gates that will be created after this Stage is executed. + * + * @param afterGates the afterGates value to set. + * @return the UpdateStage object itself. + */ + public UpdateStage withAfterGates(List afterGates) { + this.afterGates = afterGates; + return this; + } + /** * Validates the instance. * @@ -118,6 +168,12 @@ public void validate() { if (groups() != null) { groups().forEach(e -> e.validate()); } + if (beforeGates() != null) { + beforeGates().forEach(e -> e.validate()); + } + if (afterGates() != null) { + afterGates().forEach(e -> e.validate()); + } } private static final ClientLogger LOGGER = new ClientLogger(UpdateStage.class); @@ -131,6 +187,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeArrayField("groups", this.groups, (writer, element) -> writer.writeJson(element)); jsonWriter.writeNumberField("afterStageWaitInSeconds", this.afterStageWaitInSeconds); + jsonWriter.writeArrayField("beforeGates", this.beforeGates, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("afterGates", this.afterGates, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -157,6 +215,14 @@ public static UpdateStage fromJson(JsonReader jsonReader) throws IOException { deserializedUpdateStage.groups = groups; } else if ("afterStageWaitInSeconds".equals(fieldName)) { deserializedUpdateStage.afterStageWaitInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("beforeGates".equals(fieldName)) { + List beforeGates + = reader.readArray(reader1 -> GateConfiguration.fromJson(reader1)); + deserializedUpdateStage.beforeGates = beforeGates; + } else if ("afterGates".equals(fieldName)) { + List afterGates + = reader.readArray(reader1 -> GateConfiguration.fromJson(reader1)); + deserializedUpdateStage.afterGates = afterGates; } else { reader.skipChildren(); } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateStageStatus.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateStageStatus.java index 3369d7551ae9..722696fd147f 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateStageStatus.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpdateStageStatus.java @@ -32,6 +32,16 @@ public final class UpdateStageStatus implements JsonSerializable groups; + /* + * The list of Gates that will run before this UpdateStage. + */ + private List beforeGates; + + /* + * The list of Gates that will run after this UpdateStage. + */ + private List afterGates; + /* * The status of the wait period configured on the UpdateStage. */ @@ -70,6 +80,24 @@ public List groups() { return this.groups; } + /** + * Get the beforeGates property: The list of Gates that will run before this UpdateStage. + * + * @return the beforeGates value. + */ + public List beforeGates() { + return this.beforeGates; + } + + /** + * Get the afterGates property: The list of Gates that will run after this UpdateStage. + * + * @return the afterGates value. + */ + public List afterGates() { + return this.afterGates; + } + /** * Get the afterStageWaitStatus property: The status of the wait period configured on the UpdateStage. * @@ -91,6 +119,12 @@ public void validate() { if (groups() != null) { groups().forEach(e -> e.validate()); } + if (beforeGates() != null) { + beforeGates().forEach(e -> e.validate()); + } + if (afterGates() != null) { + afterGates().forEach(e -> e.validate()); + } if (afterStageWaitStatus() != null) { afterStageWaitStatus().validate(); } @@ -127,6 +161,14 @@ public static UpdateStageStatus fromJson(JsonReader jsonReader) throws IOExcepti } else if ("groups".equals(fieldName)) { List groups = reader.readArray(reader1 -> UpdateGroupStatus.fromJson(reader1)); deserializedUpdateStageStatus.groups = groups; + } else if ("beforeGates".equals(fieldName)) { + List beforeGates + = reader.readArray(reader1 -> UpdateRunGateStatus.fromJson(reader1)); + deserializedUpdateStageStatus.beforeGates = beforeGates; + } else if ("afterGates".equals(fieldName)) { + List afterGates + = reader.readArray(reader1 -> UpdateRunGateStatus.fromJson(reader1)); + deserializedUpdateStageStatus.afterGates = afterGates; } else if ("afterStageWaitStatus".equals(fieldName)) { deserializedUpdateStageStatus.afterStageWaitStatus = WaitStatus.fromJson(reader); } else { 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 38f6896035c0..dd5ef6fd2afb 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 @@ -41,6 +41,11 @@ public final class UpdateState extends ExpandableStringEnum { */ public static final UpdateState FAILED = fromString("Failed"); + /** + * The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that is pending. + */ + public static final UpdateState PENDING = fromString("Pending"); + /** * The state of an UpdateRun/UpdateStage/UpdateGroup/MemberUpdate that has completed. */ diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservicefleet/proxy-config.json b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservicefleet/proxy-config.json index 3e096edbdd4f..0301fb5d89cf 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservicefleet/proxy-config.json +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerservicefleet/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.containerservicefleet.implementation.AutoUpgradeProfileOperationsClientImpl$AutoUpgradeProfileOperationsService"],["com.azure.resourcemanager.containerservicefleet.implementation.AutoUpgradeProfilesClientImpl$AutoUpgradeProfilesService"],["com.azure.resourcemanager.containerservicefleet.implementation.FleetMembersClientImpl$FleetMembersService"],["com.azure.resourcemanager.containerservicefleet.implementation.FleetUpdateStrategiesClientImpl$FleetUpdateStrategiesService"],["com.azure.resourcemanager.containerservicefleet.implementation.FleetsClientImpl$FleetsService"],["com.azure.resourcemanager.containerservicefleet.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.containerservicefleet.implementation.UpdateRunsClientImpl$UpdateRunsService"]] \ No newline at end of file +[["com.azure.resourcemanager.containerservicefleet.implementation.AutoUpgradeProfileOperationsClientImpl$AutoUpgradeProfileOperationsService"],["com.azure.resourcemanager.containerservicefleet.implementation.AutoUpgradeProfilesClientImpl$AutoUpgradeProfilesService"],["com.azure.resourcemanager.containerservicefleet.implementation.FleetMembersClientImpl$FleetMembersService"],["com.azure.resourcemanager.containerservicefleet.implementation.FleetUpdateStrategiesClientImpl$FleetUpdateStrategiesService"],["com.azure.resourcemanager.containerservicefleet.implementation.FleetsClientImpl$FleetsService"],["com.azure.resourcemanager.containerservicefleet.implementation.GatesClientImpl$GatesService"],["com.azure.resourcemanager.containerservicefleet.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.containerservicefleet.implementation.UpdateRunsClientImpl$UpdateRunsService"]] \ No newline at end of file diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfileOperationsGenerateUpdateRunSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfileOperationsGenerateUpdateRunSamples.java index 3f95b43f315a..74ea4c1305ed 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfileOperationsGenerateUpdateRunSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfileOperationsGenerateUpdateRunSamples.java @@ -9,7 +9,7 @@ */ public final class AutoUpgradeProfileOperationsGenerateUpdateRunSamples { /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfileOperations_GenerateUpdateRun_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfileOperations_GenerateUpdateRun_MaximumSet_Gen.json */ /** * Sample code: AutoUpgradeProfileOperations_GenerateUpdateRun_MaximumSet. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesCreateOrUpdateSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesCreateOrUpdateSamples.java index ed72cccd3cf7..858dd52fc345 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesCreateOrUpdateSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesCreateOrUpdateSamples.java @@ -6,7 +6,6 @@ import com.azure.resourcemanager.containerservicefleet.models.AutoUpgradeNodeImageSelection; import com.azure.resourcemanager.containerservicefleet.models.AutoUpgradeNodeImageSelectionType; -import com.azure.resourcemanager.containerservicefleet.models.AutoUpgradeProfileStatus; import com.azure.resourcemanager.containerservicefleet.models.UpgradeChannel; /** @@ -14,7 +13,7 @@ */ public final class AutoUpgradeProfilesCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_CreateOrUpdate.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_CreateOrUpdate.json */ /** * Sample code: Create an AutoUpgradeProfile. @@ -31,7 +30,7 @@ public static void createAnAutoUpgradeProfile( } /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Create an AutoUpgradeProfile. - generated by [MaximumSet] rule. @@ -49,9 +48,8 @@ public static void createAnAutoUpgradeProfileGeneratedByMaximumSetRule( .withNodeImageSelection( new AutoUpgradeNodeImageSelection().withType(AutoUpgradeNodeImageSelectionType.LATEST)) .withDisabled(true) - .withAutoUpgradeProfileStatus(new AutoUpgradeProfileStatus()) - .withIfMatch("teikqmg") - .withIfNoneMatch("ghfmmyrekxincsxklbldnvhqd") + .withIfMatch("uktvayathbu") + .withIfNoneMatch("vdjolwxnefqamimybcvxxva") .create(); } } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesDeleteSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesDeleteSamples.java index fb4bf4434bc0..105cb67b9a1a 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesDeleteSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class AutoUpgradeProfilesDeleteSamples { /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_Delete_MaximumSet_Gen.json */ /** * Sample code: Delete an AutoUpgradeProfile resource. - generated by [MaximumSet] rule. @@ -19,11 +19,11 @@ public final class AutoUpgradeProfilesDeleteSamples { public static void deleteAnAutoUpgradeProfileResourceGeneratedByMaximumSetRule( com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { manager.autoUpgradeProfiles() - .delete("rgfleets", "fleet1", "autoupgradeprofile1", "qmdsmmawj", com.azure.core.util.Context.NONE); + .delete("rgfleets", "fleet1", "autoupgradeprofile1", "tmlfhgsu", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_Delete.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_Delete.json */ /** * Sample code: Delete an AutoUpgradeProfile resource. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesGetSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesGetSamples.java index ba9de934ee87..25df3085df78 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesGetSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesGetSamples.java @@ -9,7 +9,7 @@ */ public final class AutoUpgradeProfilesGetSamples { /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_Get_MaximumSet_Gen.json */ /** * Sample code: Gets an AutoUpgradeProfile resource. - generated by [MaximumSet] rule. @@ -23,7 +23,7 @@ public static void getsAnAutoUpgradeProfileResourceGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_Get.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_Get.json */ /** * Sample code: Gets an AutoUpgradeProfile resource. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesListByFleetSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesListByFleetSamples.java index f07025f4be58..d76a0169af74 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesListByFleetSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfilesListByFleetSamples.java @@ -9,7 +9,7 @@ */ public final class AutoUpgradeProfilesListByFleetSamples { /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_ListByFleet.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_ListByFleet.json */ /** * Sample code: Lists the AutoUpgradeProfile resources by fleet. @@ -22,7 +22,7 @@ public static void listsTheAutoUpgradeProfileResourcesByFleet( } /* - * x-ms-original-file: 2025-03-01/AutoUpgradeProfiles_ListByFleet_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/AutoUpgradeProfiles_ListByFleet_MaximumSet_Gen.json */ /** * Sample code: Lists the AutoUpgradeProfile resources by fleet. - generated by [MaximumSet] rule. 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 db85ef464907..995de82ea909 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 @@ -9,7 +9,7 @@ */ public final class FleetMembersCreateSamples { /* - * x-ms-original-file: 2025-03-01/FleetMembers_Create.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Create.json */ /** * Sample code: Creates a FleetMember resource with a long running operation. @@ -27,7 +27,7 @@ public static void createsAFleetMemberResourceWithALongRunningOperation( } /* - * x-ms-original-file: 2025-03-01/FleetMembers_Create_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Create_MaximumSet_Gen.json */ /** * Sample code: Creates a FleetMember resource with a long running operation. - generated by [MaximumSet] rule. 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 c6ee49270187..6403a01700a3 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 @@ -9,7 +9,7 @@ */ public final class FleetMembersDeleteSamples { /* - * x-ms-original-file: 2025-03-01/FleetMembers_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Delete_MaximumSet_Gen.json */ /** * Sample code: Deletes a FleetMember resource asynchronously with a long running operation. - generated by @@ -23,7 +23,7 @@ public static void deletesAFleetMemberResourceAsynchronouslyWithALongRunningOper } /* - * x-ms-original-file: 2025-03-01/FleetMembers_Delete.json + * x-ms-original-file: 2025-04-01-preview/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 72b2609cca21..a58a32817835 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 @@ -9,7 +9,7 @@ */ public final class FleetMembersGetSamples { /* - * x-ms-original-file: 2025-03-01/FleetMembers_Get.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Get.json */ /** * Sample code: Gets a FleetMember resource. @@ -22,7 +22,7 @@ public final class FleetMembersGetSamples { } /* - * x-ms-original-file: 2025-03-01/FleetMembers_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Get_MaximumSet_Gen.json */ /** * Sample code: Gets a FleetMember resource. - generated by [MaximumSet] rule. 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 8a965e36a540..50fd104bee45 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 @@ -9,7 +9,7 @@ */ public final class FleetMembersListByFleetSamples { /* - * x-ms-original-file: 2025-03-01/FleetMembers_ListByFleet_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_ListByFleet_MaximumSet_Gen.json */ /** * Sample code: Lists the members of a Fleet. - generated by [MaximumSet] rule. @@ -22,7 +22,7 @@ public static void listsTheMembersOfAFleetGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/FleetMembers_ListByFleet.json + * x-ms-original-file: 2025-04-01-preview/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/FleetMembersUpdateAsyncSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersUpdateAsyncSamples.java index 495276c92c4a..464b958f8eaf 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersUpdateAsyncSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetMembersUpdateAsyncSamples.java @@ -11,7 +11,7 @@ */ public final class FleetMembersUpdateAsyncSamples { /* - * x-ms-original-file: 2025-03-01/FleetMembers_Update_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetMembers_Update_MaximumSet_Gen.json */ /** * Sample code: Updates a FleetMember resource synchronously. - generated by [MaximumSet] rule. @@ -27,7 +27,7 @@ public static void updatesAFleetMemberResourceSynchronouslyGeneratedByMaximumSet } /* - * x-ms-original-file: 2025-03-01/FleetMembers_Update.json + * x-ms-original-file: 2025-04-01-preview/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 index d6bb32563fe9..878a32e32c34 100644 --- 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 @@ -4,6 +4,8 @@ package com.azure.resourcemanager.containerservicefleet.generated; +import com.azure.resourcemanager.containerservicefleet.models.GateConfiguration; +import com.azure.resourcemanager.containerservicefleet.models.GateType; import com.azure.resourcemanager.containerservicefleet.models.UpdateGroup; import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; import com.azure.resourcemanager.containerservicefleet.models.UpdateStage; @@ -14,7 +16,7 @@ */ public final class FleetUpdateStrategiesCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-03-01/FleetUpdateStrategies_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetUpdateStrategies_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Create a FleetUpdateStrategy. - generated by [MaximumSet] rule. @@ -35,7 +37,7 @@ public static void createAFleetUpdateStrategyGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/UpdateStrategies_CreateOrUpdate.json + * x-ms-original-file: 2025-04-01-preview/UpdateStrategies_CreateOrUpdate.json */ /** * Sample code: Create a FleetUpdateStrategy. @@ -45,11 +47,19 @@ public static void createAFleetUpdateStrategyGeneratedByMaximumSetRule( public static void createAFleetUpdateStrategy( com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { manager.fleetUpdateStrategies() - .define("strartegy1") + .define("strategy1") .withExistingFleet("rg1", "fleet1") .withStrategy(new UpdateRunStrategy().withStages(Arrays.asList(new UpdateStage().withName("stage1") - .withGroups(Arrays.asList(new UpdateGroup().withName("group-a"))) - .withAfterStageWaitInSeconds(3600)))) + .withGroups(Arrays.asList(new UpdateGroup().withName("group-a") + .withBeforeGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate before group-a").withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate after group-a").withType(GateType.APPROVAL))))) + .withAfterStageWaitInSeconds(3600) + .withBeforeGates(Arrays + .asList(new GateConfiguration().withDisplayName("gate before stage1").withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate after stage1").withType(GateType.APPROVAL)))))) .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 index d8e6aea5bfaf..f474fbf89c23 100644 --- 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 @@ -9,7 +9,7 @@ */ public final class FleetUpdateStrategiesDeleteSamples { /* - * x-ms-original-file: 2025-03-01/UpdateStrategies_Delete.json + * x-ms-original-file: 2025-04-01-preview/UpdateStrategies_Delete.json */ /** * Sample code: Delete a FleetUpdateStrategy resource. @@ -22,7 +22,7 @@ public static void deleteAFleetUpdateStrategyResource( } /* - * x-ms-original-file: 2025-03-01/FleetUpdateStrategies_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetUpdateStrategies_Delete_MaximumSet_Gen.json */ /** * Sample code: Delete a FleetUpdateStrategy resource. - generated by [MaximumSet] rule. 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 index 8b3f1f2da4d9..c0936a19a620 100644 --- 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 @@ -9,7 +9,7 @@ */ public final class FleetUpdateStrategiesGetSamples { /* - * x-ms-original-file: 2025-03-01/FleetUpdateStrategies_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetUpdateStrategies_Get_MaximumSet_Gen.json */ /** * Sample code: Get a FleetUpdateStrategy resource. - generated by [MaximumSet] rule. @@ -23,7 +23,7 @@ public static void getAFleetUpdateStrategyResourceGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/UpdateStrategies_Get.json + * x-ms-original-file: 2025-04-01-preview/UpdateStrategies_Get.json */ /** * Sample code: Get a FleetUpdateStrategy resource. 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 index 1d2f61750f4e..482feff77b78 100644 --- 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 @@ -9,7 +9,7 @@ */ public final class FleetUpdateStrategiesListByFleetSamples { /* - * x-ms-original-file: 2025-03-01/UpdateStrategies_ListByFleet.json + * x-ms-original-file: 2025-04-01-preview/UpdateStrategies_ListByFleet.json */ /** * Sample code: List the FleetUpdateStrategy resources by fleet. @@ -22,7 +22,7 @@ public static void listTheFleetUpdateStrategyResourcesByFleet( } /* - * x-ms-original-file: 2025-03-01/FleetUpdateStrategies_ListByFleet_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/FleetUpdateStrategies_ListByFleet_MaximumSet_Gen.json */ /** * Sample code: List the FleetUpdateStrategy resources by fleet. - generated by [MaximumSet] rule. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateSamples.java index 2d0224e24364..5b87820ffa19 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsCreateSamples.java @@ -18,7 +18,7 @@ */ public final class FleetsCreateSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Creates a Fleet resource with a long running operation. - generated by [MaximumSet] rule. @@ -48,7 +48,7 @@ public static void createsAFleetResourceWithALongRunningOperationGeneratedByMaxi } /* - * x-ms-original-file: 2025-03-01/Fleets_CreateOrUpdate.json + * x-ms-original-file: 2025-04-01-preview/Fleets_CreateOrUpdate.json */ /** * Sample code: Creates a Fleet resource with a long running operation. 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 7ea3ff92a6b3..ef60c928ed29 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 @@ -9,7 +9,7 @@ */ public final class FleetsDeleteSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_Delete.json + * x-ms-original-file: 2025-04-01-preview/Fleets_Delete.json */ /** * Sample code: Deletes a Fleet resource asynchronously with a long running operation. @@ -22,7 +22,7 @@ public static void deletesAFleetResourceAsynchronouslyWithALongRunningOperation( } /* - * x-ms-original-file: 2025-03-01/Fleets_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_Delete_MaximumSet_Gen.json */ /** * Sample code: Deletes a Fleet resource asynchronously with a long running operation. - generated by [MaximumSet] 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 4665838a02ab..063471a09971 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 @@ -9,7 +9,7 @@ */ public final class FleetsGetByResourceGroupSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_Get_MaximumSet_Gen.json */ /** * Sample code: Gets a Fleet resource. - generated by [MaximumSet] rule. @@ -22,7 +22,7 @@ public static void getsAFleetResourceGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/Fleets_Get.json + * x-ms-original-file: 2025-04-01-preview/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 87d366612668..9920cb950796 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 @@ -9,7 +9,7 @@ */ public final class FleetsListByResourceGroupSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_ListByResourceGroup.json + * x-ms-original-file: 2025-04-01-preview/Fleets_ListByResourceGroup.json */ /** * Sample code: Lists the Fleet resources in a resource group. @@ -22,7 +22,7 @@ public static void listsTheFleetResourcesInAResourceGroup( } /* - * x-ms-original-file: 2025-03-01/Fleets_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: Lists the Fleet resources in a resource group. - generated by [MaximumSet] rule. 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 52e0930c90f1..3ef1466532f8 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 @@ -9,7 +9,7 @@ */ public final class FleetsListCredentialsSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_ListCredentials_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_ListCredentials_MaximumSet_Gen.json */ /** * Sample code: Lists the user credentials of a Fleet. - generated by [MaximumSet] rule. @@ -22,7 +22,7 @@ public static void listsTheUserCredentialsOfAFleetGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/Fleets_ListCredentialsResult.json + * x-ms-original-file: 2025-04-01-preview/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 8c40e2a44d6a..5eba7abe64b4 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 @@ -9,7 +9,7 @@ */ public final class FleetsListSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: Lists the Fleet resources in a subscription. - generated by [MaximumSet] rule. @@ -22,7 +22,7 @@ public static void listsTheFleetResourcesInASubscriptionGeneratedByMaximumSetRul } /* - * x-ms-original-file: 2025-03-01/Fleets_ListBySub.json + * x-ms-original-file: 2025-04-01-preview/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/FleetsUpdateAsyncSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsUpdateAsyncSamples.java index 507d613cde3d..030bb1dcb628 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsUpdateAsyncSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/FleetsUpdateAsyncSamples.java @@ -16,7 +16,7 @@ */ public final class FleetsUpdateAsyncSamples { /* - * x-ms-original-file: 2025-03-01/Fleets_PatchTags.json + * x-ms-original-file: 2025-04-01-preview/Fleets_PatchTags.json */ /** * Sample code: Update a Fleet. @@ -32,7 +32,7 @@ public final class FleetsUpdateAsyncSamples { } /* - * x-ms-original-file: 2025-03-01/Fleets_Update_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Fleets_Update_MaximumSet_Gen.json */ /** * Sample code: Update a Fleet. - generated by [MaximumSet] rule. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/GatesGetSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/GatesGetSamples.java new file mode 100644 index 000000000000..c2c307cc03d9 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/GatesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.generated; + +/** + * Samples for Gates Get. + */ +public final class GatesGetSamples { + /* + * x-ms-original-file: 2025-04-01-preview/Gates_Get.json + */ + /** + * Sample code: Gets a Gate resource. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void + getsAGateResource(com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.gates() + .getWithResponse("rg1", "fleet1", "12345678-910a-bcde-f000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/GatesListByFleetSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/GatesListByFleetSamples.java new file mode 100644 index 000000000000..8fbe65d1990d --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/GatesListByFleetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.generated; + +/** + * Samples for Gates ListByFleet. + */ +public final class GatesListByFleetSamples { + /* + * x-ms-original-file: 2025-04-01-preview/Gates_ListByFleet.json + */ + /** + * Sample code: Lists the Gates of a Fleet. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void + listsTheGatesOfAFleet(com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.gates().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/GatesUpdateSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/GatesUpdateSamples.java new file mode 100644 index 000000000000..dfbd89afe476 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/GatesUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.generated; + +import com.azure.resourcemanager.containerservicefleet.models.GatePatch; +import com.azure.resourcemanager.containerservicefleet.models.GatePatchProperties; +import com.azure.resourcemanager.containerservicefleet.models.GateState; + +/** + * Samples for Gates Update. + */ +public final class GatesUpdateSamples { + /* + * x-ms-original-file: 2025-04-01-preview/Gates_Update.json + */ + /** + * Sample code: Updates a Gate resource. + * + * @param manager Entry point to ContainerServiceFleetManager. + */ + public static void + updatesAGateResource(com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager manager) { + manager.gates() + .update("rg1", "fleet1", "12345678-910a-bcde-f000-000000000000", + new GatePatch().withProperties(new GatePatchProperties().withState(GateState.COMPLETED)), null, null, + com.azure.core.util.Context.NONE); + } +} 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 f1765b34a299..cf508d7963b1 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 @@ -9,7 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-03-01/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Operations_List_MinimumSet_Gen.json */ /** * Sample code: List the operations for the provider. - generated by [MinimumSet] rule. @@ -22,7 +22,7 @@ public static void listTheOperationsForTheProviderGeneratedByMinimumSetRule( } /* - * x-ms-original-file: 2025-03-01/Operations_List.json + * x-ms-original-file: 2025-04-01-preview/Operations_List.json */ /** * Sample code: List the operations for the provider. @@ -35,7 +35,7 @@ public static void listTheOperationsForTheProvider( } /* - * x-ms-original-file: 2025-03-01/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/Operations_List_MaximumSet_Gen.json */ /** * Sample code: List the operations for the provider. - generated by [MaximumSet] rule. 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 1dfc431394e9..5cd07cb96b85 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 @@ -4,6 +4,8 @@ package com.azure.resourcemanager.containerservicefleet.generated; +import com.azure.resourcemanager.containerservicefleet.models.GateConfiguration; +import com.azure.resourcemanager.containerservicefleet.models.GateType; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpdate; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeSpec; import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeType; @@ -20,7 +22,7 @@ */ public final class UpdateRunsCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: Create an UpdateRun. - generated by [MaximumSet] rule. @@ -48,7 +50,7 @@ public static void createAnUpdateRunGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_CreateOrUpdate.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_CreateOrUpdate.json */ /** * Sample code: Create an UpdateRun. @@ -63,8 +65,16 @@ public static void createAnUpdateRunGeneratedByMaximumSetRule( .withUpdateStrategyId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1") .withStrategy(new UpdateRunStrategy().withStages(Arrays.asList(new UpdateStage().withName("stage1") - .withGroups(Arrays.asList(new UpdateGroup().withName("group-a"))) - .withAfterStageWaitInSeconds(3600)))) + .withGroups(Arrays.asList(new UpdateGroup().withName("group-a") + .withBeforeGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate before group-a").withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate after group-a").withType(GateType.APPROVAL))))) + .withAfterStageWaitInSeconds(3600) + .withBeforeGates(Arrays + .asList(new GateConfiguration().withDisplayName("gate before stage1").withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList( + new GateConfiguration().withDisplayName("gate after stage1").withType(GateType.APPROVAL)))))) .withManagedClusterUpdate(new ManagedClusterUpdate() .withUpgrade(new ManagedClusterUpgradeSpec().withType(ManagedClusterUpgradeType.FULL) .withKubernetesVersion("1.26.1")) 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 ab8014721ed5..1841938de3d4 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 @@ -9,7 +9,7 @@ */ public final class UpdateRunsDeleteSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Delete_MaximumSet_Gen.json */ /** * Sample code: Delete an updateRun resource. - generated by [MaximumSet] rule. @@ -23,7 +23,7 @@ public static void deleteAnUpdateRunResourceGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Delete.json + * x-ms-original-file: 2025-04-01-preview/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 e1e3ece152e3..19e3d9702300 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 @@ -9,7 +9,7 @@ */ public final class UpdateRunsGetSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Get_MaximumSet_Gen.json */ /** * Sample code: Gets an UpdateRun resource. - generated by [MaximumSet] rule. @@ -22,7 +22,7 @@ public static void getsAnUpdateRunResourceGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Get.json + * x-ms-original-file: 2025-04-01-preview/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 ab7e577d40fd..051b13cffb28 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 @@ -9,7 +9,7 @@ */ public final class UpdateRunsListByFleetSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_ListByFleet.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_ListByFleet.json */ /** * Sample code: Lists the UpdateRun resources by fleet. @@ -22,7 +22,7 @@ public static void listsTheUpdateRunResourcesByFleet( } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_ListByFleet_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_ListByFleet_MaximumSet_Gen.json */ /** * Sample code: Lists the UpdateRun resources by fleet. - generated by [MaximumSet] rule. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsSkipSamples.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsSkipSamples.java index 91401b797fd5..2af82455fd10 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsSkipSamples.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/samples/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunsSkipSamples.java @@ -14,7 +14,7 @@ */ public final class UpdateRunsSkipSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Skip_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Skip_MaximumSet_Gen.json */ /** * Sample code: Skips one or more member/group/stage/afterStageWait(s) of an UpdateRun. - generated by [MaximumSet] @@ -33,7 +33,7 @@ public static void skipsOneOrMoreMemberGroupStageAfterStageWaitSOfAnUpdateRunGen } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Skip.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Skip.json */ /** * Sample code: Skips one or more member/group/stage/afterStageWait(s) of an UpdateRun. 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 b730029ce948..4b97f6f2901c 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 @@ -9,7 +9,7 @@ */ public final class UpdateRunsStartSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Start_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Start_MaximumSet_Gen.json */ /** * Sample code: Starts an UpdateRun. - generated by [MaximumSet] rule. @@ -23,7 +23,7 @@ public static void startsAnUpdateRunGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Start.json + * x-ms-original-file: 2025-04-01-preview/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 9298ad07187c..15d2e6aee6b9 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 @@ -9,7 +9,7 @@ */ public final class UpdateRunsStopSamples { /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Stop_MaximumSet_Gen.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Stop_MaximumSet_Gen.json */ /** * Sample code: Stops an UpdateRun. - generated by [MaximumSet] rule. @@ -22,7 +22,7 @@ public static void stopsAnUpdateRunGeneratedByMaximumSetRule( } /* - * x-ms-original-file: 2025-03-01/UpdateRuns_Stop.json + * x-ms-original-file: 2025-04-01-preview/UpdateRuns_Stop.json */ /** * Sample code: Stops an UpdateRun. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/AgentProfileTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/AgentProfileTests.java deleted file mode 100644 index 59781030193b..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/AgentProfileTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.AgentProfile; -import org.junit.jupiter.api.Assertions; - -public final class AgentProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgentProfile model = BinaryData.fromString("{\"subnetId\":\"fsinzgvfcjrwzoxx\",\"vmSize\":\"felluwfzitonpe\"}") - .toObject(AgentProfile.class); - Assertions.assertEquals("fsinzgvfcjrwzoxx", model.subnetId()); - Assertions.assertEquals("felluwfzitonpe", model.vmSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgentProfile model = new AgentProfile().withSubnetId("fsinzgvfcjrwzoxx").withVmSize("felluwfzitonpe"); - model = BinaryData.fromObject(model).toObject(AgentProfile.class); - Assertions.assertEquals("fsinzgvfcjrwzoxx", model.subnetId()); - Assertions.assertEquals("felluwfzitonpe", model.vmSize()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ApiServerAccessProfileTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ApiServerAccessProfileTests.java deleted file mode 100644 index c4a0364ed013..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ApiServerAccessProfileTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.ApiServerAccessProfile; -import org.junit.jupiter.api.Assertions; - -public final class ApiServerAccessProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiServerAccessProfile model = BinaryData - .fromString("{\"enablePrivateCluster\":false,\"enableVnetIntegration\":true,\"subnetId\":\"jbp\"}") - .toObject(ApiServerAccessProfile.class); - Assertions.assertEquals(false, model.enablePrivateCluster()); - Assertions.assertEquals(true, model.enableVnetIntegration()); - Assertions.assertEquals("jbp", model.subnetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiServerAccessProfile model = new ApiServerAccessProfile().withEnablePrivateCluster(false) - .withEnableVnetIntegration(true) - .withSubnetId("jbp"); - model = BinaryData.fromObject(model).toObject(ApiServerAccessProfile.class); - Assertions.assertEquals(false, model.enablePrivateCluster()); - Assertions.assertEquals(true, model.enableVnetIntegration()); - Assertions.assertEquals("jbp", model.subnetId()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeNodeImageSelectionTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeNodeImageSelectionTests.java deleted file mode 100644 index 11807d450bb1..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeNodeImageSelectionTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.AutoUpgradeNodeImageSelection; -import com.azure.resourcemanager.containerservicefleet.models.AutoUpgradeNodeImageSelectionType; -import org.junit.jupiter.api.Assertions; - -public final class AutoUpgradeNodeImageSelectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoUpgradeNodeImageSelection model - = BinaryData.fromString("{\"type\":\"Consistent\"}").toObject(AutoUpgradeNodeImageSelection.class); - Assertions.assertEquals(AutoUpgradeNodeImageSelectionType.CONSISTENT, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoUpgradeNodeImageSelection model - = new AutoUpgradeNodeImageSelection().withType(AutoUpgradeNodeImageSelectionType.CONSISTENT); - model = BinaryData.fromObject(model).toObject(AutoUpgradeNodeImageSelection.class); - Assertions.assertEquals(AutoUpgradeNodeImageSelectionType.CONSISTENT, model.type()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfileOperationsGenerateUpdateRunMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfileOperationsGenerateUpdateRunMockTests.java index 00e25c106ded..5f0c1c1fd679 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfileOperationsGenerateUpdateRunMockTests.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/AutoUpgradeProfileOperationsGenerateUpdateRunMockTests.java @@ -19,7 +19,7 @@ public final class AutoUpgradeProfileOperationsGenerateUpdateRunMockTests { @Test public void testGenerateUpdateRun() throws Exception { - String responseStr = "{\"id\":\"gdv\"}"; + String responseStr = "{\"id\":\"wrck\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -29,7 +29,7 @@ public void testGenerateUpdateRun() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); GenerateResponse response = manager.autoUpgradeProfileOperations() - .generateUpdateRun("rdvstkwqqtch", "alm", "mtdaa", com.azure.core.util.Context.NONE); + .generateUpdateRun("tczheydbsdshmkx", "aehvbbxuri", "ltfnhtbaxkgx", com.azure.core.util.Context.NONE); } } 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 bd2563f253b7..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetCredentialResultTests.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec 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\":\"o\"}").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 4a3f0896ae09..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetCredentialResultsInnerTests.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec 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\":\"dmgloug\"},{\"name\":\"wtmutduq\"},{\"name\":\"pspwgcuertu\"}]}") - .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 5b3b97c8e6e2..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetHubProfileTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.AgentProfile; -import com.azure.resourcemanager.containerservicefleet.models.ApiServerAccessProfile; -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\":\"lsuuvmkjozkrwfnd\",\"apiServerAccessProfile\":{\"enablePrivateCluster\":false,\"enableVnetIntegration\":true,\"subnetId\":\"w\"},\"agentProfile\":{\"subnetId\":\"pvwryoqpsoacc\",\"vmSize\":\"zakljlahbc\"},\"fqdn\":\"ffdfdosygexpa\",\"kubernetesVersion\":\"akhmsbzjhcrz\",\"portalFqdn\":\"dphlxaolt\"}") - .toObject(FleetHubProfile.class); - Assertions.assertEquals("lsuuvmkjozkrwfnd", model.dnsPrefix()); - Assertions.assertEquals(false, model.apiServerAccessProfile().enablePrivateCluster()); - Assertions.assertEquals(true, model.apiServerAccessProfile().enableVnetIntegration()); - Assertions.assertEquals("w", model.apiServerAccessProfile().subnetId()); - Assertions.assertEquals("pvwryoqpsoacc", model.agentProfile().subnetId()); - Assertions.assertEquals("zakljlahbc", model.agentProfile().vmSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetHubProfile model = new FleetHubProfile().withDnsPrefix("lsuuvmkjozkrwfnd") - .withApiServerAccessProfile(new ApiServerAccessProfile().withEnablePrivateCluster(false) - .withEnableVnetIntegration(true) - .withSubnetId("w")) - .withAgentProfile(new AgentProfile().withSubnetId("pvwryoqpsoacc").withVmSize("zakljlahbc")); - model = BinaryData.fromObject(model).toObject(FleetHubProfile.class); - Assertions.assertEquals("lsuuvmkjozkrwfnd", model.dnsPrefix()); - Assertions.assertEquals(false, model.apiServerAccessProfile().enablePrivateCluster()); - Assertions.assertEquals(true, model.apiServerAccessProfile().enableVnetIntegration()); - Assertions.assertEquals("w", model.apiServerAccessProfile().subnetId()); - Assertions.assertEquals("pvwryoqpsoacc", model.agentProfile().subnetId()); - Assertions.assertEquals("zakljlahbc", model.agentProfile().vmSize()); - } -} 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 08c649576486..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) TypeSpec 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\":\"qguhmuo\"}").toObject(FleetMemberUpdateProperties.class); - Assertions.assertEquals("qguhmuo", model.group()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetMemberUpdateProperties model = new FleetMemberUpdateProperties().withGroup("qguhmuo"); - model = BinaryData.fromObject(model).toObject(FleetMemberUpdateProperties.class); - Assertions.assertEquals("qguhmuo", 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 6c25b3252e52..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) TypeSpec 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\":\"szdnr\"}}").toObject(FleetMemberUpdate.class); - Assertions.assertEquals("szdnr", model.group()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetMemberUpdate model = new FleetMemberUpdate().withGroup("szdnr"); - model = BinaryData.fromObject(model).toObject(FleetMemberUpdate.class); - Assertions.assertEquals("szdnr", model.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 index afda81787683..6ed80d652ccd 100644 --- 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 @@ -27,7 +27,8 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.fleetMembers().delete("vce", "vei", "ovnotyfjfcnjbkcn", "dhbt", com.azure.core.util.Context.NONE); + manager.fleetMembers() + .delete("yxbaaabjyvayf", "imrzrtuzqog", "exn", "vfdnwnwmewzsyyce", com.azure.core.util.Context.NONE); } } 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 c57922203b8c..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetPatchTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.FleetPatch; -import com.azure.resourcemanager.containerservicefleet.models.ManagedServiceIdentity; -import com.azure.resourcemanager.containerservicefleet.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.containerservicefleet.models.UserAssignedIdentity; -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\":{\"ofx\":\"gispemvtzfkufubl\",\"jbasvmsmjqulngs\":\"eofjaeqjh\",\"bkzgcwrwclx\":\"tnb\",\"vkocrcjdkwtn\":\"wrljdouskc\"},\"identity\":{\"principalId\":\"njbiksqrglssain\",\"tenantId\":\"jwnzlljfmp\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"vndhkrwpdapp\":{\"clientId\":\"mgxsab\",\"principalId\":\"qduujitcjczdz\"},\"je\":{\"clientId\":\"bdkvwrwjf\",\"principalId\":\"snhu\"},\"tqxhocdgeab\":{\"clientId\":\"mrldhu\",\"principalId\":\"zzd\"},\"aozwyiftyhxhu\":{\"clientId\":\"phut\",\"principalId\":\"ndv\"}}}}") - .toObject(FleetPatch.class); - Assertions.assertEquals("gispemvtzfkufubl", model.tags().get("ofx")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetPatch model - = new FleetPatch() - .withTags(mapOf("ofx", "gispemvtzfkufubl", "jbasvmsmjqulngs", "eofjaeqjh", "bkzgcwrwclx", "tnb", - "vkocrcjdkwtn", "wrljdouskc")) - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("vndhkrwpdapp", new UserAssignedIdentity(), "je", - new UserAssignedIdentity(), "tqxhocdgeab", new UserAssignedIdentity(), "aozwyiftyhxhu", - new UserAssignedIdentity()))); - model = BinaryData.fromObject(model).toObject(FleetPatch.class); - Assertions.assertEquals("gispemvtzfkufubl", model.tags().get("ofx")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesCreateOrUpdateMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesCreateOrUpdateMockTests.java index 65149af65808..39d49eed29cf 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesCreateOrUpdateMockTests.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesCreateOrUpdateMockTests.java @@ -11,6 +11,8 @@ import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategy; +import com.azure.resourcemanager.containerservicefleet.models.GateConfiguration; +import com.azure.resourcemanager.containerservicefleet.models.GateType; import com.azure.resourcemanager.containerservicefleet.models.UpdateGroup; import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy; import com.azure.resourcemanager.containerservicefleet.models.UpdateStage; @@ -25,7 +27,7 @@ public final class FleetUpdateStrategiesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"strategy\":{\"stages\":[{\"name\":\"ovvqfovljxywsu\",\"groups\":[{\"name\":\"rsndsytgadgvra\"}],\"afterStageWaitInSeconds\":350666785},{\"name\":\"neqn\",\"groups\":[{\"name\":\"rwlqu\"},{\"name\":\"ijfqkacewiipfp\"},{\"name\":\"bjibwwiftohq\"},{\"name\":\"vpuvks\"}],\"afterStageWaitInSeconds\":710710602},{\"name\":\"saknynfsyn\",\"groups\":[{\"name\":\"huopxodlqiynto\"}],\"afterStageWaitInSeconds\":1419616379}]}},\"eTag\":\"leosjswsrms\",\"id\":\"zrpzb\",\"name\":\"hckqqzqioxiy\",\"type\":\"uiizynke\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"strategy\":{\"stages\":[{\"name\":\"amrsreuzv\",\"groups\":[{\"name\":\"i\"},{\"name\":\"jn\"},{\"name\":\"nytx\"},{\"name\":\"fq\"}],\"afterStageWaitInSeconds\":351855115,\"beforeGates\":[{\"type\":\"Approval\"},{\"type\":\"Approval\"},{\"type\":\"Approval\"}],\"afterGates\":[{\"type\":\"Approval\"}]},{\"name\":\"pcesutrg\",\"groups\":[{\"name\":\"auutpwoqhihe\"},{\"name\":\"qg\"}],\"afterStageWaitInSeconds\":172969394,\"beforeGates\":[{\"type\":\"Approval\"},{\"type\":\"Approval\"}],\"afterGates\":[{\"type\":\"Approval\"},{\"type\":\"Approval\"}]}]}},\"eTag\":\"xjvfoimwksl\",\"id\":\"cizjxvydfceacvl\",\"name\":\"vygdyft\",\"type\":\"mrtwna\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,35 +36,49 @@ public void testCreateOrUpdate() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - FleetUpdateStrategy response - = manager.fleetUpdateStrategies() - .define("zksmondj") - .withExistingFleet("yzvqt", "nubexk") - .withStrategy( - new UpdateRunStrategy().withStages(Arrays.asList( - new UpdateStage().withName("ypomgkopkwho") - .withGroups(Arrays.asList(new UpdateGroup().withName("ajqgxy"), - new UpdateGroup().withName("mocmbqfqvmk"), new UpdateGroup().withName("xozap"))) - .withAfterStageWaitInSeconds(1382848835), - new UpdateStage().withName("lxprglyatddckcbc") - .withGroups(Arrays.asList(new UpdateGroup().withName("rjxgciqib"), - new UpdateGroup().withName("hos"), new UpdateGroup().withName("sdqrhzoymibmrq"), - new UpdateGroup().withName("ibahwflus"))) - .withAfterStageWaitInSeconds(2001573010), - new UpdateStage().withName("mhrkwofyyvoqacp") - .withGroups(Arrays.asList(new UpdateGroup().withName("pbtg"), - new UpdateGroup().withName("wbwo"), new UpdateGroup().withName("nwashrtd"))) - .withAfterStageWaitInSeconds(1226493160), - new UpdateStage().withName("nqxwbp") - .withGroups(Arrays.asList(new UpdateGroup().withName("lpiujwaa"), - new UpdateGroup().withName("ipqiiobyuqerpq"))) - .withAfterStageWaitInSeconds(2131221175)))) - .withIfMatch("h") - .withIfNoneMatch("pkkpw") - .create(); + FleetUpdateStrategy response = manager.fleetUpdateStrategies() + .define("ycnunvjsrtk") + .withExistingFleet("frpdsofbshrns", "buswdvzyy") + .withStrategy(new UpdateRunStrategy().withStages(Arrays.asList( + new UpdateStage().withName("pqgik") + .withGroups(Arrays.asList(new UpdateGroup().withName("rtxdyuxzejnt"))) + .withAfterStageWaitInSeconds(1656228092) + .withBeforeGates(Arrays.asList(new GateConfiguration().withType(GateType.APPROVAL), + new GateConfiguration().withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList(new GateConfiguration().withType(GateType.APPROVAL))), + new UpdateStage().withName("ukry") + .withGroups(Arrays.asList(new UpdateGroup().withName("qmi"), new UpdateGroup().withName("ox"))) + .withAfterStageWaitInSeconds(793254447) + .withBeforeGates(Arrays.asList(new GateConfiguration().withType(GateType.APPROVAL), + new GateConfiguration().withType(GateType.APPROVAL), + new GateConfiguration().withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList(new GateConfiguration().withType(GateType.APPROVAL), + new GateConfiguration().withType(GateType.APPROVAL), + new GateConfiguration().withType(GateType.APPROVAL), + new GateConfiguration().withType(GateType.APPROVAL))), + new UpdateStage().withName("hhavgrvkffovjz") + .withGroups(Arrays.asList(new UpdateGroup().withName("bibgjmfxumv"), + new UpdateGroup().withName("cluyovwxnbkf"))) + .withAfterStageWaitInSeconds(1794198042) + .withBeforeGates(Arrays.asList(new GateConfiguration().withType(GateType.APPROVAL), + new GateConfiguration().withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList(new GateConfiguration().withType(GateType.APPROVAL), + new GateConfiguration().withType(GateType.APPROVAL), + new GateConfiguration().withType(GateType.APPROVAL))), + new UpdateStage().withName("irujbz") + .withGroups(Arrays.asList(new UpdateGroup().withName("vzzbtdcq"), + new UpdateGroup().withName("pniyujviyl"), new UpdateGroup().withName("dshf"))) + .withAfterStageWaitInSeconds(224040944) + .withBeforeGates(Arrays.asList(new GateConfiguration().withType(GateType.APPROVAL))) + .withAfterGates(Arrays.asList(new GateConfiguration().withType(GateType.APPROVAL)))))) + .withIfMatch("hyus") + .withIfNoneMatch("skasdvlmfwdgzxu") + .create(); - Assertions.assertEquals("ovvqfovljxywsu", response.strategy().stages().get(0).name()); - Assertions.assertEquals("rsndsytgadgvra", response.strategy().stages().get(0).groups().get(0).name()); - Assertions.assertEquals(350666785, response.strategy().stages().get(0).afterStageWaitInSeconds()); + Assertions.assertEquals("amrsreuzv", response.strategy().stages().get(0).name()); + Assertions.assertEquals("i", response.strategy().stages().get(0).groups().get(0).name()); + Assertions.assertEquals(351855115, response.strategy().stages().get(0).afterStageWaitInSeconds()); + Assertions.assertEquals(GateType.APPROVAL, response.strategy().stages().get(0).beforeGates().get(0).type()); + Assertions.assertEquals(GateType.APPROVAL, response.strategy().stages().get(0).afterGates().get(0).type()); } } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesDeleteMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesDeleteMockTests.java index 00eb2c7bd6e1..3f3d07609a87 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesDeleteMockTests.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesDeleteMockTests.java @@ -28,7 +28,7 @@ public void testDelete() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.fleetUpdateStrategies() - .delete("ohdneuel", "phsdyhto", "fikdowwqu", "v", com.azure.core.util.Context.NONE); + .delete("goihx", "mwctondzjluudfd", "wggytsbwtovvt", "seinqfiuf", com.azure.core.util.Context.NONE); } } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesGetWithResponseMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesGetWithResponseMockTests.java index 800b6e6bcde5..e23c47c28692 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesGetWithResponseMockTests.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesGetWithResponseMockTests.java @@ -11,6 +11,7 @@ import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategy; +import com.azure.resourcemanager.containerservicefleet.models.GateType; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -21,7 +22,7 @@ public final class FleetUpdateStrategiesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Failed\",\"strategy\":{\"stages\":[{\"name\":\"wiwubm\",\"groups\":[{\"name\":\"esl\"},{\"name\":\"nkww\"},{\"name\":\"pp\"},{\"name\":\"flcxoga\"}],\"afterStageWaitInSeconds\":584568005},{\"name\":\"nzmnsikvm\",\"groups\":[{\"name\":\"eqqkdltfzxm\"}],\"afterStageWaitInSeconds\":172476059},{\"name\":\"hgure\",\"groups\":[{\"name\":\"wobdagxtibqdx\"},{\"name\":\"xwak\"},{\"name\":\"ogqxndlkzgxhuri\"}],\"afterStageWaitInSeconds\":1090180987},{\"name\":\"podxunkb\",\"groups\":[{\"name\":\"mubyynt\"},{\"name\":\"lrb\"},{\"name\":\"tkoievseotgq\"},{\"name\":\"l\"}],\"afterStageWaitInSeconds\":1147743130}]}},\"eTag\":\"wlauwzizxbmpg\",\"id\":\"efuzmuvpbttd\",\"name\":\"morppxebmnzbtbh\",\"type\":\"pglkf\"}"; + = "{\"properties\":{\"provisioningState\":\"Failed\",\"strategy\":{\"stages\":[{\"name\":\"c\",\"groups\":[{\"name\":\"ixbjx\"},{\"name\":\"fw\"},{\"name\":\"yl\"}],\"afterStageWaitInSeconds\":729990408,\"beforeGates\":[{\"type\":\"Approval\"},{\"type\":\"Approval\"},{\"type\":\"Approval\"},{\"type\":\"Approval\"}],\"afterGates\":[{\"type\":\"Approval\"},{\"type\":\"Approval\"}]}]}},\"eTag\":\"bnujrywvtylbf\",\"id\":\"curdoiwiitht\",\"name\":\"wubxc\",\"type\":\"ihwqknfdntwjchr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,11 +32,13 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FleetUpdateStrategy response = manager.fleetUpdateStrategies() - .getWithResponse("tmweriofzpyq", "emwabnet", "hhszh", com.azure.core.util.Context.NONE) + .getWithResponse("gupkvipmdscwxq", "pevzhfst", "txhojujb", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("wiwubm", response.strategy().stages().get(0).name()); - Assertions.assertEquals("esl", response.strategy().stages().get(0).groups().get(0).name()); - Assertions.assertEquals(584568005, response.strategy().stages().get(0).afterStageWaitInSeconds()); + Assertions.assertEquals("c", response.strategy().stages().get(0).name()); + Assertions.assertEquals("ixbjx", response.strategy().stages().get(0).groups().get(0).name()); + Assertions.assertEquals(729990408, response.strategy().stages().get(0).afterStageWaitInSeconds()); + Assertions.assertEquals(GateType.APPROVAL, response.strategy().stages().get(0).beforeGates().get(0).type()); + Assertions.assertEquals(GateType.APPROVAL, response.strategy().stages().get(0).afterGates().get(0).type()); } } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesListByFleetMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesListByFleetMockTests.java index f2b1ae936080..b7c861944d05 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesListByFleetMockTests.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategiesListByFleetMockTests.java @@ -12,6 +12,7 @@ import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; import com.azure.resourcemanager.containerservicefleet.models.FleetUpdateStrategy; +import com.azure.resourcemanager.containerservicefleet.models.GateType; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -22,7 +23,7 @@ public final class FleetUpdateStrategiesListByFleetMockTests { @Test public void testListByFleet() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"strategy\":{\"stages\":[{\"name\":\"fwdsj\",\"groups\":[{\"name\":\"ljuti\"},{\"name\":\"swacffgdkzz\"},{\"name\":\"wkfvhqcrailvp\"}],\"afterStageWaitInSeconds\":1681889122},{\"name\":\"fuflrwdmhdlx\",\"groups\":[{\"name\":\"xsaga\"},{\"name\":\"cnihgwqapnedgfbc\"},{\"name\":\"kcvqvpke\"},{\"name\":\"dcvd\"}],\"afterStageWaitInSeconds\":393734239},{\"name\":\"ood\",\"groups\":[{\"name\":\"bobzdopcjwvnhd\"},{\"name\":\"d\"}],\"afterStageWaitInSeconds\":481946424},{\"name\":\"xcxrsl\",\"groups\":[{\"name\":\"twuoegrpkhjwni\"}],\"afterStageWaitInSeconds\":1045229648}]}},\"eTag\":\"uicpd\",\"id\":\"kzzlvmbmpaxmodf\",\"name\":\"uefywsbpfvmwy\",\"type\":\"rfouyftaakcpw\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"strategy\":{\"stages\":[{\"name\":\"ojlpijnkrxf\",\"groups\":[{\"name\":\"hcrat\"},{\"name\":\"zzronasx\"}],\"afterStageWaitInSeconds\":1438708374,\"beforeGates\":[{\"type\":\"Approval\"}],\"afterGates\":[{\"type\":\"Approval\"}]}]}},\"eTag\":\"tw\",\"id\":\"gogczhonnxkrlgny\",\"name\":\"mossxkkgthrrghxj\",\"type\":\"dhqxvcx\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,11 +33,15 @@ public void testListByFleet() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.fleetUpdateStrategies().listByFleet("zx", "lvithhqzonosgg", com.azure.core.util.Context.NONE); + = manager.fleetUpdateStrategies().listByFleet("qknp", "rgnepttwqmsniffc", com.azure.core.util.Context.NONE); - Assertions.assertEquals("fwdsj", response.iterator().next().strategy().stages().get(0).name()); - Assertions.assertEquals("ljuti", response.iterator().next().strategy().stages().get(0).groups().get(0).name()); - Assertions.assertEquals(1681889122, + Assertions.assertEquals("ojlpijnkrxf", response.iterator().next().strategy().stages().get(0).name()); + Assertions.assertEquals("hcrat", response.iterator().next().strategy().stages().get(0).groups().get(0).name()); + Assertions.assertEquals(1438708374, response.iterator().next().strategy().stages().get(0).afterStageWaitInSeconds()); + Assertions.assertEquals(GateType.APPROVAL, + response.iterator().next().strategy().stages().get(0).beforeGates().get(0).type()); + Assertions.assertEquals(GateType.APPROVAL, + response.iterator().next().strategy().stages().get(0).afterGates().get(0).type()); } } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategyInnerTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategyInnerTests.java deleted file mode 100644 index 641dc0804ea0..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategyInnerTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetUpdateStrategyInner; -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; -import org.junit.jupiter.api.Assertions; - -public final class FleetUpdateStrategyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetUpdateStrategyInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"strategy\":{\"stages\":[{\"name\":\"rkgqhcjrefo\",\"groups\":[{\"name\":\"kqsleyyvxy\"},{\"name\":\"jpkcattpng\"},{\"name\":\"cr\"}],\"afterStageWaitInSeconds\":1512877841},{\"name\":\"sqpjhvmdajvn\",\"groups\":[{\"name\":\"unqecanoae\"},{\"name\":\"pfhyhl\"},{\"name\":\"rpmopjmc\"}],\"afterStageWaitInSeconds\":557848148},{\"name\":\"u\",\"groups\":[{\"name\":\"hfuiuaodsfc\"},{\"name\":\"kvxod\"},{\"name\":\"uozmyzydagfua\"},{\"name\":\"bezy\"}],\"afterStageWaitInSeconds\":269303909},{\"name\":\"kktwhrdxw\",\"groups\":[{\"name\":\"q\"},{\"name\":\"mbsureximo\"}],\"afterStageWaitInSeconds\":1010959661}]}},\"eTag\":\"fsfksymddyst\",\"id\":\"iuxhqyudxorr\",\"name\":\"nbpoczvyifqrvkdv\",\"type\":\"sllr\"}") - .toObject(FleetUpdateStrategyInner.class); - Assertions.assertEquals("rkgqhcjrefo", model.strategy().stages().get(0).name()); - Assertions.assertEquals("kqsleyyvxy", model.strategy().stages().get(0).groups().get(0).name()); - Assertions.assertEquals(1512877841, model.strategy().stages().get(0).afterStageWaitInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetUpdateStrategyInner model - = new FleetUpdateStrategyInner() - .withStrategy(new UpdateRunStrategy().withStages(Arrays.asList( - new UpdateStage().withName("rkgqhcjrefo") - .withGroups(Arrays.asList(new UpdateGroup().withName("kqsleyyvxy"), - new UpdateGroup().withName("jpkcattpng"), new UpdateGroup().withName("cr"))) - .withAfterStageWaitInSeconds(1512877841), - new UpdateStage().withName("sqpjhvmdajvn") - .withGroups(Arrays.asList(new UpdateGroup().withName("unqecanoae"), - new UpdateGroup().withName("pfhyhl"), new UpdateGroup().withName("rpmopjmc"))) - .withAfterStageWaitInSeconds(557848148), - new UpdateStage().withName("u") - .withGroups(Arrays.asList(new UpdateGroup().withName("hfuiuaodsfc"), - new UpdateGroup().withName("kvxod"), new UpdateGroup().withName("uozmyzydagfua"), - new UpdateGroup().withName("bezy"))) - .withAfterStageWaitInSeconds(269303909), - new UpdateStage().withName("kktwhrdxw") - .withGroups( - Arrays.asList(new UpdateGroup().withName("q"), new UpdateGroup().withName("mbsureximo"))) - .withAfterStageWaitInSeconds(1010959661)))); - model = BinaryData.fromObject(model).toObject(FleetUpdateStrategyInner.class); - Assertions.assertEquals("rkgqhcjrefo", model.strategy().stages().get(0).name()); - Assertions.assertEquals("kqsleyyvxy", model.strategy().stages().get(0).groups().get(0).name()); - Assertions.assertEquals(1512877841, model.strategy().stages().get(0).afterStageWaitInSeconds()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategyListResultTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategyListResultTests.java deleted file mode 100644 index df4642bfddb8..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategyListResultTests.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.implementation.models.FleetUpdateStrategyListResult; -import org.junit.jupiter.api.Assertions; - -public final class FleetUpdateStrategyListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetUpdateStrategyListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"strategy\":{\"stages\":[{\"name\":\"vsovmyokac\"}]}},\"eTag\":\"kwlhzdo\",\"id\":\"xjmflbvv\",\"name\":\"chrkcciwwzjuqk\",\"type\":\"rsa\"},{\"properties\":{\"provisioningState\":\"Failed\",\"strategy\":{\"stages\":[{\"name\":\"ofoskghs\"}]}},\"eTag\":\"uimjmvx\",\"id\":\"duugidyjr\",\"name\":\"f\",\"type\":\"y\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"strategy\":{\"stages\":[{\"name\":\"xc\"}]}},\"eTag\":\"npc\",\"id\":\"ocohslkevleg\",\"name\":\"zfbuhf\",\"type\":\"vfaxkffeiith\"}],\"nextLink\":\"m\"}") - .toObject(FleetUpdateStrategyListResult.class); - Assertions.assertEquals("vsovmyokac", model.value().get(0).strategy().stages().get(0).name()); - Assertions.assertEquals("m", model.nextLink()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategyPropertiesTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategyPropertiesTests.java deleted file mode 100644 index b15b6b3d9db4..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/FleetUpdateStrategyPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.FleetUpdateStrategyProperties; -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; -import org.junit.jupiter.api.Assertions; - -public final class FleetUpdateStrategyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FleetUpdateStrategyProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Canceled\",\"strategy\":{\"stages\":[{\"name\":\"f\",\"groups\":[{\"name\":\"kpnpulexxbczwtr\"}],\"afterStageWaitInSeconds\":1083545989}]}}") - .toObject(FleetUpdateStrategyProperties.class); - Assertions.assertEquals("f", model.strategy().stages().get(0).name()); - Assertions.assertEquals("kpnpulexxbczwtr", model.strategy().stages().get(0).groups().get(0).name()); - Assertions.assertEquals(1083545989, model.strategy().stages().get(0).afterStageWaitInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FleetUpdateStrategyProperties model = new FleetUpdateStrategyProperties() - .withStrategy(new UpdateRunStrategy().withStages(Arrays.asList(new UpdateStage().withName("f") - .withGroups(Arrays.asList(new UpdateGroup().withName("kpnpulexxbczwtr"))) - .withAfterStageWaitInSeconds(1083545989)))); - model = BinaryData.fromObject(model).toObject(FleetUpdateStrategyProperties.class); - Assertions.assertEquals("f", model.strategy().stages().get(0).name()); - Assertions.assertEquals("kpnpulexxbczwtr", model.strategy().stages().get(0).groups().get(0).name()); - Assertions.assertEquals(1083545989, model.strategy().stages().get(0).afterStageWaitInSeconds()); - } -} 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 index 1ab19a17cbda..07d599ba25aa 100644 --- 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 @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.fleets().delete("cxerf", "wutttxfvjrbi", "phxepcyvahf", com.azure.core.util.Context.NONE); + manager.fleets().delete("zynkedya", "rwyhqmibzyhwitsm", "pyy", com.azure.core.util.Context.NONE); } } 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 index b4ddfcacf323..cf2a13cb8998 100644 --- 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 @@ -19,7 +19,8 @@ public final class FleetsListCredentialsWithResponseMockTests { @Test public void testListCredentialsWithResponse() throws Exception { - String responseStr = "{\"kubeconfigs\":[{\"name\":\"ywbiexzfeyueax\"},{\"name\":\"ujwb\"}]}"; + String responseStr + = "{\"kubeconfigs\":[{\"name\":\"kkfoqr\"},{\"name\":\"kzikfjawneaivxwc\"},{\"name\":\"pcirelsfeaen\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -29,7 +30,7 @@ public void testListCredentialsWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FleetCredentialResults response = manager.fleets() - .listCredentialsWithResponse("yyazttbt", "wrqpue", com.azure.core.util.Context.NONE) + .listCredentialsWithResponse("mnpkukghimdblxg", "imfnjhfjx", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GatesGetWithResponseMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GatesGetWithResponseMockTests.java new file mode 100644 index 000000000000..c41dc9ecc18c --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GatesGetWithResponseMockTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; +import com.azure.resourcemanager.containerservicefleet.models.Gate; +import com.azure.resourcemanager.containerservicefleet.models.GateState; +import com.azure.resourcemanager.containerservicefleet.models.GateType; +import com.azure.resourcemanager.containerservicefleet.models.Timing; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GatesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"pnqi\",\"gateType\":\"Approval\",\"target\":{\"updateRunProperties\":{\"name\":\"nvkjjxdxrbuukzcl\",\"stage\":\"yhmlwpaztzp\",\"group\":\"ncckw\",\"timing\":\"Before\"}},\"state\":\"Skipped\"},\"eTag\":\"whxxbuyqax\",\"location\":\"eqz\",\"tags\":{\"lmncw\":\"riolxorjalt\",\"cqdpfuv\":\"obqwcsdbnwdcfh\"},\"id\":\"lsbjjcanvxbv\",\"name\":\"vudutncor\",\"type\":\"r\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceFleetManager manager = ContainerServiceFleetManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Gate response + = manager.gates().getWithResponse("gxsds", "uem", "sbzkf", com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals("eqz", response.location()); + Assertions.assertEquals("riolxorjalt", response.tags().get("lmncw")); + Assertions.assertEquals("pnqi", response.displayName()); + Assertions.assertEquals(GateType.APPROVAL, response.gateType()); + Assertions.assertEquals(Timing.BEFORE, response.target().updateRunProperties().timing()); + Assertions.assertEquals(GateState.SKIPPED, response.state()); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GatesListByFleetMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GatesListByFleetMockTests.java new file mode 100644 index 000000000000..4378eaded606 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GatesListByFleetMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; +import com.azure.resourcemanager.containerservicefleet.models.Gate; +import com.azure.resourcemanager.containerservicefleet.models.GateState; +import com.azure.resourcemanager.containerservicefleet.models.GateType; +import com.azure.resourcemanager.containerservicefleet.models.Timing; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GatesListByFleetMockTests { + @Test + public void testListByFleet() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"ux\",\"gateType\":\"Approval\",\"target\":{\"updateRunProperties\":{\"name\":\"aldsy\",\"stage\":\"ximerqfobwyznk\",\"group\":\"kutwpf\",\"timing\":\"After\"}},\"state\":\"Completed\"},\"eTag\":\"m\",\"location\":\"skdsnfdsdoakg\",\"tags\":{\"pusdstt\":\"mkkzevdlhe\"},\"id\":\"vogvbbejdcngqqmo\",\"name\":\"kufgmj\",\"type\":\"rwr\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceFleetManager manager = ContainerServiceFleetManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.gates().listByFleet("zcmrvexztvb", "qgsfraoyzkoow", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("skdsnfdsdoakg", response.iterator().next().location()); + Assertions.assertEquals("mkkzevdlhe", response.iterator().next().tags().get("pusdstt")); + Assertions.assertEquals("ux", response.iterator().next().displayName()); + Assertions.assertEquals(GateType.APPROVAL, response.iterator().next().gateType()); + Assertions.assertEquals(Timing.AFTER, response.iterator().next().target().updateRunProperties().timing()); + Assertions.assertEquals(GateState.COMPLETED, response.iterator().next().state()); + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GatesUpdateMockTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GatesUpdateMockTests.java new file mode 100644 index 000000000000..750ad71fce23 --- /dev/null +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GatesUpdateMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.containerservicefleet.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.containerservicefleet.ContainerServiceFleetManager; +import com.azure.resourcemanager.containerservicefleet.models.Gate; +import com.azure.resourcemanager.containerservicefleet.models.GatePatch; +import com.azure.resourcemanager.containerservicefleet.models.GatePatchProperties; +import com.azure.resourcemanager.containerservicefleet.models.GateState; +import com.azure.resourcemanager.containerservicefleet.models.GateType; +import com.azure.resourcemanager.containerservicefleet.models.Timing; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GatesUpdateMockTests { + @Test + public void testUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"vtpuqujmqlgk\",\"gateType\":\"Approval\",\"target\":{\"updateRunProperties\":{\"name\":\"ndo\",\"stage\":\"n\",\"group\":\"jcntuj\",\"timing\":\"Before\"}},\"state\":\"Completed\"},\"eTag\":\"ed\",\"location\":\"wwa\",\"tags\":{\"i\":\"ojvdcpzfoqo\",\"oxciqopidoamcio\":\"ybxarzgszu\"},\"id\":\"hkh\",\"name\":\"zxkhnzbonlwnto\",\"type\":\"gokdwbwhks\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + ContainerServiceFleetManager manager = ContainerServiceFleetManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + Gate response = manager.gates() + .update("xqtvcofu", "f", "vkg", + new GatePatch().withTags(mapOf("aznqntoru", "gdknnqv", "uwjuetaeburuvdmo", "sgsahmkycgr")) + .withProperties(new GatePatchProperties().withState(GateState.SKIPPED)), + "mz", "xwabmqoe", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("wwa", response.location()); + Assertions.assertEquals("ojvdcpzfoqo", response.tags().get("i")); + Assertions.assertEquals("vtpuqujmqlgk", response.displayName()); + Assertions.assertEquals(GateType.APPROVAL, response.gateType()); + Assertions.assertEquals(Timing.BEFORE, response.target().updateRunProperties().timing()); + Assertions.assertEquals(GateState.COMPLETED, response.state()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GenerateResponseInnerTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GenerateResponseInnerTests.java deleted file mode 100644 index f7e470903db6..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/GenerateResponseInnerTests.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.GenerateResponseInner; - -public final class GenerateResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GenerateResponseInner model - = BinaryData.fromString("{\"id\":\"cbkhajdeyeamdph\"}").toObject(GenerateResponseInner.class); - } -} 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 4ef3d32e7f08..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedClusterUpdateTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec 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 com.azure.resourcemanager.containerservicefleet.models.NodeImageSelection; -import com.azure.resourcemanager.containerservicefleet.models.NodeImageSelectionType; -import com.azure.resourcemanager.containerservicefleet.models.NodeImageVersion; -import java.util.Arrays; -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\":\"u\"},\"nodeImageSelection\":{\"type\":\"Custom\",\"customNodeImageVersions\":[{\"version\":\"z\"},{\"version\":\"vvtpgvdfgio\"},{\"version\":\"ftutqxlngxlefgu\"},{\"version\":\"xkrxdqmi\"}]}}") - .toObject(ManagedClusterUpdate.class); - Assertions.assertEquals(ManagedClusterUpgradeType.FULL, model.upgrade().type()); - Assertions.assertEquals("u", model.upgrade().kubernetesVersion()); - Assertions.assertEquals(NodeImageSelectionType.CUSTOM, model.nodeImageSelection().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedClusterUpdate model = new ManagedClusterUpdate() - .withUpgrade( - new ManagedClusterUpgradeSpec().withType(ManagedClusterUpgradeType.FULL).withKubernetesVersion("u")) - .withNodeImageSelection(new NodeImageSelection().withType(NodeImageSelectionType.CUSTOM) - .withCustomNodeImageVersions(Arrays.asList(new NodeImageVersion(), new NodeImageVersion(), - new NodeImageVersion(), new NodeImageVersion()))); - model = BinaryData.fromObject(model).toObject(ManagedClusterUpdate.class); - Assertions.assertEquals(ManagedClusterUpgradeType.FULL, model.upgrade().type()); - Assertions.assertEquals("u", model.upgrade().kubernetesVersion()); - Assertions.assertEquals(NodeImageSelectionType.CUSTOM, model.nodeImageSelection().type()); - } -} 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 0216f9fcb413..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedClusterUpgradeSpecTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec 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\":\"hzrvqd\"}") - .toObject(ManagedClusterUpgradeSpec.class); - Assertions.assertEquals(ManagedClusterUpgradeType.NODE_IMAGE_ONLY, model.type()); - Assertions.assertEquals("hzrvqd", model.kubernetesVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedClusterUpgradeSpec model - = new ManagedClusterUpgradeSpec().withType(ManagedClusterUpgradeType.NODE_IMAGE_ONLY) - .withKubernetesVersion("hzrvqd"); - model = BinaryData.fromObject(model).toObject(ManagedClusterUpgradeSpec.class); - Assertions.assertEquals(ManagedClusterUpgradeType.NODE_IMAGE_ONLY, model.type()); - Assertions.assertEquals("hzrvqd", model.kubernetesVersion()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedServiceIdentityTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 49cf16cb5fd1..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.ManagedServiceIdentity; -import com.azure.resourcemanager.containerservicefleet.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.containerservicefleet.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"ybb\",\"tenantId\":\"odepoogin\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"yevc\":{\"clientId\":\"heognarxzxtheo\",\"principalId\":\"si\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("yevc", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/NodeImageSelectionStatusTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/NodeImageSelectionStatusTests.java deleted file mode 100644 index ab74f9424048..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/NodeImageSelectionStatusTests.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.NodeImageSelectionStatus; - -public final class NodeImageSelectionStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NodeImageSelectionStatus model = BinaryData.fromString( - "{\"selectedNodeImageVersions\":[{\"version\":\"wtgrhpdjpj\"},{\"version\":\"asxazjpqyegualhb\"},{\"version\":\"hejjz\"}]}") - .toObject(NodeImageSelectionStatus.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/NodeImageSelectionTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/NodeImageSelectionTests.java deleted file mode 100644 index 8f23c98c15a3..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/NodeImageSelectionTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.NodeImageSelection; -import com.azure.resourcemanager.containerservicefleet.models.NodeImageSelectionType; -import com.azure.resourcemanager.containerservicefleet.models.NodeImageVersion; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NodeImageSelectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NodeImageSelection model = BinaryData.fromString( - "{\"type\":\"Latest\",\"customNodeImageVersions\":[{\"version\":\"yb\"},{\"version\":\"ehoqfbowskan\"},{\"version\":\"tzlcuiywgqywgn\"},{\"version\":\"vynhzgpphrcg\"}]}") - .toObject(NodeImageSelection.class); - Assertions.assertEquals(NodeImageSelectionType.LATEST, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NodeImageSelection model = new NodeImageSelection().withType(NodeImageSelectionType.LATEST) - .withCustomNodeImageVersions(Arrays.asList(new NodeImageVersion(), new NodeImageVersion(), - new NodeImageVersion(), new NodeImageVersion())); - model = BinaryData.fromObject(model).toObject(NodeImageSelection.class); - Assertions.assertEquals(NodeImageSelectionType.LATEST, model.type()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/NodeImageVersionTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/NodeImageVersionTests.java deleted file mode 100644 index 73ff8e636f67..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/NodeImageVersionTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.NodeImageVersion; - -public final class NodeImageVersionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NodeImageVersion model - = BinaryData.fromString("{\"version\":\"cocpecfvmmcoofsx\"}").toObject(NodeImageVersion.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NodeImageVersion model = new NodeImageVersion(); - model = BinaryData.fromObject(model).toObject(NodeImageVersion.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 f3c81c61627b..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationDisplayTests.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec 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\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") - .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 4b79bbb1fd53..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationInnerTests.java +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.fluent.models.OperationInner; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .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 c3cf443392e4..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/OperationListResultTests.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.implementation.models.OperationListResult; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("kfo", model.nextLink()); - } -} 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 index 0b2f1b86c443..728890fe4c90 100644 --- 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 @@ -21,7 +21,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"alpbuxwgipwhon\",\"isDataAction\":false,\"display\":{\"provider\":\"hwankixzbinjepu\",\"resource\":\"mryw\",\"operation\":\"zoqftiyqzrnkcqvy\",\"description\":\"whzlsicohoq\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"whhmhykojo\",\"isDataAction\":false,\"display\":{\"provider\":\"dlpichkoymkcdyhb\",\"resource\":\"kpw\",\"operation\":\"eqnovvqfovl\",\"description\":\"ywsuwsy\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/SkipPropertiesTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/SkipPropertiesTests.java deleted file mode 100644 index 8a3f75139ea7..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/SkipPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.SkipProperties; -import com.azure.resourcemanager.containerservicefleet.models.SkipTarget; -import com.azure.resourcemanager.containerservicefleet.models.TargetType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SkipPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkipProperties model = BinaryData.fromString( - "{\"targets\":[{\"type\":\"Group\",\"name\":\"yexfwh\"},{\"type\":\"AfterStageWait\",\"name\":\"cibvyvdcsitynn\"}]}") - .toObject(SkipProperties.class); - Assertions.assertEquals(TargetType.GROUP, model.targets().get(0).type()); - Assertions.assertEquals("yexfwh", model.targets().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkipProperties model = new SkipProperties() - .withTargets(Arrays.asList(new SkipTarget().withType(TargetType.GROUP).withName("yexfwh"), - new SkipTarget().withType(TargetType.AFTER_STAGE_WAIT).withName("cibvyvdcsitynn"))); - model = BinaryData.fromObject(model).toObject(SkipProperties.class); - Assertions.assertEquals(TargetType.GROUP, model.targets().get(0).type()); - Assertions.assertEquals("yexfwh", model.targets().get(0).name()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/SkipTargetTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/SkipTargetTests.java deleted file mode 100644 index 566b16791290..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/SkipTargetTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.SkipTarget; -import com.azure.resourcemanager.containerservicefleet.models.TargetType; -import org.junit.jupiter.api.Assertions; - -public final class SkipTargetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkipTarget model - = BinaryData.fromString("{\"type\":\"Group\",\"name\":\"mdectehfiqscjey\"}").toObject(SkipTarget.class); - Assertions.assertEquals(TargetType.GROUP, model.type()); - Assertions.assertEquals("mdectehfiqscjey", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkipTarget model = new SkipTarget().withType(TargetType.GROUP).withName("mdectehfiqscjey"); - model = BinaryData.fromObject(model).toObject(SkipTarget.class); - Assertions.assertEquals(TargetType.GROUP, model.type()); - Assertions.assertEquals("mdectehfiqscjey", model.name()); - } -} 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 93767e1b2042..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) TypeSpec 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\":\"topbobjogh\"}").toObject(UpdateGroup.class); - Assertions.assertEquals("topbobjogh", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateGroup model = new UpdateGroup().withName("topbobjogh"); - model = BinaryData.fromObject(model).toObject(UpdateGroup.class); - Assertions.assertEquals("topbobjogh", model.name()); - } -} 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 80372ee653d8..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunListResultTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.implementation.models.UpdateRunListResult; -import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeType; -import com.azure.resourcemanager.containerservicefleet.models.NodeImageSelectionType; -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\":\"Failed\",\"updateStrategyId\":\"wdslfhotwmcy\",\"strategy\":{\"stages\":[{\"name\":\"lbjnpgacftadehx\"},{\"name\":\"ltyfsop\"},{\"name\":\"usue\"},{\"name\":\"nzwdejba\"}]},\"managedClusterUpdate\":{\"upgrade\":{\"type\":\"NodeImageOnly\",\"kubernetesVersion\":\"xzdmohctb\"},\"nodeImageSelection\":{\"type\":\"Consistent\",\"customNodeImageVersions\":[{},{},{},{}]}},\"status\":{\"status\":{\"startTime\":\"2021-03-23T22:55:01Z\",\"completedTime\":\"2021-02-14T16:40:57Z\",\"state\":\"Completed\",\"error\":{}},\"stages\":[{},{},{},{}],\"nodeImageSelection\":{\"selectedNodeImageVersions\":[{},{},{}]}},\"autoUpgradeProfileId\":\"dkcglhsl\"},\"eTag\":\"jdyggdtji\",\"id\":\"b\",\"name\":\"uofqwe\",\"type\":\"kh\"}],\"nextLink\":\"n\"}") - .toObject(UpdateRunListResult.class); - Assertions.assertEquals("wdslfhotwmcy", model.value().get(0).updateStrategyId()); - Assertions.assertEquals("lbjnpgacftadehx", model.value().get(0).strategy().stages().get(0).name()); - Assertions.assertEquals(ManagedClusterUpgradeType.NODE_IMAGE_ONLY, - model.value().get(0).managedClusterUpdate().upgrade().type()); - Assertions.assertEquals("xzdmohctb", model.value().get(0).managedClusterUpdate().upgrade().kubernetesVersion()); - Assertions.assertEquals(NodeImageSelectionType.CONSISTENT, - model.value().get(0).managedClusterUpdate().nodeImageSelection().type()); - Assertions.assertEquals("n", model.nextLink()); - } -} 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 b1c7313b9be6..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateRunStrategyTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec 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.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\":\"zvddntwndeicbtwn\",\"groups\":[{\"name\":\"oqvuhr\"},{\"name\":\"cffcyddglmj\"}],\"afterStageWaitInSeconds\":439652711}]}") - .toObject(UpdateRunStrategy.class); - Assertions.assertEquals("zvddntwndeicbtwn", model.stages().get(0).name()); - Assertions.assertEquals("oqvuhr", model.stages().get(0).groups().get(0).name()); - Assertions.assertEquals(439652711, 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("zvddntwndeicbtwn") - .withGroups( - Arrays.asList(new UpdateGroup().withName("oqvuhr"), new UpdateGroup().withName("cffcyddglmj"))) - .withAfterStageWaitInSeconds(439652711))); - model = BinaryData.fromObject(model).toObject(UpdateRunStrategy.class); - Assertions.assertEquals("zvddntwndeicbtwn", model.stages().get(0).name()); - Assertions.assertEquals("oqvuhr", model.stages().get(0).groups().get(0).name()); - Assertions.assertEquals(439652711, 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 index aa2b8b0eb77b..36bcaad09674 100644 --- 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 @@ -28,7 +28,7 @@ public void testDelete() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.updateRuns() - .delete("euojgjrwju", "iotwmcdytdxwit", "nrjawgqwg", "hniskxfbkpyc", com.azure.core.util.Context.NONE); + .delete("stvlzywemhzrnc", "dtclusiypb", "fgytguslfeadcyg", "ukyhejhzis", com.azure.core.util.Context.NONE); } } 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 6661d9282186..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UpdateStageTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec 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\":\"qkwpyeicxmqc\",\"groups\":[{\"name\":\"vhkhixu\"}],\"afterStageWaitInSeconds\":1713707644}") - .toObject(UpdateStage.class); - Assertions.assertEquals("qkwpyeicxmqc", model.name()); - Assertions.assertEquals("vhkhixu", model.groups().get(0).name()); - Assertions.assertEquals(1713707644, model.afterStageWaitInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateStage model = new UpdateStage().withName("qkwpyeicxmqc") - .withGroups(Arrays.asList(new UpdateGroup().withName("vhkhixu"))) - .withAfterStageWaitInSeconds(1713707644); - model = BinaryData.fromObject(model).toObject(UpdateStage.class); - Assertions.assertEquals("qkwpyeicxmqc", model.name()); - Assertions.assertEquals("vhkhixu", model.groups().get(0).name()); - Assertions.assertEquals(1713707644, model.afterStageWaitInSeconds()); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UserAssignedIdentityTests.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 6f1c2c7bf120..000000000000 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/test/java/com/azure/resourcemanager/containerservicefleet/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.containerservicefleet.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.containerservicefleet.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString("{\"clientId\":\"qi\",\"principalId\":\"hungbwjzrnf\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/tsp-location.yaml b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/tsp-location.yaml index ba67e6a8a48f..e8cd806427f1 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/tsp-location.yaml +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/containerservice/Fleet.Management -commit: 2ddcc49aa62928eff65f3864a88832fb4959166c +commit: 632b84224a6fbde8fe582c5e3bf96f5a8fe002bc repo: Azure/azure-rest-api-specs additionalDirectories: